This adds in a ShutdownDomain action which allows for the
GracefulHalt action to attempt to shutdown the domain. If
it does not transition to domain successfully to a shutoff
state, the ShutdownDomain action is used to "nicely" shutdown
the domain. Likewise, if that action fails to transition the
domain, the HaltDomain action will be used to forcibly stop it.
Ensure the path attribute for disks in the new format is required to
ensure there is always one parameter required for the hash element in
the array of disks. This avoids a certain amount of magical behaviour.
Identify that the name attribute is optional, however add checks for
collisions in volume names generated, as well as ensuring the volumes
are still prefixed in a way to prevent accidental collisions between
boxes utilizing the same names.
Add notes to the README identifying the format as experimental, with
notes on how the format should appear.
When uploading disks to libvirt storage it is unnecessary to require
that the virtual size or the format be provided as these can be
retrieved by calling qemu-img on the box files to retrieve the required
information.
Update the handle box image support to separate the handling of the two
different formats and remove the need to specify the additional settings
in the case of the V2 format for multi disk boxes.
Adds support for a new multi disk box format and handling to upload the
multiple disks to the storage pool.
New format is:
{
'disks': [
{
'name': 'disk1.img',
'virtual_size': 10,
'format': 'qcow2'
},
{
'name': 'disk2.img',
'virtual_size': 15,
'format': 'qcow2'
},
{
'name': 'disk3.img',
}
],
'provider': 'libvirt',
'format': 'qcow2'
}
It is expected to remove format from being set at the top level when
using the new format, with the assuming that qcow2 should be the default
format, and other formats should be permitted to be specified as needed.
Includes tests for handling the box images and creation of domain
volumes. Additionally includes an integration test to ensure a box with
2 disks will work as expected.
Partially fixes: #602
Packaging an existing vagrant environment relied on copying the backing
image. Users may not have permission to read this file despite being
able to interact with it through libvirt.
Use ruby-libvirt to download the image instead so any user with libvirt
access can run the package command.
Pxe nodes are not provisioned, mgmt network is not required for them.
Provide new domain option 'mgmt_attach' which one can use to remove mgmt
interface from VM. Default behaviour is not changed.
Also take into account bridge interfaces when set boot order, to support
scenario when we would like to use vagrant VM to pxe boot physical nodes
in existing network.
Remove the ReadSSHInfo and ReadState actions and corresponding calls to
dispatch queries by vagrant on the provider for current `ssh_info` and
`state` to be handled by actions. Change the corresponding methods added
to the Driver and Provider classes to avoid modifying `machine.id`
directly and allow vagrant to take care of resetting it whenever `state`
returns :not_created.
This ensures that both `ssh_info` and `state` may be called by other
threads, such as the ansible provisioner building the inventory file,
on machines without causing exceptions due to machine locks preventing
modification (setting `machine.id` to nil) and Batch locking preventing
multiple sets of actions being executed on the same machine by
different threads/processes.
Follows the design of the in-tree docker provider for vagrant.
Useful when configuring Virtualized Switch topologies using Switch VMs like Cumulus
Linux.
vagrant network interface auto_config is disabled in the code. This may be
re-enabled in a future update, once it is better understood how to
auto configure these types of links. All guestOS ports, for now, that are
connected to a tcp tunnel are in a link down state.
TCP tunnels allow guest OSes to exchange STP and LLDP information as
if they are directly connected to each other.
This is not possible with the default virtual switch network mode.
Reference:
https://libvirt.org/formatdomain.html#elementsNICSTCP
Allow control of the volume size to be increased from the box default
virtual_size value so that it is possible to use a box configured with a
minimal initial disk size and create virtual guests with larger disk
sizes.
Warn the user and ignore sizes that are less than the box size, and
inform them that a manual filesystem resize will be needed to take
advantage of the additional available disk space.
fixes: #37
The use of the term default makes discussing this network confusing.
This network must exist and be configured a certain way in order for vagrant
to manage a VMs configuration, so lets call it the management network instead.
This commit
* renames the option default_network to default_network_name
* introduces the option default_network_address, since we need an
address in order to create a network
* handles creation of the default network similarly to other private
networks if needed
/var/lib/libvirt/dnsmasq/*.leases files.
- IP address is saved in $data_dir/ip file for future.
This IP is then checked if it match with VMs MAC address.
- Added ssh, provision and resume subcommand