Reviewed: https://review.opendev.org/696834 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=fafbc182f9179c16b89c45d02544d4582e0a1194 Submitter: Zuul Branch: master
commit fafbc182f9179c16b89c45d02544d4582e0a1194 Author: Lee Yarwood <[email protected]> Date: Sun Dec 1 16:32:47 2019 +0000 libvirt: Use virDomainBlockCopy to swap volumes when using -blockdev Previously virDomainBlockRebase [1] was used by swap_volume to switch between volumes presented to the compute host as block devices or files. As outlined in the virDomainBlockCopy [2] documentation this command is actually a superset of virDomainBlockRebase in our case: > This command is a superset of the older virDomainBlockRebase() when used > with the VIR_DOMAIN_BLOCK_REBASE_COPY flag, and offers better control > over the destination format, the ability to copy to a destination that > is not a local file, and the possibility of additional tuning > parameters. As such we can switch to virDomainBlockCopy and expand support for swap_volume outside of just host block devices and files. To allow swap_volume to support RBD volumes we also need the domain to use the recently introduced -blockdev support within libvirt >= 6.0.0 and QEMU >= 4.2.0. New MIN_LIBVIRT_BLOCKDEV and MIN_QEMU_BLOCKDEV version constants are introduced and used to determine when to switch to the virDomainBlockCopy method of moving between volumes. [1] https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockRebase [2] https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockCopy Closes-Bug: #1868996 Change-Id: I8e8035dcf508f5215bba9b7575c5c6abfe41da31 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1868996 Title: Unable to swap between RBD volumes using virDomainBlockRebase Status in OpenStack Compute (nova): Fix Released Bug description: Description =========== $subject, the use of libvirt's virDomainBlockRebase API [1] currently means that we can't swap between volumes that do not present a block device or file on the compute host. This is additionally blocked by the following conditional in Nova's libvirt driver: https://github.com/openstack/nova/blob/f454e1dec9580abf4605e071bdd678a40f492a49/nova/virt/libvirt/driver.py#L1854-L1865 This is however possible with the virDomainBlockCopy API [2] when the domain is using the new -blockdev framework for detailing how disks are attached to the guest. [1] https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockRebase [2] https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockCopy Steps to reproduce ================== * Launch an instance with a RBD volume attached. * Try to swap to another volume. Expected result =============== Success using virDomainBlockCopy. Actual result ============= Failure using virDomainBlockRebase as no block device or file is presented to the compute host. Environment =========== 1. Exact version of OpenStack you are running. See the following list for all releases: http://docs.openstack.org/releases/ master 2. Which hypervisor did you use? (For example: Libvirt + KVM, Libvirt + XEN, Hyper-V, PowerKVM, ...) What's the version of that? libvirt + QEMU/KVM 2. Which storage type did you use? (For example: Ceph, LVM, GPFS, ...) What's the version of that? Ceph 3. Which networking type did you use? (For example: nova-network, Neutron with OpenVSwitch, ...) N/A To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1868996/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

