-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for VirtualBox network resources #2
base: master
Are you sure you want to change the base?
Conversation
VBoxManage sometimes hangs while executing network related sub- commands in parallel.
A reboot(stop and start) is required to propogate the changes to vm. Also modifyvm should be invoked after machine is fully stopped.
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
I tried merging this and got it mostly working, but I'm getting some strange error where Nix doesn't like the format of the |
Thanks for verifying my PR. The code should have no issue to run with nixops 1.8. https://github.com/onixie/nikops/blob/master/shell.nix#L14 Beside the above usage, I also did some tests with other combination of the options. Due to my lack of time recently, I couldn't manage to update it with the latest version of nix and nixops. |
Motivation to the change
As I proposed in NixOS/nixops#1223, this PR focuses on enabling VirtualBox backend to create virtual networks (Host-only and NatNetwork which VirtualBox supports) and manage those networks as NixOps resources.
It also generalizes the network adaptor configurations for the machines, removes the hard-coded constraints which pressumes the existence of a DHCP-enabled
vboxnet0
link device in user's environment. After this PR, similar like libvirt backend, user can explicitly specify what networks each adaptor should be attached to.Finally, when using with Virtualbox >= v6.1, the new virtual network resources allow user specify static IPv4 address from DHCP range and bind to a specific machine. And this can finally solve the unpredictable address issue.
Test results
I tested the changes on the following environments,
OS: Ubuntu 18.04, MacOS High Sierra
NixOps: master branch
Nixpkgs: unstable channel
VirtualBox: v5.2, v6.0 and v6.1
Virtualbox image: nixops-19.09
And tried the following frequently used commands: create, deploy, redeploy, start, stop, destroy, check, info without problems. Though there are some corner cases I wasn't able to cover, I think it's already stable enough to be shared and used with NixOps developers and decent users.
So hope this PR can be approved and merged. Thank you for any comments.
Regards