Skip to content

Commit d7e1d38

Browse files
sanjaytripathichaturvedia
authored andcommitted
CLOUDSTACK-5660: Migrate vm live migration succeeds but throws error as "Failed to migrate the system vm".
(cherry picked from commit cff312e) Signed-off-by: Animesh Chaturvedi <animesh@apache.org>
1 parent ccc8aa7 commit d7e1d38

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

‎server/src/com/cloud/vm/UserVmManagerImpl.java‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4216,7 +4216,12 @@ public VirtualMachine migrateVirtualMachine(Long vmId, Host destinationHost)
42164216
collectVmDiskStatistics(uservm);
42174217
}
42184218
_itMgr.migrate(vm.getUuid(), srcHostId, dest);
4219-
return _vmDao.findById(vmId);
4219+
VMInstanceVO vmInstance = _vmInstanceDao.findById(vmId);
4220+
if (vmInstance.getType().equals(VirtualMachine.Type.User)) {
4221+
return _vmDao.findById(vmId);
4222+
} else {
4223+
return vmInstance;
4224+
}
42204225
}
42214226

42224227
private boolean checkIfHostIsDedicated(HostVO host) {

‎ui/scripts/system.js‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2508,7 +2508,7 @@
25082508
getUpdatedItem: function(json) {
25092509
//return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
25102510
$.ajax({
2511-
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
2511+
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvm.id),
25122512
dataType: "json",
25132513
async: false,
25142514
success: function(json) {
@@ -3030,7 +3030,7 @@
30303030
getUpdatedItem: function(json) {
30313031
//return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
30323032
$.ajax({
3033-
url: createURL("listInternalLoadBalancerVMs&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
3033+
url: createURL("listInternalLoadBalancerVMs&id=" + json.queryasyncjobresultresponse.jobresult.systemvm.id),
30343034
dataType: "json",
30353035
async: false,
30363036
success: function(json) {
@@ -3624,7 +3624,7 @@
36243624
getUpdatedItem: function(json) {
36253625
//return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
36263626
$.ajax({
3627-
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
3627+
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvm.id),
36283628
dataType: "json",
36293629
async: false,
36303630
success: function(json) {
@@ -6788,7 +6788,7 @@
67886788
getUpdatedItem: function(json) {
67896789
//return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
67906790
$.ajax({
6791-
url: createURL("listSystemVms&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
6791+
url: createURL("listSystemVms&id=" + json.queryasyncjobresultresponse.jobresult.systemvm.id),
67926792
dataType: "json",
67936793
async: false,
67946794
success: function(json) {
@@ -7941,7 +7941,7 @@
79417941
getUpdatedItem: function(json) {
79427942
//return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
79437943
$.ajax({
7944-
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
7944+
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvm.id),
79457945
dataType: "json",
79467946
async: false,
79477947
success: function(json) {
@@ -9167,7 +9167,7 @@
91679167
getUpdatedItem: function(json) {
91689168
//return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
91699169
$.ajax({
9170-
url: createURL("listSystemVms&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
9170+
url: createURL("listSystemVms&id=" + json.queryasyncjobresultresponse.jobresult.systemvm.id),
91719171
dataType: "json",
91729172
async: false,
91739173
success: function(json) {

0 commit comments

Comments
 (0)