Skip to content

Commit 20fd276

Browse files
CLOUDSTACK-5660: Migrate vm live migration succeeds but throws error as ""Failed to migrate the system vm"".
1 parent dfe744c commit 20fd276

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3933,7 +3933,12 @@ public VirtualMachine migrateVirtualMachine(Long vmId, Host destinationHost) thr
39333933
collectVmDiskStatistics(uservm);
39343934
}
39353935
_itMgr.migrate(vm.getUuid(), srcHostId, dest);
3936-
return _vmDao.findById(vmId);
3936+
VMInstanceVO vmInstance = _vmInstanceDao.findById(vmId);
3937+
if (vmInstance.getType().equals(VirtualMachine.Type.User)) {
3938+
return _vmDao.findById(vmId);
3939+
} else {
3940+
return vmInstance;
3941+
}
39373942
}
39383943

39393944
private boolean checkIfHostIsDedicated(HostVO host) {

‎ui/scripts/system.js‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2547,7 +2547,7 @@
25472547
getUpdatedItem: function (json) {
25482548
//return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
25492549
$.ajax({
2550-
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
2550+
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvm.id),
25512551
dataType: "json",
25522552
async: false,
25532553
success: function (json) {
@@ -3073,7 +3073,7 @@
30733073
getUpdatedItem: function (json) {
30743074
//return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
30753075
$.ajax({
3076-
url: createURL("listInternalLoadBalancerVMs&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
3076+
url: createURL("listInternalLoadBalancerVMs&id=" + json.queryasyncjobresultresponse.jobresult.systemvm.id),
30773077
dataType: "json",
30783078
async: false,
30793079
success: function (json) {
@@ -3671,7 +3671,7 @@
36713671
getUpdatedItem: function (json) {
36723672
//return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
36733673
$.ajax({
3674-
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
3674+
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvm.id),
36753675
dataType: "json",
36763676
async: false,
36773677
success: function (json) {
@@ -6264,7 +6264,7 @@
62646264
getUpdatedItem: function (json) {
62656265
//return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
62666266
$.ajax({
6267-
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
6267+
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvm.id),
62686268
dataType: "json",
62696269
async: false,
62706270
success: function (json) {
@@ -7720,7 +7720,7 @@
77207720
getUpdatedItem: function (json) {
77217721
//return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
77227722
$.ajax({
7723-
url: createURL("listSystemVms&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
7723+
url: createURL("listSystemVms&id=" + json.queryasyncjobresultresponse.jobresult.systemvm.id),
77247724
dataType: "json",
77257725
async: false,
77267726
success: function (json) {
@@ -8892,7 +8892,7 @@
88928892
getUpdatedItem: function (json) {
88938893
//return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
88948894
$.ajax({
8895-
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
8895+
url: createURL("listRouters&id=" + json.queryasyncjobresultresponse.jobresult.systemvm.id),
88968896
dataType: "json",
88978897
async: false,
88988898
success: function (json) {
@@ -10117,7 +10117,7 @@
1011710117
getUpdatedItem: function (json) {
1011810118
//return json.queryasyncjobresultresponse.jobresult.systemvminstance; //not all properties returned in systemvminstance
1011910119
$.ajax({
10120-
url: createURL("listSystemVms&id=" + json.queryasyncjobresultresponse.jobresult.systemvminstance.id),
10120+
url: createURL("listSystemVms&id=" + json.queryasyncjobresultresponse.jobresult.systemvm.id),
1012110121
dataType: "json",
1012210122
async: false,
1012310123
success: function (json) {

0 commit comments

Comments
 (0)