Commit graph

107896 commits

Author SHA1 Message Date
Firefly
680abe924c improve boot parameter documentation 2020-05-07 16:57:39 -07:00
Eduardo Speroni
442553e2c8 Port #51134 to master 2020-05-07 16:25:57 -07:00
ch3ll
df480e37c0 update pydir call and fix format 2020-05-07 16:22:31 -07:00
ch3ll
c87642181e add towncrier to manage changelog 2020-05-07 16:22:31 -07:00
Joe Eacott
d2688ae80e add tests 2020-05-07 16:21:43 -07:00
Joe Eacott
6b9c3faf11 add simple test to checking sys var 2020-05-07 16:21:43 -07:00
Joe Eacott
c760a9d21b Add False as return to not throw attr error 2020-05-07 16:21:43 -07:00
Joe Eacott
adbec88f1a change logic to check whether app is from source or bundled 2020-05-07 16:21:43 -07:00
Joe Eacott
f6c35856c9 add Path to determine system executable and add edge case 2020-05-07 16:21:43 -07:00
Joe Eacott
158762bd5e Return pip binary without -m flag when not using python 2020-05-07 16:21:43 -07:00
Mike Place
10d4f8b1a7 Port #50946 to master 2020-05-07 16:20:37 -07:00
Kenn Leth Hansen
656c9f82e1 Port #50930 to master 2020-05-07 16:19:21 -07:00
ch3ll
5d280eee1e Update test paths to include windows 2020-05-07 16:16:31 -07:00
ch3ll
cdd470c76e Add auto_detect feature to ssh_ext_alternatives 2020-05-07 16:16:31 -07:00
Cédric Bosdonnat
7d18001dba virt.update properly handle removable devices
Live attaching / detaching removable devices results in failures.
To change the source of those, we need to call updateDeviceFlags instead.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
73438d43d8 virt: handle cdrom remote images
Libvirt allows to use network images for cdroms. Use them if the image
is a remote URL for a cdrom device.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
734ae1a3a4 virt: fix VM creating with disk volume
Since volumes in a virtual storage pool of type 'disk' are partitions,
then need to be named after the disk name with sequential numbers rather
than using the VM and disk names.

Also, the format passed by the user is the one used when creating the volume.
However in the VM definition for logical and disk volumes, the format should
be set to raw.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
5ecea2bac1 Handle RBD volumes as network disks in VM definition
libvirt doesn't support attaching RBD storage pool volumes to a VM.
For instance, a disk with such a source is invalid:

    <source pool='rbd-pool' volume='rbd-volume'/>

And needs to be replaced with:

    <source protocol="rbd" name="rbd-pool-name/rbd-volume">
      <host name="hostname" port="7000"/>
      <auth username='myuser'>
        <secret type='ceph' usage='mypassid'/>
      </auth>
    </source>

This means that we need to fetch the connection data from the pool
definition and convert the volume disk definition into a network one
when creating the VM.

This also means that when purging the VM we need to search for the
pool by looking in every pool's XML to delete the volume.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
62527d052e Add volume disks support to virt.purge()
virt.purge will now remove not only the file disks, but also the disk volumes.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
f7e88a79af Add volume support to virt._get_disks
If a virtual machine has disks of volume types, they will now be
reported by the virt._get_disk() function and all the user-exposed
functions using it like virt.get_disks(), virt.vm_info() and
virt.full_info().
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
a7218588ae Add virt.volume_defined state
In order to help creating storage volumes in virtual storage pools from
states, add a virt.volume_defined state.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
1a45660920 virt.volume_infos: output disk format
Since the format of a volume may be of interest and could help to tell
if two volumes are similar, output this information in the
virt.volume_infos function.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
9b2d180e46 virt.volume_infos: output backing store as well
Since it could be useful to know whether a volume has a backing store,
output the path and format of the backing store if any is defined.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
142ca61644 virt.update handle disk volumes 2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
04965675a8 virt: let libvirt generate MAC addresses
There is no need to generate MAC addresses in the virt module if the
user hasn't provided any. This only makes it harder to make the
difference between a real mac address change from the user and a new
generated one.

Now the mac address is not written in the domain XML definition if not
provided by the user. This avoids unnecessary changes when applying
virt.running.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
87c85cc820 fix libvirtError use
libvirtError is not defined, libvirt.libvirtError should be used
instead.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
faf46571c0 Add disk volumes support in virt.init
In order to support creating VMs with disk on more storage pools like
iSCSI, disks, LVM, RBD, etc, virt.init needs to handle disks not only as
files, but also as libvirt volumes.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
7bb3572390 Share libvirt connection in virt.init
Since the next commits will introduce more uses of the libvirt
connection in virt.init(), start sharing it now.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
d6d5b51dde Extract virt.pool_capabilities logic for use with a libvirt connection
Te virt.pool_capabilities function computes a lot of interesting values
on the virtual storage pool types. Extract the logic of it into
virt._pool_capabilities for reuse.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
261d2ef7bf virt.capabilities refactoring
Extract the libvirt-handling code from virt.capabilities into a
virt._capabilities function accepting an opened libvirt connection.
This allows reusing the code in other functions with easy connection
handling.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
5ec45b7771 Add virt.volume_upload function
When using volumes the user can just copy the template disk image into
the target path. In such a case, the image needs to be uploaded into the
volume.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
c5b4737b69 Add virt.volume_define function
In the same vein than pool_define and network_define, expose a
volume_define function to let users create a volume without needing to
know all of libvirt's XML details.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
a038269738 virt.define_vol_xml_str variant using an existing libvirt connection
In order to avoid connection multiple times when reusing this function
in the virt module, create _define_vol_xml_str not caring about the
connection opening and closing.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
2fd1556819 virt: add more properties to generate volume XML
In order to generate almost all the volumes that libvirt can handle, add
the type, backingStore, permissions and allocation parameters to the
virt._gen_vol_xml() function.

Also make the format parameter optional since libvirt has default values
depending on the storage backend.
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
720673dcc0 virt._gen_vol_xml: move all esx-specifics outside
In the near future gen_vol_xml will be able to handle many volume types,
not only for ESX volumes. For this, clean up the function from all the
ESX-specifics code and move them to the caller code.

The volume key and target path values have also been removed since those
are read-only elements that should not be provided for volume creation
as per https://libvirt.org/formatstorage.html#StorageVol
2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
8ed54cd923 Remove useless default values for disks and vm_name in _disk_profile 2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
95458aef46 Add pool parameter to virt.define_vol_xml_str 2020-05-07 16:15:03 -07:00
Cédric Bosdonnat
2492714da1 Fix pylint warning in test_virt.py after blackening 2020-05-07 16:15:03 -07:00
Joe Eacott
8c6eaea3c9 Add back removed pylint 2020-05-07 16:14:27 -07:00
Joe Eacott
7e51746d2d add back removed pylint 2020-05-07 16:14:27 -07:00
Joe Eacott
7d6e441ca9 Add removed code 2020-05-07 16:14:27 -07:00
Joe Eacott
a7b40e5947 Add code that was removed on accident 2020-05-07 16:14:27 -07:00
Joe Eacott
d34ce4610b Revert import changes 2020-05-07 16:14:27 -07:00
Erik Johnson
b4d9b845c9 Fix tests again 2020-05-07 16:14:27 -07:00
Erik Johnson
d321e1ce99 Fix tests 2020-05-07 16:14:27 -07:00
Daniel Wozniak
273fc9e65c Port #52305 to master 2020-05-07 16:14:27 -07:00
Pedro Algarvio
81f43fb67f Get some insight on failing tests 2020-05-07 16:00:11 -07:00
Pedro Algarvio
bf6b61a0e5 Fix integration.reactor.test_reactor under PyTest 2020-05-07 16:00:11 -07:00
Pedro Algarvio
d14889eb1d Tweak pytest settings to speed up test collection 2020-05-07 16:00:11 -07:00
Pedro Algarvio
a0e96810fd Show test execution order in CI runs to help debug test suite hangs 2020-05-07 16:00:11 -07:00