Hello Dan Kenigsberg,
I'd like you to do a code review. Please visit
to review the following change.
Change subject: vm: discover volume path from xml definition ......................................................................
vm: discover volume path from xml definition
In a previous commit (c072945 One shot prepare) we involuntarily changed the path used for virtual machine images from:
/rhev/data-center/<spUUID>/<sdUUID>/images/<imgUUID>/<volUUID>
to:
/rhev/data-center/mnt/blockSD/<sdUUID>/images/<imgUUID>/<volUUID>
This generated an issue during live migration between different vdsm versions:
libvirtError: invalid argument: invalid path ... not assigned to domain
In this patch we inspect libvirt xml during live migration and vdsm restart to identify if it is necessary to update the path cached in the drive object (provided by prepareImage).
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1059482 Change-Id: I322f1f879fbd5b6415789f3b307e8741d846d694 Signed-off-by: Federico Simoncelli fsimonce@redhat.com Reviewed-on: http://gerrit.ovirt.org/24202 Reviewed-by: Dan Kenigsberg danken@redhat.com --- M vdsm/vm.py 1 file changed, 18 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/24/24324/1
diff --git a/vdsm/vm.py b/vdsm/vm.py index ab32971..d3d47ab 100644 --- a/vdsm/vm.py +++ b/vdsm/vm.py @@ -4964,6 +4964,16 @@
self.log.debug('Looking for drive with attributes %s', deviceDict) for d in self._devices[DISK_DEVICES]: + # When we analyze a disk device that was already discovered in + # the past (generally as soon as the VM is created) we should + # verify that the cached path is the one used in libvirt. + # We already hit few times the problem that after a live + # migration the paths were not in sync anymore (BZ#1059482). + if (hasattr(d, 'alias') and d.alias == alias + and d.path != devPath): + self.log.warning('updating drive %s path from %s to %s', + d.alias, d.path, devPath) + d.path = devPath if d.path == devPath: d.name = name d.type = devType @@ -4977,6 +4987,14 @@ # Update vm's conf with address for known disk devices knownDev = False for dev in self.conf['devices']: + # See comment in previous loop. This part is used to update + # the vm configuration as well. + if ('alias' in dev and dev['alias'] == alias + and dev['path'] != devPath): + self.log.warning('updating drive %s config path from %s ' + 'to %s', dev['alias'], dev['path'], + devPath) + dev['path'] = devPath if dev['type'] == DISK_DEVICES and dev['path'] == devPath: dev['name'] = name dev['address'] = address
Federico Simoncelli has posted comments on this change.
Change subject: vm: discover volume path from xml definition ......................................................................
Patch Set 1: Verified+1
Same as master.
Dan Kenigsberg has posted comments on this change.
Change subject: vm: discover volume path from xml definition ......................................................................
Patch Set 1: Code-Review+2
Yaniv Bronhaim has submitted this change and it was merged.
Change subject: vm: discover volume path from xml definition ......................................................................
vm: discover volume path from xml definition
In a previous commit (c072945 One shot prepare) we involuntarily changed the path used for virtual machine images from:
/rhev/data-center/<spUUID>/<sdUUID>/images/<imgUUID>/<volUUID>
to:
/rhev/data-center/mnt/blockSD/<sdUUID>/images/<imgUUID>/<volUUID>
This generated an issue during live migration between different vdsm versions:
libvirtError: invalid argument: invalid path ... not assigned to domain
In this patch we inspect libvirt xml during live migration and vdsm restart to identify if it is necessary to update the path cached in the drive object (provided by prepareImage).
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1059482 Change-Id: I322f1f879fbd5b6415789f3b307e8741d846d694 Signed-off-by: Federico Simoncelli fsimonce@redhat.com Reviewed-on: http://gerrit.ovirt.org/24202 Reviewed-by: Dan Kenigsberg danken@redhat.com Reviewed-on: http://gerrit.ovirt.org/24324 --- M vdsm/vm.py 1 file changed, 18 insertions(+), 0 deletions(-)
Approvals: Federico Simoncelli: Verified Dan Kenigsberg: Looks good to me, approved
vdsm-patches@lists.fedorahosted.org