You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge pull request #844 from ustcweizhou/assignvm-master
[4.10] CLOUDSTACK-7985: assignVM in Advanced zone with Security GroupsThis commit contains the following changes:
(1) implementation of assignVM in Advanced zone with Security Groups
(2) keep the default nic on shared network when assignVM
(3) allow migrate vm from/to project;
(4) UI change for selecting account/project/network
* pr/844:
CLOUDSTACK-7985: assignVM in Advanced zone with Security Groups
CLOUDSTACK-7985: keep the default nic on shared network when assignVM
CLOUDSTACK-7985: (1) allow migrate vm from/to project; (2) UI change for selecting account/project/network
Signed-off-by: Rajani Karuturi <rajani.karuturi@accelerite.com>
@@ -58,12 +60,15 @@ public class AssignVMCmd extends BaseCmd {
58
60
description = "id of the VM to be moved")
59
61
privateLongvirtualMachineId;
60
62
61
-
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, required = true, description = "account name of the new VM owner.")
63
+
@Parameter(name = ApiConstants.ACCOUNT, type = CommandType.STRING, description = "account name of the new VM owner.")
62
64
privateStringaccountName;
63
65
64
-
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class, required = true, description = "domain id of the new VM owner.")
66
+
@Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class, description = "domain id of the new VM owner.")
65
67
privateLongdomainId;
66
68
69
+
@Parameter(name = ApiConstants.PROJECT_ID, type = CommandType.UUID, entityType = ProjectResponse.class, description = "an optional project for the new VM owner.")
s_logger.debug("AssignVM: use old shared network " + defaultNetworkOld.getName() + " with old ip " + requestedIPv4ForDefaultNic + " on default nic of vm:" + vm.getInstanceName());
5279
+
} catch (PermissionDeniedExceptione) {
5280
+
s_logger.debug("AssignVM: the shared network on old default nic can not be applied to new account");
5281
+
}
5282
+
}
5283
+
}
5284
+
}
5285
+
// cleanup the network for the oldOwner
5286
+
_networkMgr.cleanupNics(vmOldProfile);
5287
+
_networkMgr.expungeNics(vmOldProfile);
5288
+
5289
+
if (networkIdList != null && !networkIdList.isEmpty()) {
thrownewInvalidParameterValueException("No network is specified, please specify one when you move the vm. For now, please add a network to VM on NICs tab.");
5375
+
} else {
5376
+
_networkMgr.allocate(vmProfile, networks);
5377
+
}
5378
+
5379
+
_securityGroupMgr.addInstanceToGroups(vm.getId(),
5380
+
securityGroupIdList);
5381
+
s_logger.debug("AssignVM: Advanced zone, adding security groups no "
5382
+
+ securityGroupIdList.size() + " to "
5383
+
+ vm.getInstanceName());
5384
+
5268
5385
} else {
5269
5386
if (securityGroupIdList != null && !securityGroupIdList.isEmpty()) {
5270
5387
thrownewInvalidParameterValueException("Can't move vm with security groups; security group feature is not enabled in this zone");
Copy file name to clipboardExpand all lines: ui/l10n/en.js
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1909,6 +1909,7 @@ var dictionary = {"ICMP.code":"ICMP Code",
1909
1909
"message.alert.state.detected":"Alert state detected",
1910
1910
"message.allow.vpn.access":"Please enter a username and password of the user that you want to allow VPN access.",
1911
1911
"message.apply.snapshot.policy":"You have successfully updated your current snapshot policy.",
1912
+
"message.assign.instance.another":"Please specify the account type, domain, account name and network (optional) of the new account. <br> If the default nic of the vm is on a shared network, CloudStack will check if the network can be used by the new account if you do not specify one network. <br> If the default nic of the vm is on a isolated network, and the new account has more one isolated networks, you should specify one.",
1912
1913
"message.attach.iso.confirm":"Please confirm that you want to attach the ISO to this virtual instance.",
1913
1914
"message.attach.volume":"Please fill in the following data to attach a new volume. If you are attaching a disk volume to a Windows based virtual machine, you will need to reboot the instance to see the attached disk.",
1914
1915
"message.basic.mode.desc":"Choose this network model if you do <b>*<u>not</u>*</b> want to enable any VLAN support. All virtual instances created under this network model will be assigned an IP directly from the network and security groups are used to provide security and segregation.",
0 commit comments