Some systems have to have a strict control, even in system state
information. Prefixed with "sudo" to command to gather information how
cloud init is doing.
There were very similar methods for downloading/proceeding with
checksum for both Ubuntu and Fedora classes. Extracted those two into
methods in base class.
For now, the only mode VirtualBox VM has launched was headless. For
debugging purposes, there were other types allowed using --type switch
for command create and rebuild, while headless will remain the default
one.
Currently, you could pass long version of '--version' option to either
boxpy itself and subcommands create and rebuild. With this patch proper
context is now detected.
Till now, boxpy was based on the fact, that there was power_state
section, and there was a check if VM is down already. That approach have
their own issues.
Now, there will be no more power-off, there is a check by using
`cloud-init status` command through ssh.
Cleanup/destroy parts has needed some modification, so that there will
be no leftovers from cloud init ISO image.
And finally, there was some tweaks for user-data cloud-init part (mainly
for ssh handling), so that `cloud-init status` will not report phony
errors.
If user doesn't provide options from commandline during rebuild, such
option will be overwritten by those stored in VM XML, even if user
change such option in config file. This commit fixing that.
Till now, user has to provide port number (by commandline or through
config file), otherwise 2222 will be set. That's unfortunate in case you
need to have multiple machines and forgot about setting the correct
port. In this patch random port will be used if no port is provided.
There is a function which retrieve information about VM by looking on
the 'vboxmanage vminfo' command. The output wasn't consistent, yet it
was fixed recently so that amount of memory was all wrong.
Currently the only thing which is searched for is the VM configuration
path, and all the rest is taken out from the XML VM definition.
This will avoid overwriting all of the configuration during executing
vmcreate function, which initially doesn't know anything about existing
data - it only knows about passed through command line parameters. Now
it should be fixed.
In boxpy_data section it is possible to specify another nic and its type
to be attached to the vm:
boxpy_data:
advanced:
nic2: intnet
nic3: hostonly
It's a stub for now, and only intnet will work by providing another nic,
which user should take care about providing configuration.
Currently specifying attributes of VM was done by using command options
during creation, or only required VM name for rebuilding (due to smart
way of storing information within VM definition).
Now, there is possibility for providing all the information using
special key "boxpy_data" in user-script, so that there is no need to
provide that information from command line.
All three ways are respected with following order:
- default, which are hard coded in defaults
- custom user script passed by --cloud-config (or stored in vm in case
of rebuild)
- information which is stored in VM definition (if exists - this only
affects "rebuild" command)
- and finally highest priority have parameters passed by command line.