DaanHoogland commented on a change in pull request #3976: Enable sending 
hypervior host name via metadata - VR and Config Drive
URL: https://github.com/apache/cloudstack/pull/3976#discussion_r399279684
 
 

 ##########
 File path: 
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java
 ##########
 @@ -115,6 +118,30 @@ public Answer execute(final MigrateCommand command, final 
LibvirtComputingResour
             conn = libvirtUtilitiesHelper.getConnectionByVmName(vmName);
             ifaces = libvirtComputingResource.getInterfaces(conn, vmName);
             disks = libvirtComputingResource.getDisks(conn, vmName);
+
+            String oldIsoVolumePath = null;
+            for (DiskDef disk : disks) {
+                if (disk.getDiskPath() != null && 
disk.getDiskPath().contains(vmName)) {
+                    oldIsoVolumePath = disk.getDiskPath();
+                    break;
+                }
+            }
+
+            VirtualMachineTO to = command.getVirtualMachine();
+
+            DiskTO newDisk = null;
+            for (DiskTO disk : to.getDisks()) {
+                if (disk.getPath() != null && 
disk.getPath().contains("configdrive")) {
+                    newDisk = disk;
+                    break;
+                }
+            }
+
+            String newIsoVolumePath = null;
+            if (newDisk != null) {
+                 newIsoVolumePath = 
libvirtComputingResource.getVolumePath(conn, newDisk);
+            }
+
 
 Review comment:
   this method is already 200 lines, please add your logic in a new 
method/class or module.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to