mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
Merge remote-tracking branch 'apache/4.17' into main
This commit is contained in:
commit
7ae6fdf053
@ -5253,7 +5253,7 @@ public class VmwareResource extends ServerResourceBase implements StoragePoolRes
|
||||
protected AttachIsoAnswer execute(AttachIsoCommand cmd) {
|
||||
try {
|
||||
VmwareHypervisorHost hyperHost = getHyperHost(getServiceContext());
|
||||
VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(cmd.getVmName());
|
||||
VirtualMachineMO vmMo = HypervisorHostHelper.findVmOnHypervisorHostOrPeer(hyperHost, cmd.getVmName());
|
||||
if (vmMo == null) {
|
||||
String msg = "Unable to find VM in vSphere to execute AttachIsoCommand, vmName: " + cmd.getVmName();
|
||||
s_logger.error(msg);
|
||||
|
||||
@ -2341,7 +2341,7 @@ public class VmwareStorageProcessor implements StorageProcessor {
|
||||
try {
|
||||
VmwareContext context = hostService.getServiceContext(null);
|
||||
VmwareHypervisorHost hyperHost = hostService.getHyperHost(context, null);
|
||||
VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(vmName);
|
||||
VirtualMachineMO vmMo = HypervisorHostHelper.findVmOnHypervisorHostOrPeer(hyperHost, vmName);
|
||||
if (vmMo == null) {
|
||||
String msg = "Unable to find VM in vSphere to execute AttachIsoCommand, vmName: " + vmName;
|
||||
s_logger.error(msg);
|
||||
|
||||
@ -98,6 +98,18 @@ export default {
|
||||
loading: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
items: {
|
||||
type: Object,
|
||||
default: () => {}
|
||||
},
|
||||
bordered: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
tab: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data () {
|
||||
|
||||
@ -217,6 +217,7 @@ export default {
|
||||
delete this.params[this.cpuNumberKey]
|
||||
delete this.params[this.cpuSpeedKey]
|
||||
delete this.params[this.memoryKey]
|
||||
delete this.params[this.rootDiskSizeKey]
|
||||
|
||||
this.params.serviceofferingid = id
|
||||
this.selectedOffering = this.offeringsMap[id]
|
||||
|
||||
@ -2340,4 +2340,15 @@ public class HypervisorHostHelper {
|
||||
}
|
||||
return hardwareVersion;
|
||||
}
|
||||
|
||||
public static VirtualMachineMO findVmOnHypervisorHostOrPeer(VmwareHypervisorHost hypervisorHost, String vmName) throws Exception {
|
||||
VirtualMachineMO vmMo = hypervisorHost.findVmOnHyperHost(vmName);
|
||||
if (vmMo == null) {
|
||||
if (s_logger.isDebugEnabled()) {
|
||||
s_logger.debug(String.format("Unable to find the VM on host %s, try within datacenter", hypervisorHost.getHyperHostName()));
|
||||
}
|
||||
vmMo = hypervisorHost.findVmOnPeerHyperHost(vmName);
|
||||
}
|
||||
return vmMo;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user