GabrielBrascher commented on a change in pull request #2997: Allow KVM VM live
migration with ROOT volume on file storage type
URL: https://github.com/apache/cloudstack/pull/2997#discussion_r230814607
##########
File path:
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java
##########
@@ -203,8 +207,13 @@ Use VIR_DOMAIN_XML_SECURE (value = 1) prior to v1.0.0.
destDomain = migrateThread.get(10, TimeUnit.SECONDS);
if (destDomain != null) {
- for (final DiskDef disk : disks) {
- libvirtComputingResource.cleanupDisk(disk);
+ for (DiskDef disk : disks) {
+ MigrateDiskInfo migrateDiskInfo =
searchDiskDefOnMigrateDiskInfoList(migrateDiskInfoList, disk);
+ if (migrateDiskInfo != null &&
migrateDiskInfo.isSourceDiskOnStorageFileSystem()) {
+ deleteLocalVolume(disk.getDiskPath());
+ } else {
+ libvirtComputingResource.cleanupDisk(disk);
Review comment:
@wido the `libvirtComputingResource.cleanupDisk(disk)` was already being
executed. The cleanupDisk just disconnects from the source host, after it has
been migrated to another host; it works that way with iScsi, for instance. I
can also work on renaming/documenting the cleanupDisk method, if you think that
it would good.
The `deleteLocalVolume` method was added to handle in case of the disk is on
a file; in such case it deletes the file from the source host (local primary
storage).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services