mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7494. Migration of a vm fails on Hyper-V. In an earlier commit as part of
cleaning up vmsync changes, checkvirtualmachine command was updated to return the power state of the vm. The change was missed for Hyper-V. This caused migration to fail on cloudstack even though it used to succeed on the hypervisor. Updated the hyper-v agent code to return the cloudstack equivalent power state for check virtual machine answer.
This commit is contained in:
parent
7cdb67dcf1
commit
5350e61187
|
|
@ -873,7 +873,7 @@ namespace HypervResource
|
|||
string details = null;
|
||||
bool result = false;
|
||||
string vmName = cmd.vmName;
|
||||
string state = null;
|
||||
string powerState = null;
|
||||
|
||||
// TODO: Look up the VM, convert Hyper-V state to CloudStack version.
|
||||
var sys = wmiCallsV2.GetComputerSystem(vmName);
|
||||
|
|
@ -884,7 +884,7 @@ namespace HypervResource
|
|||
}
|
||||
else
|
||||
{
|
||||
state = EnabledState.ToCloudStackState(sys.EnabledState); // TODO: V2 changes?
|
||||
powerState = EnabledState.ToCloudStackPowerState(sys.EnabledState);
|
||||
result = true;
|
||||
}
|
||||
|
||||
|
|
@ -892,7 +892,7 @@ namespace HypervResource
|
|||
{
|
||||
result = result,
|
||||
details = details,
|
||||
state = state,
|
||||
powerstate = powerState,
|
||||
contextMap = contextMap
|
||||
};
|
||||
return ReturnCloudStackTypedJArray(ansContent, CloudStackTypes.CheckVirtualMachineAnswer);
|
||||
|
|
|
|||
Loading…
Reference in New Issue