Repository navigation
Expand file tree
/
Copy pathcheck_diff
More file actions
103 lines (94 loc) · 6.53 KB
/
Copy pathcheck_diff
File metadata and controls
103 lines (94 loc) · 6.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
diff --git a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
index 47d3013f22..2dbf257fb2 100644
--- a/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
@@ -5551,11 +5551,11 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
throw new InvalidParameterValueException("Unable to find the VM by id=" + vmId);
}
- if (vm.getState() != State.Stopped) {
- InvalidParameterValueException ex = new InvalidParameterValueException("VM is not Stopped, unable to migrate the vm having the specified id");
- ex.addProxyObject(vm.getUuid(), "vmId");
- throw ex;
- }
+// if (vm.getState() != State.Stopped) {
+// InvalidParameterValueException ex = new InvalidParameterValueException("VM is not Stopped, unable to migrate the vm having the specified id");
+// ex.addProxyObject(vm.getUuid(), "vmId");
+// throw ex;
+// }
if (vm.getType() != VirtualMachine.Type.User) {
// OffLineVmwareMigration: *WHY* ?
@@ -5634,14 +5634,14 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
throw new InvalidParameterValueException("Unable to find the VM by id=" + vmId);
}
// business logic
- if (vm.getState() != State.Running) {
- if (s_logger.isDebugEnabled()) {
- s_logger.debug("VM is not Running, unable to migrate the vm " + vm);
- }
- InvalidParameterValueException ex = new InvalidParameterValueException("VM is not Running, unable to migrate the vm with specified id");
- ex.addProxyObject(vm.getUuid(), "vmId");
- throw ex;
- }
+// if (vm.getState() != State.Running) {
+// if (s_logger.isDebugEnabled()) {
+// s_logger.debug("VM is not Running, unable to migrate the vm " + vm);
+// }
+// InvalidParameterValueException ex = new InvalidParameterValueException("VM is not Running, unable to migrate the vm with specified id");
+// ex.addProxyObject(vm.getUuid(), "vmId");
+// throw ex;
+// }
checkIfHostOfVMIsInPrepareForMaintenanceState(vm.getHostId(), vmId, "Migrate");
@@ -5987,15 +5987,15 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
}
// OfflineVmwareMigration: this would be it ;) if multiple paths exist: unify
- if (vm.getState() != State.Running) {
- // OfflineVmwareMigration: and not vmware
- if (s_logger.isDebugEnabled()) {
- s_logger.debug("VM is not Running, unable to migrate the vm " + vm);
- }
- CloudRuntimeException ex = new CloudRuntimeException("VM is not Running, unable to migrate the vm with" + " specified id");
- ex.addProxyObject(vm.getUuid(), "vmId");
- throw ex;
- }
+// if (vm.getState() != State.Running) {
+// // OfflineVmwareMigration: and not vmware
+// if (s_logger.isDebugEnabled()) {
+// s_logger.debug("VM is not Running, unable to migrate the vm " + vm);
+// }
+// CloudRuntimeException ex = new CloudRuntimeException("VM is not Running, unable to migrate the vm with" + " specified id");
+// ex.addProxyObject(vm.getUuid(), "vmId");
+// throw ex;
+// }
if(serviceOfferingDetailsDao.findDetail(vm.getServiceOfferingId(), GPU.Keys.pciDevice.toString()) != null) {
throw new InvalidParameterValueException("Live Migration of GPU enabled VM is not supported");
diff --git a/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java b/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
index 62ecc9a5d5..36e102cb20 100644
--- a/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
+++ b/vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
@@ -34,8 +34,6 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
-import com.vmware.vim25.VStorageObject;
-import com.vmware.vim25.VStorageObjectConfigInfo;
import org.apache.commons.collections.CollectionUtils;
import org.apache.log4j.Logger;
import org.apache.commons.lang.StringUtils;
@@ -2430,13 +2428,13 @@ public class VirtualMachineMO extends BaseMO {
String deviceNumbering = getDeviceBusName(devices, device);
s_logger.info("Disk backing : " + diskBackingInfo.getFileName() + " matches ==> " + deviceNumbering);
- if (((VirtualDisk) device).getVDiskId() == null) {
- s_logger.debug("vDiskid does not exist for volume " + vmdkDatastorePath + " registering the disk now");
- VirtualStorageObjectManagerMO vStorageObjectManagerMO = new VirtualStorageObjectManagerMO(getOwnerDatacenter().first().getContext());
- VStorageObject vStorageObject = vStorageObjectManagerMO.registerVirtualDisk(dsBackingFile, null, getOwnerDatacenter().first().getName());
- VStorageObjectConfigInfo diskConfigInfo = vStorageObject.getConfig();
- ((VirtualDisk) device).setVDiskId(diskConfigInfo.getId());
- }
+// if (((VirtualDisk) device).getVDiskId() == null) {
+// s_logger.debug("vDiskid does not exist for volume " + vmdkDatastorePath + " registering the disk now");
+// VirtualStorageObjectManagerMO vStorageObjectManagerMO = new VirtualStorageObjectManagerMO(getOwnerDatacenter().first().getContext());
+// VStorageObject vStorageObject = vStorageObjectManagerMO.registerVirtualDisk(dsBackingFile, null, getOwnerDatacenter().first().getName());
+// VStorageObjectConfigInfo diskConfigInfo = vStorageObject.getConfig();
+// ((VirtualDisk) device).setVDiskId(diskConfigInfo.getId());
+// }
return new Pair<>((VirtualDisk)device, deviceNumbering);
}