Nir Soffer has posted comments on this change. Change subject: vm: LSM between mixed domain types ......................................................................
Patch Set 15: (14 comments) http://gerrit.ovirt.org/#/c/37095/15/vdsm/virt/vm.py File vdsm/virt/vm.py: Line 1406: # FIXME: mergeCandidates should be a dictionary of candidate volumes Line 1407: # once libvirt starts reporting watermark information for all volumes. Line 1408: mergeCandidates = {} Line 1409: for drive in self._devices[hwclass.DISK]: Line 1410: if not drive.extendable: Already in master (chunked) Line 1411: continue Line 1412: Line 1413: capacity, alloc, physical = self._dom.blockInfo(drive.path, 0) Line 1414: Line 1416: # identical to alloc, breaking extend logic. We can get the real Line 1417: # physical from the replica itself. See Line 1418: # https://www.redhat.com/archives/libvir-list/2014-December/ Line 1419: # msg00762.html Line 1420: if not drive.blockDev: Here blockDev is correct - libvirt blockInfo is not useful for file-based drives. Line 1421: replica = drive.diskReplicate Line 1422: res = self.cif.irs.getVolumeSize( Line 1423: replica["domainID"], replica["poolID"], replica["imageID"], Line 1424: replica["volumeID"]) Line 1420: if not drive.blockDev: Line 1421: replica = drive.diskReplicate Line 1422: res = self.cif.irs.getVolumeSize( Line 1423: replica["domainID"], replica["poolID"], replica["imageID"], Line 1424: replica["volumeID"]) > Separate patch: extract to getDriveVolumeSize Implemented in http://gerrit.ovirt.org/37888 Line 1425: if res['status']['code'] != 0: Line 1426: self.log.error( Line 1427: "Error getting size for volume %s domain %s", Line 1428: replica["volumeID"], replica["domainID"]) Line 1494: Line 1495: return len(extend) > 0 Line 1496: Line 1497: def extendDriveVolume(self, vmDrive, volumeID, curSize, capacity): Line 1498: if not vmDrive.extendable: Already in master (chunked) Line 1499: return Line 1500: Line 1501: newSize = vmDrive.getNextVolumeSize(curSize) # newSize is in megabytes Line 1502: Line 1500: Line 1501: newSize = vmDrive.getNextVolumeSize(curSize) # newSize is in megabytes Line 1502: Line 1503: replica = getattr(vmDrive, 'diskReplicate', {}) Line 1504: if replica.get("blockDev", False): Should we use "chunked" instead of blockDev? Line 1505: # The replica is a block device. We will handle the drive itself in Line 1506: # __afterReplictionExtension if the drive is also a block device. Line 1507: volInfo = {'poolID': replica['poolID'], Line 1508: 'domainID': replica['domainID'], Line 1501: newSize = vmDrive.getNextVolumeSize(curSize) # newSize is in megabytes Line 1502: Line 1503: replica = getattr(vmDrive, 'diskReplicate', {}) Line 1504: if replica.get("blockDev", False): Line 1505: # The replica is a block device. We will handle the drive itself in Is chunked Line 1506: # __afterReplictionExtension if the drive is also a block device. Line 1507: volInfo = {'poolID': replica['poolID'], Line 1508: 'domainID': replica['domainID'], Line 1509: 'imageID': replica['imageID'], Line 1514: self.cif.irs.sendExtendMsg(vmDrive.poolID, volInfo, Line 1515: newSize * constants.MEGAB, Line 1516: self.__afterReplicaExtension) Line 1517: else: Line 1518: # This drive is a block device this drive is chunked Line 1519: self.__extendDriveVolume(vmDrive, volumeID, newSize) Line 1520: Line 1521: def __refreshDriveVolume(self, volInfo): Line 1522: self.cif.irs.refreshVolume(volInfo['domainID'], volInfo['poolID'], Line 1557: def __afterReplicaExtension(self, volInfo): Line 1558: self.__verifyVolumeExtension(volInfo) Line 1559: vmDrive = self._findDriveByName(volInfo['name']) Line 1560: if not vmDrive.blockDev: Line 1561: return Should use vmDrive.chunked Line 1562: self.log.debug("Requesting extension for the original drive: %s " Line 1563: "(domainID: %s, volumeID: %s)", Line 1564: vmDrive.name, vmDrive.domainID, vmDrive.volumeID) Line 1565: self.__extendDriveVolume(vmDrive, vmDrive.volumeID, volInfo['newSize']) Line 3507: raise Line 3508: Line 3509: except Exception: Line 3510: self.log.exception("Cannot complete the disk replication process") Line 3511: self.cif.teardownVolumePath(dstDiskCopy) Fixup the teardown code in a separate patch. Line 3512: return errCode['replicaErr'] Line 3513: Line 3514: try: Line 3515: self.extendDriveVolume(srcDrive, srcDrive.volumeID, Line 3634: diskToTeardown) Line 3635: self.updateDriveParameters(dstDiskCopy) Line 3636: # When migrating between different domain types, cached values such Line 3637: # as blockDev may change. Line 3638: srcDrive.invalidate() Not needed, in master Drive.blockDev is invalidated when updating Drive.path. Line 3639: finally: Line 3640: self._delDiskReplica(srcDrive) Line 3641: self.startDisksStatsCollection() Line 3642: http://gerrit.ovirt.org/#/c/37095/15/vdsm/virt/vmdevices/storage.py File vdsm/virt/vmdevices/storage.py: Line 60: self.truesize = int(kwargs.get('truesize', '0')) Line 61: self.apparentsize = int(kwargs.get('apparentsize', '0')) Line 62: self.name = self._makeName() Line 63: self.cache = config.get('vars', 'qemu_drive_cache') Line 64: self._blockDev = None # Lazy initialized Already in master Line 65: Line 66: self._customize() Line 67: self._setExtSharedState() Line 68: Line 141: if self.blockDev: Line 142: return True Line 143: # TODO: Ensure that diskReplicate is initialized to None Line 144: replica = getattr(self, "diskReplicate", {}) Line 145: return replica.get("blockDev", False) Already in master except the replica support. Line 146: Line 147: def getNextVolumeSize(self, curSize): Line 148: """ Line 149: Returns the next volume size in megabytes. This value is based on the Line 175: try: Line 176: self._blockDev = utils.isBlockDevice(self.path) Line 177: except Exception: Line 178: self.log.debug("Unable to determine if the path '%s' is a " Line 179: "block device", self.path, exc_info=True) In master Line 180: return self._blockDev Line 181: Line 182: def invalidate(self): Line 183: """ Line 183: """ Line 184: Invalidate cached values such as blockDev, depending on other drive Line 185: attributes. Line 186: """ Line 187: self._blockDev = None Not needed, in master blockDev invalidates when modifying path. Line 188: Line 189: @property Line 190: def transientDisk(self): Line 191: # Using getattr to handle legacy and removable drives. -- To view, visit http://gerrit.ovirt.org/37095 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94585d9a963b2734f76f6a82f8fbb4609665224c Gerrit-PatchSet: 15 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer <[email protected]> Gerrit-Reviewer: Adam Litke <[email protected]> Gerrit-Reviewer: Allon Mureinik <[email protected]> Gerrit-Reviewer: Daniel Erez <[email protected]> Gerrit-Reviewer: Federico Simoncelli <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Liron Aravot <[email protected]> Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: Tal Nisan <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
