mirror of https://github.com/apache/cloudstack.git
move change ownership logic
This commit is contained in:
parent
1d46506c04
commit
caa8c8183b
|
|
@ -7592,9 +7592,6 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
|||
removeInstanceFromInstanceGroup(vm.getId());
|
||||
|
||||
Long newAccountId = newAccount.getAccountId();
|
||||
updateVmOwner(newAccount, vm, domainId, newAccountId);
|
||||
|
||||
updateVolumesOwner(volumes, oldAccount, newAccount, newAccountId);
|
||||
AtomicBoolean isNetworkAutoCreated = new AtomicBoolean(false);
|
||||
try {
|
||||
updateVmNetwork(cmd, caller, vm, newAccount, template, isNetworkAutoCreated);
|
||||
|
|
@ -7606,6 +7603,10 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
|
|||
throw new CloudRuntimeException(String.format("Unable to update networks when assigning VM [%s] due to [%s].", vm, e.getMessage()), e);
|
||||
}
|
||||
|
||||
updateVmOwner(newAccount, vm, domainId, newAccountId);
|
||||
|
||||
updateVolumesOwner(volumes, oldAccount, newAccount, newAccountId);
|
||||
|
||||
logger.trace(String.format("Incrementing new account [%s] resource count.", newAccount));
|
||||
if (!isResourceCountRunningVmsOnlyEnabled()) {
|
||||
resourceCountIncrement(newAccountId, vm.isDisplayVm(), offering, template);
|
||||
|
|
|
|||
Loading…
Reference in New Issue