_check_graphics_addresses_can_live_migrate was added to check
whether we can live migrate a VM with VNC/SPICE enabled when:
* libvirt did not allow to change and migrate guest XML with
updated graphics listen addresses. Right now we always can update
VNC/SPICE listen address.
* Destination node was running old-code that does not set the fields.
Currently when live migrating between two versions of OpenStack
(N and N-1) the fields are always set.
Therefore this check is redundant and can be removed.
Going deeper in this code - graphics_listen_addr_vnc and
graphics_listen_addr_spice in libvirt migrate data object are of
type IPAddressField. It means that both need to contain valid IP address.
By default in nova.conf it is 127.0.0.1. It can't be set to None because
IP address is taken from nova.conf and even if set to None it will be
passed as a string 'None' and will fail IPAddressField validation.
graphics_listen_addrs in migration.py currently always returns a dict
which contains IP addresses of both VNC and spice graphics consoles.
This means that:
* check 'if listen_addrs' is always True
* check 'if not listen_addrs' is always False
So we really never passed through 'if not listen_addrs' since
migrate_data is objectified as those addresses are always there.
However, serial_listen_addr is handled different way. The type of
this field in libvirt migrate data object is StringField that might
be set to None or empty string through nova.conf. So we still need
to validate whether serial console can be migrated so that we will
be sure that particular live migration will not break serial console
in case when serial listen address is not configured at destination.
Reviewed: https:/ /review. openstack. org/373264 /git.openstack. org/cgit/ openstack/ nova/commit/ ?id=f84ae10c66a eda223581b26c13 4b5c44c15d9e6e
Committed: https:/
Submitter: Jenkins
Branch: master
commit f84ae10c66aeda2 23581b26c134b5c 44c15d9e6e
Author: Pawel Koniszewski <email address hidden>
Date: Wed Nov 16 11:05:10 2016 +0100
Refactor console checks in live migration process
_check_ graphics_ addresses_ can_live_ migrate was added to check
whether we can live migrate a VM with VNC/SPICE enabled when:
* libvirt did not allow to change and migrate guest XML with
updated graphics listen addresses. Right now we always can update
VNC/SPICE listen address.
* Destination node was running old-code that does not set the fields.
Currently when live migrating between two versions of OpenStack
(N and N-1) the fields are always set.
Therefore this check is redundant and can be removed.
Going deeper in this code - graphics_ listen_ addr_vnc and listen_ addr_spice in libvirt migrate data object are of
graphics_
type IPAddressField. It means that both need to contain valid IP address.
By default in nova.conf it is 127.0.0.1. It can't be set to None because
IP address is taken from nova.conf and even if set to None it will be
passed as a string 'None' and will fail IPAddressField validation.
graphics_ listen_ addrs in migration.py currently always returns a dict
which contains IP addresses of both VNC and spice graphics consoles.
This means that:
* check 'if listen_addrs' is always True
* check 'if not listen_addrs' is always False
So we really never passed through 'if not listen_addrs' since
migrate_data is objectified as those addresses are always there.
However, serial_listen_addr is handled different way. The type of
this field in libvirt migrate data object is StringField that might
be set to None or empty string through nova.conf. So we still need
to validate whether serial console can be migrated so that we will
be sure that particular live migration will not break serial console
in case when serial listen address is not configured at destination.
Change-Id: I73f7bfafa4554b f1c2dfc980289be 88154170282
Closes-Bug: #1639312