From 5c37249bf7a9809b1c331adbbb289255b65f9bc5 Mon Sep 17 00:00:00 2001 From: Hugo Trippaers Date: Fri, 14 Mar 2014 17:17:38 +0100 Subject: [PATCH 001/683] Fix database upgrade from 4.3.0 to 4.4.0 --- setup/db/db/schema-430to440.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index 5c5511ac5f..1d511c40dc 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -664,7 +664,7 @@ CREATE TABLE `cloud`.`op_router_monitoring_services` ( `last_alert_timestamp` varchar(255) NOT NULL COMMENT 'Timestamp of the last alert received from Virtual Router', PRIMARY KEY (`vm_id`), CONSTRAINT `fk_virtual_router__id` FOREIGN KEY `fk_virtual_router__id` (`vm_id`) REFERENCES `vm_instance`(`id`) ON DELETE CASCADE -) ENGINE = InnoDB DEFAULT CHARSET=utf8 +) ENGINE = InnoDB DEFAULT CHARSET=utf8; ALTER TABLE `cloud`.`event` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the detail can be displayed to the end user'; From 7a929d1a0e0a32cdd2fb9a871617b291f04b46f5 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Fri, 24 Jan 2014 11:15:38 +0530 Subject: [PATCH 002/683] region level VPC support introduce 'RegionLevelVpc' as capability of 'Connectivity' service. Add support for CreateVPCOffering to take the 'regionlevelvpc' as capability of service 'connectivity'. introduces new capability 'StretchedL2Subnet' for 'Connectivity' service. Also add support to createNetworkOffering api to allow StretchedL2Subnet capablity for the connectivity service. adds check to ensure 'Connectivity' service provider supports 'StretchedL2Subnet' and 'RegionLevelVpc' capabilities when specified in createNetworkOffering and createVpcOffering respectivley enable ovs plug-in to support both StretchedL2Subnet and RegionLevelVpc capabilities make zone id optional parameter in createVpc, zone id can be null only if vpc offfering supports region level VPC in region level vpc, let the network/tier to be created in any zone of the region keep zoneid as required param for createVpc skip external guest network guru if 'Connectivy' service is present in network offering fix build break in contrail manager permit VM's to be created in different zone that in which network is created if the network support streched L2 subnet add integration tests for region level VPC rebase to master Conflicts: setup/db/db/schema-430to440.sql --- api/src/com/cloud/network/Network.java | 6 +- api/src/com/cloud/network/NetworkProfile.java | 8 + api/src/com/cloud/network/vpc/Vpc.java | 6 + .../com/cloud/network/vpc/VpcOffering.java | 6 +- .../network/vpc/VpcProvisioningService.java | 1 + .../com/cloud/offering/NetworkOffering.java | 2 + .../apache/cloudstack/api/ApiConstants.java | 4 +- .../api/command/user/vpc/CreateVPCCmd.java | 2 +- .../api/response/NetworkOfferingResponse.java | 7 + .../api/response/VpcOfferingResponse.java | 8 + .../cloudstack/api/response/VpcResponse.java | 9 +- .../src/com/cloud/network/dao/NetworkVO.java | 12 + .../com/cloud/network/vpc/VpcOfferingVO.java | 11 +- .../src/com/cloud/network/vpc/VpcVO.java | 11 +- .../cloud/offerings/NetworkOfferingVO.java | 11 +- .../com/cloud/network/element/OvsElement.java | 2 + .../src/com/cloud/api/ApiResponseHelper.java | 3 + .../ConfigurationManagerImpl.java | 54 +- .../guru/ExternalGuestNetworkGuru.java | 4 + .../com/cloud/network/vpc/VpcManagerImpl.java | 244 ++++++--- .../cloud/server/ConfigurationServerImpl.java | 6 +- .../src/com/cloud/vm/UserVmManagerImpl.java | 2 +- .../network/CreatePrivateNetworkTest.java | 2 +- .../com/cloud/vpc/MockNetworkManagerImpl.java | 2 +- server/test/com/cloud/vpc/VpcApiUnitTest.java | 2 +- .../com/cloud/vpc/dao/MockVpcDaoImpl.java | 4 +- setup/db/db/schema-430to440.sql | 4 +- test/integration/component/test_region_vpc.py | 517 ++++++++++++++++++ 28 files changed, 847 insertions(+), 103 deletions(-) create mode 100644 test/integration/component/test_region_vpc.py diff --git a/api/src/com/cloud/network/Network.java b/api/src/com/cloud/network/Network.java index 3283a55bfe..ef3bcdf51c 100644 --- a/api/src/com/cloud/network/Network.java +++ b/api/src/com/cloud/network/Network.java @@ -57,7 +57,7 @@ public static class Service { public static final Service PortForwarding = new Service("PortForwarding"); public static final Service SecurityGroup = new Service("SecurityGroup"); public static final Service NetworkACL = new Service("NetworkACL", Capability.SupportedProtocols); - public static final Service Connectivity = new Service("Connectivity", Capability.DistributedRouter); + public static final Service Connectivity = new Service("Connectivity", Capability.DistributedRouter, Capability.RegionLevelVpc, Capability.StretchedL2Subnet); private final String name; private final Capability[] caps; @@ -187,6 +187,8 @@ public static class Capability { public static final Capability LbSchemes = new Capability("LbSchemes"); public static final Capability DhcpAccrossMultipleSubnets = new Capability("DhcpAccrossMultipleSubnets"); public static final Capability DistributedRouter = new Capability("DistributedRouter"); + public static final Capability StretchedL2Subnet = new Capability("StretchedL2Subnet"); + public static final Capability RegionLevelVpc = new Capability("RegionLevelVpc"); private final String name; @@ -337,4 +339,6 @@ public void setIp6Address(String ip6Address) { Long getNetworkACLId(); void setNetworkACLId(Long networkACLId); + + boolean isStrechedL2Network(); } diff --git a/api/src/com/cloud/network/NetworkProfile.java b/api/src/com/cloud/network/NetworkProfile.java index 3f576945a5..390ec25cf6 100644 --- a/api/src/com/cloud/network/NetworkProfile.java +++ b/api/src/com/cloud/network/NetworkProfile.java @@ -57,6 +57,7 @@ public class NetworkProfile implements Network { private final boolean displayNetwork; private Long networkAclId; private final String guruName; + private boolean strechedL2Subnet; public NetworkProfile(Network network) { id = network.getId(); @@ -89,6 +90,7 @@ public NetworkProfile(Network network) { displayNetwork = network.getDisplayNetwork(); networkAclId = network.getNetworkACLId(); guruName = network.getGuruName(); + strechedL2Subnet = network.isStrechedL2Network(); } public String getDns1() { @@ -282,4 +284,10 @@ public String getIp6Cidr() { public IAMEntityType getEntityType() { return IAMEntityType.Network; } + + @Override + public boolean isStrechedL2Network() { + return false; + } + } diff --git a/api/src/com/cloud/network/vpc/Vpc.java b/api/src/com/cloud/network/vpc/Vpc.java index 4bc8c98872..23388787d2 100644 --- a/api/src/com/cloud/network/vpc/Vpc.java +++ b/api/src/com/cloud/network/vpc/Vpc.java @@ -79,4 +79,10 @@ public enum State { * @return true if VPC is configured to use distributed router to provides one-hop forwarding and hypervisor based ACL */ boolean usesDistributedRouter(); + + /** + * + * @return true if VPC spans multiple zones in the region + */ + boolean isRegionLevelVpc(); } diff --git a/api/src/com/cloud/network/vpc/VpcOffering.java b/api/src/com/cloud/network/vpc/VpcOffering.java index a0a1b1528c..660c79dc1e 100644 --- a/api/src/com/cloud/network/vpc/VpcOffering.java +++ b/api/src/com/cloud/network/vpc/VpcOffering.java @@ -56,8 +56,12 @@ public enum State { Long getServiceOfferingId(); /** - * * @return true if the offering provides a distributed router capable of one-hop forwarding */ boolean supportsDistributedRouter(); + + /** + * @return true if VPC created with the offering can span multiple zones in the region + */ + boolean offersRegionLevelVPC(); } diff --git a/api/src/com/cloud/network/vpc/VpcProvisioningService.java b/api/src/com/cloud/network/vpc/VpcProvisioningService.java index e545275217..82a7baae95 100644 --- a/api/src/com/cloud/network/vpc/VpcProvisioningService.java +++ b/api/src/com/cloud/network/vpc/VpcProvisioningService.java @@ -16,6 +16,7 @@ // under the License. package com.cloud.network.vpc; + import java.util.List; import java.util.Map; diff --git a/api/src/com/cloud/offering/NetworkOffering.java b/api/src/com/cloud/offering/NetworkOffering.java index b4f3863293..f1ef69c2f6 100644 --- a/api/src/com/cloud/offering/NetworkOffering.java +++ b/api/src/com/cloud/offering/NetworkOffering.java @@ -129,4 +129,6 @@ public enum Detail { Integer getConcurrentConnections(); boolean isKeepAliveEnabled(); + + boolean getSupportsStrechedL2(); } diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index 32107edf84..0dbc1b823c 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -589,7 +589,9 @@ public class ApiConstants { public static final String VGPUTYPE = "vgputype"; public static final String REMAININGCAPACITY = "remainingcapacity"; public static final String DISTRIBUTED_VPC_ROUTER = "distributedvpcrouter"; - + public static final String SUPPORTS_REGION_LEVEL_VPC = "supportsregionLevelvpc"; + public static final String SUPPORTS_STRECHED_L2_SUBNET = "supportsstrechedl2subnet"; + public static final String REGION_LEVEL_VPC = "regionlevelvpc"; public enum HostDetails { all, capacity, events, stats, min; diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java index c179ec857f..4bf79da9ae 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java @@ -65,7 +65,7 @@ public class CreateVPCCmd extends BaseAsyncCreateCmd { private Long projectId; @Parameter(name = ApiConstants.ZONE_ID, type = CommandType.UUID, entityType = ZoneResponse.class, - required = true, description = "the ID of the availability zone") + required = true, description = "the ID of the availability zone") private Long zoneId; @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "the name of the VPC") diff --git a/api/src/org/apache/cloudstack/api/response/NetworkOfferingResponse.java b/api/src/org/apache/cloudstack/api/response/NetworkOfferingResponse.java index 8219147726..55ca2ce886 100644 --- a/api/src/org/apache/cloudstack/api/response/NetworkOfferingResponse.java +++ b/api/src/org/apache/cloudstack/api/response/NetworkOfferingResponse.java @@ -116,6 +116,10 @@ public class NetworkOfferingResponse extends BaseResponse { @Param(description = "maximum number of concurrents connections to be handled by lb") private Integer concurrentConnections; + @SerializedName(ApiConstants.SUPPORTS_STRECHED_L2_SUBNET) + @Param(description = "true if network offering supports network that span multiple zones") + private Boolean supportsStrechedL2Subnet; + public void setId(String id) { this.id = id; } @@ -200,4 +204,7 @@ public void setConcurrentConnections(Integer concurrentConnections) { this.concurrentConnections = concurrentConnections; } + public void setSupportsStrechedL2Subnet(Boolean supportsStrechedL2Subnet) { + this.supportsStrechedL2Subnet = supportsStrechedL2Subnet; + } } diff --git a/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java b/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java index 89697f04ad..de5adef611 100644 --- a/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java +++ b/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java @@ -63,6 +63,10 @@ public class VpcOfferingResponse extends BaseResponse { @Param(description = " indicates if the vpc offering supports distributed router for one-hop forwarding") private Boolean supportsDistributedRouter; + @SerializedName((ApiConstants.SUPPORTS_REGION_LEVEL_VPC)) + @Param(description = " indicated if the offering can support region level vpc") + private Boolean supportsRegionLevelVpc; + public void setId(String id) { this.id = id; } @@ -94,4 +98,8 @@ public void setState(String state) { public void setSupportsDistributedRouter(Boolean supportsDistributedRouter) { this.supportsDistributedRouter = supportsDistributedRouter; } + + public void setSupportsRegionLevelVpc(Boolean supports) { + this.supportsRegionLevelVpc = supports; + } } diff --git a/api/src/org/apache/cloudstack/api/response/VpcResponse.java b/api/src/org/apache/cloudstack/api/response/VpcResponse.java index e3b44f2113..d86045408c 100644 --- a/api/src/org/apache/cloudstack/api/response/VpcResponse.java +++ b/api/src/org/apache/cloudstack/api/response/VpcResponse.java @@ -111,11 +111,14 @@ public class VpcResponse extends BaseResponse implements ControlledEntityRespons @Param(description = "is vpc for display to the regular user", since = "4.4", authorized = {RoleType.Admin}) private Boolean forDisplay; - @SerializedName(ApiConstants.DISTRIBUTED_VPC_ROUTER) @Param(description = "is VPC uses distributed router for one hop forwarding and host based network ACL's") private boolean usesDistributedRouter; + @SerializedName((ApiConstants.REGION_LEVEL_VPC)) + @Param(description = "true if VPC is region level") + private Boolean regionLevelVpc; + public void setId(String id) { this.id = id; } @@ -205,6 +208,10 @@ public void setForDisplay(Boolean forDisplay) { this.forDisplay = forDisplay; } + public void setRegionLevelVpc(Boolean regionLevelVpc) { + this.regionLevelVpc = regionLevelVpc; + } + public void setUsesDistributedRouter(Boolean usesDistributedRouter) { this.usesDistributedRouter = usesDistributedRouter; } diff --git a/engine/schema/src/com/cloud/network/dao/NetworkVO.java b/engine/schema/src/com/cloud/network/dao/NetworkVO.java index 13e8dbff09..dc9d60aa05 100644 --- a/engine/schema/src/com/cloud/network/dao/NetworkVO.java +++ b/engine/schema/src/com/cloud/network/dao/NetworkVO.java @@ -167,6 +167,9 @@ public class NetworkVO implements Network { @Column(name = "network_acl_id") Long networkACLId; + @Column(name = "streched_l2") + boolean strechedL2Network = false; + public NetworkVO() { uuid = UUID.randomUUID().toString(); } @@ -589,4 +592,13 @@ public Long getNetworkACLId() { public IAMEntityType getEntityType() { return IAMEntityType.Network; } + + @Override + public boolean isStrechedL2Network() { + return strechedL2Network; + } + + public void setStrechedL2Network(boolean strechedL2Network) { + this.strechedL2Network = strechedL2Network; + } } diff --git a/engine/schema/src/com/cloud/network/vpc/VpcOfferingVO.java b/engine/schema/src/com/cloud/network/vpc/VpcOfferingVO.java index 53f6f6055e..a7d61b3692 100644 --- a/engine/schema/src/com/cloud/network/vpc/VpcOfferingVO.java +++ b/engine/schema/src/com/cloud/network/vpc/VpcOfferingVO.java @@ -70,6 +70,9 @@ public class VpcOfferingVO implements VpcOffering { @Column(name = "supports_distributed_router") boolean supportsDistributedRouter=false; + @Column(name = "supports_region_level_vpc") + boolean offersRegionLevelVPC = false; + public VpcOfferingVO() { this.uuid = UUID.randomUUID().toString(); } @@ -84,10 +87,11 @@ public VpcOfferingVO(String name, String displayText, Long serviceOfferingId) { } public VpcOfferingVO(String name, String displayText, boolean isDefault, Long serviceOfferingId, - boolean supportsDistributedRouter) { + boolean supportsDistributedRouter, boolean offersRegionLevelVPC) { this(name, displayText, serviceOfferingId); this.isDefault = isDefault; this.supportsDistributedRouter = supportsDistributedRouter; + this.offersRegionLevelVPC = offersRegionLevelVPC; } @Override @@ -155,4 +159,9 @@ public Long getServiceOfferingId() { public boolean supportsDistributedRouter() { return supportsDistributedRouter; } + + @Override + public boolean offersRegionLevelVPC() { + return offersRegionLevelVPC; + } } diff --git a/engine/schema/src/com/cloud/network/vpc/VpcVO.java b/engine/schema/src/com/cloud/network/vpc/VpcVO.java index dea8c314bc..8d0f6a2a0f 100644 --- a/engine/schema/src/com/cloud/network/vpc/VpcVO.java +++ b/engine/schema/src/com/cloud/network/vpc/VpcVO.java @@ -84,12 +84,15 @@ public class VpcVO implements Vpc { @Column(name="uses_distributed_router") boolean usesDistributedRouter = false; + @Column(name = "region_level_vpc") + boolean regionLevelVpc = false; + public VpcVO() { uuid = UUID.randomUUID().toString(); } public VpcVO(long zoneId, String name, String displayText, long accountId, long domainId, long vpcOffId, String cidr, - String networkDomain, boolean useDistributedRouter) { + String networkDomain, boolean useDistributedRouter, boolean regionLevelVpc) { this.zoneId = zoneId; this.name = name; this.displayText = displayText; @@ -101,6 +104,7 @@ public VpcVO(long zoneId, String name, String displayText, long accountId, long this.networkDomain = networkDomain; this.vpcOfferingId = vpcOffId; this.usesDistributedRouter = useDistributedRouter; + this.regionLevelVpc = regionLevelVpc; } @Override @@ -193,6 +197,11 @@ public void setUuid(String uuid) { this.uuid = uuid; } + @Override + public boolean isRegionLevelVpc() { + return regionLevelVpc; + } + public void setDisplay(boolean display) { this.display = display; diff --git a/engine/schema/src/com/cloud/offerings/NetworkOfferingVO.java b/engine/schema/src/com/cloud/offerings/NetworkOfferingVO.java index bf07807494..c3d849d134 100755 --- a/engine/schema/src/com/cloud/offerings/NetworkOfferingVO.java +++ b/engine/schema/src/com/cloud/offerings/NetworkOfferingVO.java @@ -139,6 +139,9 @@ public class NetworkOfferingVO implements NetworkOffering { @Column(name = "keep_alive_enabled") boolean keepAliveEnabled = false; + @Column(name="supports_streched_l2") + boolean supportsStrechedL2 = false; + @Override public String getDisplayText() { return displayText; @@ -331,7 +334,7 @@ public NetworkOfferingVO(String name, String displayText, TrafficType trafficTyp public NetworkOfferingVO(String name, String displayText, TrafficType trafficType, boolean systemOnly, boolean specifyVlan, Integer rateMbps, Integer multicastRateMbps, boolean isDefault, Availability availability, String tags, Network.GuestType guestType, boolean conserveMode, boolean dedicatedLb, boolean sharedSourceNat, boolean redundantRouter, boolean elasticIp, boolean elasticLb, boolean specifyIpRanges, boolean inline, boolean isPersistent, - boolean associatePublicIP, boolean publicLb, boolean internalLb, boolean egressdefaultpolicy) { + boolean associatePublicIP, boolean publicLb, boolean internalLb, boolean egressdefaultpolicy, boolean supportsStrechedL2) { this(name, displayText, trafficType, @@ -356,6 +359,7 @@ public NetworkOfferingVO(String name, String displayText, TrafficType trafficTyp this.inline = inline; this.eipAssociatePublicIp = associatePublicIP; this.egressdefaultpolicy = egressdefaultpolicy; + this.supportsStrechedL2 = supportsStrechedL2; } public NetworkOfferingVO() { @@ -486,4 +490,9 @@ public void setConcurrentConnections(Integer concurrentConnections) { public void setPublicLb(boolean publicLb) { this.publicLb = publicLb; } + + @Override + public boolean getSupportsStrechedL2() { + return supportsStrechedL2; + } } diff --git a/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java index 036c3194d5..d7678340a3 100644 --- a/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java +++ b/plugins/network-elements/ovs/src/com/cloud/network/element/OvsElement.java @@ -261,6 +261,8 @@ private static Map> setCapabilities() { // L2 Support : SDN provisioning Map connectivityCapabilities = new HashMap(); connectivityCapabilities.put(Capability.DistributedRouter, null); + connectivityCapabilities.put(Capability.StretchedL2Subnet, null); + connectivityCapabilities.put(Capability.RegionLevelVpc, null); capabilities.put(Service.Connectivity, connectivityCapabilities); diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index a37bf7b2d4..bc496a3497 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -1901,6 +1901,7 @@ public NetworkOfferingResponse createNetworkOfferingResponse(NetworkOffering off response.setNetworkRate(ApiDBUtils.getNetworkRate(offering.getId())); response.setEgressDefaultPolicy(offering.getEgressDefaultPolicy()); response.setConcurrentConnections(offering.getConcurrentConnections()); + response.setSupportsStrechedL2Subnet(offering.getSupportsStrechedL2()); Long so = null; if (offering.getServiceOfferingId() != null) { so = offering.getServiceOfferingId(); @@ -2766,6 +2767,7 @@ public VpcOfferingResponse createVpcOfferingResponse(VpcOffering offering) { response.setIsDefault(offering.isDefault()); response.setState(offering.getState().name()); response.setSupportsDistributedRouter(offering.supportsDistributedRouter()); + response.setSupportsRegionLevelVpc(offering.offersRegionLevelVPC()); Map> serviceProviderMap = ApiDBUtils.listVpcOffServices(offering.getId()); List serviceResponses = new ArrayList(); @@ -2809,6 +2811,7 @@ public VpcResponse createVpcResponse(ResponseView view, Vpc vpc) { response.setNetworkDomain(vpc.getNetworkDomain()); response.setForDisplay(vpc.isDisplay()); response.setUsesDistributedRouter(vpc.usesDistributedRouter()); + response.setRegionLevelVpc(vpc.isRegionLevelVpc()); Map> serviceProviderMap = ApiDBUtils.listVpcOffServices(vpc.getVpcOfferingId()); List serviceResponses = new ArrayList(); diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 9b9bd13d26..bdceed79f4 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -16,6 +16,7 @@ // under the License. package com.cloud.configuration; +import com.cloud.network.element.NetworkElement; import java.net.URI; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -3814,10 +3815,21 @@ public NetworkOffering createNetworkOffering(CreateNetworkOfferingCmd cmd) { } validateStaticNatServiceCapablities(staticNatServiceCapabilityMap); + // validate the 'Connectivity' service capabilities specified in the network offering, if 'Connectivity' service + // is in the supported services of network offering + Map connectivityServiceCapabilityMap = cmd.getServiceCapabilities(Service.Connectivity); + if (!serviceProviderMap.containsKey(Service.Connectivity) && + (connectivityServiceCapabilityMap != null && !connectivityServiceCapabilityMap.isEmpty())) { + throw new InvalidParameterValueException("Capabilities for 'Connectivity' service can be specified " + + "only when Connectivity service is enabled for network offering."); + } + validateConnectivityServiceCapablities(serviceProviderMap.get(Service.Connectivity), connectivityServiceCapabilityMap); + Map> serviceCapabilityMap = new HashMap>(); serviceCapabilityMap.put(Service.Lb, lbServiceCapabilityMap); serviceCapabilityMap.put(Service.SourceNat, sourceNatServiceCapabilityMap); serviceCapabilityMap.put(Service.StaticNat, staticNatServiceCapabilityMap); + serviceCapabilityMap.put(Service.Connectivity, connectivityServiceCapabilityMap); // if Firewall service is missing, add Firewall service/provider // combination @@ -3952,6 +3964,36 @@ void validateStaticNatServiceCapablities(Map staticNatServic } } + void validateConnectivityServiceCapablities(Set providers, Map connectivityServiceCapabilityMap) { + if (connectivityServiceCapabilityMap != null && !connectivityServiceCapabilityMap.isEmpty()) { + for (Capability capability: connectivityServiceCapabilityMap.keySet()) { + if (capability == Capability.StretchedL2Subnet) { + String value = connectivityServiceCapabilityMap.get(capability).toLowerCase(); + if (!(value.contains("true") ^ value.contains("false"))) { + throw new InvalidParameterValueException("Invalid value (" + value + ") for " + capability + + " should be true/false"); + } + } else { + throw new InvalidParameterValueException("Capability " + capability.getName() + " can not be " + + " specified with connectivity service."); + } + } + } + + if (providers != null && !providers.isEmpty()) { + for (Provider provider: providers) { + NetworkElement element = _networkModel.getElementImplementingProvider(provider.getName()); + Map> capabilities = element.getCapabilities(); + if (capabilities != null && !capabilities.isEmpty()) { + Map connectivityCapabilities = capabilities.get(Service.Connectivity); + if (connectivityCapabilities == null || (connectivityCapabilities != null && !connectivityCapabilities.keySet().contains(Capability.StretchedL2Subnet))) { + throw new InvalidParameterValueException("Provider: " + provider.getName() + " does not support " + + Capability.StretchedL2Subnet.getName()); + } + } + } + } + } @Override @DB public NetworkOfferingVO createNetworkOffering(String name, String displayText, TrafficType trafficType, String tags, boolean specifyVlan, Availability availability, @@ -4012,6 +4054,8 @@ public NetworkOfferingVO createNetworkOffering(String name, String displayText, boolean inline = false; boolean publicLb = false; boolean internalLb = false; + boolean strechedL2Subnet = false; + if (serviceCapabilityMap != null && !serviceCapabilityMap.isEmpty()) { Map lbServiceCapabilityMap = serviceCapabilityMap.get(Service.Lb); @@ -4079,6 +4123,14 @@ public NetworkOfferingVO createNetworkOffering(String name, String displayText, } } } + + Map connectivityServiceCapabilityMap = serviceCapabilityMap.get(Service.Connectivity); + if (connectivityServiceCapabilityMap != null && !connectivityServiceCapabilityMap.isEmpty()) { + String value = connectivityServiceCapabilityMap.get(Capability.StretchedL2Subnet); + if ("true".equalsIgnoreCase(value)) { + strechedL2Subnet = true; + } + } } if (serviceProviderMap != null && serviceProviderMap.containsKey(Service.Lb) && !internalLb && !publicLb) { @@ -4088,7 +4140,7 @@ public NetworkOfferingVO createNetworkOffering(String name, String displayText, final NetworkOfferingVO offeringFinal = new NetworkOfferingVO(name, displayText, trafficType, systemOnly, specifyVlan, networkRate, multicastRate, isDefault, availability, tags, type, conserveMode, dedicatedLb, sharedSourceNat, redundantRouter, elasticIp, elasticLb, specifyIpRanges, inline, isPersistent, associatePublicIp, publicLb, - internalLb, egressDefaultPolicy); + internalLb, egressDefaultPolicy, strechedL2Subnet); if (serviceOfferingId != null) { offeringFinal.setServiceOfferingId(serviceOfferingId); diff --git a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java index 13246a74a5..ddf1f9c3d8 100644 --- a/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java +++ b/server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java @@ -127,6 +127,10 @@ public Network implement(Network config, NetworkOffering offering, DeployDestina throws InsufficientVirtualNetworkCapcityException { assert (config.getState() == State.Implementing) : "Why are we implementing " + config; + if (_networkModel.areServicesSupportedInNetwork(config.getId(), Network.Service.Connectivity)) { + return null; + } + if (!_networkModel.networkIsConfiguredForExternalNetworking(config.getDataCenterId(), config.getId())) { return super.implement(config, offering, dest, context); } diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java index 2e63639c33..ad212b0907 100644 --- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java +++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java @@ -16,6 +16,8 @@ // under the License. package com.cloud.network.vpc; + +import com.cloud.network.element.NetworkElement; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -65,7 +67,6 @@ import com.cloud.exception.ResourceAllocationException; import com.cloud.exception.ResourceUnavailableException; import com.cloud.hypervisor.Hypervisor.HypervisorType; -import com.cloud.network.element.NetworkElement; import com.cloud.network.IpAddress; import com.cloud.network.IpAddressManager; import com.cloud.network.Network; @@ -220,44 +221,49 @@ public boolean configure(String name, Map params) throws Configu Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) { - if (_vpcOffDao.findByUniqueName(VpcOffering.defaultVPCOfferingName) == null) { - s_logger.debug("Creating default VPC offering " + VpcOffering.defaultVPCOfferingName); - - Map> svcProviderMap = new HashMap>(); - Set defaultProviders = new HashSet(); - defaultProviders.add(Provider.VPCVirtualRouter); - for (Service svc : getSupportedServices()) { - if (svc == Service.Lb) { - Set lbProviders = new HashSet(); - lbProviders.add(Provider.VPCVirtualRouter); - lbProviders.add(Provider.InternalLbVm); - svcProviderMap.put(svc, lbProviders); - } else { - svcProviderMap.put(svc, defaultProviders); + + if (_vpcOffDao.findByUniqueName(VpcOffering.defaultVPCOfferingName) == null) { + s_logger.debug("Creating default VPC offering " + VpcOffering.defaultVPCOfferingName); + + Map> svcProviderMap = new HashMap>(); + Set defaultProviders = new HashSet(); + defaultProviders.add(Provider.VPCVirtualRouter); + for (Service svc : getSupportedServices()) { + if (svc == Service.Lb) { + Set lbProviders = new HashSet(); + lbProviders.add(Provider.VPCVirtualRouter); + lbProviders.add(Provider.InternalLbVm); + svcProviderMap.put(svc, lbProviders); + } else { + svcProviderMap.put(svc, defaultProviders); + } + } + createVpcOffering(VpcOffering.defaultVPCOfferingName, VpcOffering.defaultVPCOfferingName, + svcProviderMap, true, State.Enabled, null, false, false); } - } - createVpcOffering(VpcOffering.defaultVPCOfferingName, VpcOffering.defaultVPCOfferingName, svcProviderMap, true, State.Enabled, null, false); - } - //configure default vpc offering with Netscaler as LB Provider + //configure default vpc offering with Netscaler as LB Provider if (_vpcOffDao.findByUniqueName(VpcOffering.defaultVPCNSOfferingName) == null) { - s_logger.debug("Creating default VPC offering with Netscaler as LB Provider" + VpcOffering.defaultVPCNSOfferingName); - Map> svcProviderMap = new HashMap>(); - Set defaultProviders = new HashSet(); - defaultProviders.add(Provider.VPCVirtualRouter); - for (Service svc : getSupportedServices()) { - if (svc == Service.Lb) { - Set lbProviders = new HashSet(); - lbProviders.add(Provider.Netscaler); - lbProviders.add(Provider.InternalLbVm); - svcProviderMap.put(svc, lbProviders); - } else { - svcProviderMap.put(svc, defaultProviders); + s_logger.debug("Creating default VPC offering with Netscaler as LB Provider" + VpcOffering.defaultVPCNSOfferingName); + Map> svcProviderMap = new HashMap>(); + Set defaultProviders = new HashSet(); + defaultProviders.add(Provider.VPCVirtualRouter); + for (Service svc : getSupportedServices()) { + if (svc == Service.Lb) { + Set lbProviders = new HashSet(); + lbProviders.add(Provider.Netscaler); + lbProviders.add(Provider.InternalLbVm); + svcProviderMap.put(svc, lbProviders); + } else { + svcProviderMap.put(svc, defaultProviders); + } + } + createVpcOffering(VpcOffering.defaultVPCNSOfferingName, VpcOffering.defaultVPCNSOfferingName, + svcProviderMap, false, State.Enabled, null, false, false); + } } - createVpcOffering(VpcOffering.defaultVPCNSOfferingName, VpcOffering.defaultVPCNSOfferingName, svcProviderMap, false, State.Enabled, null, false); - } - } + }); Map configs = _configDao.getConfiguration(params); @@ -381,9 +387,9 @@ public VpcOffering createVpcOffering(String name, String displayText, List> svcProviderMap, final boolean isDefault, final State state, final Long serviceOfferingId, - final boolean supportsDistributedRouter) { + final boolean supportsDistributedRouter, final boolean offersRegionLevelVPC) { + return Transaction.execute(new TransactionCallback() { @Override public VpcOffering doInTransaction(TransactionStatus status) { // create vpc offering object - VpcOfferingVO offering = new VpcOfferingVO(name, displayText, isDefault, serviceOfferingId, supportsDistributedRouter); + VpcOfferingVO offering = new VpcOfferingVO(name, displayText, isDefault, serviceOfferingId, + supportsDistributedRouter, offersRegionLevelVPC); - if (state != null) { - offering.setState(state); - } - s_logger.debug("Adding vpc offering " + offering); - offering = _vpcOffDao.persist(offering); - // populate services and providers - if (svcProviderMap != null) { - for (Network.Service service : svcProviderMap.keySet()) { - Set providers = svcProviderMap.get(service); - if (providers != null && !providers.isEmpty()) { - for (Network.Provider provider : providers) { - VpcOfferingServiceMapVO offService = new VpcOfferingServiceMapVO(offering.getId(), service, provider); - _vpcOffSvcMapDao.persist(offService); - s_logger.trace("Added service for the vpc offering: " + offService + " with provider " + provider.getName()); + if (state != null) { + offering.setState(state); + } + s_logger.debug("Adding vpc offering " + offering); + offering = _vpcOffDao.persist(offering); + // populate services and providers + if (svcProviderMap != null) { + for (Network.Service service : svcProviderMap.keySet()) { + Set providers = svcProviderMap.get(service); + if (providers != null && !providers.isEmpty()) { + for (Network.Provider provider : providers) { + VpcOfferingServiceMapVO offService = new VpcOfferingServiceMapVO(offering.getId(), service, provider); + _vpcOffSvcMapDao.persist(offService); + s_logger.trace("Added service for the vpc offering: " + offService + " with provider " + provider.getName()); + } + } else { + throw new InvalidParameterValueException("Provider is missing for the VPC offering service " + service.getName()); + } } - } else { - throw new InvalidParameterValueException("Provider is missing for the VPC offering service " + service.getName()); } - } - } - return offering; - } + return offering; + } }); } - private boolean isVpcOfferingSupportsDistributedRouter(Map serviceCapabilitystList) { - boolean supportsDistributedRouter = false; + private void validateConnectivtyServiceCapablitlies(Set providers, Map serviceCapabilitystList) { + if (serviceCapabilitystList != null && !serviceCapabilitystList.isEmpty()) { Collection serviceCapabilityCollection = serviceCapabilitystList.values(); Iterator iter = serviceCapabilityCollection.iterator(); Map capabilityMap = null; + boolean distributedRouterCapabilitySpecified = false; + boolean regionLevelVpcCapabilitySpecified = false; while (iter.hasNext()) { HashMap svcCapabilityMap = (HashMap)iter.next(); @@ -448,24 +458,56 @@ private boolean isVpcOfferingSupportsDistributedRouter(Map serviceCapabilitystLi } if (!svc.equalsIgnoreCase(Service.Connectivity.getName())) { - throw new InvalidParameterValueException("Invalid Service:" + svc + " specified. Only for 'Connectivity' service capabilities can be specified"); + throw new InvalidParameterValueException("Invalid Service:" + svc + " specified. Only 'Connectivity'" + + " service capabilities can be specified"); } - if (!capabilityName.equalsIgnoreCase("DistributedRouter")) { - throw new InvalidParameterValueException("Invalid Capability:" + capabilityName + " specified. Only 'DistributedRouter' capability can be specified."); + if (!capabilityName.equalsIgnoreCase("DistributedRouter") && !capabilityName.equalsIgnoreCase("RegionLevelVpc")) { + throw new InvalidParameterValueException("Invalid Capability:" + capabilityName + " specified." + + " Only 'DistributedRouter'/'RegionLevelVpc' capability can be specified."); + } + + if (capabilityName.equalsIgnoreCase("DistributedRouter")) { + distributedRouterCapabilitySpecified = true; + } + + if (capabilityName.equalsIgnoreCase("RegionLevelVpc")) { + regionLevelVpcCapabilitySpecified = true; } if (!capabilityValue.equalsIgnoreCase("true") && capabilityValue.equalsIgnoreCase("false")) { throw new InvalidParameterValueException("Invalid Capability value:" + capabilityValue + " specified."); } - supportsDistributedRouter = capabilityValue.equalsIgnoreCase("true"); + } + + if (providers != null && !providers.isEmpty()) { + for (Provider provider: providers) { + NetworkElement element = _ntwkModel.getElementImplementingProvider(provider.getName()); + Map> capabilities = element.getCapabilities(); + if (capabilities != null && !capabilities.isEmpty()) { + Map connectivityCapabilities = capabilities.get(Service.Connectivity); + if (regionLevelVpcCapabilitySpecified) { + if (connectivityCapabilities == null || (connectivityCapabilities != null && + !connectivityCapabilities.keySet().contains(Network.Capability.RegionLevelVpc))) { + throw new InvalidParameterValueException("Provider: " + provider.getName() + " does not support " + + Network.Capability.RegionLevelVpc.getName() + " capability."); + } + } + if (distributedRouterCapabilitySpecified) { + if (connectivityCapabilities == null || (connectivityCapabilities != null && + !connectivityCapabilities.keySet().contains(Network.Capability.DistributedRouter))) { + throw new InvalidParameterValueException("Provider: " + provider.getName() + " does not support " + + Network.Capability.DistributedRouter.getName() + " capability."); + } + } + } + } } } - return supportsDistributedRouter; } - private void validateConnectivtyServiceCapablitlies(Set providers, Map serviceCapabilitystList) { - + private boolean isVpcOfferingForRegionLevelVpc(Map serviceCapabilitystList) { + boolean offersRegionLevelVPC = false; if (serviceCapabilitystList != null && !serviceCapabilitystList.isEmpty()) { Collection serviceCapabilityCollection = serviceCapabilitystList.values(); Iterator iter = serviceCapabilityCollection.iterator(); @@ -489,29 +531,55 @@ private void validateConnectivtyServiceCapablitlies(Set providers, Map throw new InvalidParameterValueException("Invalid Service:" + svc + " specified. Only for 'Connectivity' service capabilities can be specified"); } - if (!capabilityName.equalsIgnoreCase("DistributedRouter")) { - throw new InvalidParameterValueException("Invalid Capability:" + capabilityName + " specified. Only 'DistributedRouter' capability can be specified."); + if (!capabilityName.equalsIgnoreCase("RegionLevelVpc")) { + continue; } if (!capabilityValue.equalsIgnoreCase("true") && capabilityValue.equalsIgnoreCase("false")) { throw new InvalidParameterValueException("Invalid Capability value:" + capabilityValue + " specified."); } + offersRegionLevelVPC = capabilityValue.equalsIgnoreCase("true"); } + } + return offersRegionLevelVPC; + } - if (providers != null && !providers.isEmpty()) { - for (Provider provider: providers) { - NetworkElement element = _ntwkModel.getElementImplementingProvider(provider.getName()); - Map> capabilities = element.getCapabilities(); - if (capabilities != null && !capabilities.isEmpty()) { - Map connectivityCapabilities = capabilities.get(Service.Connectivity); - if (connectivityCapabilities == null || (connectivityCapabilities != null && !connectivityCapabilities.keySet().contains(Network.Capability.DistributedRouter))) { - throw new InvalidParameterValueException("Provider: " + provider.getName() + " does not support " - + Network.Capability.DistributedRouter.getName() + " capability."); - } - } + private boolean isVpcOfferingSupportsDistributedRouter(Map serviceCapabilitystList) { + boolean supportsDistributedRouter = false; + if (serviceCapabilitystList != null && !serviceCapabilitystList.isEmpty()) { + Collection serviceCapabilityCollection = serviceCapabilitystList.values(); + Iterator iter = serviceCapabilityCollection.iterator(); + Map capabilityMap = null; + + while (iter.hasNext()) { + HashMap svcCapabilityMap = (HashMap)iter.next(); + Network.Capability capability = null; + String svc = svcCapabilityMap.get("service"); + String capabilityName = svcCapabilityMap.get("capabilitytype"); + String capabilityValue = svcCapabilityMap.get("capabilityvalue"); + if (capabilityName != null) { + capability = Network.Capability.getCapability(capabilityName); + } + + if ((capability == null) || (capabilityName == null) || (capabilityValue == null)) { + throw new InvalidParameterValueException("Invalid capability:" + capabilityName + " capability value:" + capabilityValue); } + + if (!svc.equalsIgnoreCase(Service.Connectivity.getName())) { + throw new InvalidParameterValueException("Invalid Service:" + svc + " specified. Only for 'Connectivity' service capabilities can be specified"); + } + + if (!capabilityName.equalsIgnoreCase("DistributedRouter")) { + continue; + } + + if (!capabilityValue.equalsIgnoreCase("true") && capabilityValue.equalsIgnoreCase("false")) { + throw new InvalidParameterValueException("Invalid Capability value:" + capabilityValue + " specified."); + } + supportsDistributedRouter = capabilityValue.equalsIgnoreCase("true"); } } + return supportsDistributedRouter; } @Override @@ -708,6 +776,11 @@ public Vpc createVpc(long zoneId, long vpcOffId, long vpcOwnerId, String vpcName throw ex; } + boolean isRegionLevelVpcOff = vpcOff.offersRegionLevelVPC(); + if (isRegionLevelVpcOff && networkDomain == null) { + throw new InvalidParameterValueException("Network domain must be specified for region level VPC"); + } + //Validate zone DataCenter zone = _entityMgr.findById(DataCenter.class, zoneId); if (zone == null) { @@ -730,13 +803,15 @@ public Vpc createVpc(long zoneId, long vpcOffId, long vpcOwnerId, String vpcName networkDomain = "cs" + Long.toHexString(owner.getId()) + NetworkOrchestrationService.GuestDomainSuffix.valueIn(zoneId); } } + boolean useDistributedRouter = vpcOff.supportsDistributedRouter(); - return createVpc(zoneId, vpcOffId, owner, vpcName, displayText, cidr, networkDomain, displayVpc, useDistributedRouter); + return createVpc(zoneId, vpcOffId, owner, vpcName, displayText, cidr, networkDomain, displayVpc, + useDistributedRouter, isRegionLevelVpcOff); } @DB protected Vpc createVpc(final long zoneId, final long vpcOffId, final Account vpcOwner, final String vpcName, final String displayText, final String cidr, - final String networkDomain, final Boolean displayVpc, final boolean useDistributedRouter) { + final String networkDomain, final Boolean displayVpc, final boolean useDistributedRouter, final boolean regionLevelVpc) { //Validate CIDR if (!NetUtils.isValidCIDR(cidr)) { @@ -759,7 +834,8 @@ protected Vpc createVpc(final long zoneId, final long vpcOffId, final Account vp @Override public VpcVO doInTransaction(TransactionStatus status) { VpcVO vpc = new VpcVO(zoneId, vpcName, displayText, vpcOwner.getId(), vpcOwner.getDomainId(), vpcOffId, - cidr, networkDomain, useDistributedRouter); + cidr, networkDomain, useDistributedRouter, regionLevelVpc); + if (displayVpc != null) { vpc.setDisplay(displayVpc); } @@ -2210,7 +2286,7 @@ public Network createVpcGuestNetwork(long ntwkOffId, String name, String display networkDomain = vpc.getNetworkDomain(); } - if (vpc.getZoneId() != zoneId) { + if (!vpc.isRegionLevelVpc() && vpc.getZoneId() != zoneId) { throw new InvalidParameterValueException("New network doesn't belong to vpc zone"); } diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java index b8da4c8831..478101027c 100755 --- a/server/src/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java @@ -1153,9 +1153,9 @@ public void doInTransactionWithoutResult(TransactionStatus status) { // Offering #5 NetworkOfferingVO defaultNetscalerNetworkOffering = - new NetworkOfferingVO(NetworkOffering.DefaultSharedEIPandELBNetworkOffering, - "Offering for Shared networks with Elastic IP and Elastic LB capabilities", TrafficType.Guest, false, true, null, null, true, - Availability.Optional, null, Network.GuestType.Shared, true, false, false, false, true, true, true, false, false, true, true, false, false); + new NetworkOfferingVO(NetworkOffering.DefaultSharedEIPandELBNetworkOffering, + "Offering for Shared networks with Elastic IP and Elastic LB capabilities", TrafficType.Guest, false, true, null, null, true, + Availability.Optional, null, Network.GuestType.Shared, true, false, false, false, true, true, true, false, false, true, true, false, false, false); defaultNetscalerNetworkOffering.setState(NetworkOffering.State.Enabled); defaultNetscalerNetworkOffering = _networkOfferingDao.persistDefaultNetworkOffering(defaultNetscalerNetworkOffering); diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 393613a140..6a7345cf61 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -2642,7 +2642,7 @@ protected UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOf boolean securityGroupEnabled = false; boolean vpcNetwork = false; for (NetworkVO network : networkList) { - if (network.getDataCenterId() != zone.getId()) { + if ((network.getDataCenterId() != zone.getId()) && !network.isStrechedL2Network()) { throw new InvalidParameterValueException("Network id=" + network.getId() + " doesn't belong to zone " + zone.getId()); } diff --git a/server/test/com/cloud/network/CreatePrivateNetworkTest.java b/server/test/com/cloud/network/CreatePrivateNetworkTest.java index dc979d05c9..b124b20dad 100644 --- a/server/test/com/cloud/network/CreatePrivateNetworkTest.java +++ b/server/test/com/cloud/network/CreatePrivateNetworkTest.java @@ -103,7 +103,7 @@ public void setup() throws Exception { NetworkOfferingVO ntwkOff = new NetworkOfferingVO("offer", "fakeOffer", TrafficType.Guest, true, true, null, null, false, null, null, GuestType.Isolated, false, false, false, false, - false, false, false, false, false, false, false, false, false); + false, false, false, false, false, false, false, false, false, false); when(networkService._networkOfferingDao.findById(anyLong())).thenReturn(ntwkOff); List netofferlist = new ArrayList(); netofferlist.add(ntwkOff); diff --git a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java index ac303dddfc..387a710d9d 100644 --- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java +++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java @@ -606,7 +606,7 @@ public boolean destroyNetwork(long networkId, ReservationContext context, boolea @Override public Network createGuestNetwork(long networkOfferingId, String name, String displayText, String gateway, String cidr, String vlanId, String networkDomain, Account owner, Long domainId, PhysicalNetwork physicalNetwork, long zoneId, ACLType aclType, Boolean subdomainAccess, Long vpcId, String gatewayv6, - String cidrv6, Boolean displayNetworkEnabled, String isolatedPvlan) throws ConcurrentOperationException, InsufficientCapacityException, + String cidrv6, Boolean displayNetworkEnabled, String isolatedPvlan ) throws ConcurrentOperationException, InsufficientCapacityException, ResourceAllocationException { // TODO Auto-generated method stub return null; diff --git a/server/test/com/cloud/vpc/VpcApiUnitTest.java b/server/test/com/cloud/vpc/VpcApiUnitTest.java index 5e283743b7..dee9afe3b5 100644 --- a/server/test/com/cloud/vpc/VpcApiUnitTest.java +++ b/server/test/com/cloud/vpc/VpcApiUnitTest.java @@ -85,7 +85,7 @@ public void getActiveVpc() { public void validateNtwkOffForVpc() { //validate network offering //1) correct network offering - VpcVO vo = new VpcVO(1, "new vpc", "new vpc", 1, 1, 1, "0.0.0.0/0", "vpc domain", false); + VpcVO vo = new VpcVO(1, "new vpc", "new vpc", 1, 1, 1, "0.0.0.0/0", "vpc domain", false, false); boolean result = false; try { _vpcService.validateNtwkOffForNtwkInVpc(2L, 1, "0.0.0.0", "111-", vo, "10.1.1.1", new AccountVO(), null); diff --git a/server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java b/server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java index e1a6ac2ae4..7492598e90 100644 --- a/server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java +++ b/server/test/com/cloud/vpc/dao/MockVpcDaoImpl.java @@ -98,9 +98,9 @@ public void persistVpcServiceProviders(long vpcId, Map> ser public VpcVO findById(Long id) { VpcVO vo = null; if (id.longValue() == 1) { - vo = new VpcVO(1, "new vpc", "new vpc", 1, 1, 1, "0.0.0.0/0", "vpc domain", false); + vo = new VpcVO(1, "new vpc", "new vpc", 1, 1, 1, "0.0.0.0/0", "vpc domain", false, false); } else if (id.longValue() == 2) { - vo = new VpcVO(1, "new vpc", "new vpc", 1, 1, 1, "0.0.0.0/0", "vpc domain", false); + vo = new VpcVO(1, "new vpc", "new vpc", 1, 1, 1, "0.0.0.0/0", "vpc domain", false, false); vo.setState(State.Inactive); } diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index 1d511c40dc..b71ce852e4 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -742,6 +742,8 @@ UPDATE `cloud`.`guest_os` SET `created` = now(); ALTER TABLE `cloud`.`vm_reservation` ADD COLUMN `deployment_planner` varchar(40) DEFAULT NULL COMMENT 'Preferred deployment planner for the vm'; ALTER TABLE `cloud`.`vpc_offerings` ADD COLUMN supports_distributed_router boolean default false; ALTER TABLE `cloud`.`vpc` ADD COLUMN uses_distributed_router boolean default false; - INSERT INTO `cloud`.`storage_pool_details` (pool_id,name,value,display) SELECT storage_pool.id,data_center_details.name,data_center_details.value,data_center_details.display FROM `cloud`.`storage_pool` JOIN `cloud`.`data_center_details` ON data_center_details.dc_id=storage_pool.data_center_id WHERE data_center_details.name = "storage.overprovisioning.factor"; DELETE FROM `cloud`.`data_center_details` WHERE name="storage.overprovisioning.factor"; +ALTER TABLE `cloud`.`vpc_offerings` ADD COLUMN supports_region_level_vpc boolean default false; +ALTER TABLE `cloud`.`network_offerings` ADD COLUMN supports_streched_l2 boolean default false; +ALTER TABLE `cloud`.`vpc` ADD COLUMN region_level_vpc boolean default false; diff --git a/test/integration/component/test_region_vpc.py b/test/integration/component/test_region_vpc.py new file mode 100644 index 0000000000..2cd9de9073 --- /dev/null +++ b/test/integration/component/test_region_vpc.py @@ -0,0 +1,517 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +import unittest + +""" Component tests for region level VPC functionality +""" +#Import Local Modules +import marvin +from nose.plugins.attrib import attr +from marvin.cloudstackTestCase import * +from marvin.cloudstackAPI import * +from marvin.integration.lib.utils import * +from marvin.integration.lib.base import * +from marvin.integration.lib.common import * +from marvin.sshClient import SshClient +import datetime + + +class Services: + """Test inter VLAN services + """ + + def __init__(self): + self.services = { + "account": { + "email": "test@test.com", + "firstname": "Test", + "lastname": "User", + "username": "test", + # Random characters are appended for unique + # username + "password": "password", + }, + "service_offering": { + "name": "Tiny Instance", + "displaytext": "Tiny Instance", + "cpunumber": 1, + "cpuspeed": 100, + "memory": 128, + }, + "network_offering": { + "name": 'VPC Network offering', + "displaytext": 'VPC Network off', + "guestiptype": 'Isolated', + "supportedservices": 'Vpn,Dhcp,Dns,SourceNat,PortForwarding,Lb,UserData,StaticNat,NetworkACL, Connectivity', + "traffictype": 'GUEST', + "availability": 'Optional', + "useVpc": 'on', + "serviceProviderList": { + "Vpn": 'VpcVirtualRouter', + "Dhcp": 'VpcVirtualRouter', + "Dns": 'VpcVirtualRouter', + "SourceNat": 'VpcVirtualRouter', + "PortForwarding": 'VpcVirtualRouter', + "Lb": 'VpcVirtualRouter', + "UserData": 'VpcVirtualRouter', + "StaticNat": 'VpcVirtualRouter', + "NetworkACL": 'VpcVirtualRouter', + "Connectivity": 'Ovs' + }, + "serviceCapabilityList": { + "Connectivity": { + "StretchedL2Subnet": "true" + }, + }, + }, + "vpc_offering": { + "name": 'VPC off', + "displaytext": 'VPC off', + "supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Lb,UserData,StaticNat,Connectivity', + "serviceProviderList": { + "Vpn": 'VpcVirtualRouter', + "Dhcp": 'VpcVirtualRouter', + "Dns": 'VpcVirtualRouter', + "SourceNat": 'VpcVirtualRouter', + "PortForwarding": 'VpcVirtualRouter', + "Lb": 'VpcVirtualRouter', + "UserData": 'VpcVirtualRouter', + "StaticNat": 'VpcVirtualRouter', + "Connectivity": 'Ovs' + }, + "serviceCapabilityList": { + "Connectivity": { + "RegionLevelVpc": "true" + }, + }, + }, + "vpc": { + "name": "TestVPC", + "displaytext": "TestVPC", + "cidr": '10.0.0.1/24' + }, + "network": { + "name": "Test Network", + "displaytext": "Test Network", + "netmask": '255.255.255.0' + }, + "lbrule": { + "name": "SSH", + "alg": "leastconn", + # Algorithm used for load balancing + "privateport": 22, + "publicport": 2222, + "openfirewall": False, + "startport": 2222, + "endport": 2222, + "cidrlist": '0.0.0.0/0', + "protocol": 'TCP' + }, + "natrule": { + "privateport": 22, + "publicport": 22, + "startport": 22, + "endport": 22, + "protocol": "TCP", + "cidrlist": '0.0.0.0/0', + }, + "fw_rule": { + "startport": 1, + "endport": 6000, + "cidr": '0.0.0.0/0', + # Any network (For creating FW rule) + "protocol": "TCP" + }, + "virtual_machine": { + "displayname": "Test VM", + "username": "root", + "password": "password", + "ssh_port": 22, + "hypervisor": 'XenServer', + # Hypervisor type should be same as + # hypervisor type of cluster + "privateport": 22, + "publicport": 22, + "protocol": 'TCP', + }, + "ostype": 'CentOS 5.3 (64-bit)', + # Cent OS 5.3 (64 bit) + "sleep": 60, + "timeout": 10, + } + + +class TestRegionVpcOffering(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + cls.api_client = super( + TestRegionVpcOffering, + cls + ).getClsTestClient().getApiClient() + cls.services = Services().services + # Get Zone, Domain and templates + cls.domain = get_domain(cls.api_client, cls.services) + cls.zone = get_zone(cls.api_client, cls.services) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + + cls.service_offering = ServiceOffering.create( + cls.api_client, + cls.services["service_offering"] + ) + cls._cleanup = [ + cls.service_offering, + ] + return + + @classmethod + def tearDownClass(cls): + try: + #Cleanup resources used + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + def setUp(self): + self.apiclient = self.testClient.getApiClient() + self.dbclient = self.testClient.getDbConnection() + self.account = Account.create( + self.apiclient, + self.services["account"], + admin=True, + domainid=self.domain.id + ) + self.cleanup = [] + self.cleanup.insert(0, self.account) + return + + def tearDown(self): + try: + cleanup_resources(self.apiclient, self.cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + def validate_vpc_offering(self, vpc_offering): + """Validates the VPC offering""" + + self.debug("Check if the VPC offering is created successfully?") + vpc_offs = VpcOffering.list( + self.apiclient, + id=vpc_offering.id + ) + self.assertEqual( + isinstance(vpc_offs, list), + True, + "List VPC offerings should return a valid list" + ) + self.assertEqual( + vpc_offering.name, + vpc_offs[0].name, + "Name of the VPC offering should match with listVPCOff data" + ) + self.assertEqual( + vpc_offering.name, + vpc_offs[0].name, + "Name of the VPC offering should match with listVPCOff data" + ) + self.assertEqual( + vpc_offs[0].regionlevelvpc,True, + "VPC offering is not set up for region level VPC" + ) + self.debug( + "VPC offering is created successfully - %s" % + vpc_offering.name) + return + + def validate_vpc_network(self, network): + """Validates the VPC network""" + + self.debug("Check if the VPC network is created successfully?") + vpc_networks = VPC.list( + self.apiclient, + id=network.id + ) + self.assertEqual( + isinstance(vpc_networks, list), + True, + "List VPC network should return a valid list" + ) + self.assertEqual( + network.name, + vpc_networks[0].name, + "Name of the VPC network should match with listVPC data" + ) + self.debug("VPC network created successfully - %s" % network.name) + return + + @attr(tags=["advanced", "intervlan"]) + def test_01_create_vpc_offering_with_regionlevelvpc_service_capability(self): + """ Test create VPC offering + """ + + # Steps for validation + # 1. Create VPC Offering by specifying all supported Services + # 2. VPC offering should be created successfully. + + self.debug("Creating inter VPC offering") + vpc_off = VpcOffering.create( + self.apiclient, + self.services["vpc_offering"] + ) + + self.debug("Check if the VPC offering is created successfully?") + self.cleanup.append(vpc_off) + self.validate_vpc_offering(vpc_off) + return + + @attr(tags=["advanced", "intervlan"]) + def test_02_create_vpc_from_offering_with_regionlevelvpc_service_capability(self): + """ Test create VPC offering + """ + + # Steps for validation + # 1. Create VPC Offering by specifying all supported Services + # 2. VPC offering should be created successfully. + + self.debug("Creating inter VPC offering") + vpc_off = VpcOffering.create( + self.apiclient, + self.services["vpc_offering"] + ) + vpc_off.update(self.apiclient, state='Enabled') + vpc = VPC.create( + self.apiclient, + self.services["vpc"], + vpcofferingid=vpc_off.id, + zoneid=self.zone.id, + account=self.account.name, + domainid=self.account.domainid + ) + self.assertEqual(vpc.distributedvpcrouter, True, "VPC created should have 'distributedvpcrouter' set to True") + + try: + vpc.delete(self.apiclient) + except Exception as e: + self.fail("Failed to delete VPC network - %s" % e) + return + + @attr(tags=["advanced", "intervlan"]) + def test_03_deploy_vms_in_vpc_with_regionlevelvpc(self): + """Test deploy virtual machines in VPC networks""" + + # 1. Create VPC Offering by specifying all supported Services + # (Vpn,dhcpdns,UserData, SourceNat,Static NAT and PF,LB,NetworkAcl) + # 2. Create a VPC using the above VPC offering + # 3. Create a network as part of this VPC. + # 4. Deploy few Vms. + # 5. Create a LB rule for this VM. + # 6. Create a PF rule for this VM. + # 7. Create a Static Nat rule for this VM. + # 8. Create Ingress rules on the network to open the above created + # LB PF and Static Nat rule + # 9. Create Egress Network ACL for this network to access google.com. + # 10. Enable VPN services + + self.debug("Creating a VPC offering..") + vpc_off = VpcOffering.create( + self.apiclient, + self.services["vpc_offering"] + ) + + vpc_off.update(self.apiclient, state='Enabled') + + self.debug("creating a VPC network in the account: %s" % + self.account.name) + vpc = VPC.create( + self.apiclient, + self.services["vpc"], + vpcofferingid=vpc_off.id, + zoneid=self.zone.id, + account=self.account.name, + domainid=self.account.domainid + ) + self.validate_vpc_network(vpc) + + self.network_offering = NetworkOffering.create( + self.apiclient, + self.services["network_offering"], + conservemode=False + ) + # Enable Network offering + self.network_offering.update(self.apiclient, state='Enabled') + + gateway = vpc.cidr.split('/')[0] + # Split the cidr to retrieve gateway + # for eg. cidr = 10.0.0.1/24 + # Gateway = 10.0.0.1 + + # Creating network using the network offering created + self.debug("Creating network with network offering: %s" % + self.network_offering.id) + network = Network.create( + self.apiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.account.domainid, + networkofferingid=self.network_offering.id, + zoneid=self.zone.id, + gateway=gateway, + vpcid=vpc.id + ) + self.debug("Created network with ID: %s" % network.id) + # Spawn an instance in that network + virtual_machine = VirtualMachine.create( + self.apiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + networkids=[str(network.id)] + ) + self.debug("Deployed VM in network: %s" % network.id) + + self.debug("Associating public IP for network: %s" % network.name) + public_ip = PublicIPAddress.create( + self.apiclient, + accountid=self.account.name, + zoneid=self.zone.id, + domainid=self.account.domainid, + networkid=network.id, + vpcid=vpc.id + ) + self.debug("Associated %s with network %s" % ( + public_ip.ipaddress.ipaddress, + network.id + )) + + self.debug("Creating LB rule for IP address: %s" % + public_ip.ipaddress.ipaddress) + + lb_rule = LoadBalancerRule.create( + self.apiclient, + self.services["lbrule"], + ipaddressid=public_ip.ipaddress.id, + accountid=self.account.name, + networkid=network.id, + vpcid=vpc.id, + domainid=self.account.domainid + ) + + self.debug("Associating public IP for network: %s" % vpc.name) + public_ip_2 = PublicIPAddress.create( + self.apiclient, + accountid=self.account.name, + zoneid=self.zone.id, + domainid=self.account.domainid, + networkid=network.id, + vpcid=vpc.id + ) + self.debug("Associated %s with network %s" % ( + public_ip_2.ipaddress.ipaddress, + network.id + )) + + nat_rule = NATRule.create( + self.apiclient, + virtual_machine, + self.services["natrule"], + ipaddressid=public_ip_2.ipaddress.id, + openfirewall=False, + networkid=network.id, + vpcid=vpc.id + ) + + self.debug("Adding NetwrokACl rules to make PF and LB accessible") + networkacl_1 = NetworkACL.create( + self.apiclient, + networkid=network.id, + services=self.services["natrule"], + traffictype='Ingress' + ) + + networkacl_2 = NetworkACL.create( + self.apiclient, + networkid=network.id, + services=self.services["lbrule"], + traffictype='Ingress' + ) + self.debug("Checking if we can SSH into VM?") + try: + virtual_machine.get_ssh_client( + ipaddress=public_ip_2.ipaddress.ipaddress, + ) + self.debug("SSH into VM is successfully") + except Exception as e: + self.fail("Failed to SSH into VM - %s, %s" % + (public_ip_2.ipaddress.ipaddress, e)) + + self.debug("Associating public IP for network: %s" % network.name) + public_ip_3 = PublicIPAddress.create( + self.apiclient, + accountid=self.account.name, + zoneid=self.zone.id, + domainid=self.account.domainid, + networkid=network.id, + vpcid=vpc.id + ) + self.debug("Associated %s with network %s" % ( + public_ip_3.ipaddress.ipaddress, + network.id + )) + self.debug("Enabling static NAT for IP: %s" % + public_ip_3.ipaddress.ipaddress) + try: + StaticNATRule.enable( + self.apiclient, + ipaddressid=public_ip_3.ipaddress.id, + virtualmachineid=virtual_machine.id, + networkid=network.id + ) + self.debug("Static NAT enabled for IP: %s" % + public_ip_3.ipaddress.ipaddress) + except Exception as e: + self.fail("Failed to enable static NAT on IP: %s - %s" % ( + public_ip_3.ipaddress.ipaddress, e)) + + public_ips = PublicIPAddress.list( + self.apiclient, + networkid=network.id, + listall=True, + isstaticnat=True, + account=self.account.name, + domainid=self.account.domainid + ) + self.assertEqual( + isinstance(public_ips, list), + True, + "List public Ip for network should list the Ip addr" + ) + self.assertEqual( + public_ips[0].ipaddress, + public_ip_3.ipaddress.ipaddress, + "List public Ip for network should list the Ip addr" + ) + # TODO: Remote Access VPN is not yet supported in VPC + return \ No newline at end of file From c1085ed94bdf8148973ba977ccea0952f6887082 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Fri, 14 Mar 2014 21:54:06 +0530 Subject: [PATCH 003/683] fix schema issue --- setup/db/db/schema-430to440.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index b71ce852e4..6b4601a454 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -746,4 +746,5 @@ INSERT INTO `cloud`.`storage_pool_details` (pool_id,name,value,display) SELECT s DELETE FROM `cloud`.`data_center_details` WHERE name="storage.overprovisioning.factor"; ALTER TABLE `cloud`.`vpc_offerings` ADD COLUMN supports_region_level_vpc boolean default false; ALTER TABLE `cloud`.`network_offerings` ADD COLUMN supports_streched_l2 boolean default false; +ALTER TABLE `cloud`.`networks` ADD COLUMN streched_l2 boolean default false; ALTER TABLE `cloud`.`vpc` ADD COLUMN region_level_vpc boolean default false; From 14a4dd116f09b7dc13a5d8ef79d02aedda57f34f Mon Sep 17 00:00:00 2001 From: Jayapal Date: Fri, 14 Mar 2014 22:28:45 +0530 Subject: [PATCH 004/683] CLOUDSTACK-2692 Assigning LB rule for vm nic secondary ips Conflicts: setup/db/db/schema-430to440.sql --- .../network/lb/LoadBalancingRulesService.java | 2 +- .../apache/cloudstack/api/ApiConstants.java | 2 + .../AssignToLoadBalancerRuleCmd.java | 47 +++++++- .../network/dao/LoadBalancerVMMapDao.java | 2 + .../network/dao/LoadBalancerVMMapDaoImpl.java | 8 ++ .../network/dao/LoadBalancerVMMapVO.java | 19 ++++ .../com/cloud/network/NetworkServiceImpl.java | 22 +++- .../network/as/AutoScaleManagerImpl.java | 2 +- .../lb/LoadBalancingRulesManagerImpl.java | 101 +++++++++++++++--- setup/db/db/schema-430to440.sql | 2 + 10 files changed, 185 insertions(+), 22 deletions(-) diff --git a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java index 4c87d342db..ee1df33cd4 100644 --- a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java +++ b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java @@ -94,7 +94,7 @@ LoadBalancer createPublicLoadBalancerRule(String xId, String name, String descri /** * Assign a virtual machine, or list of virtual machines, to a load balancer. */ - boolean assignToLoadBalancer(long lbRuleId, List vmIds); + boolean assignToLoadBalancer(long lbRuleId, List vmIds, Map> vmIdIpMap); boolean assignSSLCertToLoadBalancerRule(Long lbRuleId, String certName, String publicCert, String privateKey); diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index 0dbc1b823c..6142a0d37d 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -262,6 +262,8 @@ public class ApiConstants { public static final String VALUE = "value"; public static final String VIRTUAL_MACHINE_ID = "virtualmachineid"; public static final String VIRTUAL_MACHINE_IDS = "virtualmachineids"; + public static final String VIRTUAL_MACHINE_ID_IP = "vmidipmap"; + public static final String VLAN = "vlan"; public static final String VLAN_RANGE = "vlanrange"; public static final String REMOVE_VLAN = "removevlan"; diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java index 6bd7537827..fad2c2a0c1 100644 --- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java @@ -16,7 +16,12 @@ // under the License. package org.apache.cloudstack.api.command.user.loadbalancer; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Collection; +import java.util.Iterator; +import java.util.ArrayList; import org.apache.log4j.Logger; @@ -62,10 +67,12 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd { type = CommandType.LIST, collectionType = CommandType.UUID, entityType = UserVmResponse.class, - required = true, description = "the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)") private List virtualMachineIds; + @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID_IP, type = CommandType.MAP, description = "VM ID and IP map, vmidipmap[0].vmid=1 vmidipmap[0].ip=10.1.1.75") + private Map vmIdIpMap; + ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// @@ -78,6 +85,10 @@ public List getVirtualMachineIds() { return virtualMachineIds; } + public Map getVmIdIpMap() { + return vmIdIpMap; + } + ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @@ -106,10 +117,42 @@ public String getEventDescription() { return "applying instances for load balancer: " + getLoadBalancerId() + " (ids: " + StringUtils.join(getVirtualMachineIds(), ",") + ")"; } + + public Map> getVmIdIpListMap() { + Map> vmIdIpsMap = null; + if (vmIdIpMap != null && !vmIdIpMap.isEmpty()) { + vmIdIpsMap = new HashMap>(); + Collection idIpsCollection = vmIdIpMap.values(); + Iterator iter = idIpsCollection.iterator(); + while (iter.hasNext()) { + HashMap idIpsMap = (HashMap)iter.next(); + String vmId = idIpsMap.get("vmid"); + String vmIp = idIpsMap.get("vmip"); + + Long longVmId = new Long(vmId); + + List ipsList = null; + if (vmIdIpsMap.containsKey(longVmId)) { + ipsList = vmIdIpsMap.get(longVmId); + } else { + ipsList = new ArrayList(); + } + ipsList.add(vmIp); + vmIdIpsMap.put(longVmId, ipsList); + + } + } + + return vmIdIpsMap; + } + @Override public void execute() { CallContext.current().setEventDetails("Load balancer Id: " + getLoadBalancerId() + " VmIds: " + StringUtils.join(getVirtualMachineIds(), ",")); - boolean result = _lbService.assignToLoadBalancer(getLoadBalancerId(), virtualMachineIds); + + Map> vmIdIpsMap = getVmIdIpListMap(); + + boolean result = _lbService.assignToLoadBalancer(getLoadBalancerId(), virtualMachineIds, vmIdIpsMap); if (result) { SuccessResponse response = new SuccessResponse(getCommandName()); this.setResponseObject(response); diff --git a/engine/schema/src/com/cloud/network/dao/LoadBalancerVMMapDao.java b/engine/schema/src/com/cloud/network/dao/LoadBalancerVMMapDao.java index 79eaf8e16b..51f45c219e 100644 --- a/engine/schema/src/com/cloud/network/dao/LoadBalancerVMMapDao.java +++ b/engine/schema/src/com/cloud/network/dao/LoadBalancerVMMapDao.java @@ -34,4 +34,6 @@ public interface LoadBalancerVMMapDao extends GenericDao listByInstanceIp(String instanceIp); } diff --git a/engine/schema/src/com/cloud/network/dao/LoadBalancerVMMapDaoImpl.java b/engine/schema/src/com/cloud/network/dao/LoadBalancerVMMapDaoImpl.java index b0b14fc23c..bb24e04221 100644 --- a/engine/schema/src/com/cloud/network/dao/LoadBalancerVMMapDaoImpl.java +++ b/engine/schema/src/com/cloud/network/dao/LoadBalancerVMMapDaoImpl.java @@ -59,6 +59,14 @@ public List listByInstanceId(long instanceId) { return listBy(sc); } + @Override + public List listByInstanceIp(String instanceIp) { + SearchCriteria sc = createSearchCriteria(); + sc.addAnd("instanceIp", SearchCriteria.Op.EQ, instanceIp); + + return listBy(sc); + } + @Override public List listByLoadBalancerId(long loadBalancerId) { SearchCriteria sc = createSearchCriteria(); diff --git a/engine/schema/src/com/cloud/network/dao/LoadBalancerVMMapVO.java b/engine/schema/src/com/cloud/network/dao/LoadBalancerVMMapVO.java index 0a67106dc9..08b918475c 100644 --- a/engine/schema/src/com/cloud/network/dao/LoadBalancerVMMapVO.java +++ b/engine/schema/src/com/cloud/network/dao/LoadBalancerVMMapVO.java @@ -39,6 +39,9 @@ public class LoadBalancerVMMapVO implements InternalIdentity { @Column(name = "instance_id") private long instanceId; + @Column(name = "instance_ip") + private String instanceIp; + @Column(name = "revoke") private boolean revoke = false; @@ -59,6 +62,13 @@ public LoadBalancerVMMapVO(long loadBalancerId, long instanceId, boolean revoke) this.revoke = revoke; } + public LoadBalancerVMMapVO(long loadBalancerId, long instanceId, String vmIp, boolean revoke) { + this.loadBalancerId = loadBalancerId; + this.instanceId = instanceId; + this.instanceIp = vmIp; + this.revoke = revoke; + } + @Override public long getId() { return id; @@ -87,4 +97,13 @@ public String getState() { public void setState(String state) { this.state = state; } + + public String getInstanceIp() { + return instanceIp; + } + + public void setInstanceIp(String instanceIp) { + this.instanceIp = instanceIp; + } + } diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java index 9238a1e8ce..e255976ae8 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -113,10 +113,12 @@ import com.cloud.network.dao.OvsProviderDao; import com.cloud.network.dao.PhysicalNetworkDao; import com.cloud.network.dao.PhysicalNetworkServiceProviderDao; +import com.cloud.network.dao.LoadBalancerVMMapDao; import com.cloud.network.dao.PhysicalNetworkServiceProviderVO; import com.cloud.network.dao.PhysicalNetworkTrafficTypeDao; import com.cloud.network.dao.PhysicalNetworkTrafficTypeVO; import com.cloud.network.dao.PhysicalNetworkVO; +import com.cloud.network.dao.LoadBalancerVMMapVO; import com.cloud.network.element.NetworkElement; import com.cloud.network.element.OvsProviderVO; import com.cloud.network.element.VirtualRouterElement; @@ -307,6 +309,8 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { IpAddressManager _ipAddrMgr; @Inject EntityManager _entityMgr; + @Inject + LoadBalancerVMMapDao _lbVmMapDao; int _cidrLimit; boolean _allowSubdomainNetworkAccess; @@ -806,7 +810,15 @@ public boolean releaseSecondaryIpFromNic(long ipAddressId) { s_logger.debug("VM nic IP " + secondaryIp + " is associated with the static NAT rule public IP address id " + publicIpVO.getId()); throw new InvalidParameterValueException("Can' remove the ip " + secondaryIp + "is associate with static NAT rule public IP address id " + publicIpVO.getId()); } - } else if (dc.getNetworkType() == NetworkType.Basic || ntwkOff.getGuestType() == Network.GuestType.Shared) { + + List lbVmMap = _lbVmMapDao.listByInstanceIp(secondaryIp); + if (lbVmMap != null && lbVmMap.size() != 0) { + s_logger.debug("VM nic IP " + secondaryIp + " is mapped to load balancing rule"); + throw new InvalidParameterValueException("Can't remove the secondary ip " + secondaryIp + " is mapped to load balancing rule"); + + } + + } else if (dc.getNetworkType() == NetworkType.Basic || ntwkOff.getGuestType() == Network.GuestType.Shared) { final IPAddressVO ip = _ipAddressDao.findByIpAndSourceNetworkId(secIpVO.getNetworkId(), secIpVO.getIp4Address()); if (ip != null) { Transaction.execute(new TransactionCallbackNoReturn() { @@ -3819,12 +3831,12 @@ private PhysicalNetworkServiceProvider addDefaultBaremetalProvidersToPhysicalNet PhysicalNetworkVO pvo = _physicalNetworkDao.findById(physicalNetworkId); DataCenterVO dvo = _dcDao.findById(pvo.getDataCenterId()); if (dvo.getNetworkType() == NetworkType.Basic) { - - Provider provider = Network.Provider.getProvider("BaremetalDhcpProvider"); - if (provider == null) { + + Provider provider = Network.Provider.getProvider("BaremetalDhcpProvider"); + if (provider == null) { // baremetal is not loaded return null; - } + } addProviderToPhysicalNetwork(physicalNetworkId, "BaremetalDhcpProvider", null, null); addProviderToPhysicalNetwork(physicalNetworkId, "BaremetalPxeProvider", null, null); diff --git a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java index 99189fe43a..b6e917dac9 100644 --- a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java +++ b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java @@ -1414,7 +1414,7 @@ private boolean assignLBruleToNewVm(long vmId, AutoScaleVmGroupVO asGroup) { } } lstVmId.add(new Long(vmId)); - return _loadBalancingRulesService.assignToLoadBalancer(lbId, lstVmId); + return _loadBalancingRulesService.assignToLoadBalancer(lbId, lstVmId, null); } diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java index 9f280ef7a8..8a7e0298b4 100755 --- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java +++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java @@ -30,6 +30,7 @@ import javax.ejb.Local; import javax.inject.Inject; +import com.cloud.vm.dao.NicSecondaryIpDao; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBHealthCheckPolicyCmd; import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBStickinessPolicyCmd; @@ -258,6 +259,9 @@ public class LoadBalancingRulesManagerImpl extends ManagerBase implements @Inject LoadBalancerCertMapDao _lbCertMapDao; + @Inject + NicSecondaryIpDao _nicSecondaryIpDao; + // Will return a string. For LB Stickiness this will be a json, for // autoscale this will be "," separated values @Override @@ -923,7 +927,7 @@ private boolean isRollBackAllowedForProvider(LoadBalancerVO loadBalancer) { @Override @DB @ActionEvent(eventType = EventTypes.EVENT_ASSIGN_TO_LOAD_BALANCER_RULE, eventDescription = "assigning to load balancer", async = true) - public boolean assignToLoadBalancer(long loadBalancerId, List instanceIds) { + public boolean assignToLoadBalancer(long loadBalancerId, List instanceIds, Map> vmIdIpMap) { CallContext ctx = CallContext.current(); Account caller = ctx.getCallingAccount(); @@ -932,22 +936,68 @@ public boolean assignToLoadBalancer(long loadBalancerId, List instanceIds) throw new InvalidParameterValueException("Failed to assign to load balancer " + loadBalancerId + ", the load balancer was not found."); } + + if (instanceIds == null && vmIdIpMap == null) { + throw new InvalidParameterValueException("Both instanceids and vmidipmap can't be null"); + } + + // instanceIds and vmIdipmap is passed + if (instanceIds != null && vmIdIpMap != null) { + for(long instanceId: instanceIds) { + if (!vmIdIpMap.containsKey(instanceId)) { + vmIdIpMap.put(instanceId, null); + } + } + } + + //only instanceids list passed + if (instanceIds != null && vmIdIpMap == null){ + vmIdIpMap = new HashMap>(); + for (long instanceId: instanceIds){ + vmIdIpMap.put(instanceId, null); + } + } + List mappedInstances = _lb2VmMapDao.listByLoadBalancerId(loadBalancerId, false); Set mappedInstanceIds = new HashSet(); for (LoadBalancerVMMapVO mappedInstance : mappedInstances) { mappedInstanceIds.add(Long.valueOf(mappedInstance.getInstanceId())); } - final List vmsToAdd = new ArrayList(); + Map> existingVmIdIps = new HashMap>(); + // now get the ips of vm and add it to map + for (LoadBalancerVMMapVO mappedInstance : mappedInstances) { - if (instanceIds == null || instanceIds.isEmpty()) { - s_logger.warn("List of vms to assign to the lb, is empty"); - return false; + List ipsList = null; + if (existingVmIdIps.containsKey(mappedInstance.getInstanceId())) { + ipsList = existingVmIdIps.get(mappedInstance.getInstanceId()); + } else { + ipsList = new ArrayList(); + } + ipsList.add(mappedInstance.getInstanceIp()); + existingVmIdIps.put(mappedInstance.getInstanceId(), ipsList); } - for (Long instanceId : instanceIds) { - if (mappedInstanceIds.contains(instanceId)) { - throw new InvalidParameterValueException("VM " + instanceId + " is already mapped to load balancer."); + + + + final List vmsToAdd = new ArrayList(); + + // check for conflict + Set passedInstanceIds = vmIdIpMap.keySet(); + for (Long instanceId : passedInstanceIds) { + if (existingVmIdIps.containsKey(instanceId)) { + // now check for ip address + List mappedIps = existingVmIdIps.get(instanceId); + List newIps = vmIdIpMap.get(instanceId); + + if (newIps != null) { + for (String newIp: newIps) { + if (mappedIps.contains(newIp)) { + throw new InvalidParameterValueException("VM " + instanceId + " with " + newIp +" is already mapped to load balancer."); + } + } + } } UserVm vm = _vmDao.findById(instanceId); @@ -985,18 +1035,43 @@ public boolean assignToLoadBalancer(long loadBalancerId, List instanceIds) throw ex; } + String priIp = nicInSameNetwork.getIp4Address(); + List vmIpsList = vmIdIpMap.get(instanceId); + String vmLbIp = null; + + if (vmIpsList == null) { + vmIpsList = new ArrayList(); + vmIpsList.add(priIp); + vmIdIpMap.put(instanceId, vmIpsList); + } else { + //check if the ips belongs to nic secondary ip + for (String ip: vmIpsList) { + if(_nicSecondaryIpDao.findByIp4AddressAndNicId(ip,nicInSameNetwork.getId()) == null) { + throw new InvalidParameterValueException("VM ip specified " + ip + " is not belongs to nic in network " + nicInSameNetwork.getNetworkId()); + } + } + } + + if (s_logger.isDebugEnabled()) { s_logger.debug("Adding " + vm + " to the load balancer pool"); } vmsToAdd.add(vm); } + final Set vmIds = vmIdIpMap.keySet(); + final Map> newMap = vmIdIpMap; + Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) { - for (UserVm vm : vmsToAdd) { - LoadBalancerVMMapVO map = new LoadBalancerVMMapVO(loadBalancer.getId(), vm.getId(), false); + + for (Long vmId : vmIds) { + final List lbVmIps = newMap.get(vmId); + for (String vmIp: lbVmIps) { + LoadBalancerVMMapVO map = new LoadBalancerVMMapVO(loadBalancer.getId(), vmId, vmIp, false); map = _lb2VmMapDao.persist(map); + } } } }); @@ -1020,8 +1095,8 @@ public void doInTransactionWithoutResult(TransactionStatus status) { Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) { - for (UserVm vm : vmsToAdd) { - vmInstanceIds.add(vm.getId()); + for (Long vmId : vmIds) { + vmInstanceIds.add(vmId); } } }); @@ -1875,7 +1950,7 @@ public List getExistingDestinations(long lbId) { for (LoadBalancerVMMapVO lbVmMap : lbVmMaps) { UserVm vm = _vmDao.findById(lbVmMap.getInstanceId()); Nic nic = _nicDao.findByInstanceIdAndNetworkIdIncludingRemoved(lb.getNetworkId(), vm.getId()); - dstIp = nic.getIp4Address(); + dstIp = lbVmMap.getInstanceIp() == null ? nic.getIp4Address(): lbVmMap.getInstanceIp(); LbDestination lbDst = new LbDestination(lb.getDefaultPortStart(), lb.getDefaultPortEnd(), dstIp, lbVmMap.isRevoke()); dstList.add(lbDst); } diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index 6b4601a454..75a303d050 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -748,3 +748,5 @@ ALTER TABLE `cloud`.`vpc_offerings` ADD COLUMN supports_region_level_vpc boolean ALTER TABLE `cloud`.`network_offerings` ADD COLUMN supports_streched_l2 boolean default false; ALTER TABLE `cloud`.`networks` ADD COLUMN streched_l2 boolean default false; ALTER TABLE `cloud`.`vpc` ADD COLUMN region_level_vpc boolean default false; +ALTER TABLE `cloud`.`load_balancer_vm_map` ADD COLUMN instance_ip VARCHAR(40); +ALTER TABLE `cloud`.`load_balancer_vm_map` DROP KEY `load_balancer_id`, ADD UNIQUE KEY load_balancer_id (`load_balancer_id`, `instance_id`, `instance_ip`); \ No newline at end of file From ba5621012747aae5d8c8f110936dca98b7537b45 Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Fri, 14 Mar 2014 10:54:27 -0700 Subject: [PATCH 005/683] Deal with concurrent state update for VM and Host objects. --- api/src/com/cloud/vm/VirtualMachine.java | 1 + .../cloud/vm/VirtualMachineManagerImpl.java | 25 ++---- .../src/com/cloud/host/dao/HostDaoImpl.java | 77 ++++++++++--------- .../com/cloud/vm/dao/VMInstanceDaoImpl.java | 54 +++++-------- .../jobs/impl/AsyncJobManagerImpl.java | 18 +++-- 5 files changed, 80 insertions(+), 95 deletions(-) diff --git a/api/src/com/cloud/vm/VirtualMachine.java b/api/src/com/cloud/vm/VirtualMachine.java index b085d4a7c4..72cbb252ee 100755 --- a/api/src/com/cloud/vm/VirtualMachine.java +++ b/api/src/com/cloud/vm/VirtualMachine.java @@ -102,6 +102,7 @@ public static StateMachine2 getStat s_fsm.addTransition(State.Running, VirtualMachine.Event.StopRequested, State.Stopping); s_fsm.addTransition(State.Running, VirtualMachine.Event.AgentReportShutdowned, State.Stopped); s_fsm.addTransition(State.Running, VirtualMachine.Event.AgentReportMigrated, State.Running); + s_fsm.addTransition(State.Running, VirtualMachine.Event.OperationSucceeded, State.Running); s_fsm.addTransition(State.Migrating, VirtualMachine.Event.MigrationRequested, State.Migrating); s_fsm.addTransition(State.Migrating, VirtualMachine.Event.OperationSucceeded, State.Running); s_fsm.addTransition(State.Migrating, VirtualMachine.Event.OperationFailed, State.Running); diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index e9d2fd2073..91d58b81b6 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -36,12 +36,10 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao; -import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; @@ -51,19 +49,9 @@ import org.apache.cloudstack.framework.config.ConfigKey; import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; -import org.apache.cloudstack.framework.jobs.AsyncJob; -import org.apache.cloudstack.framework.jobs.AsyncJobExecutionContext; -import org.apache.cloudstack.framework.jobs.AsyncJobManager; -import org.apache.cloudstack.framework.jobs.Outcome; -import org.apache.cloudstack.framework.jobs.dao.VmWorkJobDao; -import org.apache.cloudstack.framework.jobs.impl.AsyncJobVO; -import org.apache.cloudstack.framework.jobs.impl.OutcomeImpl; -import org.apache.cloudstack.framework.jobs.impl.VmWorkJobVO; import org.apache.cloudstack.framework.messagebus.MessageBus; import org.apache.cloudstack.framework.messagebus.MessageDispatcher; import org.apache.cloudstack.framework.messagebus.MessageHandler; -import org.apache.cloudstack.jobs.JobInfo; -import org.apache.cloudstack.managed.context.ManagedContextRunnable; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; import org.apache.cloudstack.storage.to.VolumeObjectTO; @@ -291,7 +279,7 @@ public List getHostAllocators() { } public void setHostAllocators(List hostAllocators) { - this.hostAllocators = hostAllocators; + hostAllocators = hostAllocators; } protected List _storagePoolAllocators; @@ -3243,9 +3231,9 @@ protected class AgentVmInfo { @SuppressWarnings("unchecked") public AgentVmInfo(String name, VMInstanceVO vm, State state, String host) { - this.name = name; - this.state = state; - this.vm = vm; + name = name; + state = state; + vm = vm; hostUuid = host; } @@ -4100,7 +4088,7 @@ private void HandlePowerStateReport(String subject, String senderAddress, Object List pendingWorkJobs = _workJobDao.listPendingWorkJobs( VirtualMachine.Type.Instance, vmId); - if (pendingWorkJobs.size() == 0 || !_haMgr.hasPendingHaWork(vmId)) { + if (pendingWorkJobs.size() == 0 && !_haMgr.hasPendingHaWork(vmId)) { // there is no pending operation job VMInstanceVO vm = _vmDao.findById(vmId); if (vm != null) { @@ -4407,7 +4395,8 @@ public VmStateSyncOutcome(final AsyncJob job, final PowerState desiredPowerState @Override public boolean checkCondition() { VMInstanceVO instance = _vmDao.findById(vmId); - if (instance.getPowerState() == desiredPowerState && (srcHostIdForMigration != null && srcHostIdForMigration.equals(instance.getPowerHostId()))) + if ((instance.getPowerState() == desiredPowerState && srcHostIdForMigration == null) || + (instance.getPowerState() == desiredPowerState && (srcHostIdForMigration != null && instance.getPowerHostId() != srcHostIdForMigration))) return true; return false; } diff --git a/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java b/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java index c2a9826405..426c90db69 100755 --- a/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java +++ b/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java @@ -953,46 +953,49 @@ public boolean updateState(Status oldStatus, Event event, Status newStatus, Host int result = update(ub, sc, null); assert result <= 1 : "How can this update " + result + " rows? "; - if (status_logger.isDebugEnabled() && result == 0) { + if (result == 0) { HostVO ho = findById(host.getId()); assert ho != null : "How how how? : " + host.getId(); - StringBuilder str = new StringBuilder("Unable to update host for event:").append(event.toString()); - str.append(". Name=").append(host.getName()); - str.append("; New=[status=") - .append(newStatus.toString()) - .append(":msid=") - .append(newStatus.lostConnection() ? "null" : host.getManagementServerId()) - .append(":lastpinged=") - .append(host.getLastPinged()) - .append("]"); - str.append("; Old=[status=") - .append(oldStatus.toString()) - .append(":msid=") - .append(host.getManagementServerId()) - .append(":lastpinged=") - .append(oldPingTime) - .append("]"); - str.append("; DB=[status=") - .append(vo.getStatus().toString()) - .append(":msid=") - .append(vo.getManagementServerId()) - .append(":lastpinged=") - .append(vo.getLastPinged()) - .append(":old update count=") - .append(oldUpdateCount) - .append("]"); - status_logger.debug(str.toString()); - } else { - StringBuilder msg = new StringBuilder("Agent status update: ["); - msg.append("id = " + host.getId()); - msg.append("; name = " + host.getName()); - msg.append("; old status = " + oldStatus); - msg.append("; event = " + event); - msg.append("; new status = " + newStatus); - msg.append("; old update count = " + oldUpdateCount); - msg.append("; new update count = " + newUpdateCount + "]"); - status_logger.debug(msg.toString()); + if (status_logger.isDebugEnabled()) { + + StringBuilder str = new StringBuilder("Unable to update host for event:").append(event.toString()); + str.append(". Name=").append(host.getName()); + str.append("; New=[status=") + .append(newStatus.toString()) + .append(":msid=") + .append(newStatus.lostConnection() ? "null" : host.getManagementServerId()) + .append(":lastpinged=") + .append(host.getLastPinged()) + .append("]"); + str.append("; Old=[status=").append(oldStatus.toString()).append(":msid=").append(host.getManagementServerId()).append(":lastpinged=").append(oldPingTime) + .append("]"); + str.append("; DB=[status=") + .append(vo.getStatus().toString()) + .append(":msid=") + .append(vo.getManagementServerId()) + .append(":lastpinged=") + .append(vo.getLastPinged()) + .append(":old update count=") + .append(oldUpdateCount) + .append("]"); + status_logger.debug(str.toString()); + } else { + StringBuilder msg = new StringBuilder("Agent status update: ["); + msg.append("id = " + host.getId()); + msg.append("; name = " + host.getName()); + msg.append("; old status = " + oldStatus); + msg.append("; event = " + event); + msg.append("; new status = " + newStatus); + msg.append("; old update count = " + oldUpdateCount); + msg.append("; new update count = " + newUpdateCount + "]"); + status_logger.debug(msg.toString()); + } + + if (ho.getState() == newStatus) { + status_logger.debug("Host " + ho.getName() + " state has already been updated to " + newStatus); + return true; + } } return result > 0; diff --git a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java index 2f25f577f4..7c5949290d 100644 --- a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java @@ -452,41 +452,29 @@ public boolean updateState(State oldState, Event event, State newState, VirtualM ub.set(vmi, _updateTimeAttr, new Date()); int result = update(vmi, sc); - if (result == 0 && s_logger.isDebugEnabled()) { - + if (result == 0) { VMInstanceVO vo = findByIdIncludingRemoved(vm.getId()); - if (vo != null) { - StringBuilder str = new StringBuilder("Unable to update ").append(vo.toString()); - str.append(": DB Data={Host=") - .append(vo.getHostId()) - .append("; State=") - .append(vo.getState().toString()) - .append("; updated=") - .append(vo.getUpdated()) - .append("; time=") - .append(vo.getUpdateTime()); - str.append("} New Data: {Host=") - .append(vm.getHostId()) - .append("; State=") - .append(vm.getState().toString()) - .append("; updated=") - .append(vmi.getUpdated()) - .append("; time=") - .append(vo.getUpdateTime()); - str.append("} Stale Data: {Host=") - .append(oldHostId) - .append("; State=") - .append(oldState) - .append("; updated=") - .append(oldUpdated) - .append("; time=") - .append(oldUpdateDate) - .append("}"); - s_logger.debug(str.toString()); - - } else { - s_logger.debug("Unable to update the vm id=" + vm.getId() + "; the vm either doesn't exist or already removed"); + if (s_logger.isDebugEnabled()) { + if (vo != null) { + StringBuilder str = new StringBuilder("Unable to update ").append(vo.toString()); + str.append(": DB Data={Host=").append(vo.getHostId()).append("; State=").append(vo.getState().toString()).append("; updated=").append(vo.getUpdated()) + .append("; time=").append(vo.getUpdateTime()); + str.append("} New Data: {Host=").append(vm.getHostId()).append("; State=").append(vm.getState().toString()).append("; updated=").append(vmi.getUpdated()) + .append("; time=").append(vo.getUpdateTime()); + str.append("} Stale Data: {Host=").append(oldHostId).append("; State=").append(oldState).append("; updated=").append(oldUpdated).append("; time=") + .append(oldUpdateDate).append("}"); + s_logger.debug(str.toString()); + + } else { + s_logger.debug("Unable to update the vm id=" + vm.getId() + "; the vm either doesn't exist or already removed"); + } + } + + if (vo != null && vo.getState() == newState) { + // allow for concurrent update if target state has already been matched + s_logger.debug("VM " + vo.getInstanceName() + " state has been already been updated to " + newState); + return true; } } return result > 0; diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java index 49c3032b12..7f3701d7e4 100644 --- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java +++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java @@ -256,13 +256,17 @@ public List doInTransaction(TransactionStatus status) { } }); - for (Long id : wakeupList) { - // TODO, we assume that all jobs in this category is API job only - AsyncJobVO jobToWakeup = _jobDao.findById(id); - if (jobToWakeup != null && (jobToWakeup.getPendingSignals() & AsyncJob.Constants.SIGNAL_MASK_WAKEUP) != 0) - scheduleExecution(jobToWakeup, false); - } - + // + // disable wakeup scheduling now, since all API jobs are currently using block-waiting for sub-jobs + // + /* + for (Long id : wakeupList) { + // TODO, we assume that all jobs in this category is API job only + AsyncJobVO jobToWakeup = _jobDao.findById(id); + if (jobToWakeup != null && (jobToWakeup.getPendingSignals() & AsyncJob.Constants.SIGNAL_MASK_WAKEUP) != 0) + scheduleExecution(jobToWakeup, false); + } + */ _messageBus.publish(null, AsyncJob.Topics.JOB_STATE, PublishScope.GLOBAL, jobId); } From 1db329f0f9d9814c09b1158a0127d5b7f337b2dd Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Fri, 14 Mar 2014 14:22:23 -0700 Subject: [PATCH 006/683] Fix the missing java imports from automatic merge --- .../src/com/cloud/vm/VirtualMachineManagerImpl.java | 12 ++++++++++++ .../framework/jobs/impl/AsyncJobManagerImpl.java | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index 91d58b81b6..ae882bfbb4 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -36,10 +36,12 @@ import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; +import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao; +import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; @@ -49,9 +51,19 @@ import org.apache.cloudstack.framework.config.ConfigKey; import org.apache.cloudstack.framework.config.Configurable; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; +import org.apache.cloudstack.framework.jobs.AsyncJob; +import org.apache.cloudstack.framework.jobs.AsyncJobExecutionContext; +import org.apache.cloudstack.framework.jobs.AsyncJobManager; +import org.apache.cloudstack.framework.jobs.Outcome; +import org.apache.cloudstack.framework.jobs.dao.VmWorkJobDao; +import org.apache.cloudstack.framework.jobs.impl.AsyncJobVO; +import org.apache.cloudstack.framework.jobs.impl.OutcomeImpl; +import org.apache.cloudstack.framework.jobs.impl.VmWorkJobVO; import org.apache.cloudstack.framework.messagebus.MessageBus; import org.apache.cloudstack.framework.messagebus.MessageDispatcher; import org.apache.cloudstack.framework.messagebus.MessageHandler; +import org.apache.cloudstack.jobs.JobInfo; +import org.apache.cloudstack.managed.context.ManagedContextRunnable; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; import org.apache.cloudstack.storage.to.VolumeObjectTO; diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java index 7f3701d7e4..4acfdbfd32 100644 --- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java +++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java @@ -259,7 +259,7 @@ public List doInTransaction(TransactionStatus status) { // // disable wakeup scheduling now, since all API jobs are currently using block-waiting for sub-jobs // - /* + /* for (Long id : wakeupList) { // TODO, we assume that all jobs in this category is API job only AsyncJobVO jobToWakeup = _jobDao.findById(id); From 709d2a096dda5b05d575e53a316c6aabb785f6cd Mon Sep 17 00:00:00 2001 From: Mike Tutkowski Date: Tue, 11 Mar 2014 13:08:00 -0600 Subject: [PATCH 007/683] CLOUDSTACK-6170 --- .../api/command/user/vm/DeployVMCmd.java | 61 +++++++++++-------- .../com/cloud/vm/VirtualMachineManager.java | 3 +- .../service/VolumeOrchestrationService.java | 2 +- .../cloud/vm/VirtualMachineManagerImpl.java | 18 +++--- .../orchestration/CloudOrchestrator.java | 50 +++++++++++---- .../orchestration/VolumeOrchestrator.java | 11 ++-- ui/css/cloudstack3.css | 40 ++++++++++++ ui/index.jsp | 13 +++- ui/scripts/instanceWizard.js | 19 ++++++ ui/scripts/ui-custom/instanceWizard.js | 10 ++- 10 files changed, 172 insertions(+), 55 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java index 0235fcc305..6db99c7e2b 100755 --- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java @@ -482,41 +482,50 @@ private void verifyDetails() { String minIops = (String)map.get("minIops"); String maxIops = (String)map.get("maxIops"); - if ((minIops != null && maxIops == null) || (minIops == null && maxIops != null)) { - throw new InvalidParameterValueException("Either 'Min IOPS' and 'Max IOPS' must both be specified or neither be specified."); - } + verifyMinAndMaxIops(minIops, maxIops); - long lMinIops; + minIops = (String)map.get("minIopsDo"); + maxIops = (String)map.get("maxIopsDo"); - try { - if (minIops != null) { - lMinIops = Long.valueOf(minIops); - } - else { - lMinIops = 0; - } + verifyMinAndMaxIops(minIops, maxIops); + } + } + + private void verifyMinAndMaxIops(String minIops, String maxIops) { + if ((minIops != null && maxIops == null) || (minIops == null && maxIops != null)) { + throw new InvalidParameterValueException("Either 'Min IOPS' and 'Max IOPS' must both be specified or neither be specified."); + } + + long lMinIops; + + try { + if (minIops != null) { + lMinIops = Long.valueOf(minIops); } - catch (NumberFormatException ex) { - throw new InvalidParameterValueException("'Min IOPS' must be a whole number."); + else { + lMinIops = 0; } + } + catch (NumberFormatException ex) { + throw new InvalidParameterValueException("'Min IOPS' must be a whole number."); + } - long lMaxIops; + long lMaxIops; - try { - if (maxIops != null) { - lMaxIops = Long.valueOf(maxIops); - } - else { - lMaxIops = 0; - } + try { + if (maxIops != null) { + lMaxIops = Long.valueOf(maxIops); } - catch (NumberFormatException ex) { - throw new InvalidParameterValueException("'Max IOPS' must be a whole number."); + else { + lMaxIops = 0; } + } + catch (NumberFormatException ex) { + throw new InvalidParameterValueException("'Max IOPS' must be a whole number."); + } - if (lMinIops > lMaxIops) { - throw new InvalidParameterValueException("'Min IOPS' must be less than or equal to 'Max IOPS'."); - } + if (lMinIops > lMaxIops) { + throw new InvalidParameterValueException("'Min IOPS' must be less than or equal to 'Max IOPS'."); } } diff --git a/engine/api/src/com/cloud/vm/VirtualMachineManager.java b/engine/api/src/com/cloud/vm/VirtualMachineManager.java index 99f5595579..f070210b75 100644 --- a/engine/api/src/com/cloud/vm/VirtualMachineManager.java +++ b/engine/api/src/com/cloud/vm/VirtualMachineManager.java @@ -36,7 +36,6 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.network.Network; -import com.cloud.offering.DiskOffering; import com.cloud.offering.DiskOfferingInfo; import com.cloud.offering.ServiceOffering; import com.cloud.storage.StoragePool; @@ -77,7 +76,7 @@ public interface Topics { * @throws InsufficientCapacityException If there are insufficient capacity to deploy this vm. */ void allocate(String vmInstanceName, VirtualMachineTemplate template, ServiceOffering serviceOffering, DiskOfferingInfo rootDiskOfferingInfo, - LinkedHashMap dataDiskOfferings, LinkedHashMap> auxiliaryNetworks, DeploymentPlan plan, + List dataDiskOfferings, LinkedHashMap> auxiliaryNetworks, DeploymentPlan plan, HypervisorType hyperType) throws InsufficientCapacityException; void allocate(String vmInstanceName, VirtualMachineTemplate template, ServiceOffering serviceOffering, diff --git a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java index 2531074029..66b5ff5961 100644 --- a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java +++ b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java @@ -86,7 +86,7 @@ VolumeInfo moveVolume(VolumeInfo volume, long destPoolDcId, Long destPoolPodId, void destroyVolume(Volume volume); - DiskProfile allocateRawVolume(Type type, String name, DiskOffering offering, Long size, VirtualMachine vm, VirtualMachineTemplate template, Account owner); + DiskProfile allocateRawVolume(Type type, String name, DiskOffering offering, Long size, Long minIops, Long maxIops, VirtualMachine vm, VirtualMachineTemplate template, Account owner); VolumeInfo createVolumeOnPrimaryStorage(VirtualMachine vm, Volume rootVolumeOfVm, VolumeInfo volume, HypervisorType rootDiskHyperType) throws NoTransitionException; diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index ae882bfbb4..0a6e83d55f 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -154,7 +154,6 @@ import com.cloud.network.dao.NetworkDao; import com.cloud.network.dao.NetworkVO; import com.cloud.network.rules.RulesManager; -import com.cloud.offering.DiskOffering; import com.cloud.offering.DiskOfferingInfo; import com.cloud.offering.ServiceOffering; import com.cloud.org.Cluster; @@ -376,7 +375,7 @@ public void registerGuru(VirtualMachine.Type type, VirtualMachineGuru guru) { @Override @DB public void allocate(String vmInstanceName, final VirtualMachineTemplate template, ServiceOffering serviceOffering, - final DiskOfferingInfo rootDiskOfferingInfo, LinkedHashMap dataDiskOfferings, + final DiskOfferingInfo rootDiskOfferingInfo, final List dataDiskOfferings, final LinkedHashMap> auxiliaryNetworks, DeploymentPlan plan, HypervisorType hyperType) throws InsufficientCapacityException { @@ -393,8 +392,6 @@ public void allocate(String vmInstanceName, final VirtualMachineTemplate templat } assert (plan.getClusterId() == null && plan.getPoolId() == null) : "We currently don't support cluster and pool preset yet"; final VMInstanceVO vmFinal = _vmDao.persist(vm); - final LinkedHashMap dataDiskOfferingsFinal = - dataDiskOfferings == null ? new LinkedHashMap() : dataDiskOfferings; final VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vmFinal, template, serviceOffering, null, null); @@ -416,8 +413,8 @@ public void doInTransactionWithoutResult(TransactionStatus status) throws Insuff } if (template.getFormat() == ImageFormat.ISO) { - volumeMgr.allocateRawVolume(Type.ROOT, "ROOT-" + vmFinal.getId(), rootDiskOfferingInfo.getDiskOffering(), rootDiskOfferingInfo.getSize(), vmFinal, - template, owner); + volumeMgr.allocateRawVolume(Type.ROOT, "ROOT-" + vmFinal.getId(), rootDiskOfferingInfo.getDiskOffering(), rootDiskOfferingInfo.getSize(), + rootDiskOfferingInfo.getMinIops(), rootDiskOfferingInfo.getMaxIops(), vmFinal, template, owner); } else if (template.getFormat() == ImageFormat.BAREMETAL) { // Do nothing } else { @@ -425,8 +422,11 @@ public void doInTransactionWithoutResult(TransactionStatus status) throws Insuff rootDiskOfferingInfo.getMinIops(), rootDiskOfferingInfo.getMaxIops(), template, vmFinal, owner); } - for (Map.Entry offering : dataDiskOfferingsFinal.entrySet()) { - volumeMgr.allocateRawVolume(Type.DATADISK, "DATA-" + vmFinal.getId(), offering.getKey(), offering.getValue(), vmFinal, template, owner); + if (dataDiskOfferings != null) { + for (DiskOfferingInfo dataDiskOfferingInfo : dataDiskOfferings) { + volumeMgr.allocateRawVolume(Type.DATADISK, "DATA-" + vmFinal.getId(), dataDiskOfferingInfo.getDiskOffering(), dataDiskOfferingInfo.getSize(), + dataDiskOfferingInfo.getMinIops(), dataDiskOfferingInfo.getMaxIops(), vmFinal, template, owner); + } } } }); @@ -439,7 +439,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) throws Insuff @Override public void allocate(String vmInstanceName, VirtualMachineTemplate template, ServiceOffering serviceOffering, LinkedHashMap> networks, DeploymentPlan plan, HypervisorType hyperType) throws InsufficientCapacityException { - allocate(vmInstanceName, template, serviceOffering, new DiskOfferingInfo(serviceOffering), null, networks, plan, hyperType); + allocate(vmInstanceName, template, serviceOffering, new DiskOfferingInfo(serviceOffering), new ArrayList(), networks, plan, hyperType); } private VirtualMachineGuru getVmGuru(VirtualMachine vm) { diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java index fc1b85c080..2b4995466b 100755 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/CloudOrchestrator.java @@ -45,7 +45,6 @@ import com.cloud.network.Network; import com.cloud.network.dao.NetworkDao; import com.cloud.network.dao.NetworkVO; -import com.cloud.offering.DiskOffering; import com.cloud.offering.DiskOfferingInfo; import com.cloud.service.ServiceOfferingVO; import com.cloud.service.dao.ServiceOfferingDao; @@ -181,14 +180,14 @@ public VirtualMachineEntity createVirtualMachine(String id, String owner, String // Else, a disk offering is optional, and if present will be used to create the data disk DiskOfferingInfo rootDiskOfferingInfo = new DiskOfferingInfo(); - LinkedHashMap dataDiskOfferings = new LinkedHashMap(); + List dataDiskOfferings = new ArrayList(); - ServiceOfferingVO offering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); + ServiceOfferingVO computeOffering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); - rootDiskOfferingInfo.setDiskOffering(offering); + rootDiskOfferingInfo.setDiskOffering(computeOffering); rootDiskOfferingInfo.setSize(rootDiskSize); - if (offering.isCustomizedIops() != null && offering.isCustomizedIops()) { + if (computeOffering.isCustomizedIops() != null && computeOffering.isCustomizedIops()) { Map userVmDetails = _userVmDetailsDao.listDetailsKeyPairs(vm.getId()); if (userVmDetails != null) { @@ -213,10 +212,28 @@ public VirtualMachineEntity createVirtualMachine(String id, String owner, String } _volumeMgr.validateVolumeSizeRange(size * 1024 * 1024 * 1024); } - dataDiskOfferings.put(diskOffering, size); + + DiskOfferingInfo dataDiskOfferingInfo = new DiskOfferingInfo(); + + dataDiskOfferingInfo.setDiskOffering(diskOffering); + dataDiskOfferingInfo.setSize(size); + + if (diskOffering.isCustomizedIops() != null && diskOffering.isCustomizedIops()) { + Map userVmDetails = _userVmDetailsDao.listDetailsKeyPairs(vm.getId()); + + if (userVmDetails != null) { + String minIops = userVmDetails.get("minIopsDo"); + String maxIops = userVmDetails.get("maxIopsDo"); + + dataDiskOfferingInfo.setMinIops(minIops != null && minIops.trim().length() > 0 ? Long.parseLong(minIops) : null); + dataDiskOfferingInfo.setMaxIops(maxIops != null && maxIops.trim().length() > 0 ? Long.parseLong(maxIops) : null); + } + } + + dataDiskOfferings.add(dataDiskOfferingInfo); } - _itMgr.allocate(vm.getInstanceName(), _templateDao.findById(new Long(templateId)), offering, rootDiskOfferingInfo, dataDiskOfferings, networkIpMap, plan, + _itMgr.allocate(vm.getInstanceName(), _templateDao.findById(new Long(templateId)), computeOffering, rootDiskOfferingInfo, dataDiskOfferings, networkIpMap, plan, hypervisorType); return vmEntity; @@ -234,13 +251,12 @@ public VirtualMachineEntity createVirtualMachineFromScratch(String id, String ow //load vm instance and offerings and call virtualMachineManagerImpl VMInstanceVO vm = _vmDao.findByUuid(id); - ServiceOfferingVO offering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); + ServiceOfferingVO computeOffering = _serviceOfferingDao.findById(vm.getId(), vm.getServiceOfferingId()); DiskOfferingInfo rootDiskOfferingInfo = new DiskOfferingInfo(); - rootDiskOfferingInfo.setDiskOffering(offering); + rootDiskOfferingInfo.setDiskOffering(computeOffering); - LinkedHashMap dataDiskOfferings = new LinkedHashMap(); Long diskOfferingId = vm.getDiskOfferingId(); if (diskOfferingId == null) { throw new InvalidParameterValueException("Installing from ISO requires a disk offering to be specified for the root disk."); @@ -261,6 +277,18 @@ public VirtualMachineEntity createVirtualMachineFromScratch(String id, String ow rootDiskOfferingInfo.setDiskOffering(diskOffering); rootDiskOfferingInfo.setSize(size); + if (diskOffering.isCustomizedIops() != null && diskOffering.isCustomizedIops()) { + Map userVmDetails = _userVmDetailsDao.listDetailsKeyPairs(vm.getId()); + + if (userVmDetails != null) { + String minIops = userVmDetails.get("minIopsDo"); + String maxIops = userVmDetails.get("maxIopsDo"); + + rootDiskOfferingInfo.setMinIops(minIops != null && minIops.trim().length() > 0 ? Long.parseLong(minIops) : null); + rootDiskOfferingInfo.setMaxIops(maxIops != null && maxIops.trim().length() > 0 ? Long.parseLong(maxIops) : null); + } + } + LinkedHashMap> networkIpMap = new LinkedHashMap>(); for (String uuid : networkNicMap.keySet()) { NetworkVO network = _networkDao.findByUuid(uuid); @@ -271,7 +299,7 @@ public VirtualMachineEntity createVirtualMachineFromScratch(String id, String ow HypervisorType hypervisorType = HypervisorType.valueOf(hypervisor); - _itMgr.allocate(vm.getInstanceName(), _templateDao.findById(new Long(isoId)), offering, rootDiskOfferingInfo, dataDiskOfferings, networkIpMap, plan, hypervisorType); + _itMgr.allocate(vm.getInstanceName(), _templateDao.findById(new Long(isoId)), computeOffering, rootDiskOfferingInfo, new ArrayList(), networkIpMap, plan, hypervisorType); return vmEntity; } diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index f3753a7417..cfa788f087 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -569,14 +569,17 @@ protected DiskProfile toDiskProfile(Volume vol, DiskOffering offering) { } @Override - public DiskProfile allocateRawVolume(Type type, String name, DiskOffering offering, Long size, VirtualMachine vm, VirtualMachineTemplate template, Account owner) { + public DiskProfile allocateRawVolume(Type type, String name, DiskOffering offering, Long size, Long minIops, Long maxIops, VirtualMachine vm, VirtualMachineTemplate template, Account owner) { if (size == null) { size = offering.getDiskSize(); } else { size = (size * 1024 * 1024 * 1024); } - VolumeVO vol = new VolumeVO(type, name, vm.getDataCenterId(), owner.getDomainId(), owner.getId(), offering.getId(), size, offering.getMinIops(), offering.getMaxIops(), - null); + + minIops = minIops != null ? minIops : offering.getMinIops(); + maxIops = maxIops != null ? maxIops : offering.getMaxIops(); + + VolumeVO vol = new VolumeVO(type, name, vm.getDataCenterId(), owner.getDomainId(), owner.getId(), offering.getId(), size, minIops, maxIops, null); if (vm != null) { vol.setInstanceId(vm.getId()); } @@ -1151,7 +1154,7 @@ private Pair recreateVolume(VolumeVO vol, VirtualMachinePro StoragePoolVO storagePool = _storagePoolDao.findById(destPool.getId()); - if (newVol.getVolumeType() == Type.DATADISK && storagePool.isManaged()) { + if (storagePool.isManaged()) { long hostId = vm.getVirtualMachine().getHostId(); Host host = _hostDao.findById(hostId); diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 2b88e03366..b363d11ff8 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -6057,6 +6057,13 @@ label.error { border-radius: 4px; } +.multi-wizard.instance-wizard .section.custom-iops-do { + position: relative; + background: #F4F4F4; + padding: 7px; + border-radius: 4px; +} + .multi-wizard.instance-wizard .section.custom-size input[type=radio] { float: left; } @@ -6073,6 +6080,12 @@ label.error { margin: 6px -1px 0 8px; } +.multi-wizard.instance-wizard .section.custom-iops-do input[type=text] { + float: left; + width: 28px; + margin: 6px -1px 0 8px; +} + .multi-wizard.instance-wizard .section.custom-size label.error { position: absolute; top: 29px; @@ -6080,6 +6093,33 @@ label.error { font-size: 10px; } +.instance-wizard .step.data-disk-offering.custom-iops-do .select-container { + height: 235px; +} + +.instance-wizard .step.data-disk-offering .custom-iops-do { + display: none; +} + +.instance-wizard .step.data-disk-offering.custom-iops-do .custom-iops-do { + display: block; +} + +.instance-wizard .step.data-disk-offering .custom-iops-do .field { + width: 30%; + float: left; + margin-bottom: 13px; +} + +.instance-wizard .step.data-disk-offering .custom-iops-do .field label { + text-indent: 20px; +} + +.instance-wizard .step.data-disk-offering .custom-iops-do .field input { + width: 88%; + margin-left: 26px; +} + /*** Compute offering*/ .instance-wizard .step.service-offering { } diff --git a/ui/index.jsp b/ui/index.jsp index d46c395cd8..f8acc0c4de 100644 --- a/ui/index.jsp +++ b/ui/index.jsp @@ -221,7 +221,7 @@ - +
@@ -259,6 +259,17 @@
+ +
+
+ + +
+
+ + +
+
diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js index 5c04d0e145..03ee344b41 100644 --- a/ui/scripts/instanceWizard.js +++ b/ui/scripts/instanceWizard.js @@ -292,6 +292,9 @@ selectedHypervisor = args.currentData.hypervisorid; } + // if the user is leveraging a template, then we can show custom IOPS, if applicable + var canShowCustomIopsForServiceOffering = (args.currentData["select-template"] != "select-iso" ? true : false); + $.ajax({ url: createURL("listServiceOfferings&issystem=false"), dataType: "json", @@ -299,6 +302,7 @@ success: function(json) { serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering; args.response.success({ + canShowCustomIops: canShowCustomIopsForServiceOffering, customFlag: 'iscustomized', //customFlag: 'offerha', //for testing only customIopsFlag: 'iscustomizediops', @@ -322,6 +326,7 @@ args.response.success({ required: isRequred, customFlag: 'iscustomized', // Field determines if custom slider is shown + customIopsDoFlag: 'iscustomizediops', data: { diskOfferings: diskOfferingObjs } @@ -657,6 +662,20 @@ size : args.data.size }); } + + if (selectedDiskOfferingObj.iscustomizediops == true) { + if (args.$wizard.find('input[name=disk-min-iops-do]').val().length > 0) { + $.extend(deployVmData, { + 'details[0].minIopsDo' : args.$wizard.find('input[name=disk-min-iops-do]').val() + }); + } + + if (args.$wizard.find('input[name=disk-max-iops-do]').val().length > 0) { + $.extend(deployVmData, { + 'details[0].maxIopsDo' : args.$wizard.find('input[name=disk-max-iops-do]').val() + }); + } + } } //step 5: select an affinity group diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index f5f7b10cfa..a2cbab72eb 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -460,7 +460,7 @@ var customIops = item[args.customIopsFlag]; - if (customIops) { + if (customIops && args.canShowCustomIops) { $step.addClass('custom-iops'); } else { $step.removeClass('custom-iops'); @@ -556,6 +556,14 @@ $step.removeClass('custom-disk-size'); } + var customIops = item[args.customIopsDoFlag]; + + if (customIops) { + $step.addClass('custom-iops-do'); + } else { + $step.removeClass('custom-iops-do'); + } + return true; }); From e9e2ee3ac5d396b32fa5e6ee82f4bf4410f5754e Mon Sep 17 00:00:00 2001 From: Marcus Sorensen Date: Fri, 14 Mar 2014 03:40:08 -0600 Subject: [PATCH 008/683] CLOUDSTACK-6181: Merge of resize root feature (resize-root branch) --- .../api/command/user/vm/DeployVMCmd.java | 6 + debian/rules | 2 +- .../orchestration/VolumeOrchestrator.java | 10 +- .../resource/LibvirtComputingResource.java | 6 + .../kvm/storage/KVMStoragePoolManager.java | 12 +- .../kvm/storage/KVMStorageProcessor.java | 29 +- .../kvm/storage/LibvirtStorageAdaptor.java | 31 ++- .../apache/cloudstack/utils/qemu/QemuImg.java | 10 +- .../cloud/storage/VolumeApiServiceImpl.java | 49 ++-- .../src/com/cloud/vm/UserVmManagerImpl.java | 22 +- .../smoke/test_deploy_vm_root_resize.py | 263 ++++++++++++++++++ test/integration/smoke/test_volumes.py | 69 ++++- .../devcloud-kvm-advanced-fusion.cfg | 16 +- tools/devcloud-kvm/devcloud-kvm-advanced.cfg | 3 +- tools/devcloud-kvm/devcloud-kvm.cfg | 3 +- tools/marvin/marvin/integration/lib/base.py | 7 +- 16 files changed, 479 insertions(+), 59 deletions(-) create mode 100644 test/integration/smoke/test_deploy_vm_root_resize.py diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java index 6db99c7e2b..f492789a16 100755 --- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java @@ -121,6 +121,9 @@ public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd { @Parameter(name = ApiConstants.SIZE, type = CommandType.LONG, description = "the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId") private Long size; + @Parameter(name = ApiConstants.ROOT_DISK_SIZE, type = CommandType.LONG, description = "Optional field to resize root disk on deploy. Only applies to template-based deployments. Analogous to details[0].rootdisksize, which takes precedence over this parameter if both are provided") + private Long rootdisksize; + @Parameter(name = ApiConstants.GROUP, type = CommandType.STRING, description = "an optional group for the virtual machine") private String group; @@ -226,6 +229,9 @@ public Map getDetails() { } } } + if (rootdisksize != null && !customparameterMap.containsKey("rootdisksize")) { + customparameterMap.put("rootdisksize", rootdisksize.toString()); + } return customparameterMap; } diff --git a/debian/rules b/debian/rules index 4edf893060..197e243bcf 100755 --- a/debian/rules +++ b/debian/rules @@ -35,7 +35,7 @@ build: build-indep build-indep: build-indep-stamp build-indep-stamp: configure - mvn clean package -Pawsapi -DskipTests -Dsystemvm \ + mvn -T C1.5 clean package -Pawsapi -DskipTests -Dsystemvm \ -Dcs.replace.properties=replace.properties.tmp \ ${ACS_BUILD_OPTS} touch $@ diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index cfa788f087..5921128429 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -612,8 +612,14 @@ public DiskProfile allocateTemplatedVolume(Type type, String name, DiskOffering assert (template.getFormat() != ImageFormat.ISO) : "ISO is not a template really...."; Long size = _tmpltMgr.getTemplateSize(template.getId(), vm.getDataCenterId()); - if (rootDisksize != null) { - size = (rootDisksize * 1024 * 1024 * 1024); + if (rootDisksize != null ) { + rootDisksize = rootDisksize * 1024 * 1024 * 1024; + if (rootDisksize > size) { + s_logger.debug("Using root disk size of " + rootDisksize + " for volume " + name); + size = rootDisksize; + } else { + s_logger.debug("Using root disk size of " + size + " for volume " + name + "since specified root disk size of " + rootDisksize + " is smaller than template"); + } } minIops = minIops != null ? minIops : offering.getMinIops(); diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index ec8bc11037..49f23f5a13 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -1827,6 +1827,12 @@ public Answer execute(ResizeVolumeCommand cmd) { boolean shrinkOk = cmd.getShrinkOk(); StorageFilerTO spool = cmd.getPool(); + if ( currentSize == newSize) { + // nothing to do + s_logger.info("No need to resize volume: current size " + currentSize + " is same as new size " + newSize); + return new ResizeVolumeAnswer(cmd, true, "success", currentSize); + } + try { KVMStoragePool pool = _storagePoolMgr.getStoragePool(spool.getType(), spool.getUuid()); KVMPhysicalDisk vol = pool.getPhysicalDisk(volid); diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java index 9e07e4bea2..583d48af52 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java @@ -302,17 +302,21 @@ public boolean deleteStoragePool(StoragePoolType type, String uuid) { } public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, String name, KVMStoragePool destPool, int timeout) { + return createDiskFromTemplate(template, name, destPool, template.getSize(), timeout); + } + + public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, String name, KVMStoragePool destPool, long size, int timeout) { StorageAdaptor adaptor = getStorageAdaptor(destPool.getType()); // LibvirtStorageAdaptor-specific statement if (destPool.getType() == StoragePoolType.RBD) { - return adaptor.createDiskFromTemplate(template, name, PhysicalDiskFormat.RAW, template.getSize(), destPool, timeout); + return adaptor.createDiskFromTemplate(template, name, PhysicalDiskFormat.RAW, size, destPool, timeout); } else if (destPool.getType() == StoragePoolType.CLVM) { - return adaptor.createDiskFromTemplate(template, name, PhysicalDiskFormat.RAW, template.getSize(), destPool, timeout); + return adaptor.createDiskFromTemplate(template, name, PhysicalDiskFormat.RAW, size, destPool, timeout); } else if (template.getFormat() == PhysicalDiskFormat.DIR) { - return adaptor.createDiskFromTemplate(template, name, PhysicalDiskFormat.DIR, template.getSize(), destPool, timeout); + return adaptor.createDiskFromTemplate(template, name, PhysicalDiskFormat.DIR, size, destPool, timeout); } else { - return adaptor.createDiskFromTemplate(template, name, PhysicalDiskFormat.QCOW2, template.getSize(), destPool, timeout); + return adaptor.createDiskFromTemplate(template, name, PhysicalDiskFormat.QCOW2, size, destPool, timeout); } } diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java index 2ea3b42d0f..98133890be 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/KVMStorageProcessor.java @@ -182,13 +182,14 @@ public Answer copyTemplateToPrimaryStorage(CopyCommand cmd) { break; } } - if (tmplVol == null) { - return new PrimaryStorageDownloadAnswer("Failed to get template from pool: " + secondaryPool.getUuid()); - } } else { tmplVol = secondaryPool.getPhysicalDisk(tmpltname); } + if (tmplVol == null) { + return new PrimaryStorageDownloadAnswer("Failed to get template from pool: " + secondaryPool.getUuid()); + } + /* Copy volume to primary storage */ s_logger.debug("Copying template to primary storage, template format is " + tmplVol.getFormat() ); KVMStoragePool primaryPool = storagePoolMgr.getStoragePool(primaryStore.getPoolType(), primaryStore.getUuid()); @@ -196,6 +197,14 @@ public Answer copyTemplateToPrimaryStorage(CopyCommand cmd) { KVMPhysicalDisk primaryVol = null; if (destData instanceof VolumeObjectTO) { VolumeObjectTO volume = (VolumeObjectTO)destData; + // pass along volume's target size if it's bigger than template's size, for storage types that copy template rather than cloning on deploy + if (volume.getSize() != null && volume.getSize() > tmplVol.getVirtualSize()) { + s_logger.debug("Using configured size of " + volume.getSize()); + tmplVol.setSize(volume.getSize()); + tmplVol.setVirtualSize(volume.getSize()); + } else { + s_logger.debug("Using template's size of " + tmplVol.getVirtualSize()); + } primaryVol = storagePoolMgr.copyPhysicalDisk(tmplVol, volume.getUuid(), primaryPool, cmd.getWaitInMillSeconds()); } else if (destData instanceof TemplateObjectTO) { TemplateObjectTO destTempl = (TemplateObjectTO)destData; @@ -239,7 +248,7 @@ else if (primaryVol.getFormat() == PhysicalDiskFormat.QCOW2) { } // this is much like PrimaryStorageDownloadCommand, but keeping it separate. copies template direct to root disk - private KVMPhysicalDisk templateToPrimaryDownload(String templateUrl, KVMStoragePool primaryPool, String volUuid, int timeout) { + private KVMPhysicalDisk templateToPrimaryDownload(String templateUrl, KVMStoragePool primaryPool, String volUuid, Long size, int timeout) { int index = templateUrl.lastIndexOf("/"); String mountpoint = templateUrl.substring(0, index); String templateName = null; @@ -275,6 +284,14 @@ private KVMPhysicalDisk templateToPrimaryDownload(String templateUrl, KVMStorage /* Copy volume to primary storage */ + if (size > templateVol.getSize()) { + s_logger.debug("Overriding provided template's size with new size " + size); + templateVol.setSize(size); + templateVol.setVirtualSize(size); + } else { + s_logger.debug("Using templates disk size of " + templateVol.getVirtualSize() + "since size passed was " + size); + } + KVMPhysicalDisk primaryVol = storagePoolMgr.copyPhysicalDisk(templateVol, volUuid, primaryPool, timeout); return primaryVol; } catch (CloudRuntimeException e) { @@ -306,14 +323,14 @@ public Answer cloneVolumeFromBaseTemplate(CopyCommand cmd) { if (primaryPool.getType() == StoragePoolType.CLVM) { templatePath = ((NfsTO)imageStore).getUrl() + File.separator + templatePath; - vol = templateToPrimaryDownload(templatePath, primaryPool, volume.getUuid(), cmd.getWaitInMillSeconds()); + vol = templateToPrimaryDownload(templatePath, primaryPool, volume.getUuid(), volume.getSize(), cmd.getWaitInMillSeconds()); } else { if (templatePath.contains("/mnt")) { //upgrade issue, if the path contains path, need to extract the volume uuid from path templatePath = templatePath.substring(templatePath.lastIndexOf(File.separator) + 1); } BaseVol = storagePoolMgr.getPhysicalDisk(primaryStore.getPoolType(), primaryStore.getUuid(), templatePath); - vol = storagePoolMgr.createDiskFromTemplate(BaseVol, volume.getUuid(), BaseVol.getPool(), cmd.getWaitInMillSeconds()); + vol = storagePoolMgr.createDiskFromTemplate(BaseVol, volume.getUuid(), BaseVol.getPool(), volume.getSize(), cmd.getWaitInMillSeconds()); } if (vol == null) { return new CopyCmdAnswer(" Can't create storage volume on storage pool"); diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java index 38ce32b69e..5de8bd26ae 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java @@ -823,11 +823,21 @@ public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, String n } else if (format == PhysicalDiskFormat.QCOW2) { QemuImgFile backingFile = new QemuImgFile(template.getPath(), template.getFormat()); QemuImgFile destFile = new QemuImgFile(disk.getPath()); + if (size > template.getVirtualSize()) { + destFile.setSize(size); + } else { + destFile.setSize(template.getVirtualSize()); + } QemuImg qemu = new QemuImg(timeout); qemu.create(destFile, backingFile); } else if (format == PhysicalDiskFormat.RAW) { QemuImgFile sourceFile = new QemuImgFile(template.getPath(), template.getFormat()); QemuImgFile destFile = new QemuImgFile(disk.getPath(), PhysicalDiskFormat.RAW); + if (size > template.getVirtualSize()) { + destFile.setSize(size); + } else { + destFile.setSize(template.getVirtualSize()); + } QemuImg qemu = new QemuImg(timeout); qemu.convert(sourceFile, destFile); } @@ -835,8 +845,14 @@ public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, String n format = PhysicalDiskFormat.RAW; disk = new KVMPhysicalDisk(destPool.getSourceDir() + "/" + newUuid, newUuid, destPool); disk.setFormat(format); - disk.setSize(template.getVirtualSize()); - disk.setVirtualSize(disk.getSize()); + if (size > template.getVirtualSize()) { + disk.setSize(size); + disk.setVirtualSize(size); + } else { + // leave these as they were if size isn't applicable + disk.setSize(template.getVirtualSize()); + disk.setVirtualSize(disk.getSize()); + } QemuImg qemu = new QemuImg(timeout); QemuImgFile srcFile; @@ -844,6 +860,11 @@ public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, String n new QemuImgFile(KVMPhysicalDisk.RBDStringBuilder(destPool.getSourceHost(), destPool.getSourcePort(), destPool.getAuthUserName(), destPool.getAuthSecret(), disk.getPath())); destFile.setFormat(format); + if (size > template.getVirtualSize()) { + destFile.setSize(size); + } else { + destFile.setSize(template.getVirtualSize()); + } if (srcPool.getType() != StoragePoolType.RBD) { srcFile = new QemuImgFile(template.getPath(), template.getFormat()); @@ -877,9 +898,9 @@ public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, String n if (srcImage.isOldFormat()) { /* The source image is RBD format 1, we have to do a regular copy */ s_logger.debug("The source image " + srcPool.getSourceDir() + "/" + template.getName() + - " is RBD format 1. We have to perform a regular copy (" + template.getVirtualSize() + " bytes)"); + " is RBD format 1. We have to perform a regular copy (" + disk.getVirtualSize() + " bytes)"); - rbd.create(disk.getName(), template.getVirtualSize(), rbdFeatures, rbdOrder); + rbd.create(disk.getName(), disk.getVirtualSize(), rbdFeatures, rbdOrder); RbdImage destImage = rbd.open(disk.getName()); s_logger.debug("Starting to copy " + srcImage.getName() + " to " + destImage.getName() + " in Ceph pool " + srcPool.getSourceDir()); @@ -923,7 +944,7 @@ public KVMPhysicalDisk createDiskFromTemplate(KVMPhysicalDisk template, String n s_logger.debug("Creating " + disk.getName() + " on the destination cluster " + rDest.confGet("mon_host") + " in pool " + destPool.getSourceDir()); - dRbd.create(disk.getName(), template.getVirtualSize(), rbdFeatures, rbdOrder); + dRbd.create(disk.getName(), disk.getVirtualSize(), rbdFeatures, rbdOrder); RbdImage srcImage = sRbd.open(template.getName()); RbdImage destImage = dRbd.open(disk.getName()); diff --git a/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java b/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java index b380815d04..4bec37535e 100644 --- a/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java +++ b/plugins/hypervisors/kvm/src/org/apache/cloudstack/utils/qemu/QemuImg.java @@ -111,10 +111,12 @@ public void create(QemuImgFile file, QemuImgFile backingFile, Map> 30) + 2 + self.virtual_machine = VirtualMachine.create( + self.apiclient, + self.testdata["virtual_machine"], + accountid=self.account.name, + zoneid=self.zone.id, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + rootdisksize=newrootsize + ) + + list_vms = VirtualMachine.list(self.apiclient, id=self.virtual_machine.id) + + self.debug( + "Verify listVirtualMachines response for virtual machine: %s"\ + % self.virtual_machine.id + ) + + self.assertEqual( + isinstance(list_vms, list), + True, + "List VM response was not a valid list" + ) + self.assertNotEqual( + len(list_vms), + 0, + "List VM response was empty" + ) + + vm = list_vms[0] + self.assertEqual( + vm.id, + self.virtual_machine.id, + "Virtual Machine ids do not match" + ) + self.assertEqual( + vm.name, + self.virtual_machine.name, + "Virtual Machine names do not match" + ) + self.assertEqual( + vm.state, + "Running", + msg="VM is not in Running state" + ) + + # get root vol from created vm, verify it is correct size + list_volume_response = list_volumes( + self.apiclient, + virtualmachineid=self.virtual_machine.id, + type='ROOT', + listall=True + ) + + rootvolume = list_volume_response[0] + success = False + if rootvolume is not None and rootvolume.size == (newrootsize << 30): + success = True + + self.assertEqual( + success, + True, + "Check if the root volume resized appropriately" + ) + else: + self.debug("hypervisor %s unsupported for test 00, verifying it errors properly" % self.apiclient.hypervisor) + + newrootsize = (self.template.size >> 30) + 2 + success = False + try: + self.virtual_machine = VirtualMachine.create( + self.apiclient, + self.testdata["virtual_machine"], + accountid=self.account.name, + zoneid=self.zone.id, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + rootdisksize=newrootsize + ) + except Exception as ex: + if "Hypervisor XenServer does not support rootdisksize override" in str(ex): + success = True + else: + self.debug("virtual machine create did not fail appropriately. Error was actually : " + str(ex)); + + self.assertEqual(success, True, "Check if unsupported hypervisor %s fails appropriately" % self.apiclient.hypervisor) + + @attr(tags = ['advanced', 'simulator', 'basic', 'sg']) + def test_01_deploy_vm_root_resize(self): + """Test proper failure to deploy virtual machine with rootdisksize of 0 + """ + if (self.apiclient.hypervisor == 'kvm'): + newrootsize = 0 + success = False + try: + self.virtual_machine = VirtualMachine.create( + self.apiclient, + self.testdata["virtual_machine"], + accountid=self.account.name, + zoneid=self.zone.id, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + rootdisksize=newrootsize + ) + except Exception as ex: + if "rootdisk size should be a non zero number" in str(ex): + success = True + else: + self.debug("virtual machine create did not fail appropriately. Error was actually : " + str(ex)); + + self.assertEqual(success, True, "Check if passing 0 as rootdisksize fails appropriately") + else: + self.debug("test 01 does not support hypervisor type " + self.apiclient.hypervisor); + + @attr(tags = ['advanced', 'simulator', 'basic', 'sg']) + def test_02_deploy_vm_root_resize(self): + """Test proper failure to deploy virtual machine with rootdisksize less than template size + """ + if (self.apiclient.hypervisor == 'kvm'): + newrootsize = (self.template.size >> 30) - 1 + + self.assertEqual(newrootsize > 0, True, "Provided template is less than 1G in size, cannot run test") + + success = False + try: + self.virtual_machine = VirtualMachine.create( + self.apiclient, + self.testdata["virtual_machine"], + accountid=self.account.name, + zoneid=self.zone.id, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + templateid=self.template.id, + rootdisksize=newrootsize + ) + except Exception as ex: + if "rootdisksize override is smaller than template size" in str(ex): + success = True + else: + self.debug("virtual machine create did not fail appropriately. Error was actually : " + str(ex)); + + self.assertEqual(success, True, "Check if passing rootdisksize < templatesize fails appropriately") + else: + self.debug("test 01 does not support hypervisor type " + self.apiclient.hypervisor); + + def tearDown(self): + try: + cleanup_resources(self.apiclient, self.cleanup) + except Exception as e: + self.debug("Warning! Exception in tearDown: %s" % e) diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index 8f41803638..719c824b73 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -571,6 +571,31 @@ def test_07_resize_fail(self): success, True, "ResizeVolume - verify disk offering is handled appropriately") + + # try to resize a root disk with a disk offering, root can only be resized by size= + # get root vol from created vm + list_volume_response = list_volumes( + self.apiClient, + virtualmachineid=self.virtual_machine.id, + type='ROOT', + listall=True + ) + + rootvolume = list_volume_response[0] + + cmd.id = rootvolume.id + cmd.diskofferingid = self.services['diskofferingid'] + success = False + try: + response = self.apiClient.resizeVolume(cmd) + except Exception as ex: + if "Can only resize Data volumes" in str(ex): + success = True + self.assertEqual( + success, + True, + "ResizeVolume - verify root disks cannot be resized by disk offering id") + # Ok, now let's try and resize a volume that is not custom. cmd.id = self.volume.id cmd.diskofferingid = self.services['diskofferingid'] @@ -647,6 +672,7 @@ def test_08_resize_volume(self): elif hosts[0].hypervisor.lower() == "vmware": self.skipTest("Resize Volume is unsupported on VmWare") + # resize the data disk self.debug("Resize Volume ID: %s" % self.volume.id) cmd = resizeVolume.resizeVolumeCmd() @@ -675,7 +701,48 @@ def test_08_resize_volume(self): self.assertEqual( success, True, - "Check if the volume resized appropriately" + "Check if the data volume resized appropriately" + ) + + # resize the root disk + self.debug("Resize Root for : %s" % self.virtual_machine.id) + + # get root vol from created vm + list_volume_response = list_volumes( + self.apiClient, + virtualmachineid=self.virtual_machine.id, + type='ROOT', + listall=True + ) + + rootvolume = list_volume_response[0] + + cmd = resizeVolume.resizeVolumeCmd() + cmd.id = rootvolume.id + cmd.size = 10 + + self.apiClient.resizeVolume(cmd) + + count = 0 + success = False + while count < 3: + list_volume_response = list_volumes( + self.apiClient, + id=rootvolume.id + ) + for vol in list_volume_response: + if vol.id == rootvolume.id and vol.size == 10737418240L and vol.state == 'Ready': + success = True + if success: + break + else: + time.sleep(10) + count += 1 + + self.assertEqual( + success, + True, + "Check if the root volume resized appropriately" ) #start the vm if it is on xenserver diff --git a/tools/devcloud-kvm/devcloud-kvm-advanced-fusion.cfg b/tools/devcloud-kvm/devcloud-kvm-advanced-fusion.cfg index 53e1a441b2..2084417cbe 100644 --- a/tools/devcloud-kvm/devcloud-kvm-advanced-fusion.cfg +++ b/tools/devcloud-kvm/devcloud-kvm-advanced-fusion.cfg @@ -120,20 +120,14 @@ "port": 3306, "user": "cloud" }, - "logger": [ - { - "name": "TestClient", - "file": "/var/log/testclient.log" - }, - { - "name": "TestCase", - "file": "/var/log/testcase.log" - } - ], + "logger": { + "LogFolderPath": "/tmp/" + }, "mgtSvr": [ { "mgtSvrIp": "172.17.10.10", - "port": 8096 + "port": 8096, + "hypervisor": "kvm" } ] } diff --git a/tools/devcloud-kvm/devcloud-kvm-advanced.cfg b/tools/devcloud-kvm/devcloud-kvm-advanced.cfg index 53e1a441b2..74c36b718d 100644 --- a/tools/devcloud-kvm/devcloud-kvm-advanced.cfg +++ b/tools/devcloud-kvm/devcloud-kvm-advanced.cfg @@ -133,7 +133,8 @@ "mgtSvr": [ { "mgtSvrIp": "172.17.10.10", - "port": 8096 + "port": 8096, + "hypervisor": "kvm" } ] } diff --git a/tools/devcloud-kvm/devcloud-kvm.cfg b/tools/devcloud-kvm/devcloud-kvm.cfg index 3122e5a979..ab7f9a5276 100644 --- a/tools/devcloud-kvm/devcloud-kvm.cfg +++ b/tools/devcloud-kvm/devcloud-kvm.cfg @@ -104,7 +104,8 @@ "mgtSvr": [ { "mgtSvrIp": "127.0.0.1", - "port": 8096 + "port": 8096, + "hypervisor": "kvm" } ], "dbSvr": diff --git a/tools/marvin/marvin/integration/lib/base.py b/tools/marvin/marvin/integration/lib/base.py index b7e2be4755..ca9f2b440d 100755 --- a/tools/marvin/marvin/integration/lib/base.py +++ b/tools/marvin/marvin/integration/lib/base.py @@ -325,7 +325,7 @@ def create(cls, apiclient, services, templateid=None, accountid=None, securitygroupids=None, projectid=None, startvm=None, diskofferingid=None, affinitygroupnames=None, affinitygroupids=None, group=None, hostid=None, keypair=None, ipaddress=None, mode='default', method='GET', - customcpunumber=None, customcpuspeed=None, custommemory=None): + customcpunumber=None, customcpuspeed=None, custommemory=None, rootdisksize=None): """Create the instance""" cmd = deployVirtualMachine.deployVirtualMachineCmd() @@ -413,7 +413,7 @@ def create(cls, apiclient, services, templateid=None, accountid=None, if "userdata" in services: cmd.userdata = base64.urlsafe_b64encode(services["userdata"]) - cmd.details = [{"cpuNumber": "","cpuSpeed":"","memory":""}] + cmd.details = [{"cpuNumber": "","cpuSpeed":"","memory":"","rootdisksize":""}] if customcpunumber: cmd.details[0]["cpuNumber"] = customcpunumber @@ -424,6 +424,9 @@ def create(cls, apiclient, services, templateid=None, accountid=None, if custommemory: cmd.details[0]["memory"] = custommemory + if rootdisksize: + cmd.details[0]["rootdisksize"] = rootdisksize + if group: cmd.group = group From 831f51318898f7588bba95650e10975a140c2686 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 17 Mar 2014 15:41:48 -0700 Subject: [PATCH 009/683] CLOUDSTACK-6246: UI > Infrastructure > SSL Certificate > update (1) mouse-over hint of SSL Certificate button. (2) description in SSL Certificate dialog. --- client/WEB-INF/classes/resources/messages.properties | 2 +- ui/index.jsp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index c46361a12e..8329325ba4 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -1780,7 +1780,7 @@ message.tooltip.reserved.system.netmask=The network prefix that defines the pod message.tooltip.zone.name=A name for the zone. message.update.os.preference=Please choose a OS preference for this host. All virtual instances with similar preferences will be first allocated to this host before choosing another. message.update.resource.count=Please confirm that you want to update resource counts for this account. -message.update.ssl=Please submit a new X.509 compliant SSL certificate to be updated to each console proxy virtual instance\: +message.update.ssl=Please submit a new X.509 compliant SSL certificate to be updated to each console proxy and secondary storage virtual instance\: message.validate.instance.name=Instance name can not be longer than 63 characters. Only ASCII letters a~z, A~Z, digits 0~9, hyphen are allowed. Must start with a letter and end with a letter or a digit. message.virtual.network.desc=A dedicated virtualized network for your account. The broadcast domain is contained within a VLAN and all public network access is routed out by a virtual router. message.vm.create.template.confirm=Create Template will reboot the VM automatically. diff --git a/ui/index.jsp b/ui/index.jsp index f8acc0c4de..adbc696af8 100644 --- a/ui/index.jsp +++ b/ui/index.jsp @@ -1076,7 +1076,7 @@
-
+
 
From ae6b9a0829b54d13039631bb1c17a9276a6e60d3 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Mon, 17 Mar 2014 15:39:08 -0700 Subject: [PATCH 010/683] Remove IAMEntityType to use existing VO interface class to annotate entityType. --- api/src/com/cloud/network/NetworkProfile.java | 6 +- .../cloud/network/vpc/StaticRouteProfile.java | 5 +- .../cloudstack/acl/ControlledEntity.java | 2 +- .../apache/cloudstack/acl/IAMEntityType.java | 61 ------ .../org/apache/cloudstack/api/APICommand.java | 3 +- .../admin/account/CreateAccountCmd.java | 3 +- .../admin/account/DeleteAccountCmd.java | 3 +- .../admin/account/DisableAccountCmd.java | 3 +- .../admin/account/EnableAccountCmd.java | 3 +- .../command/admin/account/LockAccountCmd.java | 3 +- .../admin/account/UpdateAccountCmd.java | 3 +- .../internallb/ListInternalLBVMsCmd.java | 4 +- .../internallb/StartInternalLBVMCmd.java | 4 +- .../admin/internallb/StopInternalLBVMCmd.java | 4 +- .../admin/router/DestroyRouterCmd.java | 4 +- .../command/admin/router/ListRoutersCmd.java | 4 +- .../command/admin/router/RebootRouterCmd.java | 4 +- .../command/admin/router/StartRouterCmd.java | 4 +- .../command/admin/router/StopRouterCmd.java | 4 +- .../admin/router/UpgradeRouterCmd.java | 4 +- .../admin/systemvm/DestroySystemVmCmd.java | 3 +- .../admin/systemvm/ListSystemVMsCmd.java | 3 +- .../admin/systemvm/MigrateSystemVMCmd.java | 3 +- .../admin/systemvm/RebootSystemVmCmd.java | 3 +- .../admin/systemvm/ScaleSystemVMCmd.java | 3 +- .../admin/systemvm/StartSystemVMCmd.java | 3 +- .../admin/systemvm/StopSystemVmCmd.java | 3 +- .../admin/systemvm/UpgradeSystemVMCmd.java | 3 +- .../template/ListTemplatesCmdByAdmin.java | 5 +- .../admin/template/PrepareTemplateCmd.java | 3 +- .../api/command/admin/vm/AssignVMCmd.java | 4 +- .../api/command/admin/vm/ExpungeVMCmd.java | 4 +- .../api/command/admin/vm/MigrateVMCmd.java | 3 +- .../MigrateVirtualMachineWithVolumeCmd.java | 3 +- .../api/command/admin/vm/RecoverVMCmd.java | 4 +- .../admin/vpc/CreatePrivateGatewayCmd.java | 4 +- .../admin/vpc/DeletePrivateGatewayCmd.java | 3 +- .../command/user/account/ListAccountsCmd.java | 5 +- .../affinitygroup/CreateAffinityGroupCmd.java | 3 +- .../affinitygroup/DeleteAffinityGroupCmd.java | 4 +- .../affinitygroup/ListAffinityGroupsCmd.java | 4 +- .../UpdateVMAffinityGroupCmd.java | 4 +- .../autoscale/CreateAutoScalePolicyCmd.java | 3 +- .../autoscale/CreateAutoScaleVmGroupCmd.java | 3 +- .../CreateAutoScaleVmProfileCmd.java | 3 +- .../user/autoscale/CreateConditionCmd.java | 3 +- .../autoscale/DeleteAutoScalePolicyCmd.java | 3 +- .../autoscale/DeleteAutoScaleVmGroupCmd.java | 3 +- .../DeleteAutoScaleVmProfileCmd.java | 3 +- .../user/autoscale/DeleteConditionCmd.java | 3 +- .../autoscale/DisableAutoScaleVmGroupCmd.java | 3 +- .../autoscale/EnableAutoScaleVmGroupCmd.java | 3 +- .../autoscale/ListAutoScalePoliciesCmd.java | 3 +- .../autoscale/ListAutoScaleVmGroupsCmd.java | 3 +- .../autoscale/ListAutoScaleVmProfilesCmd.java | 3 +- .../autoscale/UpdateAutoScalePolicyCmd.java | 3 +- .../autoscale/UpdateAutoScaleVmGroupCmd.java | 3 +- .../UpdateAutoScaleVmProfileCmd.java | 3 +- .../command/user/event/ArchiveEventsCmd.java | 4 +- .../command/user/event/DeleteEventsCmd.java | 4 +- .../api/command/user/event/ListEventsCmd.java | 5 +- .../firewall/CreateEgressFirewallRuleCmd.java | 7 +- .../user/firewall/CreateFirewallRuleCmd.java | 7 +- .../firewall/CreatePortForwardingRuleCmd.java | 8 +- .../firewall/DeleteEgressFirewallRuleCmd.java | 3 +- .../user/firewall/DeleteFirewallRuleCmd.java | 3 +- .../firewall/DeletePortForwardingRuleCmd.java | 3 +- .../firewall/ListEgressFirewallRulesCmd.java | 3 +- .../user/firewall/ListFirewallRulesCmd.java | 3 +- .../firewall/ListPortForwardingRulesCmd.java | 3 +- .../firewall/UpdatePortForwardingRuleCmd.java | 3 +- .../user/nat/CreateIpForwardingRuleCmd.java | 5 +- .../user/network/CreateNetworkCmd.java | 3 +- .../user/network/DeleteNetworkCmd.java | 3 +- .../command/user/network/ListNetworksCmd.java | 3 +- .../user/network/RestartNetworkCmd.java | 3 +- .../user/network/UpdateNetworkCmd.java | 3 +- .../AuthorizeSecurityGroupEgressCmd.java | 4 +- .../AuthorizeSecurityGroupIngressCmd.java | 4 +- .../securitygroup/CreateSecurityGroupCmd.java | 3 +- .../securitygroup/DeleteSecurityGroupCmd.java | 4 +- .../securitygroup/ListSecurityGroupsCmd.java | 5 +- .../RevokeSecurityGroupEgressCmd.java | 3 +- .../RevokeSecurityGroupIngressCmd.java | 3 +- .../user/snapshot/CreateSnapshotCmd.java | 3 +- .../user/snapshot/DeleteSnapshotCmd.java | 3 +- .../user/snapshot/ListSnapshotsCmd.java | 3 +- .../user/snapshot/RevertSnapshotCmd.java | 3 +- .../command/user/ssh/CreateSSHKeyPairCmd.java | 3 +- .../command/user/ssh/DeleteSSHKeyPairCmd.java | 4 +- .../command/user/ssh/ListSSHKeyPairsCmd.java | 3 +- .../user/ssh/RegisterSSHKeyPairCmd.java | 3 +- .../api/command/user/tag/CreateTagsCmd.java | 3 +- .../api/command/user/tag/DeleteTagsCmd.java | 4 +- .../api/command/user/tag/ListTagsCmd.java | 5 +- .../user/template/ListTemplatesCmd.java | 4 +- .../UpdateTemplatePermissionsCmd.java | 3 +- .../api/command/user/vm/AddNicToVMCmd.java | 4 +- .../api/command/user/vm/DeployVMCmd.java | 4 +- .../api/command/user/vm/DestroyVMCmd.java | 7 +- .../api/command/user/vm/GetVMPasswordCmd.java | 4 +- .../api/command/user/vm/ListVMsCmd.java | 4 +- .../api/command/user/vm/RebootVMCmd.java | 7 +- .../command/user/vm/RemoveNicFromVMCmd.java | 4 +- .../command/user/vm/ResetVMPasswordCmd.java | 7 +- .../api/command/user/vm/ResetVMSSHKeyCmd.java | 7 +- .../api/command/user/vm/RestoreVMCmd.java | 6 +- .../api/command/user/vm/ScaleVMCmd.java | 5 +- .../api/command/user/vm/StartVMCmd.java | 4 +- .../api/command/user/vm/StopVMCmd.java | 7 +- .../user/vm/UpdateDefaultNicForVMCmd.java | 4 +- .../api/command/user/vm/UpdateVMCmd.java | 4 +- .../api/command/user/vm/UpgradeVMCmd.java | 4 +- .../user/vmgroup/CreateVMGroupCmd.java | 3 +- .../user/vmgroup/DeleteVMGroupCmd.java | 3 +- .../command/user/vmgroup/ListVMGroupsCmd.java | 5 +- .../user/vmgroup/UpdateVMGroupCmd.java | 3 +- .../user/vmsnapshot/CreateVMSnapshotCmd.java | 3 +- .../user/vmsnapshot/DeleteVMSnapshotCmd.java | 3 +- .../user/vmsnapshot/ListVMSnapshotCmd.java | 3 +- .../command/user/volume/AttachVolumeCmd.java | 4 +- .../command/user/volume/CreateVolumeCmd.java | 3 +- .../command/user/volume/DeleteVolumeCmd.java | 3 +- .../command/user/volume/DetachVolumeCmd.java | 6 +- .../command/user/volume/ExtractVolumeCmd.java | 6 +- .../command/user/volume/ListVolumesCmd.java | 5 +- .../command/user/volume/MigrateVolumeCmd.java | 3 +- .../command/user/volume/ResizeVolumeCmd.java | 3 +- .../command/user/volume/UpdateVolumeCmd.java | 3 +- .../command/user/volume/UploadVolumeCmd.java | 3 +- .../user/vpc/CreateStaticRouteCmd.java | 3 +- .../api/command/user/vpc/CreateVPCCmd.java | 3 +- .../user/vpc/DeleteStaticRouteCmd.java | 3 +- .../api/command/user/vpc/DeleteVPCCmd.java | 3 +- .../user/vpc/ListPrivateGatewaysCmd.java | 4 +- .../command/user/vpc/ListStaticRoutesCmd.java | 3 +- .../api/command/user/vpc/ListVPCsCmd.java | 3 +- .../api/command/user/vpc/RestartVPCCmd.java | 3 +- .../api/command/user/vpc/UpdateVPCCmd.java | 3 +- .../api/command/user/vpn/AddVpnUserCmd.java | 3 +- .../user/vpn/CreateRemoteAccessVpnCmd.java | 3 +- .../user/vpn/CreateVpnConnectionCmd.java | 3 +- .../user/vpn/CreateVpnCustomerGatewayCmd.java | 3 +- .../command/user/vpn/CreateVpnGatewayCmd.java | 3 +- .../user/vpn/DeleteRemoteAccessVpnCmd.java | 3 +- .../user/vpn/DeleteVpnConnectionCmd.java | 3 +- .../user/vpn/DeleteVpnCustomerGatewayCmd.java | 3 +- .../command/user/vpn/DeleteVpnGatewayCmd.java | 3 +- .../user/vpn/ListRemoteAccessVpnsCmd.java | 3 +- .../user/vpn/ListVpnConnectionsCmd.java | 3 +- .../user/vpn/ListVpnCustomerGatewaysCmd.java | 3 +- .../command/user/vpn/ListVpnGatewaysCmd.java | 3 +- .../api/command/user/vpn/ListVpnUsersCmd.java | 3 +- .../command/user/vpn/RemoveVpnUserCmd.java | 4 +- .../user/vpn/ResetVpnConnectionCmd.java | 3 +- .../user/vpn/UpdateVpnCustomerGatewayCmd.java | 3 +- .../src/com/cloud/network/addr/PublicIp.java | 6 +- .../network/rules/StaticNatRuleImpl.java | 6 +- .../orchestration/NetworkOrchestrator.java | 5 +- .../schema/src/com/cloud/event/EventVO.java | 6 +- .../com/cloud/network/UserIpv6AddressVO.java | 6 +- .../src/com/cloud/network/VpnUserVO.java | 6 +- .../cloud/network/as/AutoScalePolicyVO.java | 5 +- .../cloud/network/as/AutoScaleVmGroupVO.java | 5 +- .../network/as/AutoScaleVmProfileVO.java | 5 +- .../src/com/cloud/network/as/ConditionVO.java | 5 +- .../com/cloud/network/dao/IPAddressVO.java | 6 +- .../network/dao/MonitoringServiceVO.java | 6 +- .../src/com/cloud/network/dao/NetworkVO.java | 5 +- .../cloud/network/dao/RemoteAccessVpnVO.java | 6 +- .../dao/Site2SiteCustomerGatewayVO.java | 6 +- .../network/dao/Site2SiteVpnConnectionVO.java | 5 +- .../network/dao/Site2SiteVpnGatewayVO.java | 6 +- .../src/com/cloud/network/dao/SslCertVO.java | 6 +- .../cloud/network/rules/FirewallRuleVO.java | 6 +- .../network/security/SecurityGroupVO.java | 6 +- .../com/cloud/network/vpc/StaticRouteVO.java | 6 +- .../com/cloud/network/vpc/VpcGatewayVO.java | 6 +- .../src/com/cloud/network/vpc/VpcVO.java | 10 +- .../cloud/projects/ProjectInvitationVO.java | 6 +- .../src/com/cloud/storage/SnapshotVO.java | 6 +- .../src/com/cloud/storage/VMTemplateVO.java | 6 +- .../src/com/cloud/storage/VolumeVO.java | 6 +- .../src/com/cloud/tags/ResourceTagVO.java | 6 +- .../schema/src/com/cloud/user/AccountVO.java | 6 +- .../src/com/cloud/user/SSHKeyPairVO.java | 6 +- .../src/com/cloud/vm/InstanceGroupVO.java | 6 +- .../schema/src/com/cloud/vm/VMInstanceVO.java | 6 +- .../src/com/cloud/vm/dao/NicIpAliasVO.java | 6 +- .../com/cloud/vm/dao/NicSecondaryIpVO.java | 6 +- .../com/cloud/vm/snapshot/VMSnapshotVO.java | 5 +- .../cloudstack/affinity/AffinityGroupVO.java | 5 +- .../cloud/entity/api/db/VMEntityVO.java | 6 +- .../region/gslb/GlobalLoadBalancerRuleVO.java | 6 +- .../storage/image/store/TemplateObject.java | 9 +- .../storage/snapshot/SnapshotObject.java | 5 +- .../storage/image/TemplateEntityImpl.java | 6 +- .../storage/snapshot/SnapshotEntityImpl.java | 6 +- .../storage/volume/VolumeObject.java | 5 +- .../api/query/vo/AffinityGroupJoinVO.java | 6 +- .../cloud/api/query/vo/AsyncJobJoinVO.java | 6 +- .../api/query/vo/DomainRouterJoinVO.java | 7 +- .../com/cloud/api/query/vo/EventJoinVO.java | 7 +- .../api/query/vo/InstanceGroupJoinVO.java | 7 +- .../api/query/vo/ProjectInvitationJoinVO.java | 7 +- .../cloud/api/query/vo/ResourceTagJoinVO.java | 7 +- .../api/query/vo/SecurityGroupJoinVO.java | 7 +- .../cloud/api/query/vo/TemplateJoinVO.java | 6 +- .../com/cloud/api/query/vo/UserVmJoinVO.java | 6 +- .../com/cloud/api/query/vo/VolumeJoinVO.java | 6 +- .../response/SecurityGroupResultObject.java | 5 +- .../network/vpc/PrivateGatewayProfile.java | 5 +- .../template/HypervisorTemplateAdapter.java | 3 +- .../cloud/template/TemplateManagerImpl.java | 5 +- .../affinity/AffinityGroupServiceImpl.java | 5 +- .../response/iam/IAMPermissionResponse.java | 7 +- .../cloudstack/iam/IAMApiServiceImpl.java | 187 +++++++++--------- .../iam/RoleBasedAPIAccessChecker.java | 13 +- .../iam/RoleBasedEntityAccessChecker.java | 2 +- .../iam/test/IAMApiServiceTest.java | 10 +- 220 files changed, 479 insertions(+), 715 deletions(-) delete mode 100644 api/src/org/apache/cloudstack/acl/IAMEntityType.java diff --git a/api/src/com/cloud/network/NetworkProfile.java b/api/src/com/cloud/network/NetworkProfile.java index 390ec25cf6..db3cba56e1 100644 --- a/api/src/com/cloud/network/NetworkProfile.java +++ b/api/src/com/cloud/network/NetworkProfile.java @@ -18,8 +18,6 @@ import java.net.URI; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.network.Networks.BroadcastDomainType; import com.cloud.network.Networks.Mode; import com.cloud.network.Networks.TrafficType; @@ -281,8 +279,8 @@ public String getIp6Cidr() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Network; + public Class getEntityType() { + return Network.class; } @Override diff --git a/api/src/com/cloud/network/vpc/StaticRouteProfile.java b/api/src/com/cloud/network/vpc/StaticRouteProfile.java index b5bd5f7af5..737541f0a4 100644 --- a/api/src/com/cloud/network/vpc/StaticRouteProfile.java +++ b/api/src/com/cloud/network/vpc/StaticRouteProfile.java @@ -16,7 +16,6 @@ // under the License. package com.cloud.network.vpc; -import org.apache.cloudstack.acl.IAMEntityType; public class StaticRouteProfile implements StaticRoute { private long id; @@ -104,7 +103,7 @@ public String getNetmask() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.StaticRoute; + public Class getEntityType() { + return StaticRoute.class; } } diff --git a/api/src/org/apache/cloudstack/acl/ControlledEntity.java b/api/src/org/apache/cloudstack/acl/ControlledEntity.java index 2572705daa..b8a244f3bd 100644 --- a/api/src/org/apache/cloudstack/acl/ControlledEntity.java +++ b/api/src/org/apache/cloudstack/acl/ControlledEntity.java @@ -29,5 +29,5 @@ public enum ACLType { Account, Domain } - IAMEntityType getEntityType(); + Class getEntityType(); } diff --git a/api/src/org/apache/cloudstack/acl/IAMEntityType.java b/api/src/org/apache/cloudstack/acl/IAMEntityType.java deleted file mode 100644 index c1703ea5c3..0000000000 --- a/api/src/org/apache/cloudstack/acl/IAMEntityType.java +++ /dev/null @@ -1,61 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package org.apache.cloudstack.acl; - -public enum IAMEntityType { - // currently supported entity, to be added one by one after we support acl on the entity - VirtualMachine, - Volume, - ResourceTag, - Account, - AffinityGroup, - AutoScalePolicy, - AutoScaleVmGroup, - AutoScaleVmProfile, - Condition, - Vpc, - VpcGateway, - PrivateGateway, - VpnUser, - VMSnapshot, - VirtualMachineTemplate, - UserIpv6Address, - StaticRoute, - SSHKeyPair, - Snapshot, - Site2SiteVpnGateway, - Site2SiteVpnConnection, - Site2SiteCustomerGateway, - SecurityGroup, - RemoteAccessVpn, - PublicIpAddress, - ProjectInvitation, - NicSecondaryIp, - NicIpAlias, - Network, - IpAddress, - InstanceGroup, - GlobalLoadBalancerRule, - FirewallRule, - PortForwardingRule, - Event, - AsyncJob, - IAMPolicy, - IAMGroup, - MonitorService, - SSLCert -} diff --git a/api/src/org/apache/cloudstack/api/APICommand.java b/api/src/org/apache/cloudstack/api/APICommand.java index 9b4dfafdb6..d451e4b10a 100644 --- a/api/src/org/apache/cloudstack/api/APICommand.java +++ b/api/src/org/apache/cloudstack/api/APICommand.java @@ -22,7 +22,6 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.ResponseObject.ResponseView; @@ -49,5 +48,5 @@ RoleType[] authorized() default {}; - IAMEntityType[] entityType() default {}; + Class[] entityType() default {}; } diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java index 0c46d501bd..50d67d993d 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/account/CreateAccountCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -37,7 +36,7 @@ import com.cloud.user.UserAccount; -@APICommand(name = "createAccount", description = "Creates an account", responseObject = AccountResponse.class, entityType = {IAMEntityType.Account}, +@APICommand(name = "createAccount", description = "Creates an account", responseObject = AccountResponse.class, entityType = {Account.class}, requestHasSensitiveInfo = true, responseHasSensitiveInfo = true) public class CreateAccountCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(CreateAccountCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java index 8cc87c2884..5754ec5010 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/account/DeleteAccountCmd.java @@ -20,7 +20,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -39,7 +38,7 @@ import com.cloud.user.Account; import com.cloud.user.User; -@APICommand(name = "deleteAccount", description = "Deletes a account, and all users associated with this account", responseObject = SuccessResponse.class, entityType = {IAMEntityType.Account}, +@APICommand(name = "deleteAccount", description = "Deletes a account, and all users associated with this account", responseObject = SuccessResponse.class, entityType = {Account.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteAccountCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteAccountCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java index 1e810091ee..3e5e1d3d01 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/account/DisableAccountCmd.java @@ -20,7 +20,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -41,7 +40,7 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.user.Account; -@APICommand(name = "disableAccount", description = "Disables an account", responseObject = AccountResponse.class, entityType = {IAMEntityType.Account}, +@APICommand(name = "disableAccount", description = "Disables an account", responseObject = AccountResponse.class, entityType = {Account.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class DisableAccountCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DisableAccountCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java index 1bfd71c804..f30c985c96 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/account/EnableAccountCmd.java @@ -20,7 +20,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -36,7 +35,7 @@ import com.cloud.user.Account; -@APICommand(name = "enableAccount", description = "Enables an account", responseObject = AccountResponse.class, entityType = {IAMEntityType.Account}, +@APICommand(name = "enableAccount", description = "Enables an account", responseObject = AccountResponse.class, entityType = {Account.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class EnableAccountCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(EnableAccountCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java index 780dac1d7a..3c185e41bd 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/account/LockAccountCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseCmd; @@ -28,7 +27,7 @@ import com.cloud.user.Account; -@APICommand(name = "lockAccount", description = "Locks an account", responseObject = AccountResponse.class, entityType = {IAMEntityType.Account}, +@APICommand(name = "lockAccount", description = "Locks an account", responseObject = AccountResponse.class, entityType = {Account.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class LockAccountCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(LockAccountCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java b/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java index 8d9fe261f9..a7ce74a129 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/account/UpdateAccountCmd.java @@ -23,7 +23,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -39,7 +38,7 @@ import com.cloud.user.Account; -@APICommand(name = "updateAccount", description = "Updates account information for the authenticated user", responseObject = AccountResponse.class, entityType = {IAMEntityType.Account}, +@APICommand(name = "updateAccount", description = "Updates account information for the authenticated user", responseObject = AccountResponse.class, entityType = {Account.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class UpdateAccountCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(UpdateAccountCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLBVMsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLBVMsCmd.java index e6ea519778..0b59b73f9d 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLBVMsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLBVMsCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -34,8 +33,9 @@ import org.apache.cloudstack.api.response.ZoneResponse; import com.cloud.network.router.VirtualRouter.Role; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "listInternalLoadBalancerVMs", description = "List internal LB VMs.", responseObject = DomainRouterResponse.class, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "listInternalLoadBalancerVMs", description = "List internal LB VMs.", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListInternalLBVMsCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListInternalLBVMsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/StartInternalLBVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/StartInternalLBVMCmd.java index 54d7621600..7040e7cf29 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/internallb/StartInternalLBVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/StartInternalLBVMCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -38,8 +37,9 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.router.VirtualRouter; import com.cloud.network.router.VirtualRouter.Role; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "startInternalLoadBalancerVM", responseObject = DomainRouterResponse.class, description = "Starts an existing internal lb vm.", entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "startInternalLoadBalancerVM", responseObject = DomainRouterResponse.class, description = "Starts an existing internal lb vm.", entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class StartInternalLBVMCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(StartInternalLBVMCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java index aa946bee31..51a3d9f8fa 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/StopInternalLBVMCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -37,8 +36,9 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.router.VirtualRouter; import com.cloud.network.router.VirtualRouter.Role; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "stopInternalLoadBalancerVM", description = "Stops an Internal LB vm.", responseObject = DomainRouterResponse.class, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "stopInternalLoadBalancerVM", description = "Stops an Internal LB vm.", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class StopInternalLBVMCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(StopInternalLBVMCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/DestroyRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/DestroyRouterCmd.java index 26440d4be9..4513e2e85e 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/router/DestroyRouterCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/router/DestroyRouterCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -34,8 +33,9 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.router.VirtualRouter; import com.cloud.user.Account; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "destroyRouter", description = "Destroys a router.", responseObject = DomainRouterResponse.class, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "destroyRouter", description = "Destroys a router.", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DestroyRouterCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DestroyRouterCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java index d55a5f3ed9..121fc5bc14 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/router/ListRoutersCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -35,8 +34,9 @@ import org.apache.cloudstack.api.response.ZoneResponse; import com.cloud.network.router.VirtualRouter.Role; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "listRouters", description = "List routers.", responseObject = DomainRouterResponse.class, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "listRouters", description = "List routers.", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListRoutersCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListRoutersCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/RebootRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/RebootRouterCmd.java index 3a8938812b..4b138f3cfc 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/router/RebootRouterCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/router/RebootRouterCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -35,8 +34,9 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.router.VirtualRouter; import com.cloud.user.Account; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "rebootRouter", description = "Starts a router.", responseObject = DomainRouterResponse.class, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "rebootRouter", description = "Starts a router.", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class RebootRouterCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(RebootRouterCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java index f83466b1dc..173833cb42 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/router/StartRouterCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -37,8 +36,9 @@ import com.cloud.network.router.VirtualRouter; import com.cloud.network.router.VirtualRouter.Role; import com.cloud.user.Account; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "startRouter", responseObject = DomainRouterResponse.class, description = "Starts a router.", entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "startRouter", responseObject = DomainRouterResponse.class, description = "Starts a router.", entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class StartRouterCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(StartRouterCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java index e2d420073d..2592cae545 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/router/StopRouterCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -36,8 +35,9 @@ import com.cloud.network.router.VirtualRouter; import com.cloud.network.router.VirtualRouter.Role; import com.cloud.user.Account; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "stopRouter", description = "Stops a router.", responseObject = DomainRouterResponse.class, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "stopRouter", description = "Stops a router.", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class StopRouterCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(StopRouterCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterCmd.java index 0b67db9cef..067d344337 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/router/UpgradeRouterCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -30,8 +29,9 @@ import com.cloud.network.router.VirtualRouter; import com.cloud.user.Account; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "changeServiceForRouter", description = "Upgrades domain router to a new service offering", responseObject = DomainRouterResponse.class, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "changeServiceForRouter", description = "Upgrades domain router to a new service offering", responseObject = DomainRouterResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpgradeRouterCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(UpgradeRouterCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java index bc977a456e..47dfe8b724 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/DestroySystemVmCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -35,7 +34,7 @@ import com.cloud.user.Account; import com.cloud.vm.VirtualMachine; -@APICommand(name = "destroySystemVm", responseObject = SystemVmResponse.class, description = "Destroyes a system virtual machine.", entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "destroySystemVm", responseObject = SystemVmResponse.class, description = "Destroyes a system virtual machine.", entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DestroySystemVmCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DestroySystemVmCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java index bfecd1857f..2b2faf5011 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ListSystemVMsCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -37,7 +36,7 @@ import com.cloud.utils.Pair; import com.cloud.vm.VirtualMachine; -@APICommand(name = "listSystemVms", description = "List system virtual machines.", responseObject = SystemVmResponse.class, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "listSystemVms", description = "List system virtual machines.", responseObject = SystemVmResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListSystemVMsCmd extends BaseListCmd { public static final Logger s_logger = Logger.getLogger(ListSystemVMsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java index 994635a1b7..97acfe0c46 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/MigrateSystemVMCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -41,7 +40,7 @@ import com.cloud.user.Account; import com.cloud.vm.VirtualMachine; -@APICommand(name = "migrateSystemVm", description = "Attempts Migration of a system virtual machine to the host specified.", responseObject = SystemVmResponse.class, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "migrateSystemVm", description = "Attempts Migration of a system virtual machine to the host specified.", responseObject = SystemVmResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class MigrateSystemVMCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(MigrateSystemVMCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java index 0031d60351..f439ddf4de 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/RebootSystemVmCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -35,7 +34,7 @@ import com.cloud.user.Account; import com.cloud.vm.VirtualMachine; -@APICommand(name = "rebootSystemVm", description = "Reboots a system VM.", responseObject = SystemVmResponse.class, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "rebootSystemVm", description = "Reboots a system VM.", responseObject = SystemVmResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class RebootSystemVmCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(RebootSystemVmCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java index f50b2c4b2c..68e9f94a8b 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/ScaleSystemVMCmd.java @@ -23,7 +23,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -48,7 +47,7 @@ import com.cloud.vm.VirtualMachine; @APICommand(name = "scaleSystemVm", responseObject = SystemVmResponse.class, description = "Scale the service offering for a system vm (console proxy or secondary storage). " - + "The system vm must be in a \"Stopped\" state for " + "this command to take effect.", entityType = {IAMEntityType.VirtualMachine}, + + "The system vm must be in a \"Stopped\" state for " + "this command to take effect.", entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ScaleSystemVMCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(UpgradeVMCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java index 6aecc9117c..c456592d10 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StartSystemVMCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -35,7 +34,7 @@ import com.cloud.user.Account; import com.cloud.vm.VirtualMachine; -@APICommand(name = "startSystemVm", responseObject = SystemVmResponse.class, description = "Starts a system virtual machine.", entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "startSystemVm", responseObject = SystemVmResponse.class, description = "Starts a system virtual machine.", entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class StartSystemVMCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(StartSystemVMCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java index 9a049c2afe..d60460ced1 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/StopSystemVmCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -37,7 +36,7 @@ import com.cloud.user.Account; import com.cloud.vm.VirtualMachine; -@APICommand(name = "stopSystemVm", description = "Stops a system VM.", responseObject = SystemVmResponse.class, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "stopSystemVm", description = "Stops a system VM.", responseObject = SystemVmResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class StopSystemVmCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(StopSystemVmCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java index 033709aca4..d71ef03244 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/systemvm/UpgradeSystemVMCmd.java @@ -23,7 +23,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -43,7 +42,7 @@ import com.cloud.vm.VirtualMachine; @APICommand(name = "changeServiceForSystemVm", responseObject = SystemVmResponse.class, description = "Changes the service offering for a system vm (console proxy or secondary storage). " - + "The system vm must be in a \"Stopped\" state for " + "this command to take effect.", entityType = {IAMEntityType.VirtualMachine}, + + "The system vm must be in a \"Stopped\" state for " + "this command to take effect.", entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpgradeSystemVMCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(UpgradeVMCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/template/ListTemplatesCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/template/ListTemplatesCmdByAdmin.java index b2e9ef54e2..4e2bb018d0 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/template/ListTemplatesCmdByAdmin.java +++ b/api/src/org/apache/cloudstack/api/command/admin/template/ListTemplatesCmdByAdmin.java @@ -16,13 +16,14 @@ // under the License. package org.apache.cloudstack.api.command.admin.template; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ResponseObject.ResponseView; import org.apache.cloudstack.api.command.user.template.ListTemplatesCmd; import org.apache.cloudstack.api.response.TemplateResponse; -@APICommand(name = "listTemplates", description = "List all public, private, and privileged templates.", responseObject = TemplateResponse.class, entityType = {IAMEntityType.VirtualMachineTemplate}, responseView = ResponseView.Full) +import com.cloud.template.VirtualMachineTemplate; + +@APICommand(name = "listTemplates", description = "List all public, private, and privileged templates.", responseObject = TemplateResponse.class, entityType = {VirtualMachineTemplate.class}, responseView = ResponseView.Full) public class ListTemplatesCmdByAdmin extends ListTemplatesCmd { } diff --git a/api/src/org/apache/cloudstack/api/command/admin/template/PrepareTemplateCmd.java b/api/src/org/apache/cloudstack/api/command/admin/template/PrepareTemplateCmd.java index ce432430e1..d4c26966d9 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/template/PrepareTemplateCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/template/PrepareTemplateCmd.java @@ -20,7 +20,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -35,7 +34,7 @@ import com.cloud.template.VirtualMachineTemplate; import com.cloud.user.Account; -@APICommand(name = "prepareTemplate", responseObject = TemplateResponse.class, description = "load template into primary storage", entityType = {IAMEntityType.VirtualMachineTemplate}, +@APICommand(name = "prepareTemplate", responseObject = TemplateResponse.class, description = "load template into primary storage", entityType = {VirtualMachineTemplate.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class PrepareTemplateCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(PrepareTemplateCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java index dd84ec2a60..435b7f1848 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vm/AssignVMCmd.java @@ -20,7 +20,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -35,11 +34,12 @@ import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; @APICommand(name = "assignVirtualMachine", description = "Change ownership of a VM from one account to another. This API is available for Basic zones with security groups and Advanced zones with guest networks. A root administrator can reassign a VM from any account to any other account in any domain. A domain administrator can reassign a VM to any account in the same domain.", responseObject = UserVmResponse.class, - since = "3.0.0", entityType = {IAMEntityType.VirtualMachine}, + since = "3.0.0", entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class AssignVMCmd extends BaseCmd { diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java index 623ddb6779..40b9bb8256 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vm/ExpungeVMCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -39,8 +38,9 @@ import com.cloud.user.Account; import com.cloud.uservm.UserVm; import com.cloud.utils.exception.CloudRuntimeException; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "expungeVirtualMachine", description = "Expunge a virtual machine. Once expunged, it cannot be recoverd.", responseObject = SuccessResponse.class, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "expungeVirtualMachine", description = "Expunge a virtual machine. Once expunged, it cannot be recoverd.", responseObject = SuccessResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ExpungeVMCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(ExpungeVMCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java index fe8446859c..ef9619effa 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVMCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -45,7 +44,7 @@ @APICommand(name = "migrateVirtualMachine", description = "Attempts Migration of a VM to a different host or Root volume of the vm to a different storage pool", - responseObject = UserVmResponse.class, entityType = {IAMEntityType.VirtualMachine}, + responseObject = UserVmResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class MigrateVMCmd extends BaseAsyncCmd { diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java index b5d1ae9315..f1d3fe975f 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vm/MigrateVirtualMachineWithVolumeCmd.java @@ -23,7 +23,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -47,7 +46,7 @@ @APICommand(name = "migrateVirtualMachineWithVolume", description = "Attempts Migration of a VM with its volumes to a different host", - responseObject = UserVmResponse.class, entityType = {IAMEntityType.VirtualMachine}, + responseObject = UserVmResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class MigrateVirtualMachineWithVolumeCmd extends BaseAsyncCmd { diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java index e7fbbdb784..4ad0917154 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vm/RecoverVMCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -31,8 +30,9 @@ import com.cloud.exception.ResourceAllocationException; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "recoverVirtualMachine", description = "Recovers a virtual machine.", responseObject = UserVmResponse.class, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "recoverVirtualMachine", description = "Recovers a virtual machine.", responseObject = UserVmResponse.class, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class RecoverVMCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(RecoverVMCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java index ff88ada781..01db44e25d 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreatePrivateGatewayCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -41,9 +40,10 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.vpc.PrivateGateway; import com.cloud.network.vpc.Vpc; +import com.cloud.network.vpc.VpcGateway; import com.cloud.user.Account; -@APICommand(name = "createPrivateGateway", description = "Creates a private gateway", responseObject = PrivateGatewayResponse.class, entityType = {IAMEntityType.PrivateGateway}, +@APICommand(name = "createPrivateGateway", description = "Creates a private gateway", responseObject = PrivateGatewayResponse.class, entityType = {VpcGateway.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreatePrivateGatewayCmd extends BaseAsyncCreateCmd { public static final Logger s_logger = Logger.getLogger(CreatePrivateGatewayCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java index dcce58e227..8d67a4ed8c 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/DeletePrivateGatewayCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -37,7 +36,7 @@ import com.cloud.network.vpc.VpcGateway; import com.cloud.user.Account; -@APICommand(name = "deletePrivateGateway", description = "Deletes a Private gateway", responseObject = SuccessResponse.class, entityType = {IAMEntityType.PrivateGateway}, +@APICommand(name = "deletePrivateGateway", description = "Deletes a Private gateway", responseObject = SuccessResponse.class, entityType = {VpcGateway.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeletePrivateGatewayCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeletePrivateGatewayCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java b/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java index 65331e4c4a..0b5ae7c0ba 100644 --- a/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/account/ListAccountsCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListDomainResourcesCmd; @@ -27,7 +26,9 @@ import org.apache.cloudstack.api.response.AccountResponse; import org.apache.cloudstack.api.response.ListResponse; -@APICommand(name = "listAccounts", description = "Lists accounts and provides detailed account information for listed accounts", responseObject = AccountResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.Account}, +import com.cloud.user.Account; + +@APICommand(name = "listAccounts", description = "Lists accounts and provides detailed account information for listed accounts", responseObject = AccountResponse.class, responseView = ResponseView.Restricted, entityType = {Account.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class ListAccountsCmd extends BaseListDomainResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListAccountsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/CreateAffinityGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/CreateAffinityGroupCmd.java index 50573e9683..c30e52820e 100644 --- a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/CreateAffinityGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/CreateAffinityGroupCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.affinity.AffinityGroup; import org.apache.cloudstack.affinity.AffinityGroupResponse; import org.apache.cloudstack.api.APICommand; @@ -35,7 +34,7 @@ import com.cloud.exception.ResourceAllocationException; import com.cloud.user.Account; -@APICommand(name = "createAffinityGroup", responseObject = AffinityGroupResponse.class, description = "Creates an affinity/anti-affinity group", entityType = {IAMEntityType.AffinityGroup}, +@APICommand(name = "createAffinityGroup", responseObject = AffinityGroupResponse.class, description = "Creates an affinity/anti-affinity group", entityType = {AffinityGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateAffinityGroupCmd extends BaseAsyncCreateCmd { public static final Logger s_logger = Logger.getLogger(CreateAffinityGroupCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/DeleteAffinityGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/DeleteAffinityGroupCmd.java index 378a826ef8..945592b7f9 100644 --- a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/DeleteAffinityGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/DeleteAffinityGroupCmd.java @@ -19,8 +19,8 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; +import org.apache.cloudstack.affinity.AffinityGroup; import org.apache.cloudstack.affinity.AffinityGroupResponse; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -38,7 +38,7 @@ import com.cloud.exception.InvalidParameterValueException; import com.cloud.user.Account; -@APICommand(name = "deleteAffinityGroup", description = "Deletes affinity group", responseObject = SuccessResponse.class, entityType = {IAMEntityType.AffinityGroup}, +@APICommand(name = "deleteAffinityGroup", description = "Deletes affinity group", responseObject = SuccessResponse.class, entityType = {AffinityGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteAffinityGroupCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteAffinityGroupCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupsCmd.java b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupsCmd.java index e469eab2c1..6313c4812e 100644 --- a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/ListAffinityGroupsCmd.java @@ -18,7 +18,7 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; +import org.apache.cloudstack.affinity.AffinityGroup; import org.apache.cloudstack.affinity.AffinityGroupResponse; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; @@ -28,7 +28,7 @@ import org.apache.cloudstack.api.response.ListResponse; import org.apache.cloudstack.api.response.UserVmResponse; -@APICommand(name = "listAffinityGroups", description = "Lists affinity groups", responseObject = AffinityGroupResponse.class, entityType = {IAMEntityType.AffinityGroup}, +@APICommand(name = "listAffinityGroups", description = "Lists affinity groups", responseObject = AffinityGroupResponse.class, entityType = {AffinityGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListAffinityGroupsCmd extends BaseListAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListAffinityGroupsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/UpdateVMAffinityGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/UpdateVMAffinityGroupCmd.java index 4bfcddb3a6..66201477b9 100644 --- a/api/src/org/apache/cloudstack/api/command/user/affinitygroup/UpdateVMAffinityGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/affinitygroup/UpdateVMAffinityGroupCmd.java @@ -22,7 +22,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.affinity.AffinityGroupResponse; import org.apache.cloudstack.api.ACL; @@ -44,13 +43,14 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; @APICommand(name = "updateVMAffinityGroup", description = "Updates the affinity/anti-affinity group associations of a virtual machine. The VM has to be stopped and restarted for the " + "new properties to take effect.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, - entityType = {IAMEntityType.VirtualMachine}, + entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class UpdateVMAffinityGroupCmd extends BaseAsyncCmd { diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java index 8b5708d072..4541efa798 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScalePolicyCmd.java @@ -20,7 +20,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -40,7 +39,7 @@ @APICommand(name = "createAutoScalePolicy", description = "Creates an autoscale policy for a provision or deprovision action, the action is taken when the all the conditions evaluates to true for the specified duration. The policy is in effect once it is attached to a autscale vm group.", - responseObject = AutoScalePolicyResponse.class, entityType = {IAMEntityType.AutoScalePolicy}, + responseObject = AutoScalePolicyResponse.class, entityType = {AutoScalePolicy.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateAutoScalePolicyCmd extends BaseAsyncCreateCmd { diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java index 43a7f18189..1fd0029e34 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java @@ -20,7 +20,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; @@ -42,7 +41,7 @@ @APICommand(name = "createAutoScaleVmGroup", description = "Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.", - responseObject = AutoScaleVmGroupResponse.class, entityType = { IAMEntityType.AutoScaleVmGroup }, + responseObject = AutoScaleVmGroupResponse.class, entityType = {AutoScaleVmGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateAutoScaleVmGroupCmd extends BaseAsyncCreateCmd { diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java index 5d78593832..189217a202 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; @@ -46,7 +45,7 @@ @APICommand(name = "createAutoScaleVmProfile", description = "Creates a profile that contains information about the virtual machine which will be provisioned automatically by autoscale feature.", - responseObject = AutoScaleVmProfileResponse.class, entityType = { IAMEntityType.AutoScaleVmProfile }, + responseObject = AutoScaleVmProfileResponse.class, entityType = {AutoScaleVmProfile.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) @SuppressWarnings("rawtypes") diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java index b603a152d5..847866ef3a 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateConditionCmd.java @@ -19,7 +19,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -36,7 +35,7 @@ import com.cloud.exception.ResourceAllocationException; import com.cloud.network.as.Condition; -@APICommand(name = "createCondition", description = "Creates a condition", responseObject = ConditionResponse.class, entityType = {IAMEntityType.Condition}, +@APICommand(name = "createCondition", description = "Creates a condition", responseObject = ConditionResponse.class, entityType = {Condition.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateConditionCmd extends BaseAsyncCreateCmd { public static final Logger s_logger = Logger.getLogger(CreateConditionCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScalePolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScalePolicyCmd.java index 779ee0a392..c0a3a00f7d 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScalePolicyCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScalePolicyCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -36,7 +35,7 @@ import com.cloud.network.as.AutoScalePolicy; import com.cloud.user.Account; -@APICommand(name = "deleteAutoScalePolicy", description = "Deletes a autoscale policy.", responseObject = SuccessResponse.class, entityType = {IAMEntityType.AutoScalePolicy}, +@APICommand(name = "deleteAutoScalePolicy", description = "Deletes a autoscale policy.", responseObject = SuccessResponse.class, entityType = {AutoScalePolicy.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteAutoScalePolicyCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteAutoScalePolicyCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmGroupCmd.java index 5a43abe866..a9d2f4e232 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmGroupCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -36,7 +35,7 @@ import com.cloud.network.as.AutoScaleVmGroup; import com.cloud.user.Account; -@APICommand(name = "deleteAutoScaleVmGroup", description = "Deletes a autoscale vm group.", responseObject = SuccessResponse.class, entityType = {IAMEntityType.AutoScaleVmGroup}, +@APICommand(name = "deleteAutoScaleVmGroup", description = "Deletes a autoscale vm group.", responseObject = SuccessResponse.class, entityType = {AutoScaleVmGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteAutoScaleVmGroupCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteAutoScaleVmGroupCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmProfileCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmProfileCmd.java index 2391a938d8..779315a96d 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmProfileCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteAutoScaleVmProfileCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -36,7 +35,7 @@ import com.cloud.network.as.AutoScaleVmProfile; import com.cloud.user.Account; -@APICommand(name = "deleteAutoScaleVmProfile", description = "Deletes a autoscale vm profile.", responseObject = SuccessResponse.class, entityType = {IAMEntityType.AutoScaleVmProfile}, +@APICommand(name = "deleteAutoScaleVmProfile", description = "Deletes a autoscale vm profile.", responseObject = SuccessResponse.class, entityType = {AutoScaleVmProfile.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteAutoScaleVmProfileCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteAutoScaleVmProfileCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteConditionCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteConditionCmd.java index 9a7d2d7df8..24f4cc6878 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteConditionCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DeleteConditionCmd.java @@ -19,7 +19,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -37,7 +36,7 @@ import com.cloud.network.as.Condition; import com.cloud.user.Account; -@APICommand(name = "deleteCondition", description = "Removes a condition", responseObject = SuccessResponse.class, entityType = {IAMEntityType.Condition}, +@APICommand(name = "deleteCondition", description = "Removes a condition", responseObject = SuccessResponse.class, entityType = {Condition.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteConditionCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteConditionCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/DisableAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/DisableAutoScaleVmGroupCmd.java index 6575d27ba7..8eb1809f88 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/DisableAutoScaleVmGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/DisableAutoScaleVmGroupCmd.java @@ -19,7 +19,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -35,7 +34,7 @@ import com.cloud.network.as.AutoScaleVmGroup; import com.cloud.user.Account; -@APICommand(name = "disableAutoScaleVmGroup", description = "Disables an AutoScale Vm Group", responseObject = AutoScaleVmGroupResponse.class, entityType = {IAMEntityType.AutoScaleVmGroup}, +@APICommand(name = "disableAutoScaleVmGroup", description = "Disables an AutoScale Vm Group", responseObject = AutoScaleVmGroupResponse.class, entityType = {AutoScaleVmGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DisableAutoScaleVmGroupCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DisableAutoScaleVmGroupCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/EnableAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/EnableAutoScaleVmGroupCmd.java index 6b9f2c3ac0..59c9f7a9aa 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/EnableAutoScaleVmGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/EnableAutoScaleVmGroupCmd.java @@ -19,7 +19,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -35,7 +34,7 @@ import com.cloud.network.as.AutoScaleVmGroup; import com.cloud.user.Account; -@APICommand(name = "enableAutoScaleVmGroup", description = "Enables an AutoScale Vm Group", responseObject = AutoScaleVmGroupResponse.class, entityType = {IAMEntityType.AutoScaleVmGroup}, +@APICommand(name = "enableAutoScaleVmGroup", description = "Enables an AutoScale Vm Group", responseObject = AutoScaleVmGroupResponse.class, entityType = {AutoScaleVmGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class EnableAutoScaleVmGroupCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(EnableAutoScaleVmGroupCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScalePoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScalePoliciesCmd.java index 43c4c72a80..c2b244f2a7 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScalePoliciesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScalePoliciesCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListAccountResourcesCmd; @@ -33,7 +32,7 @@ import com.cloud.network.as.AutoScalePolicy; -@APICommand(name = "listAutoScalePolicies", description = "Lists autoscale policies.", responseObject = AutoScalePolicyResponse.class, entityType = {IAMEntityType.AutoScalePolicy}, +@APICommand(name = "listAutoScalePolicies", description = "Lists autoscale policies.", responseObject = AutoScalePolicyResponse.class, entityType = {AutoScalePolicy.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListAutoScalePoliciesCmd extends BaseListAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListAutoScalePoliciesCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmGroupsCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmGroupsCmd.java index 2e88c27b7d..37c90b9bfd 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmGroupsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmGroupsCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -37,7 +36,7 @@ import com.cloud.exception.InvalidParameterValueException; import com.cloud.network.as.AutoScaleVmGroup; -@APICommand(name = "listAutoScaleVmGroups", description = "Lists autoscale vm groups.", responseObject = AutoScaleVmGroupResponse.class, entityType = { IAMEntityType.AutoScaleVmGroup }, +@APICommand(name = "listAutoScaleVmGroups", description = "Lists autoscale vm groups.", responseObject = AutoScaleVmGroupResponse.class, entityType = {AutoScaleVmGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListAutoScaleVmGroupsCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListAutoScaleVmGroupsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java index 94f0eee7f5..6bb33fd009 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -35,7 +34,7 @@ import com.cloud.network.as.AutoScaleVmProfile; -@APICommand(name = "listAutoScaleVmProfiles", description = "Lists autoscale vm profiles.", responseObject = AutoScaleVmProfileResponse.class, entityType = { IAMEntityType.AutoScaleVmProfile }, +@APICommand(name = "listAutoScaleVmProfiles", description = "Lists autoscale vm profiles.", responseObject = AutoScaleVmProfileResponse.class, entityType = {AutoScaleVmProfile.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListAutoScaleVmProfilesCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListAutoScaleVmProfilesCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScalePolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScalePolicyCmd.java index 8cd7211a2f..24858f4656 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScalePolicyCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScalePolicyCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -39,7 +38,7 @@ import com.cloud.network.as.AutoScalePolicy; import com.cloud.user.Account; -@APICommand(name = "updateAutoScalePolicy", description = "Updates an existing autoscale policy.", responseObject = AutoScalePolicyResponse.class, entityType = {IAMEntityType.AutoScalePolicy}, +@APICommand(name = "updateAutoScalePolicy", description = "Updates an existing autoscale policy.", responseObject = AutoScalePolicyResponse.class, entityType = {AutoScalePolicy.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpdateAutoScalePolicyCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(UpdateAutoScalePolicyCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java index 60ea51efc9..76fa3d75d1 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmGroupCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; @@ -40,7 +39,7 @@ import com.cloud.network.as.AutoScaleVmGroup; import com.cloud.user.Account; -@APICommand(name = "updateAutoScaleVmGroup", description = "Updates an existing autoscale vm group.", responseObject = AutoScaleVmGroupResponse.class, entityType = { IAMEntityType.AutoScaleVmGroup }, +@APICommand(name = "updateAutoScaleVmGroup", description = "Updates an existing autoscale vm group.", responseObject = AutoScaleVmGroupResponse.class, entityType = {AutoScaleVmGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpdateAutoScaleVmGroupCmd extends BaseAsyncCustomIdCmd { public static final Logger s_logger = Logger.getLogger(UpdateAutoScaleVmGroupCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java index 54e34da196..deebe2ecc9 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/UpdateAutoScaleVmProfileCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; @@ -41,7 +40,7 @@ import com.cloud.network.as.AutoScaleVmProfile; import com.cloud.user.Account; -@APICommand(name = "updateAutoScaleVmProfile", description = "Updates an existing autoscale vm profile.", responseObject = AutoScaleVmProfileResponse.class, entityType = { IAMEntityType.AutoScaleVmProfile }, +@APICommand(name = "updateAutoScaleVmProfile", description = "Updates an existing autoscale vm profile.", responseObject = AutoScaleVmProfileResponse.class, entityType = {AutoScaleVmProfile.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpdateAutoScaleVmProfileCmd extends BaseAsyncCustomIdCmd { public static final Logger s_logger = Logger.getLogger(UpdateAutoScaleVmProfileCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java index 8ff2c3e445..e4970d6530 100644 --- a/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/event/ArchiveEventsCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -32,10 +31,11 @@ import org.apache.cloudstack.api.response.SuccessResponse; import org.apache.cloudstack.context.CallContext; +import com.cloud.event.Event; import com.cloud.exception.InvalidParameterValueException; import com.cloud.user.Account; -@APICommand(name = "archiveEvents", description = "Archive one or more events.", responseObject = SuccessResponse.class, entityType = {IAMEntityType.Event}, +@APICommand(name = "archiveEvents", description = "Archive one or more events.", responseObject = SuccessResponse.class, entityType = {Event.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ArchiveEventsCmd extends BaseCmd { diff --git a/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java index 10c1c0c860..defb009696 100644 --- a/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/event/DeleteEventsCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -32,10 +31,11 @@ import org.apache.cloudstack.api.response.SuccessResponse; import org.apache.cloudstack.context.CallContext; +import com.cloud.event.Event; import com.cloud.exception.InvalidParameterValueException; import com.cloud.user.Account; -@APICommand(name = "deleteEvents", description = "Delete one or more events.", responseObject = SuccessResponse.class, entityType = {IAMEntityType.Event}, +@APICommand(name = "deleteEvents", description = "Delete one or more events.", responseObject = SuccessResponse.class, entityType = {Event.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteEventsCmd extends BaseCmd { diff --git a/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java b/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java index b420cf1ed2..a4934fa1dd 100644 --- a/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/event/ListEventsCmd.java @@ -20,7 +20,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd; @@ -28,7 +27,9 @@ import org.apache.cloudstack.api.response.EventResponse; import org.apache.cloudstack.api.response.ListResponse; -@APICommand(name = "listEvents", description = "A command to list events.", responseObject = EventResponse.class, entityType = {IAMEntityType.Event}, +import com.cloud.event.Event; + +@APICommand(name = "listEvents", description = "A command to list events.", responseObject = EventResponse.class, entityType = {Event.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListEventsCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListEventsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java index 8ef1b89518..579cccbfb2 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java @@ -22,7 +22,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; @@ -45,7 +44,7 @@ import com.cloud.user.Account; import com.cloud.utils.net.NetUtils; -@APICommand(name = "createEgressFirewallRule", description = "Creates a egress firewall rule for a given network ", responseObject = FirewallResponse.class, entityType = { IAMEntityType.FirewallRule }, +@APICommand(name = "createEgressFirewallRule", description = "Creates a egress firewall rule for a given network ", responseObject = FirewallResponse.class, entityType = {FirewallRule.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateEgressFirewallRuleCmd extends BaseAsyncCreateCmd implements FirewallRule { public static final Logger s_logger = Logger.getLogger(CreateEgressFirewallRuleCmd.class.getName()); @@ -357,8 +356,8 @@ public boolean isDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.FirewallRule; + public Class getEntityType() { + return FirewallRule.class; } } diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java index 21e680ae62..b09d3a73a7 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; @@ -44,7 +43,7 @@ import com.cloud.user.Account; import com.cloud.utils.net.NetUtils; -@APICommand(name = "createFirewallRule", description = "Creates a firewall rule for a given ip address", responseObject = FirewallResponse.class, entityType = { IAMEntityType.FirewallRule }, +@APICommand(name = "createFirewallRule", description = "Creates a firewall rule for a given ip address", responseObject = FirewallResponse.class, entityType = {FirewallRule.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateFirewallRuleCmd extends BaseAsyncCreateCmd implements FirewallRule { public static final Logger s_logger = Logger.getLogger(CreateFirewallRuleCmd.class.getName()); @@ -350,8 +349,8 @@ public boolean isDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.FirewallRule; + public Class getEntityType() { + return FirewallRule.class; } } diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java index 7328374f5c..8d9aa6fee9 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java @@ -20,7 +20,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; @@ -41,12 +40,13 @@ import com.cloud.exception.NetworkRuleConflictException; import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.IpAddress; +import com.cloud.network.rules.FirewallRule; import com.cloud.network.rules.PortForwardingRule; import com.cloud.user.Account; import com.cloud.utils.net.Ip; import com.cloud.utils.net.NetUtils; -@APICommand(name = "createPortForwardingRule", description = "Creates a port forwarding rule", responseObject = FirewallRuleResponse.class, entityType = { IAMEntityType.PortForwardingRule }, +@APICommand(name = "createPortForwardingRule", description = "Creates a port forwarding rule", responseObject = FirewallRuleResponse.class, entityType = {PortForwardingRule.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements PortForwardingRule { public static final Logger s_logger = Logger.getLogger(CreatePortForwardingRuleCmd.class.getName()); @@ -432,8 +432,8 @@ public boolean isDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.FirewallRule; + public Class getEntityType() { + return FirewallRule.class; } } diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java index ebed335ba3..4d227722f8 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java @@ -19,7 +19,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -39,7 +38,7 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.rules.FirewallRule; -@APICommand(name = "deleteEgressFirewallRule", description = "Deletes an ggress firewall rule", responseObject = SuccessResponse.class, entityType = {IAMEntityType.FirewallRule}, +@APICommand(name = "deleteEgressFirewallRule", description = "Deletes an ggress firewall rule", responseObject = SuccessResponse.class, entityType = {FirewallRule.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteEgressFirewallRuleCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteEgressFirewallRuleCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java index 3f61e640c8..66dcc039c3 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -38,7 +37,7 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.rules.FirewallRule; -@APICommand(name = "deleteFirewallRule", description = "Deletes a firewall rule", responseObject = SuccessResponse.class, entityType = {IAMEntityType.FirewallRule}, +@APICommand(name = "deleteFirewallRule", description = "Deletes a firewall rule", responseObject = SuccessResponse.class, entityType = {FirewallRule.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteFirewallRuleCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteFirewallRuleCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java index 551885d017..4c7b07f14f 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeletePortForwardingRuleCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -37,7 +36,7 @@ import com.cloud.exception.InvalidParameterValueException; import com.cloud.network.rules.PortForwardingRule; -@APICommand(name = "deletePortForwardingRule", description = "Deletes a port forwarding rule", responseObject = SuccessResponse.class, entityType = {IAMEntityType.PortForwardingRule}, +@APICommand(name = "deletePortForwardingRule", description = "Deletes a port forwarding rule", responseObject = SuccessResponse.class, entityType = {PortForwardingRule.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeletePortForwardingRuleCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeletePortForwardingRuleCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java index ece2201a89..e31496e474 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListEgressFirewallRulesCmd.java @@ -22,7 +22,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.Parameter; @@ -34,7 +33,7 @@ import com.cloud.network.rules.FirewallRule; import com.cloud.utils.Pair; -@APICommand(name = "listEgressFirewallRules", description = "Lists all egress firewall rules for network id.", responseObject = FirewallResponse.class, entityType = { IAMEntityType.FirewallRule }, +@APICommand(name = "listEgressFirewallRules", description = "Lists all egress firewall rules for network id.", responseObject = FirewallResponse.class, entityType = {FirewallRule.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListEgressFirewallRulesCmd extends ListFirewallRulesCmd { public static final Logger s_logger = Logger.getLogger(ListEgressFirewallRulesCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java index 870f81d914..9c9fbc8397 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListFirewallRulesCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -36,7 +35,7 @@ import com.cloud.network.rules.FirewallRule; import com.cloud.utils.Pair; -@APICommand(name = "listFirewallRules", description = "Lists all firewall rules for an IP address.", responseObject = FirewallResponse.class, entityType = {IAMEntityType.FirewallRule}, +@APICommand(name = "listFirewallRules", description = "Lists all firewall rules for an IP address.", responseObject = FirewallResponse.class, entityType = {FirewallRule.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListFirewallRulesCmd extends BaseListTaggedResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListFirewallRulesCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java index 681da333f0..cde2563f9a 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/ListPortForwardingRulesCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -35,7 +34,7 @@ import com.cloud.network.rules.PortForwardingRule; import com.cloud.utils.Pair; -@APICommand(name = "listPortForwardingRules", description = "Lists all port forwarding rules for an IP address.", responseObject = FirewallRuleResponse.class, entityType = {IAMEntityType.PortForwardingRule}, +@APICommand(name = "listPortForwardingRules", description = "Lists all port forwarding rules for an IP address.", responseObject = FirewallRuleResponse.class, entityType = {PortForwardingRule.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListPortForwardingRulesCmd extends BaseListTaggedResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListPortForwardingRulesCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java index 55b378a21a..2f50ddbb46 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -38,7 +37,7 @@ @APICommand(name = "updatePortForwardingRule", responseObject = FirewallRuleResponse.class, - description = "Updates a port forwarding rule. Only the private port and the virtual machine can be updated.", entityType = {IAMEntityType.PortForwardingRule}, + description = "Updates a port forwarding rule. Only the private port and the virtual machine can be updated.", entityType = {PortForwardingRule.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpdatePortForwardingRuleCmd extends BaseAsyncCustomIdCmd { public static final Logger s_logger = Logger.getLogger(UpdatePortForwardingRuleCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java index 77edbfccca..8925d066fe 100644 --- a/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/nat/CreateIpForwardingRuleCmd.java @@ -20,7 +20,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -325,8 +324,8 @@ public boolean isDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.FirewallRule; + public Class getEntityType() { + return FirewallRule.class; } } diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java index 3ecec7bde8..43c3d1b09e 100644 --- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -45,7 +44,7 @@ import com.cloud.network.Network.GuestType; import com.cloud.offering.NetworkOffering; -@APICommand(name = "createNetwork", description = "Creates a network", responseObject = NetworkResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.Network}, +@APICommand(name = "createNetwork", description = "Creates a network", responseObject = NetworkResponse.class, responseView = ResponseView.Restricted, entityType = {Network.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateNetworkCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(CreateNetworkCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java index 50bc94a126..4c3a292c4a 100644 --- a/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/network/DeleteNetworkCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -36,7 +35,7 @@ import com.cloud.exception.InvalidParameterValueException; import com.cloud.network.Network; -@APICommand(name = "deleteNetwork", description = "Deletes a network", responseObject = SuccessResponse.class, entityType = {IAMEntityType.Network}, +@APICommand(name = "deleteNetwork", description = "Deletes a network", responseObject = SuccessResponse.class, entityType = {Network.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteNetworkCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteNetworkOfferingCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java index 455d8dc6a0..a5de9155cf 100644 --- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -37,7 +36,7 @@ import com.cloud.network.Network; import com.cloud.utils.Pair; -@APICommand(name = "listNetworks", description = "Lists all available networks.", responseObject = NetworkResponse.class, responseView = ResponseView.Restricted, entityType = { IAMEntityType.Network }, +@APICommand(name = "listNetworks", description = "Lists all available networks.", responseObject = NetworkResponse.class, responseView = ResponseView.Restricted, entityType = {Network.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListNetworksCmd extends BaseListTaggedResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListNetworksCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java index 6baafda7c8..eba8310421 100644 --- a/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/network/RestartNetworkCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -41,7 +40,7 @@ @APICommand(name = "restartNetwork", description = "Restarts the network; includes 1) restarting network elements - virtual routers, dhcp servers 2) reapplying all public ips 3) reapplying loadBalancing/portForwarding rules", - responseObject = IPAddressResponse.class, entityType = {IAMEntityType.Network}, + responseObject = IPAddressResponse.class, entityType = {Network.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class RestartNetworkCmd extends BaseAsyncCmd { diff --git a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java index aea7448ab3..0f73ddef93 100644 --- a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; @@ -43,7 +42,7 @@ import com.cloud.user.Account; import com.cloud.user.User; -@APICommand(name = "updateNetwork", description = "Updates a network", responseObject = NetworkResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.Network}, +@APICommand(name = "updateNetwork", description = "Updates a network", responseObject = NetworkResponse.class, responseView = ResponseView.Restricted, entityType = {Network.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpdateNetworkCmd extends BaseAsyncCustomIdCmd { public static final Logger s_logger = Logger.getLogger(UpdateNetworkCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java index 96509f1081..aef0a7c738 100644 --- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java @@ -24,7 +24,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -42,10 +41,11 @@ import com.cloud.event.EventTypes; import com.cloud.exception.InvalidParameterValueException; +import com.cloud.network.security.SecurityGroup; import com.cloud.network.security.SecurityRule; import com.cloud.utils.StringUtils; -@APICommand(name = "authorizeSecurityGroupEgress", responseObject = SecurityGroupRuleResponse.class, description = "Authorizes a particular egress rule for this security group", since = "3.0.0", entityType = {IAMEntityType.SecurityGroup}, +@APICommand(name = "authorizeSecurityGroupEgress", responseObject = SecurityGroupRuleResponse.class, description = "Authorizes a particular egress rule for this security group", since = "3.0.0", entityType = {SecurityGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) @SuppressWarnings("rawtypes") diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java index 1e324e2a1e..188df6e111 100644 --- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java @@ -24,7 +24,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -42,10 +41,11 @@ import com.cloud.event.EventTypes; import com.cloud.exception.InvalidParameterValueException; +import com.cloud.network.security.SecurityGroup; import com.cloud.network.security.SecurityRule; import com.cloud.utils.StringUtils; -@APICommand(name = "authorizeSecurityGroupIngress", responseObject = SecurityGroupRuleResponse.class, description = "Authorizes a particular ingress rule for this security group", entityType = {IAMEntityType.SecurityGroup}, +@APICommand(name = "authorizeSecurityGroupIngress", responseObject = SecurityGroupRuleResponse.class, description = "Authorizes a particular ingress rule for this security group", entityType = {SecurityGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) @SuppressWarnings("rawtypes") diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/CreateSecurityGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/CreateSecurityGroupCmd.java index 1f7f872f1e..b5758ca282 100644 --- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/CreateSecurityGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/CreateSecurityGroupCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -33,7 +32,7 @@ import com.cloud.network.security.SecurityGroup; import com.cloud.user.Account; -@APICommand(name = "createSecurityGroup", responseObject = SecurityGroupResponse.class, description = "Creates a security group", entityType = {IAMEntityType.SecurityGroup}, +@APICommand(name = "createSecurityGroup", responseObject = SecurityGroupResponse.class, description = "Creates a security group", entityType = {SecurityGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateSecurityGroupCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(CreateSecurityGroupCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/DeleteSecurityGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/DeleteSecurityGroupCmd.java index 827c7d7389..87e6df41b6 100644 --- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/DeleteSecurityGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/DeleteSecurityGroupCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -35,8 +34,9 @@ import com.cloud.exception.InvalidParameterValueException; import com.cloud.exception.ResourceInUseException; +import com.cloud.network.security.SecurityGroup; -@APICommand(name = "deleteSecurityGroup", description = "Deletes security group", responseObject = SuccessResponse.class, entityType = {IAMEntityType.SecurityGroup}, +@APICommand(name = "deleteSecurityGroup", description = "Deletes security group", responseObject = SuccessResponse.class, entityType = {SecurityGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteSecurityGroupCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(DeleteSecurityGroupCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/ListSecurityGroupsCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/ListSecurityGroupsCmd.java index 02be63d0b4..4a8081a350 100644 --- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/ListSecurityGroupsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/ListSecurityGroupsCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -28,7 +27,9 @@ import org.apache.cloudstack.api.response.SecurityGroupResponse; import org.apache.cloudstack.api.response.UserVmResponse; -@APICommand(name = "listSecurityGroups", description = "Lists security groups", responseObject = SecurityGroupResponse.class, entityType = {IAMEntityType.SecurityGroup}, +import com.cloud.network.security.SecurityGroup; + +@APICommand(name = "listSecurityGroups", description = "Lists security groups", responseObject = SecurityGroupResponse.class, entityType = {SecurityGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListSecurityGroupsCmd extends BaseListTaggedResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListSecurityGroupsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java index d1ffc1e5ea..a28a220b53 100644 --- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupEgressCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -35,7 +34,7 @@ import com.cloud.user.Account; -@APICommand(name = "revokeSecurityGroupEgress", responseObject = SuccessResponse.class, description = "Deletes a particular egress rule from this security group", since = "3.0.0", entityType = {IAMEntityType.SecurityGroup}, +@APICommand(name = "revokeSecurityGroupEgress", responseObject = SuccessResponse.class, description = "Deletes a particular egress rule from this security group", since = "3.0.0", entityType = {SecurityGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class RevokeSecurityGroupEgressCmd extends BaseAsyncCmd { diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java index 8543e0e1de..9e81d0bc4e 100644 --- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/RevokeSecurityGroupIngressCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -36,7 +35,7 @@ import com.cloud.network.security.SecurityRule; import com.cloud.user.Account; -@APICommand(name = "revokeSecurityGroupIngress", responseObject = SuccessResponse.class, description = "Deletes a particular ingress rule from this security group", entityType = {IAMEntityType.SecurityGroup}, +@APICommand(name = "revokeSecurityGroupIngress", responseObject = SuccessResponse.class, description = "Deletes a particular ingress rule from this security group", entityType = {SecurityGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class RevokeSecurityGroupIngressCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(RevokeSecurityGroupIngressCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java index 2020518528..df7fe8296b 100644 --- a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -42,7 +41,7 @@ import com.cloud.storage.Volume; import com.cloud.user.Account; -@APICommand(name = "createSnapshot", description = "Creates an instant snapshot of a volume.", responseObject = SnapshotResponse.class, entityType = {IAMEntityType.Snapshot}, +@APICommand(name = "createSnapshot", description = "Creates an instant snapshot of a volume.", responseObject = SnapshotResponse.class, entityType = {Snapshot.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateSnapshotCmd extends BaseAsyncCreateCmd { public static final Logger s_logger = Logger.getLogger(CreateSnapshotCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotCmd.java index 7d57c21459..64a432d0bc 100644 --- a/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/DeleteSnapshotCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -36,7 +35,7 @@ import com.cloud.storage.Snapshot; import com.cloud.user.Account; -@APICommand(name = "deleteSnapshot", description = "Deletes a snapshot of a disk volume.", responseObject = SuccessResponse.class, entityType = {IAMEntityType.Snapshot}, +@APICommand(name = "deleteSnapshot", description = "Deletes a snapshot of a disk volume.", responseObject = SuccessResponse.class, entityType = {Snapshot.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteSnapshotCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteSnapshotCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java index ed26e7ff6f..47a6876d09 100644 --- a/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/ListSnapshotsCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -35,7 +34,7 @@ import com.cloud.storage.Snapshot; import com.cloud.utils.Pair; -@APICommand(name = "listSnapshots", description = "Lists all available snapshots for the account.", responseObject = SnapshotResponse.class, entityType = {IAMEntityType.Snapshot}, +@APICommand(name = "listSnapshots", description = "Lists all available snapshots for the account.", responseObject = SnapshotResponse.class, entityType = {Snapshot.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListSnapshotsCmd extends BaseListTaggedResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListSnapshotsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/RevertSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/RevertSnapshotCmd.java index ab83812262..0c79f81564 100644 --- a/api/src/org/apache/cloudstack/api/command/user/snapshot/RevertSnapshotCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/RevertSnapshotCmd.java @@ -18,7 +18,6 @@ */ package org.apache.cloudstack.api.command.user.snapshot; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -37,7 +36,7 @@ import com.cloud.storage.Snapshot; import com.cloud.user.Account; -@APICommand(name = "revertSnapshot", description = "revert a volume snapshot.", responseObject = SnapshotResponse.class, entityType = {IAMEntityType.Snapshot}, +@APICommand(name = "revertSnapshot", description = "revert a volume snapshot.", responseObject = SnapshotResponse.class, entityType = {Snapshot.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class RevertSnapshotCmd extends BaseAsyncCmd { private static final String s_name = "revertsnapshotresponse"; diff --git a/api/src/org/apache/cloudstack/api/command/user/ssh/CreateSSHKeyPairCmd.java b/api/src/org/apache/cloudstack/api/command/user/ssh/CreateSSHKeyPairCmd.java index a0f05d18d3..bd7f613f89 100644 --- a/api/src/org/apache/cloudstack/api/command/user/ssh/CreateSSHKeyPairCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/ssh/CreateSSHKeyPairCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseCmd; @@ -30,7 +29,7 @@ import com.cloud.user.SSHKeyPair; -@APICommand(name = "createSSHKeyPair", description = "Create a new keypair and returns the private key", responseObject = CreateSSHKeyPairResponse.class, entityType = {IAMEntityType.SSHKeyPair}, +@APICommand(name = "createSSHKeyPair", description = "Create a new keypair and returns the private key", responseObject = CreateSSHKeyPairResponse.class, entityType = {SSHKeyPair.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class CreateSSHKeyPairCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(CreateSSHKeyPairCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/ssh/DeleteSSHKeyPairCmd.java b/api/src/org/apache/cloudstack/api/command/user/ssh/DeleteSSHKeyPairCmd.java index d0a5234e05..0709686ebf 100644 --- a/api/src/org/apache/cloudstack/api/command/user/ssh/DeleteSSHKeyPairCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/ssh/DeleteSSHKeyPairCmd.java @@ -19,7 +19,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseCmd; @@ -30,8 +29,9 @@ import org.apache.cloudstack.context.CallContext; import com.cloud.user.Account; +import com.cloud.user.SSHKeyPair; -@APICommand(name = "deleteSSHKeyPair", description = "Deletes a keypair by name", responseObject = SuccessResponse.class, entityType = {IAMEntityType.SSHKeyPair}, +@APICommand(name = "deleteSSHKeyPair", description = "Deletes a keypair by name", responseObject = SuccessResponse.class, entityType = {SSHKeyPair.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteSSHKeyPairCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(CreateSSHKeyPairCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/ssh/ListSSHKeyPairsCmd.java b/api/src/org/apache/cloudstack/api/command/user/ssh/ListSSHKeyPairsCmd.java index f02bf9f4f5..022cbc5068 100644 --- a/api/src/org/apache/cloudstack/api/command/user/ssh/ListSSHKeyPairsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/ssh/ListSSHKeyPairsCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd; @@ -32,7 +31,7 @@ import com.cloud.user.SSHKeyPair; import com.cloud.utils.Pair; -@APICommand(name = "listSSHKeyPairs", description = "List registered keypairs", responseObject = SSHKeyPairResponse.class, entityType = {IAMEntityType.SSHKeyPair}, +@APICommand(name = "listSSHKeyPairs", description = "List registered keypairs", responseObject = SSHKeyPairResponse.class, entityType = {SSHKeyPair.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListSSHKeyPairsCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListSSHKeyPairsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/ssh/RegisterSSHKeyPairCmd.java b/api/src/org/apache/cloudstack/api/command/user/ssh/RegisterSSHKeyPairCmd.java index e095227d98..c7cbc56ae6 100644 --- a/api/src/org/apache/cloudstack/api/command/user/ssh/RegisterSSHKeyPairCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/ssh/RegisterSSHKeyPairCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseCmd; @@ -30,7 +29,7 @@ import com.cloud.user.SSHKeyPair; -@APICommand(name = "registerSSHKeyPair", description = "Register a public key in a keypair under a certain name", responseObject = SSHKeyPairResponse.class, entityType = {IAMEntityType.SSHKeyPair}, +@APICommand(name = "registerSSHKeyPair", description = "Register a public key in a keypair under a certain name", responseObject = SSHKeyPairResponse.class, entityType = {SSHKeyPair.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class RegisterSSHKeyPairCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(RegisterSSHKeyPairCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java b/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java index eab114fea8..6aecc05548 100644 --- a/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/tag/CreateTagsCmd.java @@ -25,7 +25,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -38,7 +37,7 @@ import com.cloud.server.ResourceTag; import com.cloud.server.ResourceTag.ResourceObjectType; -@APICommand(name = "createTags", description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0", entityType = {IAMEntityType.ResourceTag}, +@APICommand(name = "createTags", description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0", entityType = {ResourceTag.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateTagsCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(CreateTagsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java b/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java index 39b6630b61..e42cfce4d9 100644 --- a/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/tag/DeleteTagsCmd.java @@ -25,7 +25,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -35,9 +34,10 @@ import org.apache.cloudstack.api.response.SuccessResponse; import com.cloud.event.EventTypes; +import com.cloud.server.ResourceTag; import com.cloud.server.ResourceTag.ResourceObjectType; -@APICommand(name = "deleteTags", description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0", entityType = {IAMEntityType.ResourceTag}, +@APICommand(name = "deleteTags", description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0", entityType = {ResourceTag.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteTagsCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteTagsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/tag/ListTagsCmd.java b/api/src/org/apache/cloudstack/api/command/user/tag/ListTagsCmd.java index b2249104ac..e02b25c446 100644 --- a/api/src/org/apache/cloudstack/api/command/user/tag/ListTagsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/tag/ListTagsCmd.java @@ -17,7 +17,6 @@ package org.apache.cloudstack.api.command.user.tag; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd; @@ -25,7 +24,9 @@ import org.apache.cloudstack.api.response.ListResponse; import org.apache.cloudstack.api.response.ResourceTagResponse; -@APICommand(name = "listTags", description = "List resource tag(s)", responseObject = ResourceTagResponse.class, since = "4.0.0", entityType = {IAMEntityType.ResourceTag}, +import com.cloud.server.ResourceTag; + +@APICommand(name = "listTags", description = "List resource tag(s)", responseObject = ResourceTagResponse.class, since = "4.0.0", entityType = {ResourceTag.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListTagsCmd extends BaseListProjectAndAccountResourcesCmd { private static final String s_name = "listtagsresponse"; diff --git a/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java index 0be9ab8007..249aa0e9be 100644 --- a/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/template/ListTemplatesCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -30,10 +29,11 @@ import org.apache.cloudstack.api.response.ZoneResponse; import org.apache.cloudstack.context.CallContext; +import com.cloud.template.VirtualMachineTemplate; import com.cloud.template.VirtualMachineTemplate.TemplateFilter; import com.cloud.user.Account; -@APICommand(name = "listTemplates", description = "List all public, private, and privileged templates.", responseObject = TemplateResponse.class, entityType = {IAMEntityType.VirtualMachineTemplate}, responseView = ResponseView.Restricted, +@APICommand(name = "listTemplates", description = "List all public, private, and privileged templates.", responseObject = TemplateResponse.class, entityType = {VirtualMachineTemplate.class}, responseView = ResponseView.Restricted, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListTemplatesCmd extends BaseListTaggedResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListTemplatesCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplatePermissionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplatePermissionsCmd.java index d5d0c58742..2029156837 100644 --- a/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplatePermissionsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/template/UpdateTemplatePermissionsCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.BaseUpdateTemplateOrIsoPermissionsCmd; import org.apache.cloudstack.api.response.SuccessResponse; @@ -28,7 +27,7 @@ @APICommand(name = "updateTemplatePermissions", responseObject = SuccessResponse.class, description = "Updates a template visibility permissions. " + "A public template is visible to all accounts within the same domain. " + "A private template is visible only to the owner of the template. " - + "A priviledged template is a private template with account permissions added. " + "Only accounts specified under the template permissions are visible to them.", entityType = {IAMEntityType.VirtualMachineTemplate}, + + "A priviledged template is a private template with account permissions added. " + "Only accounts specified under the template permissions are visible to them.", entityType = {VirtualMachineTemplate.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpdateTemplatePermissionsCmd extends BaseUpdateTemplateOrIsoPermissionsCmd { @Override diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java index a1bbe2a45b..f265ecf236 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -39,8 +38,9 @@ import com.cloud.event.EventTypes; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "addNicToVirtualMachine", description = "Adds VM to specified network by creating a NIC", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "addNicToVirtualMachine", description = "Adds VM to specified network by creating a NIC", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class AddNicToVMCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(AddNicToVMCmd.class); diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java index f492789a16..1414774122 100755 --- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java @@ -26,7 +26,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.affinity.AffinityGroupResponse; @@ -68,8 +67,9 @@ import com.cloud.template.VirtualMachineTemplate; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "deployVirtualMachine", description = "Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = { IAMEntityType.VirtualMachine }, +@APICommand(name = "deployVirtualMachine", description = "Creates and automatically starts a virtual machine based on a service offering, disk offering, and template.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd { public static final Logger s_logger = Logger.getLogger(DeployVMCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java index 4c3a41589c..f2caa15d55 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/DestroyVMCmd.java @@ -18,16 +18,15 @@ import java.util.List; -import org.apache.cloudstack.api.BaseAsyncVMCmd; import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.BaseAsyncVMCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ResponseObject.ResponseView; import org.apache.cloudstack.api.ServerApiException; @@ -39,8 +38,9 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "destroyVirtualMachine", description = "Destroys a virtual machine. Once destroyed, only the administrator can recover it.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "destroyVirtualMachine", description = "Destroys a virtual machine. Once destroyed, only the administrator can recover it.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class DestroyVMCmd extends BaseAsyncVMCmd { @@ -67,6 +67,7 @@ public class DestroyVMCmd extends BaseAsyncVMCmd { /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// + @Override public Long getId() { return id; } diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/GetVMPasswordCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/GetVMPasswordCmd.java index ebee189d35..0ba9db538a 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/GetVMPasswordCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/GetVMPasswordCmd.java @@ -20,7 +20,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -32,8 +31,9 @@ import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "getVMPassword", responseObject = GetVMPasswordResponse.class, description = "Returns an encrypted password for the VM", entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "getVMPassword", responseObject = GetVMPasswordResponse.class, description = "Returns an encrypted password for the VM", entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class GetVMPasswordCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(GetVMPasswordCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java index 6c95a1215e..76e3db07b7 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/ListVMsCmd.java @@ -22,7 +22,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.affinity.AffinityGroupResponse; import org.apache.cloudstack.api.APICommand; @@ -46,9 +45,10 @@ import org.apache.cloudstack.api.response.ZoneResponse; import com.cloud.exception.InvalidParameterValueException; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "listVirtualMachines", description = "List the virtual machines owned by the account.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = { IAMEntityType.VirtualMachine }, +@APICommand(name = "listVirtualMachines", description = "List the virtual machines owned by the account.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class ListVMsCmd extends BaseListTaggedResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListVMsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java index 0f041148cd..2bafc739fa 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/RebootVMCmd.java @@ -16,16 +16,15 @@ // under the License. package org.apache.cloudstack.api.command.user.vm; -import org.apache.cloudstack.api.BaseAsyncVMCmd; import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.BaseAsyncVMCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ResponseObject.ResponseView; import org.apache.cloudstack.api.ServerApiException; @@ -37,8 +36,9 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "rebootVirtualMachine", description = "Reboots a virtual machine.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "rebootVirtualMachine", description = "Reboots a virtual machine.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class RebootVMCmd extends BaseAsyncVMCmd { public static final Logger s_logger = Logger.getLogger(RebootVMCmd.class.getName()); @@ -56,6 +56,7 @@ public class RebootVMCmd extends BaseAsyncVMCmd { /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// + @Override public Long getId() { return id; } diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java index 44dfcf61af..d740260fc6 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/RemoveNicFromVMCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -39,8 +38,9 @@ import com.cloud.event.EventTypes; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "removeNicFromVirtualMachine", description = "Removes VM from specified network by deleting a NIC", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "removeNicFromVirtualMachine", description = "Removes VM from specified network by deleting a NIC", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class RemoveNicFromVMCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(RemoveNicFromVMCmd.class); diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java index 615ef69369..d15ea47875 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMPasswordCmd.java @@ -16,16 +16,15 @@ // under the License. package org.apache.cloudstack.api.command.user.vm; -import org.apache.cloudstack.api.BaseAsyncVMCmd; import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.BaseAsyncVMCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ResponseObject.ResponseView; import org.apache.cloudstack.api.ServerApiException; @@ -37,10 +36,11 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; @APICommand(name = "resetPasswordForVirtualMachine", responseObject=UserVmResponse.class, description="Resets the password for virtual machine. " + "The virtual machine must be in a \"Stopped\" state and the template must already " + - "support this feature for this command to take effect. [async]", responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, + "support this feature for this command to take effect. [async]", responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class ResetVMPasswordCmd extends BaseAsyncVMCmd { public static final Logger s_logger = Logger.getLogger(ResetVMPasswordCmd.class.getName()); @@ -64,6 +64,7 @@ public class ResetVMPasswordCmd extends BaseAsyncVMCmd { /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// + @Override public Long getId() { return id; } diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java index 7d43853149..6b4ce5c998 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/ResetVMSSHKeyCmd.java @@ -17,16 +17,15 @@ package org.apache.cloudstack.api.command.user.vm; -import org.apache.cloudstack.api.BaseAsyncVMCmd; import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.BaseAsyncVMCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ResponseObject.ResponseView; import org.apache.cloudstack.api.ServerApiException; @@ -40,9 +39,10 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; @APICommand(name = "resetSSHKeyForVirtualMachine", responseObject = UserVmResponse.class, description = "Resets the SSH Key for virtual machine. " + - "The virtual machine must be in a \"Stopped\" state. [async]", responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, + "The virtual machine must be in a \"Stopped\" state. [async]", responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class ResetVMSSHKeyCmd extends BaseAsyncVMCmd { @@ -81,6 +81,7 @@ public String getName() { return name; } + @Override public Long getId() { return id; } diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java index 0d5ef70bee..b1cc602173 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/RestoreVMCmd.java @@ -16,15 +16,14 @@ // under the License. package org.apache.cloudstack.api.command.user.vm; -import org.apache.cloudstack.api.BaseAsyncVMCmd; import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.BaseAsyncVMCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ResponseObject.ResponseView; import org.apache.cloudstack.api.ServerApiException; @@ -39,8 +38,9 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "restoreVirtualMachine", description = "Restore a VM to original template/ISO or new template/ISO", responseObject = UserVmResponse.class, since = "3.0.0", responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "restoreVirtualMachine", description = "Restore a VM to original template/ISO or new template/ISO", responseObject = UserVmResponse.class, since = "3.0.0", responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class RestoreVMCmd extends BaseAsyncVMCmd { diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java index d668ad4fed..76f9472dac 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/ScaleVMCmd.java @@ -24,7 +24,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -46,9 +45,10 @@ import com.cloud.exception.VirtualMachineMigrationException; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "scaleVirtualMachine", description = "Scales the virtual machine to a new service offering.", responseObject = SuccessResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "scaleVirtualMachine", description = "Scales the virtual machine to a new service offering.", responseObject = SuccessResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ScaleVMCmd extends BaseAsyncVMCmd { public static final Logger s_logger = Logger.getLogger(ScaleVMCmd.class.getName()); @@ -73,6 +73,7 @@ public class ScaleVMCmd extends BaseAsyncVMCmd { /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// + @Override public Long getId() { return id; } diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java index 13b7442eaf..7b1cf8fd6b 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/StartVMCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; @@ -44,8 +43,9 @@ import com.cloud.user.Account; import com.cloud.uservm.UserVm; import com.cloud.utils.exception.ExecutionException; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "startVirtualMachine", responseObject = UserVmResponse.class, description = "Starts a virtual machine.", responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "startVirtualMachine", responseObject = UserVmResponse.class, description = "Starts a virtual machine.", responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class StartVMCmd extends BaseAsyncVMCmd { public static final Logger s_logger = Logger.getLogger(StartVMCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java index 6db5d18d30..d02fd7d47a 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/StopVMCmd.java @@ -16,16 +16,15 @@ // under the License. package org.apache.cloudstack.api.command.user.vm; -import org.apache.cloudstack.api.BaseAsyncVMCmd; import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.BaseAsyncVMCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ResponseObject.ResponseView; import org.apache.cloudstack.api.ServerApiException; @@ -36,8 +35,9 @@ import com.cloud.exception.ConcurrentOperationException; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "stopVirtualMachine", responseObject = UserVmResponse.class, description = "Stops a virtual machine.", responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "stopVirtualMachine", responseObject = UserVmResponse.class, description = "Stops a virtual machine.", responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class StopVMCmd extends BaseAsyncVMCmd { public static final Logger s_logger = Logger.getLogger(StopVMCmd.class.getName()); @@ -61,6 +61,7 @@ public class StopVMCmd extends BaseAsyncVMCmd { // ///////////////// Accessors /////////////////////// // /////////////////////////////////////////////////// + @Override public Long getId() { return id; } diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java index c70f7e502d..cffd903792 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateDefaultNicForVMCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -39,8 +38,9 @@ import com.cloud.event.EventTypes; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "updateDefaultNicForVirtualMachine", description = "Changes the default NIC on a VM", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "updateDefaultNicForVirtualMachine", description = "Changes the default NIC on a VM", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class UpdateDefaultNicForVMCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(UpdateDefaultNicForVMCmd.class); diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java index fac82aac9b..1d0e68dfc3 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; @@ -37,10 +36,11 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; @APICommand(name = "updateVirtualMachine", description="Updates properties of a virtual machine. The VM has to be stopped and restarted for the " + "new properties to take effect. UpdateVirtualMachine does not first check whether the VM is stopped. " + - "Therefore, stop the VM manually before issuing this call.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, + "Therefore, stop the VM manually before issuing this call.", responseObject = UserVmResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class UpdateVMCmd extends BaseCustomIdCmd { public static final Logger s_logger = Logger.getLogger(UpdateVMCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java index 3560b04098..1923198eb5 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java @@ -23,7 +23,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -42,10 +41,11 @@ import com.cloud.offering.ServiceOffering; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; @APICommand(name = "changeServiceForVirtualMachine", responseObject=UserVmResponse.class, description="Changes the service offering for a virtual machine. " + "The virtual machine must be in a \"Stopped\" state for " + - "this command to take effect.", responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, + "this command to take effect.", responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class UpgradeVMCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(UpgradeVMCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vmgroup/CreateVMGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmgroup/CreateVMGroupCmd.java index 104cfa3672..6947f15059 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vmgroup/CreateVMGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vmgroup/CreateVMGroupCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -32,7 +31,7 @@ import com.cloud.vm.InstanceGroup; -@APICommand(name = "createInstanceGroup", description = "Creates a vm group", responseObject = InstanceGroupResponse.class, entityType = {IAMEntityType.InstanceGroup}, +@APICommand(name = "createInstanceGroup", description = "Creates a vm group", responseObject = InstanceGroupResponse.class, entityType = {InstanceGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateVMGroupCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(CreateVMGroupCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vmgroup/DeleteVMGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmgroup/DeleteVMGroupCmd.java index 0bc52369d2..8311eccf99 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vmgroup/DeleteVMGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vmgroup/DeleteVMGroupCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -33,7 +32,7 @@ import com.cloud.user.Account; import com.cloud.vm.InstanceGroup; -@APICommand(name = "deleteInstanceGroup", description = "Deletes a vm group", responseObject = SuccessResponse.class, entityType = {IAMEntityType.InstanceGroup}, +@APICommand(name = "deleteInstanceGroup", description = "Deletes a vm group", responseObject = SuccessResponse.class, entityType = {InstanceGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteVMGroupCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(DeleteVMGroupCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vmgroup/ListVMGroupsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmgroup/ListVMGroupsCmd.java index e9844dd19a..73fdb8aa18 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vmgroup/ListVMGroupsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vmgroup/ListVMGroupsCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd; @@ -26,7 +25,9 @@ import org.apache.cloudstack.api.response.InstanceGroupResponse; import org.apache.cloudstack.api.response.ListResponse; -@APICommand(name = "listInstanceGroups", description = "Lists vm groups", responseObject = InstanceGroupResponse.class, entityType = {IAMEntityType.InstanceGroup}, +import com.cloud.vm.InstanceGroup; + +@APICommand(name = "listInstanceGroups", description = "Lists vm groups", responseObject = InstanceGroupResponse.class, entityType = {InstanceGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListVMGroupsCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListVMGroupsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vmgroup/UpdateVMGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmgroup/UpdateVMGroupCmd.java index e06ec52e1a..befa46c9ce 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vmgroup/UpdateVMGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vmgroup/UpdateVMGroupCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -32,7 +31,7 @@ import com.cloud.user.Account; import com.cloud.vm.InstanceGroup; -@APICommand(name = "updateInstanceGroup", description = "Updates a vm group", responseObject = InstanceGroupResponse.class, entityType = {IAMEntityType.InstanceGroup}, +@APICommand(name = "updateInstanceGroup", description = "Updates a vm group", responseObject = InstanceGroupResponse.class, entityType = {InstanceGroup.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpdateVMGroupCmd extends BaseCmd { diff --git a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java index fae0e61723..10ff5cddb1 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java @@ -19,7 +19,6 @@ import java.util.logging.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -37,7 +36,7 @@ import com.cloud.uservm.UserVm; import com.cloud.vm.snapshot.VMSnapshot; -@APICommand(name = "createVMSnapshot", description = "Creates snapshot for a vm.", responseObject = VMSnapshotResponse.class, since = "4.2.0", entityType = {IAMEntityType.VMSnapshot}, +@APICommand(name = "createVMSnapshot", description = "Creates snapshot for a vm.", responseObject = VMSnapshotResponse.class, since = "4.2.0", entityType = {VMSnapshot.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateVMSnapshotCmd extends BaseAsyncCreateCmd { diff --git a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java index af076cff57..7baad7cd59 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/DeleteVMSnapshotCmd.java @@ -19,7 +19,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -36,7 +35,7 @@ import com.cloud.user.Account; import com.cloud.vm.snapshot.VMSnapshot; -@APICommand(name = "deleteVMSnapshot", description = "Deletes a vmsnapshot.", responseObject = SuccessResponse.class, since = "4.2.0", entityType = {IAMEntityType.VMSnapshot}, +@APICommand(name = "deleteVMSnapshot", description = "Deletes a vmsnapshot.", responseObject = SuccessResponse.class, since = "4.2.0", entityType = {VMSnapshot.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteVMSnapshotCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteVMSnapshotCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/ListVMSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/ListVMSnapshotCmd.java index 3167d09f01..c9bc2430d2 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/ListVMSnapshotCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/ListVMSnapshotCmd.java @@ -20,7 +20,6 @@ import java.util.ArrayList; import java.util.List; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListTaggedResourcesCmd; @@ -31,7 +30,7 @@ import com.cloud.vm.snapshot.VMSnapshot; -@APICommand(name = "listVMSnapshot", description = "List virtual machine snapshot by conditions", responseObject = VMSnapshotResponse.class, since = "4.2.0", entityType = {IAMEntityType.VMSnapshot}, +@APICommand(name = "listVMSnapshot", description = "List virtual machine snapshot by conditions", responseObject = VMSnapshotResponse.class, since = "4.2.0", entityType = {VMSnapshot.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListVMSnapshotCmd extends BaseListTaggedResourcesCmd { diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java index f9d9081f36..53b6bb6a4f 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -36,8 +35,9 @@ import com.cloud.event.EventTypes; import com.cloud.storage.Volume; import com.cloud.user.Account; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "attachVolume", description = "Attaches a disk volume to a virtual machine.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.VirtualMachine}, +@APICommand(name = "attachVolume", description = "Attaches a disk volume to a virtual machine.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class AttachVolumeCmd extends BaseAsyncVolumeCmd { public static final Logger s_logger = Logger.getLogger(AttachVolumeCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java index 9b83f61b0b..75c34a21c5 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; @@ -43,7 +42,7 @@ import com.cloud.storage.Snapshot; import com.cloud.storage.Volume; -@APICommand(name = "createVolume", responseObject = VolumeResponse.class, description = "Creates a disk volume from a disk offering. This disk volume must still be attached to a virtual machine to make use of it.", responseView = ResponseView.Restricted, entityType = {IAMEntityType.Volume}, +@APICommand(name = "createVolume", responseObject = VolumeResponse.class, description = "Creates a disk volume from a disk offering. This disk volume must still be attached to a virtual machine to make use of it.", responseView = ResponseView.Restricted, entityType = {Volume.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateVolumeCmd extends BaseAsyncCreateCustomIdCmd { public static final Logger s_logger = Logger.getLogger(CreateVolumeCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java index 6ca96b08b0..02b80d983d 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java @@ -17,7 +17,6 @@ package org.apache.cloudstack.api.command.user.volume; import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -34,7 +33,7 @@ import com.cloud.storage.Volume; import com.cloud.user.Account; -@APICommand(name = "deleteVolume", description = "Deletes a detached disk volume.", responseObject = SuccessResponse.class, entityType = {IAMEntityType.Volume}, +@APICommand(name = "deleteVolume", description = "Deletes a detached disk volume.", responseObject = SuccessResponse.class, entityType = {Volume.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteVolumeCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(DeleteVolumeCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java index bfd032203c..270931c261 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/DetachVolumeCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -37,8 +36,9 @@ import com.cloud.storage.Volume; import com.cloud.user.Account; import com.cloud.uservm.UserVm; +import com.cloud.vm.VirtualMachine; -@APICommand(name = "detachVolume", description = "Detaches a disk volume from a virtual machine.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.Volume}, +@APICommand(name = "detachVolume", description = "Detaches a disk volume from a virtual machine.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DetachVolumeCmd extends BaseAsyncVolumeCmd { public static final Logger s_logger = Logger.getLogger(DetachVolumeCmd.class.getName()); @@ -48,7 +48,6 @@ public class DetachVolumeCmd extends BaseAsyncVolumeCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @ACL(accessType = AccessType.OperateEntry) @Parameter(name=ApiConstants.ID, type=CommandType.UUID, entityType=VolumeResponse.class, description="the ID of the disk volume") private Long id; @@ -56,6 +55,7 @@ public class DetachVolumeCmd extends BaseAsyncVolumeCmd { @Parameter(name = ApiConstants.DEVICE_ID, type = CommandType.LONG, description = "the device ID on the virtual machine where volume is detached from") private Long deviceId; + @ACL(accessType = AccessType.OperateEntry) @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, entityType = UserVmResponse.class, diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java index cc7f56cc7b..d560fc2e89 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/ExtractVolumeCmd.java @@ -16,16 +16,15 @@ // under the License. package org.apache.cloudstack.api.command.user.volume; -import org.apache.cloudstack.api.BaseAsyncVolumeCmd; import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; +import org.apache.cloudstack.api.BaseAsyncVolumeCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; import org.apache.cloudstack.api.response.ExtractResponse; @@ -39,7 +38,7 @@ import com.cloud.storage.Volume; import com.cloud.user.Account; -@APICommand(name = "extractVolume", description = "Extracts volume", responseObject = ExtractResponse.class, entityType = {IAMEntityType.Volume}, +@APICommand(name = "extractVolume", description = "Extracts volume", responseObject = ExtractResponse.class, entityType = {Volume.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ExtractVolumeCmd extends BaseAsyncVolumeCmd { public static final Logger s_logger = Logger.getLogger(ExtractVolumeCmd.class.getName()); @@ -72,6 +71,7 @@ public class ExtractVolumeCmd extends BaseAsyncVolumeCmd { /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// + @Override public Long getId() { return id; } diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java index b4ac4ae64c..bd169b5ba4 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; @@ -35,7 +34,9 @@ import org.apache.cloudstack.api.response.VolumeResponse; import org.apache.cloudstack.api.response.ZoneResponse; -@APICommand(name = "listVolumes", description = "Lists all volumes.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = { IAMEntityType.Volume }, +import com.cloud.storage.Volume; + +@APICommand(name = "listVolumes", description = "Lists all volumes.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {Volume.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListVolumesCmd extends BaseListTaggedResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListVolumesCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/MigrateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/MigrateVolumeCmd.java index d80595a78f..3cfcdc831a 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/MigrateVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/MigrateVolumeCmd.java @@ -16,7 +16,6 @@ // under the License. package org.apache.cloudstack.api.command.user.volume; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -31,7 +30,7 @@ import com.cloud.storage.Volume; import com.cloud.user.Account; -@APICommand(name = "migrateVolume", description = "Migrate volume", responseObject = VolumeResponse.class, since = "3.0.0", responseView = ResponseView.Restricted, entityType = {IAMEntityType.Volume}, +@APICommand(name = "migrateVolume", description = "Migrate volume", responseObject = VolumeResponse.class, since = "3.0.0", responseView = ResponseView.Restricted, entityType = {Volume.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class MigrateVolumeCmd extends BaseAsyncVolumeCmd { private static final String s_name = "migratevolumeresponse"; diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java index d5cd62bbc3..dd887ac5ad 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/ResizeVolumeCmd.java @@ -17,7 +17,6 @@ package org.apache.cloudstack.api.command.user.volume; import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -41,7 +40,7 @@ import com.cloud.user.Account; -@APICommand(name = "resizeVolume", description = "Resizes a volume", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.Volume}, +@APICommand(name = "resizeVolume", description = "Resizes a volume", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {Volume.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ResizeVolumeCmd extends BaseAsyncVolumeCmd { public static final Logger s_logger = Logger.getLogger(ResizeVolumeCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java index 05e461e5ec..45b9ecd26f 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; @@ -38,7 +37,7 @@ import com.cloud.exception.InvalidParameterValueException; import com.cloud.storage.Volume; -@APICommand(name = "updateVolume", description = "Updates the volume.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = { IAMEntityType.Volume }, +@APICommand(name = "updateVolume", description = "Updates the volume.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {Volume.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpdateVolumeCmd extends BaseAsyncCustomIdCmd { public static final Logger s_logger = Logger.getLogger(UpdateVolumeCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java index e992759224..7a08abf276 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/UploadVolumeCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -40,7 +39,7 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.storage.Volume; -@APICommand(name = "uploadVolume", description = "Uploads a data disk.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.Volume}, +@APICommand(name = "uploadVolume", description = "Uploads a data disk.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {Volume.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UploadVolumeCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(UploadVolumeCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java index f2c9e2c2e2..e2f2029ce0 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateStaticRouteCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -40,7 +39,7 @@ import com.cloud.network.vpc.Vpc; import com.cloud.network.vpc.VpcGateway; -@APICommand(name = "createStaticRoute", description = "Creates a static route", responseObject = StaticRouteResponse.class, entityType = {IAMEntityType.StaticRoute}, +@APICommand(name = "createStaticRoute", description = "Creates a static route", responseObject = StaticRouteResponse.class, entityType = {StaticRoute.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateStaticRouteCmd extends BaseAsyncCreateCmd { private static final String s_name = "createstaticrouteresponse"; diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java index 4bf79da9ae..e2f261e1ba 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpc/CreateVPCCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -41,7 +40,7 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.vpc.Vpc; -@APICommand(name = "createVPC", description = "Creates a VPC", responseObject = VpcResponse.class, responseView = ResponseView.Restricted, entityType = {IAMEntityType.Vpc}, +@APICommand(name = "createVPC", description = "Creates a VPC", responseObject = VpcResponse.class, responseView = ResponseView.Restricted, entityType = {Vpc.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateVPCCmd extends BaseAsyncCreateCmd { public static final Logger s_logger = Logger.getLogger(CreateVPCCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java index 0017753e33..9449e6d534 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteStaticRouteCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -38,7 +37,7 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.vpc.StaticRoute; -@APICommand(name = "deleteStaticRoute", description = "Deletes a static route", responseObject = SuccessResponse.class, entityType = {IAMEntityType.StaticRoute}, +@APICommand(name = "deleteStaticRoute", description = "Deletes a static route", responseObject = SuccessResponse.class, entityType = {StaticRoute.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteStaticRouteCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteStaticRouteCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java index 5928aabff6..9d13b63e6a 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpc/DeleteVPCCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -36,7 +35,7 @@ import com.cloud.network.vpc.Vpc; import com.cloud.user.Account; -@APICommand(name = "deleteVPC", description = "Deletes a VPC", responseObject = SuccessResponse.class, entityType = {IAMEntityType.Vpc}, +@APICommand(name = "deleteVPC", description = "Deletes a VPC", responseObject = SuccessResponse.class, entityType = {Vpc.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteVPCCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteVPCCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java index 160355a481..a985e7633c 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpc/ListPrivateGatewaysCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd; @@ -31,9 +30,10 @@ import org.apache.cloudstack.api.response.VpcResponse; import com.cloud.network.vpc.PrivateGateway; +import com.cloud.network.vpc.VpcGateway; import com.cloud.utils.Pair; -@APICommand(name = "listPrivateGateways", description = "List private gateways", responseObject = PrivateGatewayResponse.class, entityType = {IAMEntityType.VpcGateway}, +@APICommand(name = "listPrivateGateways", description = "List private gateways", responseObject = PrivateGatewayResponse.class, entityType = {VpcGateway.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListPrivateGatewaysCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListPrivateGatewaysCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/ListStaticRoutesCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/ListStaticRoutesCmd.java index b2cdf87911..3dba84c8a7 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpc/ListStaticRoutesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpc/ListStaticRoutesCmd.java @@ -19,7 +19,6 @@ import java.util.ArrayList; import java.util.List; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListTaggedResourcesCmd; @@ -32,7 +31,7 @@ import com.cloud.network.vpc.StaticRoute; import com.cloud.utils.Pair; -@APICommand(name = "listStaticRoutes", description = "Lists all static routes", responseObject = StaticRouteResponse.class, entityType = {IAMEntityType.StaticRoute}, +@APICommand(name = "listStaticRoutes", description = "Lists all static routes", responseObject = StaticRouteResponse.class, entityType = {StaticRoute.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListStaticRoutesCmd extends BaseListTaggedResourcesCmd { private static final String s_name = "liststaticroutesresponse"; diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java index fa60f6f773..9079dff11d 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCsCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -36,7 +35,7 @@ import com.cloud.network.vpc.Vpc; -@APICommand(name = "listVPCs", description = "Lists VPCs", responseObject = VpcResponse.class, responseView = ResponseView.Restricted, entityType = { IAMEntityType.Vpc }, +@APICommand(name = "listVPCs", description = "Lists VPCs", responseObject = VpcResponse.class, responseView = ResponseView.Restricted, entityType = {Vpc.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListVPCsCmd extends BaseListTaggedResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListVPCsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java index d1d805ae48..e1a5306866 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -37,7 +36,7 @@ import com.cloud.network.vpc.Vpc; import com.cloud.user.Account; -@APICommand(name = "restartVPC", description = "Restarts a VPC", responseObject = VpcResponse.class, entityType = {IAMEntityType.Vpc}, +@APICommand(name = "restartVPC", description = "Restarts a VPC", responseObject = VpcResponse.class, entityType = {Vpc.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class RestartVPCCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(RestartVPCCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java index 76244233b9..e4956031f5 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; @@ -36,7 +35,7 @@ import com.cloud.network.vpc.Vpc; import com.cloud.user.Account; -@APICommand(name = "updateVPC", description = "Updates a VPC", responseObject = VpcResponse.class, responseView = ResponseView.Restricted, entityType = { IAMEntityType.Vpc }, +@APICommand(name = "updateVPC", description = "Updates a VPC", responseObject = VpcResponse.class, responseView = ResponseView.Restricted, entityType = {Vpc.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpdateVPCCmd extends BaseAsyncCustomIdCmd { public static final Logger s_logger = Logger.getLogger(UpdateVPCCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java index e839f9feff..9993102eca 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/AddVpnUserCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -35,7 +34,7 @@ import com.cloud.network.VpnUser; import com.cloud.user.Account; -@APICommand(name = "addVpnUser", description = "Adds vpn users", responseObject = VpnUsersResponse.class, entityType = {IAMEntityType.VpnUser}, +@APICommand(name = "addVpnUser", description = "Adds vpn users", responseObject = VpnUsersResponse.class, entityType = {VpnUser.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class AddVpnUserCmd extends BaseAsyncCreateCmd { public static final Logger s_logger = Logger.getLogger(AddVpnUserCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java index 4df21345ec..2883b1999d 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -38,7 +37,7 @@ import com.cloud.network.IpAddress; import com.cloud.network.RemoteAccessVpn; -@APICommand(name = "createRemoteAccessVpn", description = "Creates a l2tp/ipsec remote access vpn", responseObject = RemoteAccessVpnResponse.class, entityType = { IAMEntityType.RemoteAccessVpn }, +@APICommand(name = "createRemoteAccessVpn", description = "Creates a l2tp/ipsec remote access vpn", responseObject = RemoteAccessVpnResponse.class, entityType = {RemoteAccessVpn.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateRemoteAccessVpnCmd extends BaseAsyncCreateCmd { public static final Logger s_logger = Logger.getLogger(CreateRemoteAccessVpnCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java index d405c17ac3..71245c340a 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -39,7 +38,7 @@ import com.cloud.network.vpc.Vpc; -@APICommand(name = "createVpnConnection", description = "Create site to site vpn connection", responseObject = Site2SiteVpnConnectionResponse.class, entityType = { IAMEntityType.Site2SiteVpnConnection }, +@APICommand(name = "createVpnConnection", description = "Create site to site vpn connection", responseObject = Site2SiteVpnConnectionResponse.class, entityType = {Site2SiteVpnConnection.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateVpnConnectionCmd extends BaseAsyncCreateCmd { public static final Logger s_logger = Logger.getLogger(CreateVpnConnectionCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java index 5da46f0ada..6967ff4978 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnCustomerGatewayCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -32,7 +31,7 @@ import com.cloud.event.EventTypes; import com.cloud.network.Site2SiteCustomerGateway; -@APICommand(name = "createVpnCustomerGateway", description = "Creates site to site vpn customer gateway", responseObject = Site2SiteCustomerGatewayResponse.class, entityType = {IAMEntityType.Site2SiteCustomerGateway}, +@APICommand(name = "createVpnCustomerGateway", description = "Creates site to site vpn customer gateway", responseObject = Site2SiteCustomerGatewayResponse.class, entityType = {Site2SiteCustomerGateway.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateVpnCustomerGatewayCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(CreateVpnCustomerGatewayCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java index 12abfb6e35..d5b5edbeee 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -33,7 +32,7 @@ import com.cloud.network.Site2SiteVpnGateway; import com.cloud.network.vpc.Vpc; -@APICommand(name = "createVpnGateway", description = "Creates site to site vpn local gateway", responseObject = Site2SiteVpnGatewayResponse.class, entityType = { IAMEntityType.Site2SiteVpnGateway }, +@APICommand(name = "createVpnGateway", description = "Creates site to site vpn local gateway", responseObject = Site2SiteVpnGatewayResponse.class, entityType = {Site2SiteVpnGateway.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateVpnGatewayCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(CreateVpnGatewayCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteRemoteAccessVpnCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteRemoteAccessVpnCmd.java index 7d0c5aa5a4..f8941246d6 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteRemoteAccessVpnCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteRemoteAccessVpnCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseAsyncCmd; @@ -33,7 +32,7 @@ import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.RemoteAccessVpn; -@APICommand(name = "deleteRemoteAccessVpn", description = "Destroys a l2tp/ipsec remote access vpn", responseObject = SuccessResponse.class, entityType = {IAMEntityType.RemoteAccessVpn}, +@APICommand(name = "deleteRemoteAccessVpn", description = "Destroys a l2tp/ipsec remote access vpn", responseObject = SuccessResponse.class, entityType = {RemoteAccessVpn.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteRemoteAccessVpnCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteRemoteAccessVpnCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java index 6034bcb0de..a76b0c804e 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnConnectionCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -33,7 +32,7 @@ import com.cloud.network.Site2SiteVpnConnection; import com.cloud.user.Account; -@APICommand(name = "deleteVpnConnection", description = "Delete site to site vpn connection", responseObject = SuccessResponse.class, entityType = {IAMEntityType.Site2SiteVpnConnection}, +@APICommand(name = "deleteVpnConnection", description = "Delete site to site vpn connection", responseObject = SuccessResponse.class, entityType = {Site2SiteVpnConnection.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteVpnConnectionCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteVpnConnectionCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java index 3faf5fd201..aad69ce0a9 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnCustomerGatewayCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -34,7 +33,7 @@ import com.cloud.network.Site2SiteCustomerGateway; import com.cloud.user.Account; -@APICommand(name = "deleteVpnCustomerGateway", description = "Delete site to site vpn customer gateway", responseObject = SuccessResponse.class, entityType = {IAMEntityType.Site2SiteCustomerGateway}, +@APICommand(name = "deleteVpnCustomerGateway", description = "Delete site to site vpn customer gateway", responseObject = SuccessResponse.class, entityType = {Site2SiteCustomerGateway.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteVpnCustomerGatewayCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteVpnCustomerGatewayCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java index 66fd55bba2..ff927408a2 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/DeleteVpnGatewayCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -32,7 +31,7 @@ import com.cloud.network.Site2SiteVpnGateway; import com.cloud.user.Account; -@APICommand(name = "deleteVpnGateway", description = "Delete site to site vpn gateway", responseObject = SuccessResponse.class, entityType = {IAMEntityType.Site2SiteVpnGateway}, +@APICommand(name = "deleteVpnGateway", description = "Delete site to site vpn gateway", responseObject = SuccessResponse.class, entityType = {Site2SiteVpnGateway.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DeleteVpnGatewayCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeleteVpnGatewayCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListRemoteAccessVpnsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListRemoteAccessVpnsCmd.java index 61a3a2993b..492eaccefa 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListRemoteAccessVpnsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListRemoteAccessVpnsCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -35,7 +34,7 @@ import com.cloud.network.RemoteAccessVpn; import com.cloud.utils.Pair; -@APICommand(name = "listRemoteAccessVpns", description = "Lists remote access vpns", responseObject = RemoteAccessVpnResponse.class, entityType = { IAMEntityType.RemoteAccessVpn }, +@APICommand(name = "listRemoteAccessVpns", description = "Lists remote access vpns", responseObject = RemoteAccessVpnResponse.class, entityType = {RemoteAccessVpn.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListRemoteAccessVpnsCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListRemoteAccessVpnsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnConnectionsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnConnectionsCmd.java index f8e81c2f01..74b9325eb2 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnConnectionsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnConnectionsCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -34,7 +33,7 @@ import com.cloud.network.Site2SiteVpnConnection; import com.cloud.utils.Pair; -@APICommand(name = "listVpnConnections", description = "Lists site to site vpn connection gateways", responseObject = Site2SiteVpnConnectionResponse.class, entityType = { IAMEntityType.Site2SiteVpnConnection }, +@APICommand(name = "listVpnConnections", description = "Lists site to site vpn connection gateways", responseObject = Site2SiteVpnConnectionResponse.class, entityType = {Site2SiteVpnConnection.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListVpnConnectionsCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListVpnConnectionsCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnCustomerGatewaysCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnCustomerGatewaysCmd.java index fed96a72b3..6b870be138 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnCustomerGatewaysCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnCustomerGatewaysCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd; @@ -32,7 +31,7 @@ import com.cloud.network.Site2SiteCustomerGateway; import com.cloud.utils.Pair; -@APICommand(name = "listVpnCustomerGateways", description = "Lists site to site vpn customer gateways", responseObject = Site2SiteCustomerGatewayResponse.class, entityType = {IAMEntityType.Site2SiteCustomerGateway}, +@APICommand(name = "listVpnCustomerGateways", description = "Lists site to site vpn customer gateways", responseObject = Site2SiteCustomerGatewayResponse.class, entityType = {Site2SiteCustomerGateway.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListVpnCustomerGatewaysCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListVpnCustomerGatewaysCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnGatewaysCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnGatewaysCmd.java index 17702252e8..3eade02880 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnGatewaysCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnGatewaysCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -34,7 +33,7 @@ import com.cloud.network.Site2SiteVpnGateway; import com.cloud.utils.Pair; -@APICommand(name = "listVpnGateways", description = "Lists site 2 site vpn gateways", responseObject = Site2SiteVpnGatewayResponse.class, entityType = { IAMEntityType.Site2SiteVpnGateway }, +@APICommand(name = "listVpnGateways", description = "Lists site 2 site vpn gateways", responseObject = Site2SiteVpnGatewayResponse.class, entityType = {Site2SiteVpnGateway.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListVpnGatewaysCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListVpnGatewaysCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnUsersCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnUsersCmd.java index 1d8ea85cbb..9af060ac00 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnUsersCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ListVpnUsersCmd.java @@ -21,7 +21,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListProjectAndAccountResourcesCmd; @@ -32,7 +31,7 @@ import com.cloud.network.VpnUser; import com.cloud.utils.Pair; -@APICommand(name = "listVpnUsers", description = "Lists vpn users", responseObject = VpnUsersResponse.class, entityType = {IAMEntityType.VpnUser}, +@APICommand(name = "listVpnUsers", description = "Lists vpn users", responseObject = VpnUsersResponse.class, entityType = {VpnUser.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListVpnUsersCmd extends BaseListProjectAndAccountResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListVpnUsersCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/RemoveVpnUserCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/RemoveVpnUserCmd.java index 068746945c..f552b14fbf 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/RemoveVpnUserCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/RemoveVpnUserCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -31,9 +30,10 @@ import org.apache.cloudstack.context.CallContext; import com.cloud.event.EventTypes; +import com.cloud.network.VpnUser; import com.cloud.user.Account; -@APICommand(name = "removeVpnUser", description = "Removes vpn user", responseObject = SuccessResponse.class, entityType = {IAMEntityType.VpnUser}, +@APICommand(name = "removeVpnUser", description = "Removes vpn user", responseObject = SuccessResponse.class, entityType = {VpnUser.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class RemoveVpnUserCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(RemoveVpnUserCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java index 21eb182d0b..75e74adcda 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/ResetVpnConnectionCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -34,7 +33,7 @@ import com.cloud.network.Site2SiteVpnConnection; import com.cloud.user.Account; -@APICommand(name = "resetVpnConnection", description = "Reset site to site vpn connection", responseObject = Site2SiteVpnConnectionResponse.class, entityType = {IAMEntityType.Site2SiteVpnConnection}, +@APICommand(name = "resetVpnConnection", description = "Reset site to site vpn connection", responseObject = Site2SiteVpnConnectionResponse.class, entityType = {Site2SiteVpnConnection.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ResetVpnConnectionCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(ResetVpnConnectionCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java index 9e178efc0e..ceb67d510a 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/UpdateVpnCustomerGatewayCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -32,7 +31,7 @@ import com.cloud.event.EventTypes; import com.cloud.network.Site2SiteCustomerGateway; -@APICommand(name = "updateVpnCustomerGateway", description = "Update site to site vpn customer gateway", responseObject = Site2SiteCustomerGatewayResponse.class, entityType = {IAMEntityType.Site2SiteCustomerGateway}, +@APICommand(name = "updateVpnCustomerGateway", description = "Update site to site vpn customer gateway", responseObject = Site2SiteCustomerGatewayResponse.class, entityType = {Site2SiteCustomerGateway.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpdateVpnCustomerGatewayCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(UpdateVpnCustomerGatewayCmd.class.getName()); diff --git a/engine/components-api/src/com/cloud/network/addr/PublicIp.java b/engine/components-api/src/com/cloud/network/addr/PublicIp.java index ff11b3349a..ec4a9ee82e 100644 --- a/engine/components-api/src/com/cloud/network/addr/PublicIp.java +++ b/engine/components-api/src/com/cloud/network/addr/PublicIp.java @@ -18,8 +18,6 @@ import java.util.Date; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.dc.VlanVO; import com.cloud.network.PublicIpAddress; import com.cloud.network.dao.IPAddressVO; @@ -240,7 +238,7 @@ public boolean isDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.PublicIpAddress; + public Class getEntityType() { + return PublicIpAddress.class; } } diff --git a/engine/components-api/src/com/cloud/network/rules/StaticNatRuleImpl.java b/engine/components-api/src/com/cloud/network/rules/StaticNatRuleImpl.java index bdaf2bc1b2..9a49db0ca1 100644 --- a/engine/components-api/src/com/cloud/network/rules/StaticNatRuleImpl.java +++ b/engine/components-api/src/com/cloud/network/rules/StaticNatRuleImpl.java @@ -18,8 +18,6 @@ import java.util.List; -import org.apache.cloudstack.acl.IAMEntityType; - public class StaticNatRuleImpl implements StaticNatRule { long id; String xid; @@ -152,7 +150,7 @@ public boolean isDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.FirewallRule; + public Class getEntityType() { + return FirewallRule.class; } } diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java index 6aa1e36ccd..00c2d1af18 100755 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java @@ -40,7 +40,6 @@ import org.apache.log4j.Logger; import org.apache.cloudstack.acl.ControlledEntity.ACLType; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; @@ -675,7 +674,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { _networksDao.addDomainToNetwork(id, domainId, subdomainAccess == null ? true : subdomainAccess); //send event for storing the domain wide resource access Map params = new HashMap(); - params.put(ApiConstants.ENTITY_TYPE, IAMEntityType.Network); + params.put(ApiConstants.ENTITY_TYPE, Network.class); params.put(ApiConstants.ENTITY_ID, id); params.put(ApiConstants.DOMAIN_ID, domainId); params.put(ApiConstants.SUBDOMAIN_ACCESS, subdomainAccess == null ? true : subdomainAccess); @@ -2245,7 +2244,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { _networkAccountDao.remove(networkAccount.getId()); // remove its related ACL permission - Pair networkMsg = new Pair(IAMEntityType.Network, networkFinal.getId()); + Pair, Long> networkMsg = new Pair, Long>(Network.class, networkFinal.getId()); _messageBus.publish(_name, EntityManager.MESSAGE_REMOVE_ENTITY_EVENT, PublishScope.LOCAL, networkMsg); } diff --git a/engine/schema/src/com/cloud/event/EventVO.java b/engine/schema/src/com/cloud/event/EventVO.java index 3ae46d6244..9be37ddb96 100644 --- a/engine/schema/src/com/cloud/event/EventVO.java +++ b/engine/schema/src/com/cloud/event/EventVO.java @@ -29,8 +29,6 @@ import javax.persistence.Table; import javax.persistence.Transient; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.utils.db.GenericDao; @Entity @@ -223,7 +221,7 @@ public void setDisplay(boolean display) { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Event; + public Class getEntityType() { + return Event.class; } } diff --git a/engine/schema/src/com/cloud/network/UserIpv6AddressVO.java b/engine/schema/src/com/cloud/network/UserIpv6AddressVO.java index 9314993620..397c7b3b31 100644 --- a/engine/schema/src/com/cloud/network/UserIpv6AddressVO.java +++ b/engine/schema/src/com/cloud/network/UserIpv6AddressVO.java @@ -28,8 +28,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.utils.db.GenericDao; @Entity @@ -188,7 +186,7 @@ public void setCreated(Date created) { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.UserIpv6Address; + public Class getEntityType() { + return UserIpv6Address.class; } } diff --git a/engine/schema/src/com/cloud/network/VpnUserVO.java b/engine/schema/src/com/cloud/network/VpnUserVO.java index 695aac0a9d..d6c4b60352 100644 --- a/engine/schema/src/com/cloud/network/VpnUserVO.java +++ b/engine/schema/src/com/cloud/network/VpnUserVO.java @@ -27,8 +27,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.utils.db.Encrypt; @Entity @@ -129,7 +127,7 @@ public void setUuid(String uuid) { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.VpnUser; + public Class getEntityType() { + return VpnUser.class; } } diff --git a/engine/schema/src/com/cloud/network/as/AutoScalePolicyVO.java b/engine/schema/src/com/cloud/network/as/AutoScalePolicyVO.java index bde38f83d9..1842533000 100644 --- a/engine/schema/src/com/cloud/network/as/AutoScalePolicyVO.java +++ b/engine/schema/src/com/cloud/network/as/AutoScalePolicyVO.java @@ -30,7 +30,6 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.InternalIdentity; import com.cloud.utils.db.GenericDao; @@ -153,8 +152,8 @@ public void setLastQuiteTime(Date lastQuiteTime) { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.AutoScalePolicy; + public Class getEntityType() { + return AutoScalePolicy.class; } } diff --git a/engine/schema/src/com/cloud/network/as/AutoScaleVmGroupVO.java b/engine/schema/src/com/cloud/network/as/AutoScaleVmGroupVO.java index 3a05a7b909..d32e7f873a 100644 --- a/engine/schema/src/com/cloud/network/as/AutoScaleVmGroupVO.java +++ b/engine/schema/src/com/cloud/network/as/AutoScaleVmGroupVO.java @@ -30,7 +30,6 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.InternalIdentity; import com.cloud.utils.db.GenericDao; @@ -227,7 +226,7 @@ public boolean isDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.AutoScaleVmGroup; + public Class getEntityType() { + return AutoScaleVmGroup.class; } } diff --git a/engine/schema/src/com/cloud/network/as/AutoScaleVmProfileVO.java b/engine/schema/src/com/cloud/network/as/AutoScaleVmProfileVO.java index 0b59394ddd..69e4c8190f 100644 --- a/engine/schema/src/com/cloud/network/as/AutoScaleVmProfileVO.java +++ b/engine/schema/src/com/cloud/network/as/AutoScaleVmProfileVO.java @@ -33,7 +33,6 @@ import javax.persistence.InheritanceType; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; @@ -235,8 +234,8 @@ public boolean isDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.AutoScaleVmProfile; + public Class getEntityType() { + return AutoScaleVmProfile.class; } } diff --git a/engine/schema/src/com/cloud/network/as/ConditionVO.java b/engine/schema/src/com/cloud/network/as/ConditionVO.java index e8c1d0bc59..5035f731b5 100644 --- a/engine/schema/src/com/cloud/network/as/ConditionVO.java +++ b/engine/schema/src/com/cloud/network/as/ConditionVO.java @@ -29,7 +29,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; @@ -130,8 +129,8 @@ public Date getRemoved() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Condition; + public Class getEntityType() { + return Condition.class; } } diff --git a/engine/schema/src/com/cloud/network/dao/IPAddressVO.java b/engine/schema/src/com/cloud/network/dao/IPAddressVO.java index d06b8c51d7..de2d934630 100644 --- a/engine/schema/src/com/cloud/network/dao/IPAddressVO.java +++ b/engine/schema/src/com/cloud/network/dao/IPAddressVO.java @@ -31,8 +31,6 @@ import javax.persistence.TemporalType; import javax.persistence.Transient; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.network.IpAddress; import com.cloud.utils.net.Ip; @@ -350,7 +348,7 @@ public void setDisplay(boolean display) { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.IpAddress; + public Class getEntityType() { + return IpAddress.class; } } diff --git a/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java b/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java index 999fdfc649..01fba00d0b 100644 --- a/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java +++ b/engine/schema/src/com/cloud/network/dao/MonitoringServiceVO.java @@ -25,8 +25,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.network.MonitoringService; @Entity @@ -120,7 +118,7 @@ public String getProcessName() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.MonitorService; + public Class getEntityType() { + return MonitoringService.class; } } diff --git a/engine/schema/src/com/cloud/network/dao/NetworkVO.java b/engine/schema/src/com/cloud/network/dao/NetworkVO.java index dc9d60aa05..f1d7e7efba 100644 --- a/engine/schema/src/com/cloud/network/dao/NetworkVO.java +++ b/engine/schema/src/com/cloud/network/dao/NetworkVO.java @@ -30,7 +30,6 @@ import javax.persistence.Transient; import org.apache.cloudstack.acl.ControlledEntity; -import org.apache.cloudstack.acl.IAMEntityType; import com.cloud.network.Network; import com.cloud.network.Networks.BroadcastDomainType; @@ -589,8 +588,8 @@ public Long getNetworkACLId() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Network; + public Class getEntityType() { + return Network.class; } @Override diff --git a/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java b/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java index 8f95f184c4..0616939fc2 100644 --- a/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java +++ b/engine/schema/src/com/cloud/network/dao/RemoteAccessVpnVO.java @@ -25,8 +25,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.network.RemoteAccessVpn; @Entity @@ -168,7 +166,7 @@ public boolean isDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.RemoteAccessVpn; + public Class getEntityType() { + return RemoteAccessVpn.class; } } diff --git a/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayVO.java b/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayVO.java index 6de4d429ce..5bcf361836 100644 --- a/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayVO.java +++ b/engine/schema/src/com/cloud/network/dao/Site2SiteCustomerGatewayVO.java @@ -26,8 +26,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.network.Site2SiteCustomerGateway; import com.cloud.utils.db.Encrypt; import com.cloud.utils.db.GenericDao; @@ -211,7 +209,7 @@ public long getAccountId() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Site2SiteCustomerGateway; + public Class getEntityType() { + return Site2SiteCustomerGateway.class; } } diff --git a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionVO.java b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionVO.java index f0074c04dc..85643fc043 100644 --- a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionVO.java +++ b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnConnectionVO.java @@ -28,7 +28,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.InternalIdentity; import com.cloud.network.Site2SiteVpnConnection; @@ -175,7 +174,7 @@ public boolean isDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Site2SiteVpnConnection; + public Class getEntityType() { + return Site2SiteVpnConnection.class; } } diff --git a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayVO.java b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayVO.java index 33236b9d68..260e5fc4c0 100644 --- a/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayVO.java +++ b/engine/schema/src/com/cloud/network/dao/Site2SiteVpnGatewayVO.java @@ -26,8 +26,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.network.Site2SiteVpnGateway; import com.cloud.utils.db.GenericDao; @@ -133,7 +131,7 @@ public boolean isDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Site2SiteVpnGateway; + public Class getEntityType() { + return Site2SiteVpnGateway.class; } } diff --git a/engine/schema/src/com/cloud/network/dao/SslCertVO.java b/engine/schema/src/com/cloud/network/dao/SslCertVO.java index 6ef7afd1c7..2676d611bd 100644 --- a/engine/schema/src/com/cloud/network/dao/SslCertVO.java +++ b/engine/schema/src/com/cloud/network/dao/SslCertVO.java @@ -23,8 +23,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.network.lb.SslCert; import com.cloud.utils.db.Encrypt; @@ -124,8 +122,8 @@ public String getFingerPrint() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.SSLCert; + public Class getEntityType() { + return SslCert.class; } } \ No newline at end of file diff --git a/engine/schema/src/com/cloud/network/rules/FirewallRuleVO.java b/engine/schema/src/com/cloud/network/rules/FirewallRuleVO.java index 5e22dd4f4e..169102af8c 100644 --- a/engine/schema/src/com/cloud/network/rules/FirewallRuleVO.java +++ b/engine/schema/src/com/cloud/network/rules/FirewallRuleVO.java @@ -34,8 +34,6 @@ import javax.persistence.Table; import javax.persistence.Transient; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.utils.db.GenericDao; import com.cloud.utils.net.NetUtils; @@ -285,7 +283,7 @@ public boolean isDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.FirewallRule; + public Class getEntityType() { + return FirewallRule.class; } } diff --git a/engine/schema/src/com/cloud/network/security/SecurityGroupVO.java b/engine/schema/src/com/cloud/network/security/SecurityGroupVO.java index 26859f704e..4a4c83ae74 100644 --- a/engine/schema/src/com/cloud/network/security/SecurityGroupVO.java +++ b/engine/schema/src/com/cloud/network/security/SecurityGroupVO.java @@ -25,8 +25,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - @Entity @Table(name = ("security_group")) public class SecurityGroupVO implements SecurityGroup { @@ -97,7 +95,7 @@ public void setUuid(String uuid) { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.SecurityGroup; + public Class getEntityType() { + return SecurityGroup.class; } } diff --git a/engine/schema/src/com/cloud/network/vpc/StaticRouteVO.java b/engine/schema/src/com/cloud/network/vpc/StaticRouteVO.java index a9ba05154b..2c2d53edb2 100644 --- a/engine/schema/src/com/cloud/network/vpc/StaticRouteVO.java +++ b/engine/schema/src/com/cloud/network/vpc/StaticRouteVO.java @@ -28,8 +28,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.utils.db.GenericDao; @Entity @@ -139,7 +137,7 @@ public String toString() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.StaticRoute; + public Class getEntityType() { + return StaticRoute.class; } } \ No newline at end of file diff --git a/engine/schema/src/com/cloud/network/vpc/VpcGatewayVO.java b/engine/schema/src/com/cloud/network/vpc/VpcGatewayVO.java index 48238b1971..23568b4923 100644 --- a/engine/schema/src/com/cloud/network/vpc/VpcGatewayVO.java +++ b/engine/schema/src/com/cloud/network/vpc/VpcGatewayVO.java @@ -28,8 +28,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.utils.db.GenericDao; @Entity @@ -219,7 +217,7 @@ public long getNetworkACLId() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.VpcGateway; + public Class getEntityType() { + return VpcGateway.class; } } diff --git a/engine/schema/src/com/cloud/network/vpc/VpcVO.java b/engine/schema/src/com/cloud/network/vpc/VpcVO.java index 8d0f6a2a0f..22d51dd542 100644 --- a/engine/schema/src/com/cloud/network/vpc/VpcVO.java +++ b/engine/schema/src/com/cloud/network/vpc/VpcVO.java @@ -26,8 +26,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.utils.db.GenericDao; @Entity @@ -102,8 +100,8 @@ public VpcVO(long zoneId, String name, String displayText, long accountId, long uuid = UUID.randomUUID().toString(); state = State.Enabled; this.networkDomain = networkDomain; - this.vpcOfferingId = vpcOffId; - this.usesDistributedRouter = useDistributedRouter; + vpcOfferingId = vpcOffId; + usesDistributedRouter = useDistributedRouter; this.regionLevelVpc = regionLevelVpc; } @@ -213,8 +211,8 @@ public boolean isDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Vpc; + public Class getEntityType() { + return Vpc.class; } @Override diff --git a/engine/schema/src/com/cloud/projects/ProjectInvitationVO.java b/engine/schema/src/com/cloud/projects/ProjectInvitationVO.java index 885c148c2b..9775135bea 100644 --- a/engine/schema/src/com/cloud/projects/ProjectInvitationVO.java +++ b/engine/schema/src/com/cloud/projects/ProjectInvitationVO.java @@ -28,8 +28,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.utils.db.GenericDao; @Entity @@ -149,7 +147,7 @@ public long getAccountId() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.ProjectInvitation; + public Class getEntityType() { + return ProjectInvitation.class; } } diff --git a/engine/schema/src/com/cloud/storage/SnapshotVO.java b/engine/schema/src/com/cloud/storage/SnapshotVO.java index 4c8ceb7cdd..dae049f604 100644 --- a/engine/schema/src/com/cloud/storage/SnapshotVO.java +++ b/engine/schema/src/com/cloud/storage/SnapshotVO.java @@ -30,8 +30,6 @@ import com.google.gson.annotations.Expose; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.utils.db.GenericDao; @@ -239,7 +237,7 @@ public void setUuid(String uuid) { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Snapshot; + public Class getEntityType() { + return Snapshot.class; } } diff --git a/engine/schema/src/com/cloud/storage/VMTemplateVO.java b/engine/schema/src/com/cloud/storage/VMTemplateVO.java index c0b7d0fc02..9a77cbf873 100755 --- a/engine/schema/src/com/cloud/storage/VMTemplateVO.java +++ b/engine/schema/src/com/cloud/storage/VMTemplateVO.java @@ -31,8 +31,6 @@ import javax.persistence.TemporalType; import javax.persistence.Transient; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.storage.Storage.ImageFormat; import com.cloud.storage.Storage.TemplateType; @@ -635,7 +633,7 @@ public void setUpdated(Date updated) { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.VirtualMachineTemplate; + public Class getEntityType() { + return VirtualMachineTemplate.class; } } diff --git a/engine/schema/src/com/cloud/storage/VolumeVO.java b/engine/schema/src/com/cloud/storage/VolumeVO.java index af99a16ffa..9f27c231f0 100755 --- a/engine/schema/src/com/cloud/storage/VolumeVO.java +++ b/engine/schema/src/com/cloud/storage/VolumeVO.java @@ -32,8 +32,6 @@ import javax.persistence.TemporalType; import javax.persistence.Transient; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.storage.Storage.StoragePoolType; import com.cloud.utils.NumbersUtil; import com.cloud.utils.db.GenericDao; @@ -601,7 +599,7 @@ public Integer getHypervisorSnapshotReserve() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Volume; + public Class getEntityType() { + return Volume.class; } } diff --git a/engine/schema/src/com/cloud/tags/ResourceTagVO.java b/engine/schema/src/com/cloud/tags/ResourceTagVO.java index 6b743ffd23..eadddd1e31 100644 --- a/engine/schema/src/com/cloud/tags/ResourceTagVO.java +++ b/engine/schema/src/com/cloud/tags/ResourceTagVO.java @@ -27,8 +27,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.server.ResourceTag; @@ -166,7 +164,7 @@ public String getResourceUuid() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.ResourceTag; + public Class getEntityType() { + return ResourceTag.class; } } diff --git a/engine/schema/src/com/cloud/user/AccountVO.java b/engine/schema/src/com/cloud/user/AccountVO.java index 674cdb9101..0f5a0446e9 100644 --- a/engine/schema/src/com/cloud/user/AccountVO.java +++ b/engine/schema/src/com/cloud/user/AccountVO.java @@ -28,8 +28,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.utils.db.GenericDao; @Entity @@ -190,7 +188,7 @@ public boolean isDefault() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Account; + public Class getEntityType() { + return Account.class; } } diff --git a/engine/schema/src/com/cloud/user/SSHKeyPairVO.java b/engine/schema/src/com/cloud/user/SSHKeyPairVO.java index 4dc03c45b0..fd7173ee7a 100644 --- a/engine/schema/src/com/cloud/user/SSHKeyPairVO.java +++ b/engine/schema/src/com/cloud/user/SSHKeyPairVO.java @@ -24,8 +24,6 @@ import javax.persistence.Table; import javax.persistence.Transient; -import org.apache.cloudstack.acl.IAMEntityType; - @Entity @Table(name = "ssh_keypairs") public class SSHKeyPairVO implements SSHKeyPair { @@ -117,7 +115,7 @@ public void setPrivateKey(String privateKey) { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.SSHKeyPair; + public Class getEntityType() { + return SSHKeyPair.class; } } diff --git a/engine/schema/src/com/cloud/vm/InstanceGroupVO.java b/engine/schema/src/com/cloud/vm/InstanceGroupVO.java index 9b463d3428..395751b705 100644 --- a/engine/schema/src/com/cloud/vm/InstanceGroupVO.java +++ b/engine/schema/src/com/cloud/vm/InstanceGroupVO.java @@ -28,8 +28,6 @@ import javax.persistence.SecondaryTable; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.utils.db.GenericDao; @Entity @@ -120,7 +118,7 @@ public Short getAccountType() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.InstanceGroup; + public Class getEntityType() { + return InstanceGroup.class; } } diff --git a/engine/schema/src/com/cloud/vm/VMInstanceVO.java b/engine/schema/src/com/cloud/vm/VMInstanceVO.java index ddeebfeb75..c7206d07f4 100644 --- a/engine/schema/src/com/cloud/vm/VMInstanceVO.java +++ b/engine/schema/src/com/cloud/vm/VMInstanceVO.java @@ -36,8 +36,6 @@ import javax.persistence.TemporalType; import javax.persistence.Transient; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.utils.db.Encrypt; import com.cloud.utils.db.GenericDao; @@ -506,8 +504,8 @@ public Boolean isDynamicallyScalable() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.VirtualMachine; + public Class getEntityType() { + return VirtualMachine.class; } public VirtualMachine.PowerState getPowerState() { diff --git a/engine/schema/src/com/cloud/vm/dao/NicIpAliasVO.java b/engine/schema/src/com/cloud/vm/dao/NicIpAliasVO.java index 3df9909620..2f000fde8a 100644 --- a/engine/schema/src/com/cloud/vm/dao/NicIpAliasVO.java +++ b/engine/schema/src/com/cloud/vm/dao/NicIpAliasVO.java @@ -28,8 +28,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.utils.db.GenericDao; import com.cloud.utils.net.NetUtils; import com.cloud.vm.NicIpAlias; @@ -235,7 +233,7 @@ public String getStartIpOfSubnet() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.NicIpAlias; + public Class getEntityType() { + return NicIpAlias.class; } } diff --git a/engine/schema/src/com/cloud/vm/dao/NicSecondaryIpVO.java b/engine/schema/src/com/cloud/vm/dao/NicSecondaryIpVO.java index 995da17ddc..f8730aac5d 100644 --- a/engine/schema/src/com/cloud/vm/dao/NicSecondaryIpVO.java +++ b/engine/schema/src/com/cloud/vm/dao/NicSecondaryIpVO.java @@ -26,8 +26,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.utils.db.GenericDao; import com.cloud.vm.NicSecondaryIp; @@ -128,7 +126,7 @@ public long getVmId() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.NicSecondaryIp; + public Class getEntityType() { + return NicSecondaryIp.class; } } diff --git a/engine/schema/src/com/cloud/vm/snapshot/VMSnapshotVO.java b/engine/schema/src/com/cloud/vm/snapshot/VMSnapshotVO.java index 042b276fe4..df2966d45b 100644 --- a/engine/schema/src/com/cloud/vm/snapshot/VMSnapshotVO.java +++ b/engine/schema/src/com/cloud/vm/snapshot/VMSnapshotVO.java @@ -33,7 +33,6 @@ import javax.persistence.TemporalType; import javax.persistence.Transient; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.engine.subsystem.api.storage.VMSnapshotOptions; import com.cloud.utils.db.GenericDao; @@ -246,7 +245,7 @@ public void setRemoved(Date removed) { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.VMSnapshot; + public Class getEntityType() { + return VMSnapshot.class; } } diff --git a/engine/schema/src/org/apache/cloudstack/affinity/AffinityGroupVO.java b/engine/schema/src/org/apache/cloudstack/affinity/AffinityGroupVO.java index b9fda8e9e3..03274ad438 100644 --- a/engine/schema/src/org/apache/cloudstack/affinity/AffinityGroupVO.java +++ b/engine/schema/src/org/apache/cloudstack/affinity/AffinityGroupVO.java @@ -28,7 +28,6 @@ import javax.persistence.Table; import org.apache.cloudstack.acl.ControlledEntity; -import org.apache.cloudstack.acl.IAMEntityType; @Entity @Table(name = ("affinity_group")) @@ -126,8 +125,8 @@ public String toString() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.AffinityGroup; + public Class getEntityType() { + return AffinityGroup.class; } } diff --git a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java index 7403d62fcf..ced2f22dfa 100644 --- a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java +++ b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java @@ -37,8 +37,6 @@ import javax.persistence.TemporalType; import javax.persistence.Transient; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.utils.db.Encrypt; import com.cloud.utils.db.GenericDao; @@ -538,7 +536,7 @@ public void setVmReservation(VMReservationVO vmReservation) { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.VirtualMachine; + public Class getEntityType() { + return VirtualMachine.class; } } diff --git a/engine/schema/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancerRuleVO.java b/engine/schema/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancerRuleVO.java index a37fec2d51..88cd0003a2 100644 --- a/engine/schema/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancerRuleVO.java +++ b/engine/schema/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancerRuleVO.java @@ -28,8 +28,6 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.region.ha.GlobalLoadBalancerRule; @Entity @@ -191,7 +189,7 @@ public GlobalLoadBalancerRule.State getState() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.GlobalLoadBalancerRule; + public Class getEntityType() { + return GlobalLoadBalancerRule.class; } } diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java index bd14df59b0..7288d454c3 100644 --- a/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java +++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/store/TemplateObject.java @@ -23,7 +23,8 @@ import javax.inject.Inject; -import org.apache.cloudstack.acl.IAMEntityType; +import org.apache.log4j.Logger; + import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine; @@ -35,7 +36,6 @@ import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao; import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO; import org.apache.cloudstack.storage.to.TemplateObjectTO; -import org.apache.log4j.Logger; import com.cloud.agent.api.Answer; import com.cloud.agent.api.to.DataObjectType; @@ -50,6 +50,7 @@ import com.cloud.storage.VMTemplateVO; import com.cloud.storage.dao.VMTemplateDao; import com.cloud.storage.dao.VMTemplatePoolDao; +import com.cloud.template.VirtualMachineTemplate; import com.cloud.utils.component.ComponentContext; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.fsm.NoTransitionException; @@ -452,7 +453,7 @@ public boolean delete() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.VirtualMachineTemplate; + public Class getEntityType() { + return VirtualMachineTemplate.class; } } diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java index a8f1a56735..da8d341e49 100644 --- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java +++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotObject.java @@ -24,7 +24,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine; @@ -383,7 +382,7 @@ public boolean delete() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Snapshot; + public Class getEntityType() { + return Snapshot.class; } } diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java index fde13e17c8..c1aa8c2f0d 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java +++ b/engine/storage/src/org/apache/cloudstack/storage/image/TemplateEntityImpl.java @@ -23,7 +23,6 @@ import java.util.List; import java.util.Map; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.engine.cloud.entity.api.TemplateEntity; import org.apache.cloudstack.engine.subsystem.api.storage.TemplateInfo; import org.apache.cloudstack.storage.image.datastore.ImageStoreInfo; @@ -31,6 +30,7 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.storage.Storage.ImageFormat; import com.cloud.storage.Storage.TemplateType; +import com.cloud.template.VirtualMachineTemplate; public class TemplateEntityImpl implements TemplateEntity { protected TemplateInfo templateInfo; @@ -287,7 +287,7 @@ public long getVirtualSize() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.VirtualMachineTemplate; + public Class getEntityType() { + return VirtualMachineTemplate.class; } } diff --git a/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotEntityImpl.java b/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotEntityImpl.java index 848b165893..a660f41211 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotEntityImpl.java +++ b/engine/storage/src/org/apache/cloudstack/storage/snapshot/SnapshotEntityImpl.java @@ -21,10 +21,10 @@ import java.util.List; import java.util.Map; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.engine.cloud.entity.api.SnapshotEntity; import com.cloud.hypervisor.Hypervisor.HypervisorType; +import com.cloud.storage.Snapshot; public class SnapshotEntityImpl implements SnapshotEntity { @@ -185,7 +185,7 @@ public Type getRecurringType() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Snapshot; + public Class getEntityType() { + return Snapshot.class; } } diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java index 1f05be21f2..385f8e63e9 100644 --- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java +++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java @@ -22,7 +22,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.engine.subsystem.api.storage.DataObjectInStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine; @@ -670,7 +669,7 @@ public Long getVmSnapshotChainSize() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Volume; + public Class getEntityType() { + return Volume.class; } } diff --git a/server/src/com/cloud/api/query/vo/AffinityGroupJoinVO.java b/server/src/com/cloud/api/query/vo/AffinityGroupJoinVO.java index f659ed95bb..bcd0fdcbb9 100644 --- a/server/src/com/cloud/api/query/vo/AffinityGroupJoinVO.java +++ b/server/src/com/cloud/api/query/vo/AffinityGroupJoinVO.java @@ -24,7 +24,7 @@ import javax.persistence.Table; import org.apache.cloudstack.acl.ControlledEntity; -import org.apache.cloudstack.acl.IAMEntityType; +import org.apache.cloudstack.affinity.AffinityGroup; import com.cloud.vm.VirtualMachine; @@ -194,8 +194,8 @@ public ControlledEntity.ACLType getAclType() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.AffinityGroup; + public Class getEntityType() { + return AffinityGroup.class; } } diff --git a/server/src/com/cloud/api/query/vo/AsyncJobJoinVO.java b/server/src/com/cloud/api/query/vo/AsyncJobJoinVO.java index 7889b760a1..be85c2a62b 100644 --- a/server/src/com/cloud/api/query/vo/AsyncJobJoinVO.java +++ b/server/src/com/cloud/api/query/vo/AsyncJobJoinVO.java @@ -25,8 +25,8 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.ApiCommandJobType; +import org.apache.cloudstack.framework.jobs.AsyncJob; import com.cloud.utils.db.GenericDao; @@ -203,8 +203,8 @@ public String getInstanceUuid() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.AsyncJob; + public Class getEntityType() { + return AsyncJob.class; } @Override diff --git a/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java b/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java index ac32859ea1..79eb3bfb70 100644 --- a/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java +++ b/server/src/com/cloud/api/query/vo/DomainRouterJoinVO.java @@ -26,13 +26,12 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.network.Network.GuestType; import com.cloud.network.Networks.TrafficType; import com.cloud.network.router.VirtualRouter; import com.cloud.network.router.VirtualRouter.RedundantState; import com.cloud.utils.db.GenericDao; +import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachine.State; @Entity @@ -514,7 +513,7 @@ public VirtualRouter.Role getRole() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.VirtualMachine; + public Class getEntityType() { + return VirtualMachine.class; } } diff --git a/server/src/com/cloud/api/query/vo/EventJoinVO.java b/server/src/com/cloud/api/query/vo/EventJoinVO.java index b6b023ef6e..8fba938876 100644 --- a/server/src/com/cloud/api/query/vo/EventJoinVO.java +++ b/server/src/com/cloud/api/query/vo/EventJoinVO.java @@ -25,8 +25,7 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - +import com.cloud.event.Event; import com.cloud.event.Event.State; import com.cloud.utils.db.GenericDao; @@ -227,7 +226,7 @@ public boolean getDisplay() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Event; + public Class getEntityType() { + return Event.class; } } diff --git a/server/src/com/cloud/api/query/vo/InstanceGroupJoinVO.java b/server/src/com/cloud/api/query/vo/InstanceGroupJoinVO.java index 98d1a523e7..857cebf75f 100644 --- a/server/src/com/cloud/api/query/vo/InstanceGroupJoinVO.java +++ b/server/src/com/cloud/api/query/vo/InstanceGroupJoinVO.java @@ -23,9 +23,8 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.utils.db.GenericDao; +import com.cloud.vm.InstanceGroup; @Entity @Table(name = "instance_group_view") @@ -160,7 +159,7 @@ public Date getCreated() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.InstanceGroup; + public Class getEntityType() { + return InstanceGroup.class; } } diff --git a/server/src/com/cloud/api/query/vo/ProjectInvitationJoinVO.java b/server/src/com/cloud/api/query/vo/ProjectInvitationJoinVO.java index ba619a9a08..8b4918561c 100644 --- a/server/src/com/cloud/api/query/vo/ProjectInvitationJoinVO.java +++ b/server/src/com/cloud/api/query/vo/ProjectInvitationJoinVO.java @@ -25,8 +25,7 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - +import com.cloud.projects.ProjectInvitation; import com.cloud.projects.ProjectInvitation.State; import com.cloud.utils.db.GenericDao; @@ -164,7 +163,7 @@ public String getDomainPath() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.ProjectInvitation; + public Class getEntityType() { + return ProjectInvitation.class; } } diff --git a/server/src/com/cloud/api/query/vo/ResourceTagJoinVO.java b/server/src/com/cloud/api/query/vo/ResourceTagJoinVO.java index e1b8b812ae..2c1ff47509 100644 --- a/server/src/com/cloud/api/query/vo/ResourceTagJoinVO.java +++ b/server/src/com/cloud/api/query/vo/ResourceTagJoinVO.java @@ -23,8 +23,7 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - +import com.cloud.server.ResourceTag; import com.cloud.server.ResourceTag.ResourceObjectType; @Entity @@ -182,7 +181,7 @@ public String getCustomer() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.ResourceTag; + public Class getEntityType() { + return ResourceTag.class; } } diff --git a/server/src/com/cloud/api/query/vo/SecurityGroupJoinVO.java b/server/src/com/cloud/api/query/vo/SecurityGroupJoinVO.java index 3c9e3bf87a..69604e8286 100644 --- a/server/src/com/cloud/api/query/vo/SecurityGroupJoinVO.java +++ b/server/src/com/cloud/api/query/vo/SecurityGroupJoinVO.java @@ -23,8 +23,7 @@ import javax.persistence.Id; import javax.persistence.Table; -import org.apache.cloudstack.acl.IAMEntityType; - +import com.cloud.network.security.SecurityGroup; import com.cloud.network.security.SecurityRule.SecurityRuleType; import com.cloud.server.ResourceTag.ResourceObjectType; @@ -306,7 +305,7 @@ public String getTagCustomer() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.SecurityGroup; + public Class getEntityType() { + return SecurityGroup.class; } } diff --git a/server/src/com/cloud/api/query/vo/TemplateJoinVO.java b/server/src/com/cloud/api/query/vo/TemplateJoinVO.java index de0da2f1e5..834a9cedd0 100644 --- a/server/src/com/cloud/api/query/vo/TemplateJoinVO.java +++ b/server/src/com/cloud/api/query/vo/TemplateJoinVO.java @@ -27,7 +27,6 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine; import com.cloud.hypervisor.Hypervisor.HypervisorType; @@ -35,6 +34,7 @@ import com.cloud.storage.ScopeType; import com.cloud.storage.Storage; import com.cloud.storage.VMTemplateStorageResourceAssoc.Status; +import com.cloud.template.VirtualMachineTemplate; import com.cloud.template.VirtualMachineTemplate.State; import com.cloud.utils.db.GenericDao; @@ -544,7 +544,7 @@ public State getTemplateState() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.VirtualMachineTemplate; + public Class getEntityType() { + return VirtualMachineTemplate.class; } } diff --git a/server/src/com/cloud/api/query/vo/UserVmJoinVO.java b/server/src/com/cloud/api/query/vo/UserVmJoinVO.java index fcee393207..f3f48fc9ae 100644 --- a/server/src/com/cloud/api/query/vo/UserVmJoinVO.java +++ b/server/src/com/cloud/api/query/vo/UserVmJoinVO.java @@ -28,8 +28,6 @@ import javax.persistence.Table; import javax.persistence.Transient; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.network.Network.GuestType; import com.cloud.network.Networks.TrafficType; @@ -913,7 +911,7 @@ public String getDetailValue() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.VirtualMachine; + public Class getEntityType() { + return VirtualMachine.class; } } diff --git a/server/src/com/cloud/api/query/vo/VolumeJoinVO.java b/server/src/com/cloud/api/query/vo/VolumeJoinVO.java index 289b0b85af..8165d68f80 100644 --- a/server/src/com/cloud/api/query/vo/VolumeJoinVO.java +++ b/server/src/com/cloud/api/query/vo/VolumeJoinVO.java @@ -27,8 +27,6 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; -import org.apache.cloudstack.acl.IAMEntityType; - import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.server.ResourceTag.ResourceObjectType; import com.cloud.storage.Storage; @@ -578,7 +576,7 @@ public String getChainInfo() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.Volume; + public Class getEntityType() { + return Volume.class; } } diff --git a/server/src/com/cloud/api/response/SecurityGroupResultObject.java b/server/src/com/cloud/api/response/SecurityGroupResultObject.java index 66ba487641..c2cd423bef 100644 --- a/server/src/com/cloud/api/response/SecurityGroupResultObject.java +++ b/server/src/com/cloud/api/response/SecurityGroupResultObject.java @@ -22,7 +22,6 @@ import java.util.Map; import org.apache.cloudstack.acl.ControlledEntity; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.InternalIdentity; import com.cloud.api.ApiDBUtils; @@ -212,7 +211,7 @@ public static List transposeNetworkGroups(List getEntityType() { + return SecurityGroup.class; } } diff --git a/server/src/com/cloud/network/vpc/PrivateGatewayProfile.java b/server/src/com/cloud/network/vpc/PrivateGatewayProfile.java index b912e227ae..3dc984e444 100644 --- a/server/src/com/cloud/network/vpc/PrivateGatewayProfile.java +++ b/server/src/com/cloud/network/vpc/PrivateGatewayProfile.java @@ -16,7 +16,6 @@ // under the License. package com.cloud.network.vpc; -import org.apache.cloudstack.acl.IAMEntityType; public class PrivateGatewayProfile implements PrivateGateway { VpcGateway vpcGateway; @@ -113,7 +112,7 @@ public long getNetworkACLId() { } @Override - public IAMEntityType getEntityType() { - return IAMEntityType.VpcGateway; + public Class getEntityType() { + return VpcGateway.class; } } diff --git a/server/src/com/cloud/template/HypervisorTemplateAdapter.java b/server/src/com/cloud/template/HypervisorTemplateAdapter.java index 2b6f1ebf3a..9d52b3917e 100755 --- a/server/src/com/cloud/template/HypervisorTemplateAdapter.java +++ b/server/src/com/cloud/template/HypervisorTemplateAdapter.java @@ -29,7 +29,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.api.command.user.iso.DeleteIsoCmd; import org.apache.cloudstack.api.command.user.iso.RegisterIsoCmd; import org.apache.cloudstack.api.command.user.template.DeleteTemplateCmd; @@ -423,7 +422,7 @@ public boolean delete(TemplateProfile profile) { } // remove its related ACL permission - Pair tmplt = new Pair(IAMEntityType.VirtualMachineTemplate, template.getId()); + Pair, Long> tmplt = new Pair, Long>(VirtualMachineTemplate.class, template.getId()); _messageBus.publish(_name, EntityManager.MESSAGE_REMOVE_ENTITY_EVENT, PublishScope.LOCAL, tmplt); } diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java index 34123cdb98..81dc19890f 100755 --- a/server/src/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/com/cloud/template/TemplateManagerImpl.java @@ -33,7 +33,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListTemplateOrIsoPermissionsCmd; @@ -1304,7 +1303,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { // add ACL permission in IAM Map permit = new HashMap(); - permit.put(ApiConstants.ENTITY_TYPE, IAMEntityType.VirtualMachineTemplate.toString()); + permit.put(ApiConstants.ENTITY_TYPE, VirtualMachineTemplate.class); permit.put(ApiConstants.ENTITY_ID, id); permit.put(ApiConstants.ACCESS_TYPE, AccessType.UseEntry); permit.put(ApiConstants.IAM_ACTION, "listTemplates"); @@ -1321,7 +1320,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { _launchPermissionDao.removePermissions(id, accountIds); // remove ACL permission in IAM Map permit = new HashMap(); - permit.put(ApiConstants.ENTITY_TYPE, IAMEntityType.VirtualMachineTemplate.toString()); + permit.put(ApiConstants.ENTITY_TYPE, VirtualMachineTemplate.class); permit.put(ApiConstants.ENTITY_ID, id); permit.put(ApiConstants.ACCESS_TYPE, AccessType.UseEntry); permit.put(ApiConstants.IAM_ACTION, "listTemplates"); diff --git a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java index f375fde565..8e606ca058 100644 --- a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java +++ b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java @@ -28,7 +28,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.ControlledEntity; import org.apache.cloudstack.acl.ControlledEntity.ACLType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; @@ -218,7 +217,7 @@ public AffinityGroupVO doInTransaction(TransactionStatus status) { _affinityGroupDomainMapDao.persist(domainMap); //send event for storing the domain wide resource access Map params = new HashMap(); - params.put(ApiConstants.ENTITY_TYPE, IAMEntityType.AffinityGroup); + params.put(ApiConstants.ENTITY_TYPE, AffinityGroup.class); params.put(ApiConstants.ENTITY_ID, group.getId()); params.put(ApiConstants.DOMAIN_ID, domainId); params.put(ApiConstants.SUBDOMAIN_ACCESS, subDomainAccess); @@ -300,7 +299,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { _affinityGroupDomainMapDao.remove(groupDomain.getId()); } // remove its related ACL permission - Pair params = new Pair(IAMEntityType.AffinityGroup, affinityGroupIdFinal); + Pair, Long> params = new Pair, Long>(AffinityGroup.class, affinityGroupIdFinal); _messageBus.publish(_name, EntityManager.MESSAGE_REMOVE_ENTITY_EVENT, PublishScope.LOCAL, params); } } diff --git a/services/iam/plugin/src/org/apache/cloudstack/api/response/iam/IAMPermissionResponse.java b/services/iam/plugin/src/org/apache/cloudstack/api/response/iam/IAMPermissionResponse.java index 5def248d7a..046e1f4d34 100644 --- a/services/iam/plugin/src/org/apache/cloudstack/api/response/iam/IAMPermissionResponse.java +++ b/services/iam/plugin/src/org/apache/cloudstack/api/response/iam/IAMPermissionResponse.java @@ -18,7 +18,6 @@ import com.google.gson.annotations.SerializedName; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.PermissionScope; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseResponse; @@ -34,7 +33,7 @@ public class IAMPermissionResponse extends BaseResponse { @SerializedName(ApiConstants.ENTITY_TYPE) @Param(description = "the entity type of this permission") - private IAMEntityType entityType; + private String entityType; @SerializedName(ApiConstants.IAM_SCOPE) @Param(description = "scope of this permission") @@ -48,11 +47,11 @@ public class IAMPermissionResponse extends BaseResponse { @Param(description = "allow or deny of this permission") private IAMPolicyPermission.Permission permission; - public IAMEntityType getEntityType() { + public String getEntityType() { return entityType; } - public void setEntityType(IAMEntityType entityType) { + public void setEntityType(String entityType) { this.entityType = entityType; } diff --git a/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java b/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java index 69f669c7e1..e128cf13df 100644 --- a/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java +++ b/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java @@ -27,11 +27,18 @@ import javax.naming.ConfigurationException; import org.apache.log4j.Logger; +import org.bouncycastle.util.IPAddress; + +import com.amazonaws.auth.policy.Condition; +import com.amazonaws.services.ec2.model.SecurityGroup; +import com.amazonaws.services.ec2.model.Snapshot; +import com.amazonaws.services.ec2.model.Volume; +import com.amazonaws.services.ec2.model.Vpc; +import com.amazonaws.services.elasticache.model.Event; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.PermissionScope; import org.apache.cloudstack.acl.SecurityChecker.AccessType; -import org.apache.cloudstack.affinity.AffinityGroupVO; +import org.apache.cloudstack.affinity.AffinityGroup; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListCmd; import org.apache.cloudstack.api.InternalIdentity; @@ -54,7 +61,7 @@ import org.apache.cloudstack.api.response.iam.IAMPermissionResponse; import org.apache.cloudstack.api.response.iam.IAMPolicyResponse; import org.apache.cloudstack.context.CallContext; -import org.apache.cloudstack.framework.jobs.impl.AsyncJobVO; +import org.apache.cloudstack.framework.jobs.AsyncJob; import org.apache.cloudstack.framework.messagebus.MessageBus; import org.apache.cloudstack.framework.messagebus.MessageSubscriber; import org.apache.cloudstack.iam.api.IAMGroup; @@ -62,9 +69,6 @@ import org.apache.cloudstack.iam.api.IAMPolicyPermission; import org.apache.cloudstack.iam.api.IAMPolicyPermission.Permission; import org.apache.cloudstack.iam.api.IAMService; -import org.apache.cloudstack.iam.server.IAMGroupVO; -import org.apache.cloudstack.iam.server.IAMPolicyVO; -import org.apache.cloudstack.region.gslb.GlobalLoadBalancerRuleVO; import com.cloud.api.ApiServerService; import com.cloud.domain.Domain; @@ -72,50 +76,45 @@ import com.cloud.domain.dao.DomainDao; import com.cloud.event.ActionEvent; import com.cloud.event.EventTypes; -import com.cloud.event.EventVO; import com.cloud.exception.InvalidParameterValueException; -import com.cloud.network.UserIpv6AddressVO; -import com.cloud.network.VpnUserVO; -import com.cloud.network.as.AutoScalePolicyVO; -import com.cloud.network.as.AutoScaleVmGroupVO; -import com.cloud.network.as.AutoScaleVmProfileVO; -import com.cloud.network.as.ConditionVO; -import com.cloud.network.dao.IPAddressVO; -import com.cloud.network.dao.MonitoringServiceVO; -import com.cloud.network.dao.NetworkVO; -import com.cloud.network.dao.RemoteAccessVpnVO; -import com.cloud.network.dao.Site2SiteCustomerGatewayVO; -import com.cloud.network.dao.Site2SiteVpnConnectionVO; -import com.cloud.network.dao.Site2SiteVpnGatewayVO; -import com.cloud.network.dao.SslCertVO; -import com.cloud.network.rules.FirewallRuleVO; -import com.cloud.network.rules.PortForwardingRuleVO; -import com.cloud.network.security.SecurityGroupVO; -import com.cloud.network.vpc.StaticRouteVO; -import com.cloud.network.vpc.VpcGatewayVO; -import com.cloud.network.vpc.VpcVO; -import com.cloud.projects.ProjectInvitationVO; -import com.cloud.storage.SnapshotVO; -import com.cloud.storage.VMTemplateVO; -import com.cloud.storage.VolumeVO; -import com.cloud.tags.ResourceTagVO; +import com.cloud.network.IpAddress; +import com.cloud.network.MonitoringService; +import com.cloud.network.Network; +import com.cloud.network.RemoteAccessVpn; +import com.cloud.network.Site2SiteCustomerGateway; +import com.cloud.network.Site2SiteVpnConnection; +import com.cloud.network.Site2SiteVpnGateway; +import com.cloud.network.UserIpv6Address; +import com.cloud.network.VpnUser; +import com.cloud.network.as.AutoScalePolicy; +import com.cloud.network.as.AutoScaleVmGroup; +import com.cloud.network.as.AutoScaleVmProfile; +import com.cloud.network.lb.SslCert; +import com.cloud.network.rules.FirewallRule; +import com.cloud.network.rules.PortForwardingRule; +import com.cloud.network.vpc.StaticRoute; +import com.cloud.network.vpc.VpcGateway; +import com.cloud.projects.ProjectInvitation; +import com.cloud.region.ha.GlobalLoadBalancerRule; +import com.cloud.server.ResourceTag; import com.cloud.template.TemplateManager; +import com.cloud.template.VirtualMachineTemplate; import com.cloud.user.Account; import com.cloud.user.AccountManager; import com.cloud.user.AccountVO; import com.cloud.user.DomainManager; -import com.cloud.user.SSHKeyPairVO; +import com.cloud.user.SSHKeyPair; import com.cloud.user.dao.AccountDao; import com.cloud.utils.Pair; import com.cloud.utils.component.Manager; import com.cloud.utils.component.ManagerBase; import com.cloud.utils.db.DB; import com.cloud.utils.db.EntityManager; -import com.cloud.vm.InstanceGroupVO; -import com.cloud.vm.VMInstanceVO; -import com.cloud.vm.dao.NicIpAliasVO; -import com.cloud.vm.dao.NicSecondaryIpVO; -import com.cloud.vm.snapshot.VMSnapshotVO; +import com.cloud.vm.InstanceGroup; +import com.cloud.vm.NicIpAlias; +import com.cloud.vm.NicSecondaryIp; +import com.cloud.vm.VirtualMachine; +import com.cloud.vm.snapshot.VMSnapshot; @Local(value = {IAMApiService.class}) public class IAMApiServiceImpl extends ManagerBase implements IAMApiService, Manager { @@ -144,48 +143,46 @@ public class IAMApiServiceImpl extends ManagerBase implements IAMApiService, Man @Inject EntityManager _entityMgr; - private static final Map> s_typeMap = new HashMap>(); + private static final Map> s_typeMap = new HashMap>(); static { - s_typeMap.put(IAMEntityType.VirtualMachine, VMInstanceVO.class); - s_typeMap.put(IAMEntityType.Volume, VolumeVO.class); - s_typeMap.put(IAMEntityType.ResourceTag, ResourceTagVO.class); - s_typeMap.put(IAMEntityType.Account, AccountVO.class); - s_typeMap.put(IAMEntityType.AffinityGroup, AffinityGroupVO.class); - s_typeMap.put(IAMEntityType.AutoScalePolicy, AutoScalePolicyVO.class); - s_typeMap.put(IAMEntityType.AutoScaleVmProfile, AutoScaleVmProfileVO.class); - s_typeMap.put(IAMEntityType.AutoScaleVmGroup, AutoScaleVmGroupVO.class); - s_typeMap.put(IAMEntityType.Condition, ConditionVO.class); - s_typeMap.put(IAMEntityType.Vpc, VpcVO.class); - s_typeMap.put(IAMEntityType.VpcGateway, VpcGatewayVO.class); - s_typeMap.put(IAMEntityType.PrivateGateway, RemoteAccessVpnVO.class); - s_typeMap.put(IAMEntityType.VpnUser, VpnUserVO.class); - s_typeMap.put(IAMEntityType.VMSnapshot, VMSnapshotVO.class); - s_typeMap.put(IAMEntityType.VirtualMachineTemplate, VMTemplateVO.class); - s_typeMap.put(IAMEntityType.UserIpv6Address, UserIpv6AddressVO.class); - s_typeMap.put(IAMEntityType.StaticRoute, StaticRouteVO.class); - s_typeMap.put(IAMEntityType.SSHKeyPair, SSHKeyPairVO.class); - s_typeMap.put(IAMEntityType.Snapshot, SnapshotVO.class); - s_typeMap.put(IAMEntityType.Site2SiteVpnGateway, Site2SiteVpnGatewayVO.class); - s_typeMap.put(IAMEntityType.Site2SiteCustomerGateway, Site2SiteCustomerGatewayVO.class); - s_typeMap.put(IAMEntityType.Site2SiteVpnConnection, Site2SiteVpnConnectionVO.class); - s_typeMap.put(IAMEntityType.SecurityGroup, SecurityGroupVO.class); - s_typeMap.put(IAMEntityType.RemoteAccessVpn, RemoteAccessVpnVO.class); - s_typeMap.put(IAMEntityType.PublicIpAddress, IPAddressVO.class); - s_typeMap.put(IAMEntityType.ProjectInvitation, ProjectInvitationVO.class); - s_typeMap.put(IAMEntityType.NicSecondaryIp, NicSecondaryIpVO.class); - s_typeMap.put(IAMEntityType.NicIpAlias, NicIpAliasVO.class); - s_typeMap.put(IAMEntityType.Network, NetworkVO.class); - s_typeMap.put(IAMEntityType.IpAddress, IPAddressVO.class); - s_typeMap.put(IAMEntityType.InstanceGroup, InstanceGroupVO.class); - s_typeMap.put(IAMEntityType.GlobalLoadBalancerRule, GlobalLoadBalancerRuleVO.class); - s_typeMap.put(IAMEntityType.FirewallRule, FirewallRuleVO.class); - s_typeMap.put(IAMEntityType.PortForwardingRule, PortForwardingRuleVO.class); - s_typeMap.put(IAMEntityType.Event, EventVO.class); - s_typeMap.put(IAMEntityType.AsyncJob, AsyncJobVO.class); - s_typeMap.put(IAMEntityType.IAMGroup, IAMGroupVO.class); - s_typeMap.put(IAMEntityType.IAMPolicy, IAMPolicyVO.class); - s_typeMap.put(IAMEntityType.MonitorService, MonitoringServiceVO.class); - s_typeMap.put(IAMEntityType.SSLCert, SslCertVO.class); + s_typeMap.put(VirtualMachine.class.getSimpleName(), VirtualMachine.class); + s_typeMap.put(Volume.class.getSimpleName(), Volume.class); + s_typeMap.put(ResourceTag.class.getSimpleName(), ResourceTag.class); + s_typeMap.put(Account.class.getSimpleName(), Account.class); + s_typeMap.put(AffinityGroup.class.getSimpleName(), AffinityGroup.class); + s_typeMap.put(AutoScalePolicy.class.getSimpleName(), AutoScalePolicy.class); + s_typeMap.put(AutoScaleVmProfile.class.getSimpleName(), AutoScaleVmProfile.class); + s_typeMap.put(AutoScaleVmGroup.class.getSimpleName(), AutoScaleVmGroup.class); + s_typeMap.put(Condition.class.getSimpleName(), Condition.class); + s_typeMap.put(Vpc.class.getSimpleName(), Vpc.class); + s_typeMap.put(VpcGateway.class.getSimpleName(), VpcGateway.class); + s_typeMap.put(VpnUser.class.getSimpleName(), VpnUser.class); + s_typeMap.put(VMSnapshot.class.getSimpleName(), VMSnapshot.class); + s_typeMap.put(VirtualMachineTemplate.class.getSimpleName(), VirtualMachineTemplate.class); + s_typeMap.put(UserIpv6Address.class.getSimpleName(), UserIpv6Address.class); + s_typeMap.put(StaticRoute.class.getSimpleName(), StaticRoute.class); + s_typeMap.put(SSHKeyPair.class.getSimpleName(), SSHKeyPair.class); + s_typeMap.put(Snapshot.class.getSimpleName(), Snapshot.class); + s_typeMap.put(Site2SiteVpnGateway.class.getSimpleName(), Site2SiteVpnGateway.class); + s_typeMap.put(Site2SiteCustomerGateway.class.getSimpleName(), Site2SiteCustomerGateway.class); + s_typeMap.put(Site2SiteVpnConnection.class.getSimpleName(), Site2SiteVpnConnection.class); + s_typeMap.put(SecurityGroup.class.getSimpleName(), SecurityGroup.class); + s_typeMap.put(RemoteAccessVpn.class.getSimpleName(), RemoteAccessVpn.class); + s_typeMap.put(ProjectInvitation.class.getSimpleName(), ProjectInvitation.class); + s_typeMap.put(NicSecondaryIp.class.getSimpleName(), NicSecondaryIp.class); + s_typeMap.put(NicIpAlias.class.getSimpleName(), NicIpAlias.class); + s_typeMap.put(Network.class.getSimpleName(), Network.class); + s_typeMap.put(IpAddress.class.getSimpleName(), IPAddress.class); + s_typeMap.put(InstanceGroup.class.getSimpleName(), InstanceGroup.class); + s_typeMap.put(GlobalLoadBalancerRule.class.getSimpleName(), GlobalLoadBalancerRule.class); + s_typeMap.put(FirewallRule.class.getSimpleName(), FirewallRule.class); + s_typeMap.put(PortForwardingRule.class.getSimpleName(), PortForwardingRule.class); + s_typeMap.put(Event.class.getSimpleName(), Event.class); + s_typeMap.put(AsyncJob.class.getSimpleName(), AsyncJob.class); + s_typeMap.put(IAMGroup.class.getSimpleName(), IAMGroup.class); + s_typeMap.put(IAMPolicy.class.getSimpleName(), IAMPolicy.class); + s_typeMap.put(MonitoringService.class.getSimpleName(), MonitoringService.class); + s_typeMap.put(SslCert.class.getSimpleName(), SslCert.class); } @Override @@ -261,9 +258,9 @@ public void onPublishMessage(String senderAddress, String subject, Object obj) { Long templateId = (Long)obj; if (templateId != null) { s_logger.debug("MessageBus message: new public template registered: " + templateId + ", grant permission to domain admin and normal user policies"); - _iamSrv.addIAMPermissionToIAMPolicy(new Long(Account.ACCOUNT_TYPE_DOMAIN_ADMIN + 1), IAMEntityType.VirtualMachineTemplate.toString(), + _iamSrv.addIAMPermissionToIAMPolicy(new Long(Account.ACCOUNT_TYPE_DOMAIN_ADMIN + 1), VirtualMachineTemplate.class.getSimpleName(), PermissionScope.RESOURCE.toString(), templateId, "listTemplates", AccessType.UseEntry.toString(), Permission.Allow, false); - _iamSrv.addIAMPermissionToIAMPolicy(new Long(Account.ACCOUNT_TYPE_NORMAL + 1), IAMEntityType.VirtualMachineTemplate.toString(), + _iamSrv.addIAMPermissionToIAMPolicy(new Long(Account.ACCOUNT_TYPE_NORMAL + 1), VirtualMachineTemplate.class.getSimpleName(), PermissionScope.RESOURCE.toString(), templateId, "listTemplates", AccessType.UseEntry.toString(), Permission.Allow, false); } } @@ -283,9 +280,9 @@ public void onPublishMessage(String senderAddress, String subject, Object obj) { _messageBus.subscribe(EntityManager.MESSAGE_REMOVE_ENTITY_EVENT, new MessageSubscriber() { @Override public void onPublishMessage(String senderAddress, String subject, Object obj) { - Pair entity = (Pair)obj; + Pair, Long> entity = (Pair, Long>)obj; if (entity != null) { - String entityType = entity.first().toString(); + String entityType = entity.first().getSimpleName(); Long entityId = entity.second(); s_logger.debug("MessageBus message: delete an entity: (" + entityType + "," + entityId + "), remove its related permission"); _iamSrv.removeIAMPermissionForEntity(entityType, entityId); @@ -299,13 +296,13 @@ public void onPublishMessage(String senderAddress, String subject, Object obj) { public void onPublishMessage(String senderAddress, String subject, Object obj) { Map permit = (Map)obj; if (permit != null) { - String entityType = (String)permit.get(ApiConstants.ENTITY_TYPE); + Class entityType = (Class)permit.get(ApiConstants.ENTITY_TYPE); Long entityId = (Long)permit.get(ApiConstants.ENTITY_ID); AccessType accessType = (AccessType)permit.get(ApiConstants.ACCESS_TYPE); String action = (String)permit.get(ApiConstants.IAM_ACTION); List acctIds = (List)permit.get(ApiConstants.ACCOUNTS); s_logger.debug("MessageBus message: grant accounts permission to an entity: (" + entityType + "," + entityId + ")"); - grantEntityPermissioinToAccounts(entityType, entityId, accessType, action, acctIds); + grantEntityPermissioinToAccounts(entityType.getSimpleName(), entityId, accessType, action, acctIds); } } }); @@ -315,13 +312,13 @@ public void onPublishMessage(String senderAddress, String subject, Object obj) { public void onPublishMessage(String senderAddress, String subject, Object obj) { Map permit = (Map)obj; if (permit != null) { - String entityType = (String)permit.get(ApiConstants.ENTITY_TYPE); + Class entityType = (Class)permit.get(ApiConstants.ENTITY_TYPE); Long entityId = (Long)permit.get(ApiConstants.ENTITY_ID); AccessType accessType = (AccessType)permit.get(ApiConstants.ACCESS_TYPE); String action = (String)permit.get(ApiConstants.IAM_ACTION); List acctIds = (List)permit.get(ApiConstants.ACCOUNTS); s_logger.debug("MessageBus message: revoke from accounts permission to an entity: (" + entityType + "," + entityId + ")"); - revokeEntityPermissioinFromAccounts(entityType, entityId, accessType, action, acctIds); + revokeEntityPermissioinFromAccounts(entityType.getSimpleName(), entityId, accessType, action, acctIds); } } }); @@ -359,15 +356,15 @@ private void populateIAMGroupAdminAccountMap() { private void addDomainWideResourceAccess(Map params) { - IAMEntityType entityType = (IAMEntityType)params.get(ApiConstants.ENTITY_TYPE); + Class entityType = (Class)params.get(ApiConstants.ENTITY_TYPE); Long entityId = (Long) params.get(ApiConstants.ENTITY_ID); Long domainId = (Long) params.get(ApiConstants.DOMAIN_ID); Boolean isRecursive = (Boolean) params.get(ApiConstants.SUBDOMAIN_ACCESS); - if (entityType == IAMEntityType.Network) { + if (entityType == Network.class) { createPolicyAndAddToDomainGroup("DomainWideNetwork-" + entityId, "domain wide network", entityType.toString(), entityId, "listNetworks", AccessType.UseEntry, domainId, isRecursive); - } else if (entityType == IAMEntityType.AffinityGroup) { + } else if (entityType == AffinityGroup.class) { createPolicyAndAddToDomainGroup("DomainWideNetwork-" + entityId, "domain wide affinityGroup", entityType.toString(), entityId, "listAffinityGroups", AccessType.UseEntry, domainId, isRecursive); } @@ -575,7 +572,7 @@ public IAMPolicyResponse createIAMPolicyResponse(IAMPolicy policy) { IAMPermissionResponse perm = new IAMPermissionResponse(); perm.setAction(permission.getAction()); if (permission.getEntityType() != null) { - perm.setEntityType(IAMEntityType.valueOf(permission.getEntityType())); + perm.setEntityType(permission.getEntityType()); } if (permission.getScope() != null) { perm.setScope(PermissionScope.valueOf(permission.getScope())); @@ -758,12 +755,12 @@ private boolean isPolicyAttachedToAccount(Long policyId, Long accountId) { private void resetTemplatePermission(Long templateId){ // reset template will change template to private, so we need to remove its permission for domain admin and normal user group - _iamSrv.removeIAMPermissionFromIAMPolicy(new Long(Account.ACCOUNT_TYPE_DOMAIN_ADMIN + 1), IAMEntityType.VirtualMachineTemplate.toString(), + _iamSrv.removeIAMPermissionFromIAMPolicy(new Long(Account.ACCOUNT_TYPE_DOMAIN_ADMIN + 1), VirtualMachineTemplate.class.getSimpleName(), PermissionScope.RESOURCE.toString(), templateId, "listTemplates"); - _iamSrv.removeIAMPermissionFromIAMPolicy(new Long(Account.ACCOUNT_TYPE_NORMAL + 1), IAMEntityType.VirtualMachineTemplate.toString(), + _iamSrv.removeIAMPermissionFromIAMPolicy(new Long(Account.ACCOUNT_TYPE_NORMAL + 1), VirtualMachineTemplate.class.getSimpleName(), PermissionScope.RESOURCE.toString(), templateId, "listTemplates"); // check if there is a policy with only UseEntry permission for this template added - IAMPolicy policy = _iamSrv.getResourceGrantPolicy(IAMEntityType.VirtualMachineTemplate.toString(), templateId, AccessType.UseEntry.toString(), "listTemplates"); + IAMPolicy policy = _iamSrv.getResourceGrantPolicy(VirtualMachineTemplate.class.getSimpleName(), templateId, AccessType.UseEntry.toString(), "listTemplates"); if ( policy == null ){ s_logger.info("No policy found for this template grant: " + templateId + ", no detach to be done"); return; @@ -788,7 +785,7 @@ public Long getPermissionScopeId(String scope, String entityType, String scopeId entity = _accountDao.findByUuid(scopeId); break; case RESOURCE: - Class clazz = s_typeMap.get(IAMEntityType.valueOf(entityType)); + Class clazz = s_typeMap.get(entityType); entity = (InternalIdentity)_entityMgr.findByUuid(clazz, scopeId); } diff --git a/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedAPIAccessChecker.java b/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedAPIAccessChecker.java index fb75db310f..1afe5e8772 100644 --- a/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedAPIAccessChecker.java +++ b/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedAPIAccessChecker.java @@ -29,7 +29,6 @@ import org.apache.log4j.Logger; import org.apache.cloudstack.acl.APIChecker; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.PermissionScope; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; @@ -46,6 +45,7 @@ import com.cloud.exception.PermissionDeniedException; import com.cloud.storage.VMTemplateVO; import com.cloud.storage.dao.VMTemplateDao; +import com.cloud.template.VirtualMachineTemplate; import com.cloud.user.Account; import com.cloud.user.AccountService; import com.cloud.user.User; @@ -133,9 +133,9 @@ public boolean start() { // add permissions for public templates List pTmplts = _templateDao.listByPublic(); for (VMTemplateVO tmpl : pTmplts){ - _iamSrv.addIAMPermissionToIAMPolicy(new Long(Account.ACCOUNT_TYPE_DOMAIN_ADMIN + 1), IAMEntityType.VirtualMachineTemplate.toString(), + _iamSrv.addIAMPermissionToIAMPolicy(new Long(Account.ACCOUNT_TYPE_DOMAIN_ADMIN + 1), VirtualMachineTemplate.class.getSimpleName(), PermissionScope.RESOURCE.toString(), tmpl.getId(), "listTemplates", AccessType.UseEntry.toString(), Permission.Allow, false); - _iamSrv.addIAMPermissionToIAMPolicy(new Long(Account.ACCOUNT_TYPE_NORMAL + 1), IAMEntityType.VirtualMachineTemplate.toString(), + _iamSrv.addIAMPermissionToIAMPolicy(new Long(Account.ACCOUNT_TYPE_NORMAL + 1), VirtualMachineTemplate.class.getSimpleName(), PermissionScope.RESOURCE.toString(), tmpl.getId(), "listTemplates", AccessType.UseEntry.toString(), Permission.Allow, false); } @@ -218,7 +218,7 @@ public void setServices(List services) { private void addDefaultAclPolicyPermission(String apiName, Class cmdClass, RoleType role) { AccessType accessType = null; - IAMEntityType[] entityTypes = null; + Class[] entityTypes = null; if (cmdClass != null) { BaseCmd cmdObj; try { @@ -262,8 +262,9 @@ private void addDefaultAclPolicyPermission(String apiName, Class cmdClass, Ro _iamSrv.addIAMPermissionToIAMPolicy(policyId, null, permissionScope.toString(), new Long(IAMPolicyPermission.PERMISSION_SCOPE_ID_CURRENT_CALLER), apiName, (accessType == null) ? null : accessType.toString(), Permission.Allow, false); } else { - for (IAMEntityType entityType : entityTypes) { - _iamSrv.addIAMPermissionToIAMPolicy(policyId, entityType.toString(), permissionScope.toString(), new Long(IAMPolicyPermission.PERMISSION_SCOPE_ID_CURRENT_CALLER), + for (Class entityType : entityTypes) { + _iamSrv.addIAMPermissionToIAMPolicy(policyId, entityType.getSimpleName(), permissionScope.toString(), new Long( + IAMPolicyPermission.PERMISSION_SCOPE_ID_CURRENT_CALLER), apiName, (accessType == null) ? null : accessType.toString(), Permission.Allow, false); } } diff --git a/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java b/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java index 3fe854a2a0..3ab3749123 100644 --- a/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java +++ b/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java @@ -83,7 +83,7 @@ public boolean checkAccess(Account caller, ControlledEntity entity, AccessType a String entityType = null; if (entity.getEntityType() != null) { - entityType = entity.getEntityType().toString(); + entityType = entity.getEntityType().getSimpleName(); } if (accessType == null) { diff --git a/services/iam/plugin/test/org/apache/cloudstack/iam/test/IAMApiServiceTest.java b/services/iam/plugin/test/org/apache/cloudstack/iam/test/IAMApiServiceTest.java index b825ab224f..49c4c9f4ca 100644 --- a/services/iam/plugin/test/org/apache/cloudstack/iam/test/IAMApiServiceTest.java +++ b/services/iam/plugin/test/org/apache/cloudstack/iam/test/IAMApiServiceTest.java @@ -50,7 +50,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.support.AnnotationConfigContextLoader; -import org.apache.cloudstack.acl.IAMEntityType; import org.apache.cloudstack.acl.PermissionScope; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.command.user.vm.ListVMsCmd; @@ -84,6 +83,7 @@ import com.cloud.utils.Pair; import com.cloud.utils.component.ComponentContext; import com.cloud.utils.db.EntityManager; +import com.cloud.vm.VirtualMachine; @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(loader = AnnotationConfigContextLoader.class) @@ -292,15 +292,15 @@ public void addRemovePermissionToPolicyTest() { Class clz = ListVMsCmd.class; when(_apiServer.getCmdClass("listVirtualMachines")).thenReturn(clz); when( - _iamSrv.addIAMPermissionToIAMPolicy(policyId, IAMEntityType.VirtualMachine.toString(), + _iamSrv.addIAMPermissionToIAMPolicy(policyId, VirtualMachine.class.getSimpleName(), PermissionScope.RESOURCE.toString(), resId, "listVirtualMachines", AccessType.UseEntry.toString(), Permission.Allow, false)).thenReturn(policy); - _aclSrv.addIAMPermissionToIAMPolicy(policyId, IAMEntityType.VirtualMachine.toString(), + _aclSrv.addIAMPermissionToIAMPolicy(policyId, VirtualMachine.class.getSimpleName(), PermissionScope.RESOURCE, resId, "listVirtualMachines", Permission.Allow, false); Pair, Integer> policyList = new Pair, Integer>(policies, 1); List policyPerms = new ArrayList(); IAMPolicyPermission perm = new IAMPolicyPermissionVO(policyId, "listVirtualMachines", - IAMEntityType.VirtualMachine.toString(), AccessType.UseEntry.toString(), + VirtualMachine.class.getSimpleName(), AccessType.UseEntry.toString(), PermissionScope.RESOURCE.toString(), resId, Permission.Allow, false); policyPerms.add(perm); @@ -316,7 +316,7 @@ public void addRemovePermissionToPolicyTest() { //remove permission from policy policyPerms.remove(perm); - _aclSrv.removeIAMPermissionFromIAMPolicy(policyId, IAMEntityType.VirtualMachine.toString(), + _aclSrv.removeIAMPermissionFromIAMPolicy(policyId, VirtualMachine.class.getSimpleName(), PermissionScope.RESOURCE, resId, "listVirtualMachines"); policyResp = _aclSrv.listIAMPolicies(null, "policy1", callerDomainId, 0L, 20L); assertTrue("No. of response items should be one", policyResp.getCount() == 1); From 30a98381bba5a8b93889313efaae4df1d495896c Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Mon, 17 Mar 2014 18:50:06 -0700 Subject: [PATCH 011/683] CLOUDSTACK-6247: Usage Events - hide them when display flag is off in the context of "Ability to have better control over first class objects in CS" feature And when the flag is updated on the resource accordingly generate usage events again. Also when display flag is false in deployvm cmd it should be false for the volumes associated with the vm as well --- .../com/cloud/storage/VolumeApiService.java | 2 + .../service/VolumeOrchestrationService.java | 1 + .../src/com/cloud/event/UsageEventUtils.java | 30 +++++- .../orchestration/VolumeOrchestrator.java | 27 +++-- .../cloud/storage/VolumeApiServiceImpl.java | 75 ++++++++++--- server/src/com/cloud/vm/UserVmManager.java | 2 + .../src/com/cloud/vm/UserVmManagerImpl.java | 101 +++++++++++++----- .../src/com/cloud/vm/UserVmStateListener.java | 31 +++--- 8 files changed, 200 insertions(+), 69 deletions(-) diff --git a/api/src/com/cloud/storage/VolumeApiService.java b/api/src/com/cloud/storage/VolumeApiService.java index beaa29096e..5487a4bf9b 100644 --- a/api/src/com/cloud/storage/VolumeApiService.java +++ b/api/src/com/cloud/storage/VolumeApiService.java @@ -96,4 +96,6 @@ public interface VolumeApiService { String extractVolume(ExtractVolumeCmd cmd); boolean isDisplayResourceEnabled(Long id); + + void updateDisplay(Volume volume, Boolean displayVolume); } diff --git a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java index 66b5ff5961..095d95408f 100644 --- a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java +++ b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java @@ -118,4 +118,5 @@ DiskProfile allocateTemplatedVolume(Type type, String name, DiskOffering offerin StoragePool findStoragePool(DiskProfile dskCh, DataCenter dc, Pod pod, Long clusterId, Long hostId, VirtualMachine vm, Set avoid); void updateVolumeDiskChain(long volumeId, String path, String chainInfo); + } diff --git a/engine/components-api/src/com/cloud/event/UsageEventUtils.java b/engine/components-api/src/com/cloud/event/UsageEventUtils.java index 4f32cb3263..f1707bd45d 100644 --- a/engine/components-api/src/com/cloud/event/UsageEventUtils.java +++ b/engine/components-api/src/com/cloud/event/UsageEventUtils.java @@ -70,6 +70,15 @@ public static void publishUsageEvent(String usageType, long accountId, long zone publishUsageEvent(usageType, accountId, zoneId, entityType, entityUUID); } + public static void publishUsageEvent(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId, + Long size, String entityType, String entityUUID, boolean displayResource) { + if(displayResource){ + saveUsageEvent(usageType, accountId, zoneId, resourceId, resourceName, offeringId, templateId, size); + } + publishUsageEvent(usageType, accountId, zoneId, entityType, entityUUID); + + } + public static void publishUsageEvent(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId, Long size, Long virtualSize, String entityType, String entityUUID) { saveUsageEvent(usageType, accountId, zoneId, resourceId, resourceName, offeringId, templateId, size, virtualSize); @@ -81,6 +90,13 @@ public static void publishUsageEvent(String usageType, long accountId, long zone publishUsageEvent(usageType, accountId, zoneId, entityType, entityUUID); } + public static void publishUsageEvent(String usageType, long accountId, long zoneId, long resourceId, String resourceName, String entityType, String entityUUID, boolean diplayResource) { + if (diplayResource){ + saveUsageEvent(usageType, accountId, zoneId, resourceId, resourceName); + publishUsageEvent(usageType, accountId, zoneId, entityType, entityUUID); + } + } + public static void publishUsageEvent(String usageType, long accountId, long zoneId, long ipAddressId, String ipAddress, boolean isSourceNat, String guestType, boolean isSystem, String entityType, String entityUUID) { saveUsageEvent(usageType, accountId, zoneId, ipAddressId, ipAddress, isSourceNat, guestType, isSystem); @@ -88,9 +104,12 @@ public static void publishUsageEvent(String usageType, long accountId, long zone } public static void publishUsageEvent(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId, - String resourceType, String entityType, String entityUUID) { - saveUsageEvent(usageType, accountId, zoneId, resourceId, resourceName, offeringId, templateId, resourceType); + String resourceType, String entityType, String entityUUID, boolean displayResource) { + if(displayResource){ + saveUsageEvent(usageType, accountId, zoneId, resourceId, resourceName, offeringId, templateId, resourceType); + } publishUsageEvent(usageType, accountId, zoneId, entityType, entityUUID); + } public static void publishUsageEvent(String usageType, long accountId, long zoneId, long vmId, long securityGroupId, String entityType, String entityUUID) { @@ -99,9 +118,12 @@ public static void publishUsageEvent(String usageType, long accountId, long zone } public static void publishUsageEvent(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId, - String resourceType, String entityType, String entityUUID, Map details) { - saveUsageEvent(usageType, accountId, zoneId, resourceId, resourceName, offeringId, templateId, resourceType, details); + String resourceType, String entityType, String entityUUID, Map details, boolean displayResource) { + if(displayResource){ + saveUsageEvent(usageType, accountId, zoneId, resourceId, resourceName, offeringId, templateId, resourceType, details); + } publishUsageEvent(usageType, accountId, zoneId, entityType, entityUUID); + } private static void saveUsageEvent(String usageType, long accountId, long zoneId, long resourceId, String resourceName, Long offeringId, Long templateId, diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index 5921128429..b8f9506cdf 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -30,6 +30,8 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; +import com.cloud.vm.UserVmVO; +import com.cloud.vm.dao.UserVmDao; import org.apache.log4j.Logger; import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService; @@ -149,6 +151,8 @@ public class VolumeOrchestrator extends ManagerBase implements VolumeOrchestrati HostDao _hostDao; @Inject SnapshotService _snapshotSrv; + @Inject + protected UserVmDao _userVmDao; private final StateMachine2 _volStateMachine; protected List _storagePoolAllocators; @@ -592,6 +596,11 @@ public DiskProfile allocateRawVolume(Type type, String name, DiskOffering offeri if (template.getFormat() == ImageFormat.ISO) { vol.setIsoId(template.getId()); } + // display flag matters only for the User vms + if (vm.getType() == VirtualMachine.Type.User) { + UserVmVO userVm = _userVmDao.findById(vm.getId()); + vol.setDisplayVolume(userVm.isDisplayVm()); + } vol.setFormat(getSupportedImageFormatForCluster(vm.getHypervisorType())); vol = _volsDao.persist(vol); @@ -599,10 +608,10 @@ public DiskProfile allocateRawVolume(Type type, String name, DiskOffering offeri // Save usage event and update resource count for user vm volumes if (vm.getType() == VirtualMachine.Type.User) { UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, vol.getAccountId(), vol.getDataCenterId(), vol.getId(), vol.getName(), offering.getId(), null, size, - Volume.class.getName(), vol.getUuid()); + Volume.class.getName(), vol.getUuid(), vol.isDisplayVolume()); - _resourceLimitMgr.incrementResourceCount(vm.getAccountId(), ResourceType.volume); - _resourceLimitMgr.incrementResourceCount(vm.getAccountId(), ResourceType.primary_storage, new Long(vol.getSize())); + _resourceLimitMgr.incrementResourceCount(vm.getAccountId(), ResourceType.volume, vol.isDisplayVolume()); + _resourceLimitMgr.incrementResourceCount(vm.getAccountId(), ResourceType.primary_storage, vol.isDisplayVolume(), new Long(vol.getSize())); } return toDiskProfile(vol, offering); } @@ -642,6 +651,12 @@ public DiskProfile allocateTemplatedVolume(Type type, String name, DiskOffering vol.setDeviceId(1l); } + if (vm.getType() == VirtualMachine.Type.User) { + UserVmVO userVm = _userVmDao.findById(vm.getId()); + vol.setDisplayVolume(userVm.isDisplayVm()); + } + + vol = _volsDao.persist(vol); // Create event and update resource count for volumes if vm is a user vm @@ -652,10 +667,10 @@ public DiskProfile allocateTemplatedVolume(Type type, String name, DiskOffering offeringId = offering.getId(); UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, vol.getAccountId(), vol.getDataCenterId(), vol.getId(), vol.getName(), offeringId, null, size, - Volume.class.getName(), vol.getUuid()); + Volume.class.getName(), vol.getUuid(), vol.isDisplayVolume()); - _resourceLimitMgr.incrementResourceCount(vm.getAccountId(), ResourceType.volume); - _resourceLimitMgr.incrementResourceCount(vm.getAccountId(), ResourceType.primary_storage, new Long(vol.getSize())); + _resourceLimitMgr.incrementResourceCount(vm.getAccountId(), ResourceType.volume, vol.isDisplayVolume()); + _resourceLimitMgr.incrementResourceCount(vm.getAccountId(), ResourceType.primary_storage, vol.isDisplayVolume(), new Long(vol.getSize())); } return toDiskProfile(vol, offering); } diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index d820d02ac6..5ffa99b0de 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -591,10 +591,10 @@ public VolumeVO doInTransaction(TransactionStatus status) { } volume = _volsDao.persist(volume); - if (cmd.getSnapshotId() == null) { + if (cmd.getSnapshotId() == null && displayVolume) { // for volume created from snapshot, create usage event after volume creation - UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(), - diskOfferingId, null, size, Volume.class.getName(), volume.getUuid()); + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(), + diskOfferingId, null, size, Volume.class.getName(), volume.getUuid(), displayVolume); } CallContext.current().setEventDetails("Volume Id: " + volume.getId()); @@ -677,11 +677,11 @@ protected VolumeVO createVolumeFromSnapshot(VolumeVO volume, long snapshotId, Lo // sync old snapshots to region store if necessary createdVolume = _volumeMgr.createVolumeFromSnapshot(volume, snapshot, vm); - + VolumeVO volumeVo = _volsDao.findById(createdVolume.getId()); UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, createdVolume.getAccountId(), createdVolume.getDataCenterId(), createdVolume.getId(), - createdVolume.getName(), createdVolume.getDiskOfferingId(), null, createdVolume.getSize(), Volume.class.getName(), createdVolume.getUuid()); + createdVolume.getName(), createdVolume.getDiskOfferingId(), null, createdVolume.getSize(), Volume.class.getName(), createdVolume.getUuid(), volumeVo.isDisplayVolume()); - return _volsDao.findById(createdVolume.getId()); + return volumeVo; } @Override @@ -972,7 +972,7 @@ storage count (in case of upload volume). */ // Log usage event for volumes belonging user VM's only UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_DELETE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(), - Volume.class.getName(), volume.getUuid()); + Volume.class.getName(), volume.getUuid(), volume.isDisplayVolume()); } } // Mark volume as removed if volume has not been created on primary or secondary @@ -1225,14 +1225,13 @@ public Volume updateVolume(long volumeId, String path, String state, Long storag VolumeVO volume = _volumeDao.findById(volumeId); + if(volume == null) + throw new InvalidParameterValueException("The volume id doesn't exist"); + if (path != null) { volume.setPath(path); } - if (displayVolume != null) { - volume.setDisplayVolume(displayVolume); - } - if(chainInfo != null){ volume.setChainInfo(chainInfo); } @@ -1258,17 +1257,61 @@ public Volume updateVolume(long volumeId, String path, String state, Long storag volume.setUuid(customId); } - if (displayVolume != null && displayVolume != volume.isDisplayVolume()) { // No need to check permissions since only Admin allowed to call this API. - volume.setDisplayVolume(displayVolume); - _resourceLimitMgr.changeResourceCount(entityOwnerId, ResourceType.volume, displayVolume); - _resourceLimitMgr.changeResourceCount(entityOwnerId, ResourceType.primary_storage, displayVolume, new Long(volume.getSize())); - } + updateDisplay(volume, displayVolume); _volumeDao.update(volumeId, volume); return volume; } + + @Override + public void updateDisplay(Volume volume, Boolean displayVolume){ + // 1. Resource limit changes + updateResourceCount(volume, displayVolume); + + // 2. generate usage event if not in destroyed state + saveUsageEvent(volume, displayVolume); + + // 3. Set the flag + if (displayVolume != null && displayVolume != volume.isDisplayVolume()){ + // FIXME - Confused - typecast for now. + ((VolumeVO)volume).setDisplayVolume(displayVolume); + _volumeDao.update(volume.getId(), (VolumeVO)volume); + } + + } + + private void updateResourceCount(Volume volume, Boolean displayVolume){ + // Update only when the flag has changed. + if (displayVolume != null && displayVolume != volume.isDisplayVolume()){ + _resourceLimitMgr.changeResourceCount(volume.getAccountId(), ResourceType.volume, displayVolume); + _resourceLimitMgr.changeResourceCount(volume.getAccountId(), ResourceType.primary_storage, displayVolume, new Long(volume.getSize())); + } + } + + private void saveUsageEvent(Volume volume, Boolean displayVolume){ + + // Update only when the flag has changed && only when volume in a non-destroyed state. + if ((displayVolume != null && displayVolume != volume.isDisplayVolume()) && !isVolumeDestroyed(volume)){ + if (displayVolume){ + // flag turned 1 equivalent to freshly created volume + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(), + volume.getDiskOfferingId(), volume.getTemplateId(), volume.getSize(), Volume.class.getName(), volume.getUuid()); + }else { + // flag turned 0 equivalent to deleting a volume + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_DELETE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(), + Volume.class.getName(), volume.getUuid()); + } + } + } + + private boolean isVolumeDestroyed(Volume volume){ + if(volume.getState() == Volume.State.Destroy || volume.getState() == Volume.State.Expunging && volume.getState() == Volume.State.Expunged) + return true; + return false; + } + @Override @ActionEvent(eventType = EventTypes.EVENT_VOLUME_DETACH, eventDescription = "detaching volume", async = true) public Volume detachVolumeFromVM(DetachVolumeCmd cmmd) { diff --git a/server/src/com/cloud/vm/UserVmManager.java b/server/src/com/cloud/vm/UserVmManager.java index afe1002788..61e28d81bd 100755 --- a/server/src/com/cloud/vm/UserVmManager.java +++ b/server/src/com/cloud/vm/UserVmManager.java @@ -109,4 +109,6 @@ UserVm updateVirtualMachine(long id, String displayName, String group, Boolean h public void saveCustomOfferingDetails(long vmId, ServiceOffering serviceOffering); public void removeCustomOfferingDetails(long vmId); + + void generateUsageEvent(VirtualMachine vm, boolean isDisplay, String eventType); } diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 6fe1b20431..bca0d29be2 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -38,6 +38,7 @@ import org.apache.commons.codec.binary.Base64; import org.apache.log4j.Logger; +import com.cloud.storage.VolumeApiService; import org.apache.cloudstack.acl.ControlledEntity.ACLType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.affinity.AffinityGroupService; @@ -445,6 +446,8 @@ public enum UserVmCloneType { UUIDManager _uuidMgr; @Inject DeploymentPlanningManager _planningMgr; + @Inject + VolumeApiService _volumeService; protected ScheduledExecutorService _executor = null; protected int _expungeInterval; @@ -828,9 +831,10 @@ public UserVm upgradeVirtualMachine(UpgradeVMCmd cmd) throws ResourceAllocationE } // Generate usage event for VM upgrade - generateUsageEvent(newServiceOffering, cmd.getDetails(), _vmDao.findById(vmId), EventTypes.EVENT_VM_UPGRADE); + UserVmVO userVm = _vmDao.findById(vmId); + generateUsageEvent( userVm, userVm.isDisplayVm(), EventTypes.EVENT_VM_UPGRADE); - return _vmDao.findById(vmInstance.getId()); + return userVm; } @Override @@ -1212,11 +1216,11 @@ public UserVm upgradeVirtualMachine(ScaleVMCmd cmd) throws ResourceUnavailableEx UserVmVO vmInstance = _vmDao.findById(vmId); if (vmInstance.getState().equals(State.Stopped)) { // Generate usage event for VM upgrade - generateUsageEvent(_offeringDao.findById(newServiceOfferingId), cmd.getDetails(), _vmDao.findById(vmId), EventTypes.EVENT_VM_UPGRADE); + generateUsageEvent(vmInstance, vmInstance.isDisplayVm(), EventTypes.EVENT_VM_UPGRADE); } if (vmInstance.getState().equals(State.Running)) { // Generate usage event for Dynamic scaling of VM - generateUsageEvent(_offeringDao.findById(newServiceOfferingId), cmd.getDetails(), _vmDao.findById(vmId), EventTypes.EVENT_VM_UPGRADE); + generateUsageEvent( vmInstance, vmInstance.isDisplayVm(), EventTypes.EVENT_VM_DYNAMIC_SCALE); } return vmInstance; } else { @@ -1557,8 +1561,8 @@ public void doInTransactionWithoutResult(TransactionStatus status) throws Resour offeringId = offering.getId(); } } - UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(), - offeringId, templateId, volume.getSize(), Volume.class.getName(), volume.getUuid()); + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(), + offeringId, templateId, volume.getSize(), Volume.class.getName(), volume.getUuid(), volume.isDisplayVolume()); } } @@ -1610,7 +1614,7 @@ public boolean configure(String name, Map params) throws Configu _itMgr.registerGuru(VirtualMachine.Type.User, this); - VirtualMachine.State.getStateMachine().registerListener(new UserVmStateListener(_usageEventDao, _networkDao, _nicDao, _offeringDao)); + VirtualMachine.State.getStateMachine().registerListener(new UserVmStateListener(_usageEventDao, _networkDao, _nicDao, _offeringDao, _vmDao, this)); String value = _configDao.getValue(Config.SetVmInternalNameUsingDisplayName.key()); _instanceNameFlag = (value == null) ? false : Boolean.parseBoolean(value); @@ -1829,6 +1833,7 @@ public UserVm updateVirtualMachine(UpdateVMCmd cmd) throws ResourceUnavailableEx String userData = cmd.getUserData(); Boolean isDynamicallyScalable = cmd.isDynamicallyScalable(); String hostName = cmd.getHostName(); + Account caller = CallContext.current().getCallingAccount(); // Input validation and permission checks UserVmVO vmInstance = _vmDao.findById(id.longValue()); @@ -1840,15 +1845,52 @@ public UserVm updateVirtualMachine(UpdateVMCmd cmd) throws ResourceUnavailableEx //If the flag is specified and is changed if (isDisplayVm != null && isDisplayVm != vmInstance.isDisplayVm()) { + + //update vm + vmInstance.setDisplayVm(isDisplayVm); + + // Resource limit changes ServiceOffering offering = _serviceOfferingDao.findByIdIncludingRemoved(vmInstance.getServiceOfferingId()); _resourceLimitMgr.changeResourceCount(vmInstance.getAccountId(), ResourceType.user_vm, isDisplayVm); _resourceLimitMgr.changeResourceCount(vmInstance.getAccountId(), ResourceType.cpu, isDisplayVm, new Long(offering.getCpu())); _resourceLimitMgr.changeResourceCount(vmInstance.getAccountId(), ResourceType.memory, isDisplayVm, new Long(offering.getRamSize())); + + // Usage + saveUsageEvent(vmInstance); + + // take care of the root volume as well. + _volumeService.updateDisplay(_volsDao.findByInstanceAndType(id, Volume.Type.ROOT).get(0), isDisplayVm); + } return updateVirtualMachine(id, displayName, group, ha, isDisplayVm, osTypeId, userData, isDynamicallyScalable, cmd.getHttpMethod(), cmd.getCustomId(), hostName); } + private void saveUsageEvent(UserVmVO vm) { + + // If vm not destroyed + if( vm.getState() != State.Destroyed && vm.getState() != State.Expunging && vm.getState() != State.Error){ + + if(vm.isDisplayVm()){ + //1. Allocated VM Usage Event + generateUsageEvent(vm, true, EventTypes.EVENT_VM_CREATE); + //2. Running VM Usage Event + if(vm.getState() == State.Running || vm.getState() == State.Stopping){ + generateUsageEvent(vm, true, EventTypes.EVENT_VM_START); + } + + }else { + //1. Allocated VM Usage Event + generateUsageEvent(vm, true, EventTypes.EVENT_VM_DESTROY); + //2. Running VM Usage Event + if(vm.getState() == State.Running || vm.getState() == State.Stopping){ + generateUsageEvent(vm, true, EventTypes.EVENT_VM_STOP); + } + } + } + + } + @Override public UserVm updateVirtualMachine(long id, String displayName, String group, Boolean ha, Boolean isDisplayVmEnabled, Long osTypeId, String userData, Boolean isDynamicallyScalable, HTTPMethod httpMethod, String customId, String hostName) throws ResourceUnavailableException, InsufficientCapacityException { @@ -2935,10 +2977,10 @@ public UserVmVO doInTransaction(TransactionStatus status) throws InsufficientCap if (!offering.isDynamic()) { UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_CREATE, accountId, zone.getId(), vm.getId(), vm.getHostName(), offering.getId(), template.getId(), - hypervisorType.toString(), VirtualMachine.class.getName(), vm.getUuid()); + hypervisorType.toString(), VirtualMachine.class.getName(), vm.getUuid(), vm.isDisplayVm()); } else { UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_CREATE, accountId, zone.getId(), vm.getId(), vm.getHostName(), offering.getId(), template.getId(), - hypervisorType.toString(), VirtualMachine.class.getName(), vm.getUuid(), customParameters); + hypervisorType.toString(), VirtualMachine.class.getName(), vm.getUuid(), customParameters, vm.isDisplayVm()); } //Update Resource Count for the given account @@ -2948,13 +2990,22 @@ public UserVmVO doInTransaction(TransactionStatus status) throws InsufficientCap }); } - private void generateUsageEvent(ServiceOfferingVO serviceOffering, Map customParameters, UserVmVO vm, String eventType) { + @Override + public void generateUsageEvent(VirtualMachine vm, boolean isDisplay, String eventType){ + ServiceOfferingVO serviceOffering = _offeringDao.findById(vm.getId(), vm.getServiceOfferingId()); if (!serviceOffering.isDynamic()) { - UsageEventUtils.publishUsageEvent(eventType, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getHostName(), serviceOffering.getId(), vm.getTemplateId(), vm - .getHypervisorType().toString(), VirtualMachine.class.getName(), vm.getUuid()); - } else { - UsageEventUtils.publishUsageEvent(eventType, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getHostName(), serviceOffering.getId(), vm.getTemplateId(), vm - .getHypervisorType().toString(), VirtualMachine.class.getName(), vm.getUuid(), customParameters); + UsageEventUtils.publishUsageEvent(eventType, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), + vm.getHostName(), serviceOffering.getId(), vm.getTemplateId(), vm.getHypervisorType().toString(), + VirtualMachine.class.getName(), vm.getUuid(), isDisplay); + } + else { + Map customParameters = new HashMap(); + customParameters.put(UsageEventVO.DynamicParameters.cpuNumber.name(), serviceOffering.getCpu().toString()); + customParameters.put(UsageEventVO.DynamicParameters.cpuSpeed.name(), serviceOffering.getSpeed().toString()); + customParameters.put(UsageEventVO.DynamicParameters.memory.name(), serviceOffering.getRamSize().toString()); + UsageEventUtils.publishUsageEvent(eventType, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), + vm.getHostName(), serviceOffering.getId(), vm.getTemplateId(), vm.getHypervisorType().toString(), + VirtualMachine.class.getName(), vm.getUuid(), customParameters, isDisplay); } } @@ -3409,7 +3460,7 @@ public UserVm destroyVm(long vmId) throws ResourceUnavailableException, Concurre for (VolumeVO volume : volumes) { if (volume.getVolumeType().equals(Volume.Type.ROOT)) { UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_DELETE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(), - Volume.class.getName(), volume.getUuid()); + Volume.class.getName(), volume.getUuid(), volume.isDisplayVolume()); } } @@ -4214,7 +4265,7 @@ public UserVm moveVMToUser(final AssignVMCmd cmd) throws ResourceAllocationExcep public void doInTransactionWithoutResult(TransactionStatus status) { //generate destroy vm event for usage UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_DESTROY, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getHostName(), vm.getServiceOfferingId(), - vm.getTemplateId(), vm.getHypervisorType().toString(), VirtualMachine.class.getName(), vm.getUuid()); + vm.getTemplateId(), vm.getHypervisorType().toString(), VirtualMachine.class.getName(), vm.getUuid(), vm.isDisplayVm()); // update resource counts for old account resourceCountDecrement(oldAccount.getAccountId(), vm.isDisplayVm(), new Long(offering.getCpu()), new Long(offering.getRamSize())); @@ -4226,20 +4277,20 @@ public void doInTransactionWithoutResult(TransactionStatus status) { // OS 2: update volume for (VolumeVO volume : volumes) { - UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_DELETE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(), - Volume.class.getName(), volume.getUuid()); + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_DELETE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(), + Volume.class.getName(), volume.getUuid(), volume.isDisplayVolume()); _resourceLimitMgr.decrementResourceCount(oldAccount.getAccountId(), ResourceType.volume); - _resourceLimitMgr.decrementResourceCount(oldAccount.getAccountId(), ResourceType.primary_storage, new Long(volume.getSize())); + _resourceLimitMgr.decrementResourceCount(oldAccount.getAccountId(), ResourceType.primary_storage, new Long(volume.getSize())); volume.setAccountId(newAccount.getAccountId()); volume.setDomainId(newAccount.getDomainId()); _volsDao.persist(volume); _resourceLimitMgr.incrementResourceCount(newAccount.getAccountId(), ResourceType.volume); - _resourceLimitMgr.incrementResourceCount(newAccount.getAccountId(), ResourceType.primary_storage, new Long(volume.getSize())); - UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(), - volume.getDiskOfferingId(), volume.getTemplateId(), volume.getSize(), Volume.class.getName(), volume.getUuid()); + _resourceLimitMgr.incrementResourceCount(newAccount.getAccountId(), ResourceType.primary_storage, new Long(volume.getSize())); + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VOLUME_CREATE, volume.getAccountId(), volume.getDataCenterId(), volume.getId(), volume.getName(), + volume.getDiskOfferingId(), volume.getTemplateId(), volume.getSize(), Volume.class.getName(), volume.getUuid(), volume.isDisplayVolume()); //snapshots: mark these removed in db List snapshots = _snapshotDao.listByVolumeIdIncludingRemoved(volume.getId()); - for (SnapshotVO snapshot : snapshots) { + for (SnapshotVO snapshot : snapshots) { _snapshotDao.remove(snapshot.getId()); } } @@ -4249,7 +4300,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { //generate usage events to account for this change UsageEventUtils.publishUsageEvent(EventTypes.EVENT_VM_CREATE, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), vm.getHostName(), vm.getServiceOfferingId(), - vm.getTemplateId(), vm.getHypervisorType().toString(), VirtualMachine.class.getName(), vm.getUuid()); + vm.getTemplateId(), vm.getHypervisorType().toString(), VirtualMachine.class.getName(), vm.getUuid(), vm.isDisplayVm()); } }); diff --git a/server/src/com/cloud/vm/UserVmStateListener.java b/server/src/com/cloud/vm/UserVmStateListener.java index 2f6be6cbbc..af5f882088 100644 --- a/server/src/com/cloud/vm/UserVmStateListener.java +++ b/server/src/com/cloud/vm/UserVmStateListener.java @@ -25,6 +25,7 @@ import javax.inject.Inject; import com.cloud.server.ManagementService; +import com.cloud.vm.dao.UserVmDao; import org.apache.log4j.Logger; import org.springframework.beans.factory.NoSuchBeanDefinitionException; @@ -33,11 +34,9 @@ import com.cloud.event.EventCategory; import com.cloud.event.EventTypes; import com.cloud.event.UsageEventUtils; -import com.cloud.event.UsageEventVO; import com.cloud.event.dao.UsageEventDao; import com.cloud.network.dao.NetworkDao; import com.cloud.network.dao.NetworkVO; -import com.cloud.service.ServiceOfferingVO; import com.cloud.service.dao.ServiceOfferingDao; import com.cloud.utils.component.ComponentContext; import com.cloud.utils.fsm.StateListener; @@ -51,15 +50,19 @@ public class UserVmStateListener implements StateListener customParameters = new HashMap(); - customParameters.put(UsageEventVO.DynamicParameters.cpuNumber.name(), serviceOffering.getCpu().toString()); - customParameters.put(UsageEventVO.DynamicParameters.cpuSpeed.name(), serviceOffering.getSpeed().toString()); - customParameters.put(UsageEventVO.DynamicParameters.memory.name(), serviceOffering.getRamSize().toString()); - UsageEventUtils.publishUsageEvent(eventType, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), - vm.getHostName(), serviceOffering.getId(), vm.getTemplateId(), vm.getHypervisorType().toString(), - VirtualMachine.class.getName(), vm.getUuid(), customParameters); + private void generateUsageEvent(Long serviceOfferingId, VirtualMachine vm, String eventType){ + boolean displayVm = true; + if(vm.getType() == VirtualMachine.Type.User){ + UserVmVO uservm = _userVmDao.findById(vm.getId()); + displayVm = uservm.isDisplayVm(); } + + _userVmMgr.generateUsageEvent(vm, displayVm, eventType); } private void pubishOnEventBus(String event, String status, VirtualMachine vo, VirtualMachine.State oldState, VirtualMachine.State newState) { From 4901cc535ff77f5e2f6f811c618cb908699e5016 Mon Sep 17 00:00:00 2001 From: Marcus Sorensen Date: Fri, 14 Mar 2014 07:13:34 -0600 Subject: [PATCH 012/683] Change newly added details map for deployVirtualMachine to an empty map, instead of passing all possible keys as empty values --- tools/marvin/marvin/integration/lib/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/marvin/marvin/integration/lib/base.py b/tools/marvin/marvin/integration/lib/base.py index ca9f2b440d..38e8568211 100755 --- a/tools/marvin/marvin/integration/lib/base.py +++ b/tools/marvin/marvin/integration/lib/base.py @@ -413,7 +413,7 @@ def create(cls, apiclient, services, templateid=None, accountid=None, if "userdata" in services: cmd.userdata = base64.urlsafe_b64encode(services["userdata"]) - cmd.details = [{"cpuNumber": "","cpuSpeed":"","memory":"","rootdisksize":""}] + cmd.details = [{}] if customcpunumber: cmd.details[0]["cpuNumber"] = customcpunumber From 5fe568d5cf435484945d58c8da17f0f815f123f8 Mon Sep 17 00:00:00 2001 From: Marcus Sorensen Date: Fri, 14 Mar 2014 07:40:12 -0600 Subject: [PATCH 013/683] now fix MY root resize test, which passes 0 in one test... --- tools/marvin/marvin/integration/lib/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/marvin/marvin/integration/lib/base.py b/tools/marvin/marvin/integration/lib/base.py index 38e8568211..775b289b14 100755 --- a/tools/marvin/marvin/integration/lib/base.py +++ b/tools/marvin/marvin/integration/lib/base.py @@ -424,7 +424,7 @@ def create(cls, apiclient, services, templateid=None, accountid=None, if custommemory: cmd.details[0]["memory"] = custommemory - if rootdisksize: + if rootdisksize >= 0: cmd.details[0]["rootdisksize"] = rootdisksize if group: From df3a2083d647c3cb6b9cc558dda0c092358e1a5e Mon Sep 17 00:00:00 2001 From: Min Chen Date: Tue, 18 Mar 2014 10:10:22 -0700 Subject: [PATCH 014/683] Fix a regression caused by IAM search criteria refactor on VPC. --- server/src/com/cloud/network/vpc/VpcManagerImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java index ad212b0907..3ccb250dae 100644 --- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java +++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java @@ -17,7 +17,6 @@ package com.cloud.network.vpc; -import com.cloud.network.element.NetworkElement; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -36,6 +35,8 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; +import org.apache.log4j.Logger; + import org.apache.cloudstack.acl.ControlledEntity.ACLType; import org.apache.cloudstack.api.command.user.vpc.ListPrivateGatewaysCmd; import org.apache.cloudstack.api.command.user.vpc.ListStaticRoutesCmd; @@ -44,7 +45,6 @@ import org.apache.cloudstack.framework.config.ConfigDepot; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.managed.context.ManagedContextRunnable; -import org.apache.log4j.Logger; import com.cloud.configuration.Config; import com.cloud.configuration.ConfigurationManager; @@ -86,6 +86,7 @@ import com.cloud.network.dao.NetworkVO; import com.cloud.network.dao.PhysicalNetworkDao; import com.cloud.network.dao.Site2SiteVpnGatewayDao; +import com.cloud.network.element.NetworkElement; import com.cloud.network.element.StaticNatServiceProvider; import com.cloud.network.element.VpcProvider; import com.cloud.network.vpc.VpcOffering.State; @@ -1810,7 +1811,7 @@ public Pair, Integer> listPrivateGateway(ListPrivateGateway } SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); if (id != null) { sc.addAnd("id", Op.EQ, id); From 4723fbb83f9c0e26eef7306ee02e71b24c01f83c Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Tue, 18 Mar 2014 13:54:25 -0700 Subject: [PATCH 015/683] CLOUDSTACK-6247: Usage Events - hide them when display flag is off in the context of "Ability to have better control over first class objects in CS" feature Work done for network offering. --- api/src/com/cloud/vm/VirtualMachine.java | 2 + .../cloud/vm/VirtualMachineManagerImpl.java | 4 +- .../schema/src/com/cloud/vm/VMInstanceVO.java | 6 +++ .../cloud/entity/api/db/VMEntityVO.java | 12 ++++++ .../com/cloud/network/NetworkServiceImpl.java | 4 +- .../src/com/cloud/vm/UserVmManagerImpl.java | 43 ++++++++++++++++--- .../src/com/cloud/vm/UserVmStateListener.java | 2 +- 7 files changed, 61 insertions(+), 12 deletions(-) diff --git a/api/src/com/cloud/vm/VirtualMachine.java b/api/src/com/cloud/vm/VirtualMachine.java index 72cbb252ee..e7cfd64c4e 100755 --- a/api/src/com/cloud/vm/VirtualMachine.java +++ b/api/src/com/cloud/vm/VirtualMachine.java @@ -321,4 +321,6 @@ public boolean isUsedBySystem() { long getUpdated(); + boolean isDisplay(); + } diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index 0a6e83d55f..a31172ca76 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -3422,7 +3422,7 @@ private NicProfile orchestrateAddVmToNetwork(VirtualMachine vm, Network network, long isDefault = (nic.isDefaultNic()) ? 1 : 0; // insert nic's Id into DB as resource_name UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_ASSIGN, vmVO.getAccountId(), vmVO.getDataCenterId(), vmVO.getId(), - Long.toString(nic.getId()), network.getNetworkOfferingId(), null, isDefault, VirtualMachine.class.getName(), vmVO.getUuid()); + Long.toString(nic.getId()), network.getNetworkOfferingId(), null, isDefault, VirtualMachine.class.getName(), vmVO.getUuid(), vm.isDisplay()); return nic; } else { s_logger.warn("Failed to plug nic to the vm " + vm + " in network " + network); @@ -3537,7 +3537,7 @@ private boolean orchestrateRemoveNicFromVm(VirtualMachine vm, Nic nic) throws Co s_logger.debug("Nic is unplugged successfully for vm " + vm + " in network " + network); long isDefault = (nic.isDefaultNic()) ? 1 : 0; UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_REMOVE, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), - Long.toString(nic.getId()), network.getNetworkOfferingId(), null, isDefault, VirtualMachine.class.getName(), vm.getUuid()); + Long.toString(nic.getId()), network.getNetworkOfferingId(), null, isDefault, VirtualMachine.class.getName(), vm.getUuid(), vm.isDisplay()); } else { s_logger.warn("Failed to unplug nic for the vm " + vm + " from network " + network); return false; diff --git a/engine/schema/src/com/cloud/vm/VMInstanceVO.java b/engine/schema/src/com/cloud/vm/VMInstanceVO.java index c7206d07f4..9ebade120e 100644 --- a/engine/schema/src/com/cloud/vm/VMInstanceVO.java +++ b/engine/schema/src/com/cloud/vm/VMInstanceVO.java @@ -384,10 +384,16 @@ public boolean isHaEnabled() { return haEnabled; } + //FIXME - Remove this and use isDisplay() instead public boolean isDisplayVm() { return displayVm; } + @Override + public boolean isDisplay() { + return displayVm; + } + public void setDisplayVm(boolean displayVm) { this.displayVm = displayVm; } diff --git a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java index ced2f22dfa..b20cae320e 100644 --- a/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java +++ b/engine/schema/src/org/apache/cloudstack/engine/cloud/entity/api/db/VMEntityVO.java @@ -173,6 +173,9 @@ public class VMEntityVO implements VirtualMachine, FiniteStateObject getEntityType() { return VirtualMachine.class; } + + @Override + public boolean isDisplay() { + return display; + } + + public void setDisplay(boolean display) { + this.display = display; + } } diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java index e255976ae8..b804b0704e 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -2277,9 +2277,9 @@ public void doInTransactionWithoutResult(TransactionStatus status) { long isDefault = (nic.isDefaultNic()) ? 1 : 0; String nicIdString = Long.toString(nic.getId()); UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_REMOVE, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), nicIdString, - oldNetworkOfferingId, null, isDefault, VirtualMachine.class.getName(), vm.getUuid()); + oldNetworkOfferingId, null, isDefault, VirtualMachine.class.getName(), vm.getUuid(), vm.isDisplay()); UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_ASSIGN, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), nicIdString, - networkOfferingId, null, isDefault, VirtualMachine.class.getName(), vm.getUuid()); + networkOfferingId, null, isDefault, VirtualMachine.class.getName(), vm.getUuid(), vm.isDisplay()); } } }); diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index bca0d29be2..b4888a8b58 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -1188,13 +1188,13 @@ public UserVm updateDefaultNicForVirtualMachine(UpdateDefaultNicForVMCmd cmd) th String nicIdString = Long.toString(nic.getId()); long newNetworkOfferingId = network.getNetworkOfferingId(); UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_REMOVE, vmInstance.getAccountId(), vmInstance.getDataCenterId(), vmInstance.getId(), - oldNicIdString, oldNetworkOfferingId, null, 1L, VirtualMachine.class.getName(), vmInstance.getUuid()); + oldNicIdString, oldNetworkOfferingId, null, 1L, VirtualMachine.class.getName(), vmInstance.getUuid(), vmInstance.isDisplay()); UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_ASSIGN, vmInstance.getAccountId(), vmInstance.getDataCenterId(), vmInstance.getId(), nicIdString, - newNetworkOfferingId, null, 1L, VirtualMachine.class.getName(), vmInstance.getUuid()); + newNetworkOfferingId, null, 1L, VirtualMachine.class.getName(), vmInstance.getUuid(), vmInstance.isDisplay()); UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_REMOVE, vmInstance.getAccountId(), vmInstance.getDataCenterId(), vmInstance.getId(), nicIdString, - newNetworkOfferingId, null, 0L, VirtualMachine.class.getName(), vmInstance.getUuid()); + newNetworkOfferingId, null, 0L, VirtualMachine.class.getName(), vmInstance.getUuid(), vmInstance.isDisplay()); UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_ASSIGN, vmInstance.getAccountId(), vmInstance.getDataCenterId(), vmInstance.getId(), - oldNicIdString, oldNetworkOfferingId, null, 0L, VirtualMachine.class.getName(), vmInstance.getUuid()); + oldNicIdString, oldNetworkOfferingId, null, 0L, VirtualMachine.class.getName(), vmInstance.getUuid(), vmInstance.isDisplay()); return _vmDao.findById(vmInstance.getId()); } @@ -1866,6 +1866,15 @@ public UserVm updateVirtualMachine(UpdateVMCmd cmd) throws ResourceUnavailableEx return updateVirtualMachine(id, displayName, group, ha, isDisplayVm, osTypeId, userData, isDynamicallyScalable, cmd.getHttpMethod(), cmd.getCustomId(), hostName); } + private void usage(VirtualMachine vm){ + List nics = _nicDao.listByVmId(vm.getId()); + for (NicVO nic : nics) { + NetworkVO network = _networkDao.findById(nic.getNetworkId()); + UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_REMOVE, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), + Long.toString(nic.getId()), network.getNetworkOfferingId(), null, 0L, vm.getClass().getName(), vm.getUuid(), vm.isDisplay()); + } + } + private void saveUsageEvent(UserVmVO vm) { // If vm not destroyed @@ -1874,23 +1883,43 @@ private void saveUsageEvent(UserVmVO vm) { if(vm.isDisplayVm()){ //1. Allocated VM Usage Event generateUsageEvent(vm, true, EventTypes.EVENT_VM_CREATE); - //2. Running VM Usage Event + if(vm.getState() == State.Running || vm.getState() == State.Stopping){ + //2. Running VM Usage Event generateUsageEvent(vm, true, EventTypes.EVENT_VM_START); + + // 3. Network offering usage + generateNetworkUsageForVm(vm, true, EventTypes.EVENT_NETWORK_OFFERING_ASSIGN); } }else { //1. Allocated VM Usage Event generateUsageEvent(vm, true, EventTypes.EVENT_VM_DESTROY); - //2. Running VM Usage Event + if(vm.getState() == State.Running || vm.getState() == State.Stopping){ + //2. Running VM Usage Event generateUsageEvent(vm, true, EventTypes.EVENT_VM_STOP); + + // 3. Network offering usage + generateNetworkUsageForVm(vm, true, EventTypes.EVENT_NETWORK_OFFERING_REMOVE); } } } } + private void generateNetworkUsageForVm(VirtualMachine vm, boolean isDisplay, String eventType){ + + List nics = _nicDao.listByVmId(vm.getId()); + for (NicVO nic : nics) { + NetworkVO network = _networkDao.findById(nic.getNetworkId()); + long isDefault = (nic.isDefaultNic()) ? 1 : 0; + UsageEventUtils.publishUsageEvent(eventType, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), + Long.toString(nic.getId()), network.getNetworkOfferingId(), null, isDefault, vm.getClass().getName(), vm.getUuid(), isDisplay); + } + + } + @Override public UserVm updateVirtualMachine(long id, String displayName, String group, Boolean ha, Boolean isDisplayVmEnabled, Long osTypeId, String userData, Boolean isDynamicallyScalable, HTTPMethod httpMethod, String customId, String hostName) throws ResourceUnavailableException, InsufficientCapacityException { @@ -3175,7 +3204,7 @@ public boolean finalizeStart(VirtualMachineProfile profile, long hostId, Command NetworkVO network = _networkDao.findById(nic.getNetworkId()); long isDefault = (nic.isDefaultNic()) ? 1 : 0; UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_ASSIGN, vm.getAccountId(), vm.getDataCenterId(), vm.getId(), Long.toString(nic.getId()), - network.getNetworkOfferingId(), null, isDefault, VirtualMachine.class.getName(), vm.getUuid()); + network.getNetworkOfferingId(), null, isDefault, VirtualMachine.class.getName(), vm.getUuid(), vm.isDisplay()); if (network.getTrafficType() == TrafficType.Guest) { originalIp = nic.getIp4Address(); guestNic = nic; diff --git a/server/src/com/cloud/vm/UserVmStateListener.java b/server/src/com/cloud/vm/UserVmStateListener.java index af5f882088..202391f4e4 100644 --- a/server/src/com/cloud/vm/UserVmStateListener.java +++ b/server/src/com/cloud/vm/UserVmStateListener.java @@ -93,7 +93,7 @@ public boolean postStateTransitionEvent(State oldState, Event event, State newSt for (NicVO nic : nics) { NetworkVO network = _networkDao.findById(nic.getNetworkId()); UsageEventUtils.publishUsageEvent(EventTypes.EVENT_NETWORK_OFFERING_REMOVE, vo.getAccountId(), vo.getDataCenterId(), vo.getId(), - Long.toString(nic.getId()), network.getNetworkOfferingId(), null, 0L, vo.getClass().getName(), vo.getUuid()); + Long.toString(nic.getId()), network.getNetworkOfferingId(), null, 0L, vo.getClass().getName(), vo.getUuid(), vo.isDisplay()); } } else if (VirtualMachine.State.isVmDestroyed(oldState, event, newState)) { generateUsageEvent(vo.getServiceOfferingId(), vo, EventTypes.EVENT_VM_DESTROY); From ec5ee761d98c67c7da2ea70b623d4a9f3da966b5 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Tue, 18 Mar 2014 16:07:22 -0700 Subject: [PATCH 016/683] Refactor listNetworks logic to use new IAM model. --- .../com/cloud/network/NetworkServiceImpl.java | 326 ++++-------------- 1 file changed, 65 insertions(+), 261 deletions(-) diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java index b804b0704e..1c7786e9f3 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -105,20 +105,19 @@ import com.cloud.network.dao.FirewallRulesDao; import com.cloud.network.dao.IPAddressDao; import com.cloud.network.dao.IPAddressVO; +import com.cloud.network.dao.LoadBalancerVMMapDao; +import com.cloud.network.dao.LoadBalancerVMMapVO; import com.cloud.network.dao.NetworkDao; import com.cloud.network.dao.NetworkDomainDao; -import com.cloud.network.dao.NetworkDomainVO; import com.cloud.network.dao.NetworkServiceMapDao; import com.cloud.network.dao.NetworkVO; import com.cloud.network.dao.OvsProviderDao; import com.cloud.network.dao.PhysicalNetworkDao; import com.cloud.network.dao.PhysicalNetworkServiceProviderDao; -import com.cloud.network.dao.LoadBalancerVMMapDao; import com.cloud.network.dao.PhysicalNetworkServiceProviderVO; import com.cloud.network.dao.PhysicalNetworkTrafficTypeDao; import com.cloud.network.dao.PhysicalNetworkTrafficTypeVO; import com.cloud.network.dao.PhysicalNetworkVO; -import com.cloud.network.dao.LoadBalancerVMMapVO; import com.cloud.network.element.NetworkElement; import com.cloud.network.element.OvsProviderVO; import com.cloud.network.element.VirtualRouterElement; @@ -141,13 +140,13 @@ import com.cloud.offerings.dao.NetworkOfferingServiceMapDao; import com.cloud.org.Grouping; import com.cloud.projects.Project; +import com.cloud.projects.Project.ListProjectResourcesCriteria; import com.cloud.projects.ProjectManager; import com.cloud.server.ResourceTag.ResourceObjectType; import com.cloud.tags.ResourceTagVO; import com.cloud.tags.dao.ResourceTagDao; import com.cloud.user.Account; import com.cloud.user.AccountManager; -import com.cloud.user.AccountVO; import com.cloud.user.DomainManager; import com.cloud.user.ResourceLimitService; import com.cloud.user.User; @@ -157,6 +156,7 @@ import com.cloud.utils.Journal; import com.cloud.utils.NumbersUtil; import com.cloud.utils.Pair; +import com.cloud.utils.Ternary; import com.cloud.utils.component.ManagerBase; import com.cloud.utils.db.DB; import com.cloud.utils.db.EntityManager; @@ -1390,14 +1390,10 @@ public Pair, Integer> searchForNetworks(ListNetworksCmd String trafficType = cmd.getTrafficType(); Boolean isSystem = cmd.getIsSystem(); String aclType = cmd.getAclType(); - Long projectId = cmd.getProjectId(); - List permittedAccounts = new ArrayList(); - String path = null; Long physicalNetworkId = cmd.getPhysicalNetworkId(); List supportedServicesStr = cmd.getSupportedServices(); Boolean restartRequired = cmd.getRestartRequired(); boolean listAll = cmd.listAll(); - boolean isRecursive = cmd.isRecursive(); Boolean specifyIpRanges = cmd.getSpecifyIpRanges(); Long vpcId = cmd.getVpcId(); Boolean canUseForDeploy = cmd.canUseForDeploy(); @@ -1416,66 +1412,16 @@ public Pair, Integer> searchForNetworks(ListNetworksCmd throw new InvalidParameterValueException("System network belongs to system, account and domainId parameters can't be specified"); } - if (domainId != null) { - DomainVO domain = _domainDao.findById(domainId); - if (domain == null) { - // see DomainVO.java - throw new InvalidParameterValueException("Specified domain id doesn't exist in the system"); - } - - _accountMgr.checkAccess(caller, domain); - if (accountName != null) { - Account owner = _accountMgr.getActiveAccountByName(accountName, domainId); - if (owner == null) { - // see DomainVO.java - throw new InvalidParameterValueException("Unable to find account " + accountName + " in specified domain"); - } - - _accountMgr.checkAccess(caller, null, true, owner); - permittedAccounts.add(owner.getId()); - } - } - - if (!_accountMgr.isAdmin(caller.getType()) || (projectId != null && projectId.longValue() != -1 && domainId == null)) { - permittedAccounts.add(caller.getId()); - domainId = caller.getDomainId(); - } - - // set project information - boolean skipProjectNetworks = true; - if (projectId != null) { - if (projectId.longValue() == -1) { - if (!_accountMgr.isAdmin(caller.getType())) { - permittedAccounts.addAll(_projectMgr.listPermittedProjectAccounts(caller.getId())); - } - } else { - permittedAccounts.clear(); - Project project = _projectMgr.getProject(projectId); - if (project == null) { - throw new InvalidParameterValueException("Unable to find project by specified id"); - } - if (!_projectMgr.canAccessProjectAccount(caller, project.getProjectAccountId())) { - // getProject() returns type ProjectVO. - InvalidParameterValueException ex = new InvalidParameterValueException("Account " + caller + " cannot access specified project id"); - ex.addProxyObject(project.getUuid(), "projectId"); - throw ex; - } - - //add project account - permittedAccounts.add(project.getProjectAccountId()); - //add caller account (if admin) - if (_accountMgr.isAdmin(caller.getType())) { - permittedAccounts.add(caller.getId()); - } - } - skipProjectNetworks = false; - } + List permittedDomains = new ArrayList(); + List permittedAccounts = new ArrayList(); + List permittedResources = new ArrayList(); + Ternary domainIdRecursiveListProject = new Ternary(cmd.getDomainId(), + cmd.isRecursive(), null); + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, + domainIdRecursiveListProject, cmd.listAll(), false, "listNetworks"); + Boolean isRecursive = domainIdRecursiveListProject.second(); + ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); - if (domainId != null) { - path = _domainDao.findById(domainId).getPath(); - } else { - path = _domainDao.findById(caller.getDomainId()).getPath(); - } if (listAll && domainId == null) { isRecursive = true; @@ -1483,6 +1429,7 @@ public Pair, Integer> searchForNetworks(ListNetworksCmd Filter searchFilter = new Filter(NetworkVO.class, "id", false, null, null); SearchBuilder sb = _networksDao.createSearchBuilder(); + _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); if (forVpc != null) { if (forVpc) { @@ -1517,122 +1464,9 @@ public Pair, Integer> searchForNetworks(ListNetworksCmd sb.join("tagSearch", tagSearch, sb.entity().getId(), tagSearch.entity().getResourceId(), JoinBuilder.JoinType.INNER); } - if (permittedAccounts.isEmpty()) { - SearchBuilder domainSearch = _domainDao.createSearchBuilder(); - domainSearch.and("path", domainSearch.entity().getPath(), SearchCriteria.Op.LIKE); - sb.join("domainSearch", domainSearch, sb.entity().getDomainId(), domainSearch.entity().getId(), JoinBuilder.JoinType.INNER); - } - - SearchBuilder accountSearch = _accountDao.createSearchBuilder(); - accountSearch.and("typeNEQ", accountSearch.entity().getType(), SearchCriteria.Op.NEQ); - accountSearch.and("typeEQ", accountSearch.entity().getType(), SearchCriteria.Op.EQ); - - sb.join("accountSearch", accountSearch, sb.entity().getAccountId(), accountSearch.entity().getId(), JoinBuilder.JoinType.INNER); - - List networksToReturn = new ArrayList(); - - if (isSystem == null || !isSystem) { - if (!permittedAccounts.isEmpty()) { - //get account level networks - networksToReturn.addAll(listAccountSpecificNetworks( - buildNetworkSearchCriteria(sb, keyword, id, isSystem, zoneId, guestIpType, trafficType, physicalNetworkId, aclType, skipProjectNetworks, restartRequired, - specifyIpRanges, vpcId, tags, display), searchFilter, permittedAccounts)); - //get domain level networks - if (domainId != null) { - networksToReturn.addAll(listDomainLevelNetworks( - buildNetworkSearchCriteria(sb, keyword, id, isSystem, zoneId, guestIpType, trafficType, physicalNetworkId, aclType, true, restartRequired, - specifyIpRanges, vpcId, tags, display), searchFilter, domainId, false)); - } - } else { - //add account specific networks - networksToReturn.addAll(listAccountSpecificNetworksByDomainPath( - buildNetworkSearchCriteria(sb, keyword, id, isSystem, zoneId, guestIpType, trafficType, physicalNetworkId, aclType, skipProjectNetworks, restartRequired, - specifyIpRanges, vpcId, tags, display), searchFilter, path, isRecursive)); - //add domain specific networks of domain + parent domains - networksToReturn.addAll(listDomainSpecificNetworksByDomainPath( - buildNetworkSearchCriteria(sb, keyword, id, isSystem, zoneId, guestIpType, trafficType, physicalNetworkId, aclType, skipProjectNetworks, restartRequired, - specifyIpRanges, vpcId, tags, display), searchFilter, path, isRecursive)); - //add networks of subdomains - if (domainId == null) { - networksToReturn.addAll(listDomainLevelNetworks( - buildNetworkSearchCriteria(sb, keyword, id, isSystem, zoneId, guestIpType, trafficType, physicalNetworkId, aclType, true, restartRequired, - specifyIpRanges, vpcId, tags, display), searchFilter, caller.getDomainId(), true)); - } - } - } else { - networksToReturn = _networksDao.search( - buildNetworkSearchCriteria(sb, keyword, id, isSystem, zoneId, guestIpType, trafficType, physicalNetworkId, null, skipProjectNetworks, restartRequired, - specifyIpRanges, vpcId, tags, display), searchFilter); - } - - if (supportedServicesStr != null && !supportedServicesStr.isEmpty() && !networksToReturn.isEmpty()) { - List supportedNetworks = new ArrayList(); - Service[] suppportedServices = new Service[supportedServicesStr.size()]; - int i = 0; - for (String supportedServiceStr : supportedServicesStr) { - Service service = Service.getService(supportedServiceStr); - if (service == null) { - throw new InvalidParameterValueException("Invalid service specified " + supportedServiceStr); - } else { - suppportedServices[i] = service; - } - i++; - } - - for (NetworkVO network : networksToReturn) { - if (areServicesSupportedInNetwork(network.getId(), suppportedServices)) { - supportedNetworks.add(network); - } - } - - networksToReturn = supportedNetworks; - } - - if (canUseForDeploy != null) { - List networksForDeploy = new ArrayList(); - for (NetworkVO network : networksToReturn) { - if (_networkModel.canUseForDeploy(network) == canUseForDeploy) { - networksForDeploy.add(network); - } - } - - networksToReturn = networksForDeploy; - } - - //Now apply pagination - //Most likely pageSize will never exceed int value, and we need integer to partition the listToReturn - boolean notNull = cmd.getStartIndex() != null && cmd.getPageSizeVal() != null; - if (notNull && cmd.getStartIndex() <= Integer.MAX_VALUE && cmd.getStartIndex() >= Integer.MIN_VALUE && cmd.getPageSizeVal() <= Integer.MAX_VALUE - && cmd.getPageSizeVal() >= Integer.MIN_VALUE) { - int index = cmd.getStartIndex().intValue() == 0 ? 0 : cmd.getStartIndex().intValue() / cmd.getPageSizeVal().intValue(); - List wPagination = new ArrayList(); - List> partitions = partitionNetworks(networksToReturn, cmd.getPageSizeVal().intValue()); - if (index < partitions.size()) { - wPagination = partitions.get(index); - } - return new Pair, Integer>(wPagination, networksToReturn.size()); - } - - return new Pair, Integer>(networksToReturn, networksToReturn.size()); - } - - private static List> partitionNetworks(List originalList, int chunkSize) { - List> listOfChunks = new ArrayList>(); - for (int i = 0; i < originalList.size() / chunkSize; i++) { - listOfChunks.add(originalList.subList(i * chunkSize, i * chunkSize + chunkSize)); - } - if (originalList.size() % chunkSize != 0) { - listOfChunks.add(originalList.subList(originalList.size() - originalList.size() % chunkSize, originalList.size())); - } - return listOfChunks; - } - - private SearchCriteria buildNetworkSearchCriteria(SearchBuilder sb, String keyword, Long id, Boolean isSystem, Long zoneId, String guestIpType, - String trafficType, Long physicalNetworkId, String aclType, boolean skipProjectNetworks, Boolean restartRequired, Boolean specifyIpRanges, Long vpcId, - Map tags, Boolean display) { - + // build network search criteria SearchCriteria sc = sb.create(); - + _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); if (isSystem != null) { sc.setJoinParameters("networkOfferingSearch", "systemOnly", isSystem); } @@ -1671,12 +1505,6 @@ private SearchCriteria buildNetworkSearchCriteria(SearchBuilder buildNetworkSearchCriteria(SearchBuilder listDomainLevelNetworks(SearchCriteria sc, Filter searchFilter, long domainId, boolean parentDomainsOnly) { - List networkIds = new ArrayList(); - Set allowedDomains = _domainMgr.getDomainParentIds(domainId); - List maps = _networkDomainDao.listDomainNetworkMapByDomain(allowedDomains.toArray()); + List networksToReturn = _networksDao.search(sc, searchFilter); - for (NetworkDomainVO map : maps) { - if (map.getDomainId() == domainId && parentDomainsOnly) { - continue; - } - boolean subdomainAccess = (map.isSubdomainAccess() != null) ? map.isSubdomainAccess() : getAllowSubdomainAccessGlobal(); - if (map.getDomainId() == domainId || subdomainAccess) { - networkIds.add(map.getNetworkId()); + // filter by supported services + if (supportedServicesStr != null && !supportedServicesStr.isEmpty() && !networksToReturn.isEmpty()) { + List supportedNetworks = new ArrayList(); + Service[] suppportedServices = new Service[supportedServicesStr.size()]; + int i = 0; + for (String supportedServiceStr : supportedServicesStr) { + Service service = Service.getService(supportedServiceStr); + if (service == null) { + throw new InvalidParameterValueException("Invalid service specified " + supportedServiceStr); + } else { + suppportedServices[i] = service; + } + i++; } - } - - if (!networkIds.isEmpty()) { - SearchCriteria domainSC = _networksDao.createSearchCriteria(); - domainSC.addAnd("id", SearchCriteria.Op.IN, networkIds.toArray()); - domainSC.addAnd("aclType", SearchCriteria.Op.EQ, ACLType.Domain.toString()); - sc.addAnd("id", SearchCriteria.Op.SC, domainSC); - return _networksDao.search(sc, searchFilter); - } else { - return new ArrayList(); - } - } + for (NetworkVO network : networksToReturn) { + if (areServicesSupportedInNetwork(network.getId(), suppportedServices)) { + supportedNetworks.add(network); + } + } - private List listAccountSpecificNetworks(SearchCriteria sc, Filter searchFilter, List permittedAccounts) { - SearchCriteria accountSC = _networksDao.createSearchCriteria(); - if (!permittedAccounts.isEmpty()) { - accountSC.addAnd("accountId", SearchCriteria.Op.IN, permittedAccounts.toArray()); + networksToReturn = supportedNetworks; } - accountSC.addAnd("aclType", SearchCriteria.Op.EQ, ACLType.Account.toString()); - - sc.addAnd("id", SearchCriteria.Op.SC, accountSC); - return _networksDao.search(sc, searchFilter); - } - - private List listAccountSpecificNetworksByDomainPath(SearchCriteria sc, Filter searchFilter, String path, boolean isRecursive) { - SearchCriteria accountSC = _networksDao.createSearchCriteria(); - accountSC.addAnd("aclType", SearchCriteria.Op.EQ, ACLType.Account.toString()); - - if (path != null) { - if (isRecursive) { - sc.setJoinParameters("domainSearch", "path", path + "%"); - } else { - sc.setJoinParameters("domainSearch", "path", path); + // filter by usability to deploy + if (canUseForDeploy != null) { + List networksForDeploy = new ArrayList(); + for (NetworkVO network : networksToReturn) { + if (_networkModel.canUseForDeploy(network) == canUseForDeploy) { + networksForDeploy.add(network); + } } - } - - sc.addAnd("id", SearchCriteria.Op.SC, accountSC); - return _networksDao.search(sc, searchFilter); - } - private List listDomainSpecificNetworksByDomainPath(SearchCriteria sc, Filter searchFilter, String path, boolean isRecursive) { + networksToReturn = networksForDeploy; + } - Set allowedDomains = new HashSet(); - if (path != null) { - if (isRecursive) { - allowedDomains = _domainMgr.getDomainChildrenIds(path); - } else { - Domain domain = _domainDao.findDomainByPath(path); - allowedDomains.add(domain.getId()); + //Now apply pagination + //Most likely pageSize will never exceed int value, and we need integer to partition the listToReturn + boolean notNull = cmd.getStartIndex() != null && cmd.getPageSizeVal() != null; + if (notNull && cmd.getStartIndex() <= Integer.MAX_VALUE && cmd.getStartIndex() >= Integer.MIN_VALUE && cmd.getPageSizeVal() <= Integer.MAX_VALUE + && cmd.getPageSizeVal() >= Integer.MIN_VALUE) { + int index = cmd.getStartIndex().intValue() == 0 ? 0 : cmd.getStartIndex().intValue() / cmd.getPageSizeVal().intValue(); + List wPagination = new ArrayList(); + List> partitions = partitionNetworks(networksToReturn, cmd.getPageSizeVal().intValue()); + if (index < partitions.size()) { + wPagination = partitions.get(index); } + return new Pair, Integer>(wPagination, networksToReturn.size()); } - List networkIds = new ArrayList(); - - List maps = _networkDomainDao.listDomainNetworkMapByDomain(allowedDomains.toArray()); + return new Pair, Integer>(networksToReturn, networksToReturn.size()); + } - for (NetworkDomainVO map : maps) { - networkIds.add(map.getNetworkId()); + private static List> partitionNetworks(List originalList, int chunkSize) { + List> listOfChunks = new ArrayList>(); + for (int i = 0; i < originalList.size() / chunkSize; i++) { + listOfChunks.add(originalList.subList(i * chunkSize, i * chunkSize + chunkSize)); } - - if (!networkIds.isEmpty()) { - SearchCriteria domainSC = _networksDao.createSearchCriteria(); - domainSC.addAnd("id", SearchCriteria.Op.IN, networkIds.toArray()); - domainSC.addAnd("aclType", SearchCriteria.Op.EQ, ACLType.Domain.toString()); - - sc.addAnd("id", SearchCriteria.Op.SC, domainSC); - return _networksDao.search(sc, searchFilter); - } else { - return new ArrayList(); + if (originalList.size() % chunkSize != 0) { + listOfChunks.add(originalList.subList(originalList.size() - originalList.size() % chunkSize, originalList.size())); } + return listOfChunks; } @Override From 0043a8f384d4981b19c245609dbcbaad3cd2a9ad Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Sat, 15 Mar 2014 12:56:19 -0700 Subject: [PATCH 017/683] avoid mysql lock-promotion situation. --- .../src/com/cloud/host/dao/HostDaoImpl.java | 3 +- .../com/cloud/vm/dao/VMInstanceDaoImpl.java | 73 ++++++++++--------- 2 files changed, 40 insertions(+), 36 deletions(-) diff --git a/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java b/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java index 426c90db69..3a3bdf67b9 100755 --- a/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java +++ b/engine/schema/src/com/cloud/host/dao/HostDaoImpl.java @@ -899,7 +899,8 @@ public long countRoutingHostsByDataCenter(long dcId) { @Override public boolean updateState(Status oldStatus, Event event, Status newStatus, Host vo, Object data) { - HostVO host = findById(vo.getId()); + // lock target row from beginning to avoid lock-promotion caused deadlock + HostVO host = lockRow(vo.getId(), true); if (host == null) { if (event == Event.Remove && newStatus == Status.Removed) { host = findByIdIncludingRemoved(vo.getId()); diff --git a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java index 7c5949290d..0c13ae7f7c 100644 --- a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java @@ -417,41 +417,44 @@ public void updateProxyId(long id, Long proxyId, Date time) { @Override public boolean updateState(State oldState, Event event, State newState, VirtualMachine vm, Object opaque) { - if (newState == null) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("There's no way to transition from old state: " + oldState.toString() + " event: " + event.toString()); - } - return false; - } - - @SuppressWarnings("unchecked") - Pair hosts = (Pair)opaque; - Long newHostId = hosts.second(); - - VMInstanceVO vmi = (VMInstanceVO)vm; - Long oldHostId = vmi.getHostId(); - Long oldUpdated = vmi.getUpdated(); - Date oldUpdateDate = vmi.getUpdateTime(); - if (newState.equals(oldState) && newHostId != null && newHostId.equals(oldHostId)) { - // state is same, don't need to update - return true; - } - - SearchCriteria sc = StateChangeSearch.create(); - sc.setParameters("id", vmi.getId()); - sc.setParameters("states", oldState); - sc.setParameters("host", vmi.getHostId()); - sc.setParameters("update", vmi.getUpdated()); - - vmi.incrUpdated(); - UpdateBuilder ub = getUpdateBuilder(vmi); - - ub.set(vmi, "state", newState); - ub.set(vmi, "hostId", newHostId); - ub.set(vmi, "podIdToDeployIn", vmi.getPodIdToDeployIn()); - ub.set(vmi, _updateTimeAttr, new Date()); - - int result = update(vmi, sc); + if (newState == null) { + if (s_logger.isDebugEnabled()) { + s_logger.debug("There's no way to transition from old state: " + oldState.toString() + " event: " + event.toString()); + } + return false; + } + + @SuppressWarnings("unchecked") + Pair hosts = (Pair)opaque; + Long newHostId = hosts.second(); + + VMInstanceVO vmi = (VMInstanceVO)vm; + Long oldHostId = vmi.getHostId(); + Long oldUpdated = vmi.getUpdated(); + Date oldUpdateDate = vmi.getUpdateTime(); + if ( newState.equals(oldState) && newHostId != null && newHostId.equals(oldHostId) ) { + // state is same, don't need to update + return true; + } + + // lock the target row at beginning to avoid lock-promotion caused deadlock + lockRow(vm.getId(), true); + + SearchCriteria sc = StateChangeSearch.create(); + sc.setParameters("id", vmi.getId()); + sc.setParameters("states", oldState); + sc.setParameters("host", vmi.getHostId()); + sc.setParameters("update", vmi.getUpdated()); + + vmi.incrUpdated(); + UpdateBuilder ub = getUpdateBuilder(vmi); + + ub.set(vmi, "state", newState); + ub.set(vmi, "hostId", newHostId); + ub.set(vmi, "podIdToDeployIn", vmi.getPodIdToDeployIn()); + ub.set(vmi, _updateTimeAttr, new Date()); + + int result = update(vmi, sc); if (result == 0) { VMInstanceVO vo = findByIdIncludingRemoved(vm.getId()); From a5f418dd022ea64e56690c7b52ec68752a083e60 Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Sun, 16 Mar 2014 12:34:17 -0700 Subject: [PATCH 018/683] Let VMSync be aware of HA take-over on VM state management. --- .../cloud/vm/VirtualMachineManagerImpl.java | 17 ++++- .../schema/src/com/cloud/vm/VMInstanceVO.java | 2 +- .../com/cloud/vm/dao/VMInstanceDaoImpl.java | 70 +++++++++---------- .../cloud/ha/HighAvailabilityManagerImpl.java | 42 +++-------- 4 files changed, 58 insertions(+), 73 deletions(-) diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index a31172ca76..bdc0f34dcd 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -4221,6 +4221,16 @@ private void handlePowerOffReportWithNoPendingJobsOnVM(VMInstanceVO vm) { case Stopped: case Migrating: s_logger.info("VM " + vm.getInstanceName() + " is at " + vm.getState() + " and we received a power-off report while there is no pending jobs on it"); + if(vm.isHaEnabled() && vm.getState() == State.Running && vm.getHypervisorType() != HypervisorType.VMware && vm.getHypervisorType() != HypervisorType.Hyperv) { + s_logger.info("Detected out-of-band stop of a HA enabled VM " + vm.getInstanceName() + ", will schedule restart"); + if(!_haMgr.hasPendingHaWork(vm.getId())) + _haMgr.scheduleRestart(vm, true); + else + s_logger.info("VM " + vm.getInstanceName() + " already has an pending HA task working on it"); + + return; + } + VirtualMachineGuru vmGuru = getVmGuru(vm); VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); sendStop(vmGuru, profile, true); @@ -4406,10 +4416,11 @@ public VmStateSyncOutcome(final AsyncJob job, final PowerState desiredPowerState super(VirtualMachine.class, job, VmJobCheckInterval.value(), new Predicate() { @Override public boolean checkCondition() { - VMInstanceVO instance = _vmDao.findById(vmId); - if ((instance.getPowerState() == desiredPowerState && srcHostIdForMigration == null) || - (instance.getPowerState() == desiredPowerState && (srcHostIdForMigration != null && instance.getPowerHostId() != srcHostIdForMigration))) + AsyncJobVO jobVo = _entityMgr.findById(AsyncJobVO.class, job.getId()); + assert (jobVo != null); + if (jobVo == null || jobVo.getStatus() != JobInfo.Status.IN_PROGRESS) return true; + return false; } }, Topics.VM_POWER_STATE, AsyncJob.Topics.JOB_STATE); diff --git a/engine/schema/src/com/cloud/vm/VMInstanceVO.java b/engine/schema/src/com/cloud/vm/VMInstanceVO.java index 9ebade120e..376b8357f0 100644 --- a/engine/schema/src/com/cloud/vm/VMInstanceVO.java +++ b/engine/schema/src/com/cloud/vm/VMInstanceVO.java @@ -465,7 +465,7 @@ public void setDetails(Map details) { @Override public String toString() { if (toString == null) { - toString = new StringBuilder("VM[").append(type.toString()).append("|").append(hostName).append("]").toString(); + toString = new StringBuilder("VM[").append(type.toString()).append("|").append(getInstanceName()).append("]").toString(); } return toString; } diff --git a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java index 0c13ae7f7c..cc05f53605 100644 --- a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java @@ -417,44 +417,44 @@ public void updateProxyId(long id, Long proxyId, Date time) { @Override public boolean updateState(State oldState, Event event, State newState, VirtualMachine vm, Object opaque) { - if (newState == null) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("There's no way to transition from old state: " + oldState.toString() + " event: " + event.toString()); - } - return false; - } - - @SuppressWarnings("unchecked") - Pair hosts = (Pair)opaque; - Long newHostId = hosts.second(); - - VMInstanceVO vmi = (VMInstanceVO)vm; - Long oldHostId = vmi.getHostId(); - Long oldUpdated = vmi.getUpdated(); - Date oldUpdateDate = vmi.getUpdateTime(); - if ( newState.equals(oldState) && newHostId != null && newHostId.equals(oldHostId) ) { - // state is same, don't need to update - return true; - } + if (newState == null) { + if (s_logger.isDebugEnabled()) { + s_logger.debug("There's no way to transition from old state: " + oldState.toString() + " event: " + event.toString()); + } + return false; + } + + @SuppressWarnings("unchecked") + Pair hosts = (Pair)opaque; + Long newHostId = hosts.second(); + + VMInstanceVO vmi = (VMInstanceVO)vm; + Long oldHostId = vmi.getHostId(); + Long oldUpdated = vmi.getUpdated(); + Date oldUpdateDate = vmi.getUpdateTime(); + if (newState.equals(oldState) && newHostId != null && newHostId.equals(oldHostId)) { + // state is same, don't need to update + return true; + } // lock the target row at beginning to avoid lock-promotion caused deadlock lockRow(vm.getId(), true); - - SearchCriteria sc = StateChangeSearch.create(); - sc.setParameters("id", vmi.getId()); - sc.setParameters("states", oldState); - sc.setParameters("host", vmi.getHostId()); - sc.setParameters("update", vmi.getUpdated()); - - vmi.incrUpdated(); - UpdateBuilder ub = getUpdateBuilder(vmi); - - ub.set(vmi, "state", newState); - ub.set(vmi, "hostId", newHostId); - ub.set(vmi, "podIdToDeployIn", vmi.getPodIdToDeployIn()); - ub.set(vmi, _updateTimeAttr, new Date()); - - int result = update(vmi, sc); + + SearchCriteria sc = StateChangeSearch.create(); + sc.setParameters("id", vmi.getId()); + sc.setParameters("states", oldState); + sc.setParameters("host", vmi.getHostId()); + sc.setParameters("update", vmi.getUpdated()); + + vmi.incrUpdated(); + UpdateBuilder ub = getUpdateBuilder(vmi); + + ub.set(vmi, "state", newState); + ub.set(vmi, "hostId", newHostId); + ub.set(vmi, "podIdToDeployIn", vmi.getPodIdToDeployIn()); + ub.set(vmi, _updateTimeAttr, new Date()); + + int result = update(vmi, sc); if (result == 0) { VMInstanceVO vo = findByIdIncludingRemoved(vm.getId()); diff --git a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java index 48d998a53d..f7ab552033 100755 --- a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java +++ b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java @@ -72,7 +72,6 @@ import com.cloud.utils.component.ManagerBase; import com.cloud.utils.concurrency.NamedThreadFactory; import com.cloud.utils.exception.CloudRuntimeException; -import com.cloud.utils.fsm.StateListener; import com.cloud.vm.VMInstanceVO; import com.cloud.vm.VirtualMachine; import com.cloud.vm.VirtualMachine.State; @@ -103,8 +102,7 @@ * before retrying the stop | seconds | 120 || * } **/ @Local(value = { HighAvailabilityManager.class }) -public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvailabilityManager, ClusterManagerListener, - StateListener { +public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvailabilityManager, ClusterManagerListener { protected static final Logger s_logger = Logger.getLogger(HighAvailabilityManagerImpl.class); WorkerThread[] _workers; @@ -236,7 +234,7 @@ public void scheduleRestartForVmsOnHost(final HostVO host, boolean investigate) return; } - s_logger.warn("Scheduling restart for VMs on host " + host.getId()); + s_logger.warn("Scheduling restart for VMs on host " + host.getId() + "-" + host.getName()); final List vms = _instanceDao.listByHostId(host.getId()); final DataCenterVO dcVO = _dcDao.findById(host.getDataCenterId()); @@ -806,7 +804,6 @@ public boolean configure(final String name, final Map xmlParams) _stopped = true; _executor = Executors.newScheduledThreadPool(count, new NamedThreadFactory("HA")); - VirtualMachine.State.getStateMachine().registerListener(this); return true; } @@ -921,6 +918,12 @@ private void runWithContext() { work.setTimeToTry(nextTime); work.setServerId(null); work.setDateTaken(null); + + // if restart failed in the middle due to exception, VM state may has been changed + // recapture into the HA worker so that it can really continue in it next turn + VMInstanceVO vm = _instanceDao.findById(work.getInstanceId()); + work.setUpdateTime(vm.getUpdated()); + work.setPreviousState(vm.getState()); } _haDao.update(work.getId(), work); } catch (final Throwable th) { @@ -962,35 +965,6 @@ public DeploymentPlanner getHAPlanner() { return _haPlanners.get(0); } - @Override - public boolean preStateTransitionEvent(State oldState, VirtualMachine.Event event, State newState, VirtualMachine vo, boolean status, Object opaque) { - return true; - } - - @Override - public boolean postStateTransitionEvent(State oldState, VirtualMachine.Event event, State newState, VirtualMachine vo, boolean status, Object opaque) { - if (oldState == State.Running && event == VirtualMachine.Event.FollowAgentPowerOffReport && newState == State.Stopped) { - final VMInstanceVO vm = _instanceDao.findById(vo.getId()); - if (vm.isHaEnabled()) { - if (vm.getState() != State.Stopped) - s_logger.warn("Sanity check failed. postStateTransitionEvent reports transited to Stopped but VM " + vm + " is still at state " + vm.getState()); - - s_logger.info("Detected out-of-band stop of a HA enabled VM " + vm.getInstanceName() + ", will schedule restart"); - _executor.submit(new ManagedContextRunnable() { - @Override - protected void runInContext() { - try { - scheduleRestart(vm, false); - } catch (Exception e) { - s_logger.warn("Unexpected exception when scheduling a HA restart", e); - } - } - }); - } - } - return true; - } - @Override public boolean hasPendingHaWork(long vmId) { List haWorks = _haDao.listRunningHaWorkForVm(vmId); From 63563b740aff97701c909ea14a3b03bcd1c1cd6d Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Tue, 18 Mar 2014 17:00:08 -0700 Subject: [PATCH 019/683] Fix style-check issue after cherry-picks --- .../src/com/cloud/vm/VirtualMachineManagerImpl.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index bdc0f34dcd..2ff870aed6 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -4224,13 +4224,12 @@ private void handlePowerOffReportWithNoPendingJobsOnVM(VMInstanceVO vm) { if(vm.isHaEnabled() && vm.getState() == State.Running && vm.getHypervisorType() != HypervisorType.VMware && vm.getHypervisorType() != HypervisorType.Hyperv) { s_logger.info("Detected out-of-band stop of a HA enabled VM " + vm.getInstanceName() + ", will schedule restart"); if(!_haMgr.hasPendingHaWork(vm.getId())) - _haMgr.scheduleRestart(vm, true); + _haMgr.scheduleRestart(vm, true); else s_logger.info("VM " + vm.getInstanceName() + " already has an pending HA task working on it"); - return; } - + VirtualMachineGuru vmGuru = getVmGuru(vm); VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm); sendStop(vmGuru, profile, true); @@ -4420,7 +4419,6 @@ public boolean checkCondition() { assert (jobVo != null); if (jobVo == null || jobVo.getStatus() != JobInfo.Status.IN_PROGRESS) return true; - return false; } }, Topics.VM_POWER_STATE, AsyncJob.Topics.JOB_STATE); From 7ff49cb887d355eb9ce787bb816e4331a46e0cc8 Mon Sep 17 00:00:00 2001 From: Jayapal Date: Wed, 19 Mar 2014 15:46:15 +0530 Subject: [PATCH 020/683] CLOUDSTACK-6240 Fixed updating advanced SG rules for vm nic secondary ip --- .../api/command/user/vm/AddIpToVmNicCmd.java | 8 +++++++- .../api/command/user/vm/RemoveIpFromVmNicCmd.java | 9 ++++++++- .../network/security/SecurityGroupManagerImpl.java | 13 +++++++------ 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java index a7f94368dc..870bbbf01e 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/AddIpToVmNicCmd.java @@ -92,6 +92,12 @@ private NetworkType getNetworkType() { return dc.getNetworkType(); } + private boolean isZoneSGEnabled() { + Network ntwk = _entityMgr.findById(Network.class, getNetworkId()); + DataCenter dc = _entityMgr.findById(DataCenter.class, ntwk.getDataCenterId()); + return dc.isSecurityGroupEnabled(); + } + @Override public String getEventType() { return EventTypes.EVENT_NET_IP_ASSIGN; @@ -136,7 +142,7 @@ public void execute() throws ResourceUnavailableException, ResourceAllocationExc if (result != null) { secondaryIp = result.getIp4Address(); - if (getNetworkType() == NetworkType.Basic) { + if (isZoneSGEnabled()) { // add security group rules for the secondary ip addresses boolean success = false; success = _securityGroupService.securityGroupRulesForVmSecIp(getNicId(), secondaryIp, true); diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java index 75eafa9503..70d5b48a16 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/RemoveIpFromVmNicCmd.java @@ -131,6 +131,13 @@ public NetworkType getNetworkType() { return null; } + + private boolean isZoneSGEnabled() { + Network ntwk = _entityMgr.findById(Network.class, getNetworkId()); + DataCenter dc = _entityMgr.findById(DataCenter.class, ntwk.getDataCenterId()); + return dc.isSecurityGroupEnabled(); + } + @Override public void execute() throws InvalidParameterValueException { CallContext.current().setEventDetails("Ip Id: " + id); @@ -140,7 +147,7 @@ public void execute() throws InvalidParameterValueException { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Invalid IP id is passed"); } - if (getNetworkType() == NetworkType.Basic) { + if (isZoneSGEnabled()) { //remove the security group rules for this secondary ip boolean success = false; success = _securityGroupService.securityGroupRulesForVmSecIp(nicSecIp.getNicId(), nicSecIp.getIp4Address(), false); diff --git a/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java b/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java index cf71b25119..9c1b967c6e 100755 --- a/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java +++ b/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java @@ -1350,16 +1350,17 @@ public boolean securityGroupRulesForVmSecIp(long nicId, String secondaryIp, bool // Validate parameters List vmSgGrps = getSecurityGroupsForVm(vmId); - if (vmSgGrps == null) { + if (vmSgGrps.isEmpty()) { s_logger.debug("Vm is not in any Security group "); return true; } - for (SecurityGroupVO securityGroup : vmSgGrps) { - Account owner = _accountMgr.getAccount(securityGroup.getAccountId()); - if (owner == null) { - throw new InvalidParameterValueException("Unable to find security group owner by id=" + securityGroup.getAccountId()); - } + //If network does not support SG service, no need add SG rules for secondary ip + Network network = _networkModel.getNetwork(nic.getNetworkId()); + if (!_networkModel.isSecurityGroupSupportedInNetwork(network)) { + s_logger.debug("Network " + network + " is not enabled with security group service, "+ + "so not applying SG rules for secondary ip"); + return true; } String vmMac = vm.getPrivateMacAddress(); From a919f740d0ef71fc69f2a02a77f387cc391c2c23 Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Fri, 14 Mar 2014 16:44:34 -0700 Subject: [PATCH 021/683] Adding support for 'readOnly' access. AccessType.ListEntry introduced. Conflicts: api/src/org/apache/cloudstack/api/ApiConstants.java --- .../org/apache/cloudstack/acl/SecurityChecker.java | 3 ++- api/src/org/apache/cloudstack/api/ApiConstants.java | 2 ++ .../command/iam/AddIAMPermissionToIAMPolicyCmd.java | 10 +++++++++- .../src/org/apache/cloudstack/iam/IAMApiService.java | 2 +- .../org/apache/cloudstack/iam/IAMApiServiceImpl.java | 11 +++++++++-- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/api/src/org/apache/cloudstack/acl/SecurityChecker.java b/api/src/org/apache/cloudstack/acl/SecurityChecker.java index 614f604aec..8ca34d05b0 100644 --- a/api/src/org/apache/cloudstack/acl/SecurityChecker.java +++ b/api/src/org/apache/cloudstack/acl/SecurityChecker.java @@ -33,7 +33,8 @@ public interface SecurityChecker extends Adapter { public enum AccessType { ModifyProject, OperateEntry, - UseEntry + UseEntry, + ListEntry } /** diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index 6142a0d37d..aa7c2d4071 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -594,6 +594,8 @@ public class ApiConstants { public static final String SUPPORTS_REGION_LEVEL_VPC = "supportsregionLevelvpc"; public static final String SUPPORTS_STRECHED_L2_SUBNET = "supportsstrechedl2subnet"; public static final String REGION_LEVEL_VPC = "regionlevelvpc"; + public static final String READ_ONLY = "readOnly"; + public enum HostDetails { all, capacity, events, stats, min; diff --git a/services/iam/plugin/src/org/apache/cloudstack/api/command/iam/AddIAMPermissionToIAMPolicyCmd.java b/services/iam/plugin/src/org/apache/cloudstack/api/command/iam/AddIAMPermissionToIAMPolicyCmd.java index d37cc3cb7b..e7c5650ed2 100644 --- a/services/iam/plugin/src/org/apache/cloudstack/api/command/iam/AddIAMPermissionToIAMPolicyCmd.java +++ b/services/iam/plugin/src/org/apache/cloudstack/api/command/iam/AddIAMPermissionToIAMPolicyCmd.java @@ -29,6 +29,7 @@ import org.apache.cloudstack.api.BaseAsyncCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.BaseCmd.CommandType; import org.apache.cloudstack.api.response.iam.IAMPolicyResponse; import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.iam.IAMApiService; @@ -72,6 +73,9 @@ public class AddIAMPermissionToIAMPolicyCmd extends BaseAsyncCmd { @Parameter(name = ApiConstants.IAM_SCOPE_ID, type = CommandType.STRING, required = false, description = "The UUID of the permission scope id") private String scopeId; + @Parameter(name = ApiConstants.READ_ONLY, type = CommandType.BOOLEAN, required = false, description = "Read Only access is added; Only applicable when action = List/Read api name") + private Boolean readOnly; + ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// @@ -100,6 +104,10 @@ public Long getScopeId() { return _iamApiSrv.getPermissionScopeId(scope, entityType, scopeId); } + public Boolean isReadOnly() { + return (readOnly != null) ? readOnly : false; + } + ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @@ -123,7 +131,7 @@ public void execute() throws ResourceUnavailableException, CallContext.current().setEventDetails("IAM policy Id: " + getId()); // Only explicit ALLOW is supported for this release, no explicit deny IAMPolicy result = _iamApiSrv.addIAMPermissionToIAMPolicy(id, entityType, PermissionScope.valueOf(scope), - getScopeId(), action, Permission.Allow, false); + getScopeId(), action, Permission.Allow, false, isReadOnly()); if (result != null) { IAMPolicyResponse response = _iamApiSrv.createIAMPolicyResponse(result); response.setResponseName(getCommandName()); diff --git a/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiService.java b/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiService.java index bb8f03b77f..6735d4804d 100644 --- a/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiService.java +++ b/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiService.java @@ -60,7 +60,7 @@ public interface IAMApiService extends PluggableService { void removeIAMPolicyFromAccounts(Long policyId, List accountIds); IAMPolicy addIAMPermissionToIAMPolicy(long iamPolicyId, String entityType, PermissionScope scope, Long scopeId, - String action, Permission perm, Boolean recursive); + String action, Permission perm, Boolean recursive, Boolean readOnly); IAMPolicy removeIAMPermissionFromIAMPolicy(long iamPolicyId, String entityType, PermissionScope scope, Long scopeId, String action); diff --git a/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java b/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java index e128cf13df..467caed3d7 100644 --- a/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java +++ b/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java @@ -40,6 +40,7 @@ import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.affinity.AffinityGroup; import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.BaseAsyncCreateCmd; import org.apache.cloudstack.api.BaseListCmd; import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.command.iam.AddAccountToIAMGroupCmd; @@ -506,11 +507,17 @@ public void removeIAMPolicyFromAccounts(final Long policyId, final List ac @Override @ActionEvent(eventType = EventTypes.EVENT_IAM_POLICY_GRANT, eventDescription = "Granting acl permission to IAM Policy") public IAMPolicy addIAMPermissionToIAMPolicy(long iamPolicyId, String entityType, PermissionScope scope, - Long scopeId, String action, Permission perm, Boolean recursive) { + Long scopeId, String action, Permission perm, Boolean recursive, Boolean readOnly) { Class cmdClass = _apiServer.getCmdClass(action); AccessType accessType = null; if (BaseListCmd.class.isAssignableFrom(cmdClass)) { - accessType = AccessType.UseEntry; + if (readOnly) { + accessType = AccessType.ListEntry; + } else { + accessType = AccessType.UseEntry; + } + } else if (!(BaseAsyncCreateCmd.class.isAssignableFrom(cmdClass))) { + accessType = AccessType.OperateEntry; } String accessTypeStr = (accessType != null) ? accessType.toString() : null; return _iamSrv.addIAMPermissionToIAMPolicy(iamPolicyId, entityType, scope.toString(), scopeId, action, From b3e22191cb53145abd064d09264407b7e000c49f Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Tue, 18 Mar 2014 17:04:27 -0700 Subject: [PATCH 022/683] More changes to support 'readOnly' access Conflicts: api/src/org/apache/cloudstack/api/ApiConstants.java --- api/src/org/apache/cloudstack/api/ApiConstants.java | 2 +- server/src/com/cloud/acl/DomainChecker.java | 11 +++++++++++ .../command/iam/AddIAMPermissionToIAMPolicyCmd.java | 1 - .../org/apache/cloudstack/iam/IAMApiServiceImpl.java | 3 ++- .../apache/cloudstack/iam/test/IAMApiServiceTest.java | 4 ++-- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index aa7c2d4071..cc2c93bf71 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -594,7 +594,7 @@ public class ApiConstants { public static final String SUPPORTS_REGION_LEVEL_VPC = "supportsregionLevelvpc"; public static final String SUPPORTS_STRECHED_L2_SUBNET = "supportsstrechedl2subnet"; public static final String REGION_LEVEL_VPC = "regionlevelvpc"; - public static final String READ_ONLY = "readOnly"; + public static final String READ_ONLY = "readonly"; public enum HostDetails { diff --git a/server/src/com/cloud/acl/DomainChecker.java b/server/src/com/cloud/acl/DomainChecker.java index cb6921d9fa..ea129f7aef 100755 --- a/server/src/com/cloud/acl/DomainChecker.java +++ b/server/src/com/cloud/acl/DomainChecker.java @@ -328,6 +328,17 @@ else if (_accountService.isDomainAdmin(account.getId())) { @Override public boolean checkAccess(Account caller, ControlledEntity entity, AccessType accessType, String action) throws PermissionDeniedException { + + if (action != null && ("SystemCapability".equals(action))) { + if (caller != null && caller.getType() == Account.ACCOUNT_TYPE_ADMIN) { + return true; + } + + } else if (action != null && ("DomainCapability".equals(action))) { + if (caller != null && caller.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) { + return true; + } + } return checkAccess(caller, entity, accessType); } } diff --git a/services/iam/plugin/src/org/apache/cloudstack/api/command/iam/AddIAMPermissionToIAMPolicyCmd.java b/services/iam/plugin/src/org/apache/cloudstack/api/command/iam/AddIAMPermissionToIAMPolicyCmd.java index e7c5650ed2..d69f3d0a0b 100644 --- a/services/iam/plugin/src/org/apache/cloudstack/api/command/iam/AddIAMPermissionToIAMPolicyCmd.java +++ b/services/iam/plugin/src/org/apache/cloudstack/api/command/iam/AddIAMPermissionToIAMPolicyCmd.java @@ -29,7 +29,6 @@ import org.apache.cloudstack.api.BaseAsyncCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; -import org.apache.cloudstack.api.BaseCmd.CommandType; import org.apache.cloudstack.api.response.iam.IAMPolicyResponse; import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.iam.IAMApiService; diff --git a/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java b/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java index 467caed3d7..5d35ee2794 100644 --- a/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java +++ b/services/iam/plugin/src/org/apache/cloudstack/iam/IAMApiServiceImpl.java @@ -721,7 +721,8 @@ public void grantEntityPermissioinToAccounts(String entityType, Long entityId, A String description = "Policy to grant permission to " + entityType + entityId; policy = createIAMPolicy(caller, aclPolicyName, description, null); // add permission to this policy - addIAMPermissionToIAMPolicy(policy.getId(), entityType, PermissionScope.RESOURCE, entityId, action, Permission.Allow, false); + addIAMPermissionToIAMPolicy(policy.getId(), entityType, PermissionScope.RESOURCE, entityId, action, + Permission.Allow, false, false); } // attach this policy to list of accounts if not attached already Long policyId = policy.getId(); diff --git a/services/iam/plugin/test/org/apache/cloudstack/iam/test/IAMApiServiceTest.java b/services/iam/plugin/test/org/apache/cloudstack/iam/test/IAMApiServiceTest.java index 49c4c9f4ca..1f0972066d 100644 --- a/services/iam/plugin/test/org/apache/cloudstack/iam/test/IAMApiServiceTest.java +++ b/services/iam/plugin/test/org/apache/cloudstack/iam/test/IAMApiServiceTest.java @@ -295,8 +295,8 @@ public void addRemovePermissionToPolicyTest() { _iamSrv.addIAMPermissionToIAMPolicy(policyId, VirtualMachine.class.getSimpleName(), PermissionScope.RESOURCE.toString(), resId, "listVirtualMachines", AccessType.UseEntry.toString(), Permission.Allow, false)).thenReturn(policy); - _aclSrv.addIAMPermissionToIAMPolicy(policyId, VirtualMachine.class.getSimpleName(), - PermissionScope.RESOURCE, resId, "listVirtualMachines", Permission.Allow, false); + _aclSrv.addIAMPermissionToIAMPolicy(policyId, IAMEntityType.VirtualMachine.toString(), + PermissionScope.RESOURCE, resId, "listVirtualMachines", Permission.Allow, false, false); Pair, Integer> policyList = new Pair, Integer>(policies, 1); List policyPerms = new ArrayList(); IAMPolicyPermission perm = new IAMPolicyPermissionVO(policyId, "listVirtualMachines", From 0cc6b303e099d8a3fe3e143e4e5f71a3e4ca29fb Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Wed, 19 Mar 2014 10:59:45 -0700 Subject: [PATCH 023/683] IAMEntityType change in the test after merge --- .../test/org/apache/cloudstack/iam/test/IAMApiServiceTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/iam/plugin/test/org/apache/cloudstack/iam/test/IAMApiServiceTest.java b/services/iam/plugin/test/org/apache/cloudstack/iam/test/IAMApiServiceTest.java index 1f0972066d..84e1e56255 100644 --- a/services/iam/plugin/test/org/apache/cloudstack/iam/test/IAMApiServiceTest.java +++ b/services/iam/plugin/test/org/apache/cloudstack/iam/test/IAMApiServiceTest.java @@ -295,7 +295,7 @@ public void addRemovePermissionToPolicyTest() { _iamSrv.addIAMPermissionToIAMPolicy(policyId, VirtualMachine.class.getSimpleName(), PermissionScope.RESOURCE.toString(), resId, "listVirtualMachines", AccessType.UseEntry.toString(), Permission.Allow, false)).thenReturn(policy); - _aclSrv.addIAMPermissionToIAMPolicy(policyId, IAMEntityType.VirtualMachine.toString(), + _aclSrv.addIAMPermissionToIAMPolicy(policyId, VirtualMachine.class.getSimpleName(), PermissionScope.RESOURCE, resId, "listVirtualMachines", Permission.Allow, false, false); Pair, Integer> policyList = new Pair, Integer>(policies, 1); List policyPerms = new ArrayList(); From 342696f2716b2f9ee272a0908ca3a6418ed93072 Mon Sep 17 00:00:00 2001 From: punith-cloudbyte Date: Thu, 13 Mar 2014 11:30:27 +0530 Subject: [PATCH 024/683] cloudbyte storage plugin for master commit --- client/pom.xml | 5 + plugins/pom.xml | 1 + plugins/storage/volume/cloudbyte/pom.xml | 71 + .../module.properties | 18 + ...pring-storage-volume-cloudbyte-context.xml | 40 + .../ElastistorPrimaryDataStoreDriver.java | 88 ++ .../ElastistorPrimaryDataStoreLifeCycle.java | 479 +++++++ .../provider/ElastistorHostListener.java | 69 + .../ElastistorPrimaryDataStoreProvider.java | 165 +++ .../datastore/util/ElastistorUtil.java | 1144 +++++++++++++++++ 10 files changed, 2080 insertions(+) create mode 100755 plugins/storage/volume/cloudbyte/pom.xml create mode 100755 plugins/storage/volume/cloudbyte/resources/META-INF/cloudstack/storage-volume-cloudbyte/module.properties create mode 100755 plugins/storage/volume/cloudbyte/resources/META-INF/cloudstack/storage-volume-cloudbyte/spring-storage-volume-cloudbyte-context.xml create mode 100755 plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/driver/ElastistorPrimaryDataStoreDriver.java create mode 100755 plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/lifecycle/ElastistorPrimaryDataStoreLifeCycle.java create mode 100755 plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorHostListener.java create mode 100755 plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorPrimaryDataStoreProvider.java create mode 100755 plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util/ElastistorUtil.java diff --git a/client/pom.xml b/client/pom.xml index 74c459e769..eda8a8560f 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -35,6 +35,11 @@ cloud-plugin-storage-volume-solidfire ${project.version} + + org.apache.cloudstack + cloud-plugin-storage-volume-cloudbyte + ${project.version} + org.apache.cloudstack cloud-server diff --git a/plugins/pom.xml b/plugins/pom.xml index 097f224601..01b0713494 100755 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -78,6 +78,7 @@ storage/image/sample storage/volume/nexenta storage/volume/solidfire + storage/volume/cloudbyte storage/volume/default storage/volume/sample alert-handlers/snmp-alerts diff --git a/plugins/storage/volume/cloudbyte/pom.xml b/plugins/storage/volume/cloudbyte/pom.xml new file mode 100755 index 0000000000..3d3c9f020d --- /dev/null +++ b/plugins/storage/volume/cloudbyte/pom.xml @@ -0,0 +1,71 @@ + + + 4.0.0 + cloud-plugin-storage-volume-cloudbyte + Apache CloudStack Plugin - Storage Volume CloudByte Provider + + org.apache.cloudstack + cloudstack-plugins + 4.4.0-SNAPSHOT + ../../../pom.xml + + + + org.apache.cloudstack + cloud-plugin-storage-volume-default + ${project.version} + + + org.apache.cloudstack + cloud-engine-storage-volume + ${project.version} + + + mysql + mysql-connector-java + ${cs.mysql.version} + provided + + + com.google.code.gson + gson + ${cs.gson.version} + + + com.sun.jersey + jersey-bundle + 1.17.1 + + + + install + src + test + + + maven-surefire-plugin + + true + + + + integration-test + + test + + + + + + + diff --git a/plugins/storage/volume/cloudbyte/resources/META-INF/cloudstack/storage-volume-cloudbyte/module.properties b/plugins/storage/volume/cloudbyte/resources/META-INF/cloudstack/storage-volume-cloudbyte/module.properties new file mode 100755 index 0000000000..730e376c92 --- /dev/null +++ b/plugins/storage/volume/cloudbyte/resources/META-INF/cloudstack/storage-volume-cloudbyte/module.properties @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +name=storage-volume-cloudbyte +parent=storage \ No newline at end of file diff --git a/plugins/storage/volume/cloudbyte/resources/META-INF/cloudstack/storage-volume-cloudbyte/spring-storage-volume-cloudbyte-context.xml b/plugins/storage/volume/cloudbyte/resources/META-INF/cloudstack/storage-volume-cloudbyte/spring-storage-volume-cloudbyte-context.xml new file mode 100755 index 0000000000..87c5f51393 --- /dev/null +++ b/plugins/storage/volume/cloudbyte/resources/META-INF/cloudstack/storage-volume-cloudbyte/spring-storage-volume-cloudbyte-context.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + diff --git a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/driver/ElastistorPrimaryDataStoreDriver.java b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/driver/ElastistorPrimaryDataStoreDriver.java new file mode 100755 index 0000000000..f603b349db --- /dev/null +++ b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/driver/ElastistorPrimaryDataStoreDriver.java @@ -0,0 +1,88 @@ +package org.apache.cloudstack.storage.datastore.driver; + + +import javax.inject.Inject; + +import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo; +import org.apache.cloudstack.engine.subsystem.api.storage.CopyCommandResult; +import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult; +import org.apache.cloudstack.engine.subsystem.api.storage.DataObject; +import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; +import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver; +import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo; +import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; +import org.apache.cloudstack.framework.async.AsyncCompletionCallback; +import org.apache.cloudstack.storage.command.CommandResult; +import org.apache.log4j.Logger; + +import com.cloud.agent.api.to.DataStoreTO; +import com.cloud.agent.api.to.DataTO; +import com.cloud.storage.dao.DiskOfferingDao; +import com.cloud.user.AccountManager; + +/** + * The implementation class for PrimaryDataStoreDriver. This + * directs the public interface methods to use CloudByte's Elastistor based + * volumes. + * + * @author amit.das@cloudbyte.com + * @author punith.s@cloudbyte.com + * + */ +public class ElastistorPrimaryDataStoreDriver extends CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver{ + + private static final Logger s_logger = Logger.getLogger(ElastistorPrimaryDataStoreDriver.class); + + @Inject + AccountManager _accountMgr; + @Inject + DiskOfferingDao _diskOfferingDao; + @Override + public DataTO getTO(DataObject data) { + return null; + } + + @Override + public DataStoreTO getStoreTO(DataStore store) { + return null; + } + + public void createAsync(DataStore dataStore, DataObject dataObject, AsyncCompletionCallback callback) { + super.createAsync(dataStore, dataObject, callback); + } + + public void deleteAsync(DataStore dataStore, DataObject dataObject, AsyncCompletionCallback callback) { + super.deleteAsync(dataStore, dataObject, callback); + } + + @Override + public void copyAsync(DataObject srcdata, DataObject destData, AsyncCompletionCallback callback) { + throw new UnsupportedOperationException(); + + } + + @Override + public boolean canCopy(DataObject srcData, DataObject destData) { + return false; + } + + @Override + public void resize(DataObject data, AsyncCompletionCallback callback) { + throw new UnsupportedOperationException(); + } + + public ChapInfo getChapInfo(VolumeInfo volumeInfo) { + return super.getChapInfo(volumeInfo); + } + + @Override + public void takeSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback callback) { + throw new UnsupportedOperationException(); + } + + @Override + public void revertSnapshot(SnapshotInfo snapshot, AsyncCompletionCallback callback) { + throw new UnsupportedOperationException(); + } + +} diff --git a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/lifecycle/ElastistorPrimaryDataStoreLifeCycle.java b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/lifecycle/ElastistorPrimaryDataStoreLifeCycle.java new file mode 100755 index 0000000000..9719ba85d6 --- /dev/null +++ b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/lifecycle/ElastistorPrimaryDataStoreLifeCycle.java @@ -0,0 +1,479 @@ +package org.apache.cloudstack.storage.datastore.lifecycle; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.StringTokenizer; + +import javax.inject.Inject; + +import org.apache.cloudstack.engine.subsystem.api.storage.ClusterScope; +import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; +import org.apache.cloudstack.engine.subsystem.api.storage.HostScope; +import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreInfo; +import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreLifeCycle; +import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreParameters; +import org.apache.cloudstack.engine.subsystem.api.storage.ZoneScope; +import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; +import org.apache.cloudstack.storage.datastore.db.StoragePoolDetailsDao; +import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; +import org.apache.cloudstack.storage.datastore.util.ElastistorUtil; +import org.apache.cloudstack.storage.datastore.util.ElastistorUtil.CreateTsmCmdResponse; +import org.apache.cloudstack.storage.datastore.util.ElastistorUtil.CreateVolumeCmdResponse; +import org.apache.cloudstack.storage.volume.datastore.PrimaryDataStoreHelper; +import org.apache.log4j.Logger; + +import com.cloud.agent.AgentManager; +import com.cloud.agent.api.Answer; +import com.cloud.agent.api.CreateStoragePoolCommand; +import com.cloud.agent.api.DeleteStoragePoolCommand; +import com.cloud.agent.api.StoragePoolInfo; +import com.cloud.dc.dao.DataCenterDao; +import com.cloud.host.Host; +import com.cloud.host.HostVO; +import com.cloud.host.dao.HostDao; +import com.cloud.hypervisor.Hypervisor.HypervisorType; +import com.cloud.resource.ResourceManager; +import com.cloud.storage.Storage.StoragePoolType; +import com.cloud.storage.StorageManager; +import com.cloud.storage.StoragePool; +import com.cloud.storage.StoragePoolAutomation; +import com.cloud.storage.StoragePoolHostVO; +import com.cloud.storage.dao.StoragePoolHostDao; +import com.cloud.utils.exception.CloudRuntimeException; + +public class ElastistorPrimaryDataStoreLifeCycle implements PrimaryDataStoreLifeCycle { + private static final Logger s_logger = Logger.getLogger(ElastistorPrimaryDataStoreLifeCycle.class); + + @Inject + HostDao _hostDao; + @Inject + StoragePoolHostDao _storagePoolHostDao; + @Inject + protected ResourceManager _resourceMgr; + @Inject + PrimaryDataStoreDao primaryDataStoreDao; + @Inject + AgentManager agentMgr; + @Inject + StorageManager storageMgr; + @Inject + PrimaryDataStoreHelper dataStoreHelper; + @Inject + PrimaryDataStoreDao _storagePoolDao; + @Inject + PrimaryDataStoreHelper _dataStoreHelper; + @Inject + StoragePoolAutomation _storagePoolAutomation; + @Inject + StoragePoolDetailsDao _storagePoolDetailsDao; + @Inject + DataCenterDao _zoneDao; + + @Override + public DataStore initialize(Map dsInfos) { + + String url = (String) dsInfos.get("url"); + Long zoneId = (Long) dsInfos.get("zoneId"); + Long podId = (Long) dsInfos.get("podId"); + Long clusterId = (Long) dsInfos.get("clusterId"); + String storagePoolName = (String) dsInfos.get("name"); + String providerName = (String) dsInfos.get("providerName"); + Long capacityBytes = (Long) dsInfos.get("capacityBytes"); + Long capacityIops = (Long) dsInfos.get("capacityIops"); + String tags = (String) dsInfos.get("tags"); + Map details = (Map) dsInfos.get("details"); + String storageIp = getStorageIp(url); + int storagePort = getDefaultStoragePort(url); + StoragePoolType storagetype = getStorageType(url); + String accesspath = getAccessPath(url); + String protocoltype = getProtocolType(url); + String[] mp = accesspath.split("/"); + String mountpoint = mp[1]; + String uuid = null ; + + /** + * if the elastistor params which are required for plugin configuration + * are not injected through spring-storage-volume-cloudbyte-context.xml, it can be set from details map. + */ + if(details.get("esaccountid") != null) + ElastistorUtil.setElastistorAccountId(details.get("esaccountid")); + if(details.get("esapikey") != null) + ElastistorUtil.setElastistorApiKey(details.get("esapikey")); + if(details.get("esdefaultgateway") != null) + ElastistorUtil.setElastistorGateway(details.get("esdefaultgateway")); + if(details.get("estntinterface") != null) + ElastistorUtil.setElastistorInterface(details.get("estntinterface")); + if(details.get("esmanagementip") != null) + ElastistorUtil.setElastistorManagementIp(details.get("esmanagementip")); + if(details.get("espoolid") != null) + ElastistorUtil.setElastistorPoolId(details.get("espoolid")); + if(details.get("essubnet") != null) + ElastistorUtil.setElastistorSubnet(details.get("essubnet")); + + if (capacityBytes == null || capacityBytes <= 0) { + throw new IllegalArgumentException("'capacityBytes' must be present and greater than 0."); + } + + if (capacityIops == null || capacityIops <= 0) { + throw new IllegalArgumentException("'capacityIops' must be present and greater than 0."); + } + + // elastistor does not allow same name and ip pools. + List storagePoolVO = _storagePoolDao.listAll(); + for(StoragePoolVO poolVO : storagePoolVO){ + if (storagePoolName.equals(poolVO.getName())) { + throw new IllegalArgumentException("storage pool with that name already exists in elastistor,please specify a unique name ."); + } + if (storageIp.equals(poolVO.getHostAddress())) { + throw new IllegalArgumentException("storage pool with that ip already exists in elastistor,please specify a unique ip ."); + } + } + + PrimaryDataStoreParameters parameters = new PrimaryDataStoreParameters(); + + // creates the volume in elastistor + parameters = createElastistorVolume(parameters, storagePoolName, storageIp, capacityBytes, capacityIops, protocoltype, mountpoint); + + parameters.setHost(storageIp); + parameters.setPort(storagePort); + if(protocoltype.contentEquals("nfs")){ + parameters.setPath(accesspath); + } + parameters.setType(storagetype); + parameters.setZoneId(zoneId); + parameters.setPodId(podId); + parameters.setName(storagePoolName); + parameters.setProviderName(providerName); + parameters.setManaged(false); + parameters.setCapacityBytes(capacityBytes); + parameters.setUsedBytes(0); + parameters.setCapacityIops(capacityIops); + parameters.setHypervisorType(HypervisorType.Any); + parameters.setTags(tags); + parameters.setDetails(details); + parameters.setClusterId(clusterId); + + return _dataStoreHelper.createPrimaryDataStore(parameters); + } + + private PrimaryDataStoreParameters createElastistorVolume(PrimaryDataStoreParameters parameters, String storagePoolName, String storageIp, Long capacityBytes, Long capacityIops, String protocoltype, String mountpoint){ + + s_logger.info("creation of elastistor volume started"); + try { + + CreateTsmCmdResponse tsmCmdResponse = ElastistorUtil.createElastistorTsm(storagePoolName, storageIp, capacityBytes, capacityIops); + + String uuid = tsmCmdResponse.getTsm().getUuid(); + parameters.setUuid(uuid); + + CreateVolumeCmdResponse volumeCmdResponse = ElastistorUtil.createElastistorVolume(storagePoolName, tsmCmdResponse, capacityBytes, capacityIops, protocoltype ,mountpoint); + + if(protocoltype.contentEquals("iscsi")){ + String accesspath = "/"+volumeCmdResponse.getFileSystem().getIqn()+"/0"; + parameters.setPath(accesspath); + } + s_logger.info("creation of elastistor volume complete"); + + return parameters; + } catch (Throwable e) { + throw new CloudRuntimeException("Failed to create volume in elastistor" + e.toString()); + } + + } + + private String getAccessPath(String url) { + StringTokenizer st = new StringTokenizer(url ,"/"); + int count = 0; + while (st.hasMoreElements()) { + if(count == 2) + { String s = "/" ; + return s.concat(st.nextElement().toString()); + } + st.nextElement(); + count++; + } + return null; + } + + + private StoragePoolType getStorageType(String url) { + + StringTokenizer st = new StringTokenizer(url ,":"); + + while (st.hasMoreElements()) + { + String accessprotocol = st.nextElement().toString(); + + if(accessprotocol.contentEquals("nfs")) + { + return StoragePoolType.NetworkFilesystem; + } + else if(accessprotocol.contentEquals("iscsi")) + { + return StoragePoolType.IscsiLUN; + } + + else + + break; + + } + return null; + } + + private String getProtocolType(String url) { + StringTokenizer st = new StringTokenizer(url ,":"); + + while (st.hasMoreElements()) + { + String accessprotocol = st.nextElement().toString(); + + if(accessprotocol.contentEquals("nfs")){ + return "nfs"; + }else if(accessprotocol.contentEquals("iscsi")){ + return "iscsi"; + } else + break; + } + return null; + } + + // this method parses the url and gets the default storage port based on access protocol + private int getDefaultStoragePort(String url) { + + StringTokenizer st = new StringTokenizer(url ,":"); + + while (st.hasMoreElements()) + { + + String accessprotocol = st.nextElement().toString(); + + if(accessprotocol.contentEquals("nfs")){ + return 2049; + } + else if(accessprotocol.contentEquals("iscsi")){ + return 3260; + } + else + break; + + } + return -1; + + } + + // parses the url and returns the storage volume ip + private String getStorageIp(String url) { + + StringTokenizer st = new StringTokenizer(url ,"/"); + int count = 0; + + while (st.hasMoreElements()) { + if(count == 1) + return st.nextElement().toString(); + + st.nextElement(); + count++; + } + return null; + } + + @Override + public boolean attachCluster(DataStore store, ClusterScope scope) { + + dataStoreHelper.attachCluster(store); + + PrimaryDataStoreInfo primarystore = (PrimaryDataStoreInfo) store; + // Check if there is host up in this cluster + List allHosts = _resourceMgr.listAllUpAndEnabledHosts(Host.Type.Routing, primarystore.getClusterId(), + primarystore.getPodId(), primarystore.getDataCenterId()); + if (allHosts.isEmpty()) { + primaryDataStoreDao.expunge(primarystore.getId()); + throw new CloudRuntimeException("No host up to associate a storage pool with in cluster " + + primarystore.getClusterId()); + } + + + boolean success = false; + for (HostVO h : allHosts) { + success = createStoragePool(h.getId(), primarystore); + if (success) { + break; + } + } + + s_logger.debug("In createPool Adding the pool to each of the hosts"); + List poolHosts = new ArrayList(); + for (HostVO h : allHosts) { + try { + storageMgr.connectHostToSharedPool(h.getId(), primarystore.getId()); + poolHosts.add(h); + } catch (Exception e) { + s_logger.warn("Unable to establish a connection between " + h + " and " + primarystore, e); + } + + if (poolHosts.isEmpty()) { + s_logger.warn("No host can access storage pool " + primarystore + " on cluster " + + primarystore.getClusterId()); + primaryDataStoreDao.expunge(primarystore.getId()); + throw new CloudRuntimeException("Failed to access storage pool"); + } + } + + return true; + } + + private boolean createStoragePool(long hostId, StoragePool pool) { + s_logger.debug("creating pool " + pool.getName() + " on host " + hostId); + if (pool.getPoolType() != StoragePoolType.NetworkFilesystem && pool.getPoolType() != StoragePoolType.Filesystem + && pool.getPoolType() != StoragePoolType.IscsiLUN && pool.getPoolType() != StoragePoolType.Iscsi + && pool.getPoolType() != StoragePoolType.VMFS && pool.getPoolType() != StoragePoolType.SharedMountPoint + && pool.getPoolType() != StoragePoolType.PreSetup && pool.getPoolType() != StoragePoolType.OCFS2 + && pool.getPoolType() != StoragePoolType.RBD && pool.getPoolType() != StoragePoolType.CLVM) { + s_logger.warn(" Doesn't support storage pool type " + pool.getPoolType()); + return false; + } + CreateStoragePoolCommand cmd = new CreateStoragePoolCommand(true, pool); + final Answer answer = agentMgr.easySend(hostId, cmd); + if (answer != null && answer.getResult()) { + return true; + } else { + primaryDataStoreDao.expunge(pool.getId()); + String msg = ""; + if (answer != null) { + msg = "Can not create storage pool through host " + hostId + " due to " + answer.getDetails(); + s_logger.warn(msg); + } else { + msg = "Can not create storage pool through host " + hostId + " due to CreateStoragePoolCommand returns null"; + s_logger.warn(msg); + } + throw new CloudRuntimeException(msg); + } + } + + + @Override + public boolean attachHost(DataStore store, HostScope scope, StoragePoolInfo existingInfo) { + _dataStoreHelper.attachHost(store, scope, existingInfo); + return true; + } + + @Override + public boolean attachZone(DataStore dataStore, ZoneScope scope, HypervisorType hypervisorType) { + List hosts = _resourceMgr.listAllUpAndEnabledHostsInOneZoneByHypervisor(hypervisorType, scope.getScopeId()); + s_logger.debug("In createPool. Attaching the pool to each of the hosts."); + List poolHosts = new ArrayList(); + for (HostVO host : hosts) { + try { + storageMgr.connectHostToSharedPool(host.getId(), dataStore.getId()); + poolHosts.add(host); + } catch (Exception e) { + s_logger.warn("Unable to establish a connection between " + host + " and " + dataStore, e); + } + } + if (poolHosts.isEmpty()) { + s_logger.warn("No host can access storage pool " + dataStore + " in this zone."); + primaryDataStoreDao.expunge(dataStore.getId()); + throw new CloudRuntimeException("Failed to create storage pool as it is not accessible to hosts."); + } + dataStoreHelper.attachZone(dataStore, hypervisorType); + return true; + } + + @Override + public boolean maintain(DataStore store) { + _storagePoolAutomation.maintain(store); + _dataStoreHelper.maintain(store); + return true; + } + + @Override + public boolean cancelMaintain(DataStore store) { + _dataStoreHelper.cancelMaintain(store); + _storagePoolAutomation.cancelMaintain(store); + return true; + } + + @SuppressWarnings("finally") + @Override + public boolean deleteDataStore(DataStore store) { + List hostPoolRecords = _storagePoolHostDao.listByPoolId(store.getId()); + StoragePool pool = (StoragePool) store; + + // find the hypervisor where the storage is attached to. + HypervisorType hType = null; + if(hostPoolRecords.size() > 0 ){ + hType = getHypervisorType(hostPoolRecords.get(0).getHostId()); + } + + // Remove the SR associated with the Xenserver + for (StoragePoolHostVO host : hostPoolRecords) { + DeleteStoragePoolCommand deleteCmd = new DeleteStoragePoolCommand(pool); + final Answer answer = agentMgr.easySend(host.getHostId(), deleteCmd); + + if (answer != null && answer.getResult()) { + // if host is KVM hypervisor then send deleteStoragepoolcmd to all the kvm hosts. + if (HypervisorType.KVM != hType) { + break; + } + } else { + if (answer != null) { + s_logger.error("Failed to delete storage pool: " + answer.getResult()); + } + } + } + + //delete the Elastistor volume at backend + deleteElastistorVolume(pool); + + return _dataStoreHelper.deletePrimaryDataStore(store); + } + + private void deleteElastistorVolume(StoragePool pool){ + + String poolip = pool.getHostAddress(); + String esip = null; + String apikey = null; + + // check if apikey and managentip is empty, if so getting it from stragepooldetails + if(ElastistorUtil.s_esIPVAL == "" && ElastistorUtil.s_esAPIKEYVAL == ""){ + Map detailsMap = _storagePoolDetailsDao.listDetailsKeyPairs(pool.getId()); + ElastistorUtil.setElastistorManagementIp(detailsMap.get("esmanagementip")); + esip=ElastistorUtil.s_esIPVAL; + ElastistorUtil.setElastistorApiKey(detailsMap.get("esapikey")); + apikey = ElastistorUtil.s_esAPIKEYVAL; + }else{ + esip = ElastistorUtil.s_esIPVAL; + apikey = ElastistorUtil.s_esAPIKEYVAL; + } + + boolean status; + try { + status = ElastistorUtil.deleteElastistorVolume(poolip,esip,apikey); + } catch (Throwable e) { + throw new CloudRuntimeException("Failed to delete primary storage on elastistor" + e); + } + + if(status == true){ + s_logger.info("deletion of elastistor primary storage complete"); + }else{ + s_logger.error("deletion of elastistor volume failed"); + } + + } + + private HypervisorType getHypervisorType(long hostId) { + HostVO host = _hostDao.findById(hostId); + if (host != null) + return host.getHypervisorType(); + return HypervisorType.None; + } + + @Override + public boolean migrateToObjectStore(DataStore store) { + return false; + } + + +} diff --git a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorHostListener.java b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorHostListener.java new file mode 100755 index 0000000000..23ea2ddfb7 --- /dev/null +++ b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorHostListener.java @@ -0,0 +1,69 @@ +package org.apache.cloudstack.storage.datastore.provider; + +import javax.inject.Inject; + +import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; +import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener; +import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; +import org.apache.log4j.Logger; + +import com.cloud.agent.AgentManager; +import com.cloud.agent.api.Answer; +import com.cloud.agent.api.ModifyStoragePoolAnswer; +import com.cloud.agent.api.ModifyStoragePoolCommand; +import com.cloud.alert.AlertManager; +import com.cloud.storage.DataStoreRole; +import com.cloud.storage.StoragePool; +import com.cloud.storage.StoragePoolHostVO; +import com.cloud.storage.dao.StoragePoolHostDao; +import com.cloud.utils.exception.CloudRuntimeException; + +public class ElastistorHostListener implements HypervisorHostListener { + private static final Logger s_logger = Logger.getLogger(DefaultHostListener.class); + @Inject + AgentManager agentMgr; + @Inject + DataStoreManager dataStoreMgr; + @Inject + AlertManager alertMgr; + @Inject + StoragePoolHostDao storagePoolHostDao; + @Inject + PrimaryDataStoreDao primaryStoreDao; + + @Override + public boolean hostConnect(long hostId, long poolId) { + StoragePool pool = (StoragePool) this.dataStoreMgr.getDataStore(poolId, DataStoreRole.Primary); + ModifyStoragePoolCommand cmd = new ModifyStoragePoolCommand(true, pool); + final Answer answer = agentMgr.easySend(hostId, cmd); + + if (answer == null) { + throw new CloudRuntimeException("Unable to get an answer to the modify storage pool command" + pool.getId()); + } + + if (!answer.getResult()) { + String msg = "Unable to attach storage pool" + poolId + " to the host" + hostId; + + alertMgr.sendAlert(AlertManager.AlertType.ALERT_TYPE_HOST,pool.getDataCenterId(), pool.getPodId(), msg, msg); + + throw new CloudRuntimeException("Unable establish connection from storage head to storage pool " + pool.getId() + " due to " + answer.getDetails() + pool.getId()); + } + + assert (answer instanceof ModifyStoragePoolAnswer) : "Well, now why won't you actually return the ModifyStoragePoolAnswer when it's ModifyStoragePoolCommand? Pool=" + pool.getId() + "Host=" + hostId; + + s_logger.info("Connection established between " + pool + " host + " + hostId); + return true; + } + + @Override + public boolean hostDisconnected(long hostId, long poolId) { + StoragePoolHostVO storagePoolHost = storagePoolHostDao.findByPoolHost( + poolId, hostId); + + if (storagePoolHost != null) { + storagePoolHostDao.deleteStoragePoolHostDetails(hostId, poolId); + } + return false; + } + +} diff --git a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorPrimaryDataStoreProvider.java b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorPrimaryDataStoreProvider.java new file mode 100755 index 0000000000..e0a154a026 --- /dev/null +++ b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorPrimaryDataStoreProvider.java @@ -0,0 +1,165 @@ +package org.apache.cloudstack.storage.datastore.provider; + +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import javax.inject.Inject; + +import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreLifeCycle; +import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; +import org.apache.cloudstack.engine.subsystem.api.storage.HypervisorHostListener; +import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver; +import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreProvider; +import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; +import org.apache.cloudstack.storage.datastore.driver.ElastistorPrimaryDataStoreDriver; +import org.apache.cloudstack.storage.datastore.lifecycle.ElastistorPrimaryDataStoreLifeCycle; +import org.apache.cloudstack.storage.datastore.util.ElastistorUtil; +import org.apache.log4j.Logger; +import org.springframework.stereotype.Component; + +import com.cloud.agent.AgentManager; +import com.cloud.alert.AlertManager; +import com.cloud.storage.dao.StoragePoolHostDao; +import com.cloud.utils.component.ComponentContext; + +/** + * This is the starting point of the elastistor storage plugin. This bean will + * be detected by Spring container & initialized. This will be one of the + * providers available via {@link DataStoreProviderManagerImpl} object. + * + * @author amit.das@cloudbyte.com + * @author punith.s@cloudbyte.com + */ +@Component +public class ElastistorPrimaryDataStoreProvider implements PrimaryDataStoreProvider { + + private static final Logger s_logger = Logger.getLogger(DefaultHostListener.class); + + //these classes will be injected by spring + private ElastistorPrimaryDataStoreLifeCycle lifecycle; + private PrimaryDataStoreDriver driver; + private HypervisorHostListener listener; + + // these params will be initialized with respective values given in spring-storage-volume-cloudbyte-context.xml bean for the elastistor porpose only. + private String esmanagementip; + private String esapikey; + private String esaccountid; + private String espoolid; + private String esdefaultgateway; + private String essubnet; + private String estntinterface; + + @Inject + AgentManager agentMgr; + @Inject + DataStoreManager dataStoreMgr; + @Inject + AlertManager alertMgr; + @Inject + StoragePoolHostDao storagePoolHostDao; + @Inject + PrimaryDataStoreDao primaryStoreDao; + + + @Override + public String getName() { + return ElastistorUtil.ES_PROVIDER_NAME; + } + + @Override + public DataStoreLifeCycle getDataStoreLifeCycle() { + return lifecycle; + } + + @Override + public PrimaryDataStoreDriver getDataStoreDriver() { + return driver; + } + + @Override + public HypervisorHostListener getHostListener() { + return listener; + } + + @Override + public boolean configure(Map params) { + + lifecycle = ComponentContext.inject(ElastistorPrimaryDataStoreLifeCycle.class); + driver = ComponentContext.inject(ElastistorPrimaryDataStoreDriver.class); + listener = ComponentContext.inject(ElastistorHostListener.class); + + ElastistorUtil.setElastistorAccountId(esaccountid); + ElastistorUtil.setElastistorApiKey(esapikey); + ElastistorUtil.setElastistorManagementIp(esmanagementip); + ElastistorUtil.setElastistorPoolId(espoolid); + ElastistorUtil.setElastistorGateway(esdefaultgateway); + ElastistorUtil.setElastistorInterface(estntinterface); + ElastistorUtil.setElastistorSubnet(essubnet); + + return true; + } + + @Override + public Set getTypes() { + Set types = new HashSet(); + + types.add(DataStoreProviderType.PRIMARY); + + return types; + } + public String getEspoolid() { + return espoolid; + } + + public void setEspoolid(String espoolid) { + this.espoolid = espoolid; + } + + public String getEsmanagementip() { + return esmanagementip; + } + + public void setEsmanagementip(String esmanagementip) { + this.esmanagementip = esmanagementip; + } + + public String getEsaccountid() { + return esaccountid; + } + + public void setEsaccountid(String esaccountid) { + this.esaccountid = esaccountid; + } + + public String getEsapikey() { + return esapikey; + } + + public void setEsapikey(String esapikey) { + this.esapikey = esapikey; + } + + public String getesdefaultgateway() { + return esdefaultgateway; + } + + public void setesdefaultgateway(String esdefaultgateway) { + this.esdefaultgateway = esdefaultgateway; + } + public String getEssubnet() { + return essubnet; + } + + public void setEssubnet(String essubnet) { + this.essubnet = essubnet; + } + + public String getEstntinterface(){ + return estntinterface; + } + + public void setEstntinterface(String estntinterface){ + this.estntinterface = estntinterface; + } +} diff --git a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util/ElastistorUtil.java b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util/ElastistorUtil.java new file mode 100755 index 0000000000..09b2a309b5 --- /dev/null +++ b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util/ElastistorUtil.java @@ -0,0 +1,1144 @@ +package org.apache.cloudstack.storage.datastore.util; + +import java.net.ConnectException; +import java.security.InvalidParameterException; +import java.security.SecureRandom; +import java.security.cert.X509Certificate; +import java.util.HashMap; + +import javax.naming.ServiceUnavailableException; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLHandshakeException; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.UriBuilder; + +import org.apache.http.auth.InvalidCredentialsException; +import org.apache.log4j.Logger; + +import com.cloud.utils.exception.CloudRuntimeException; +import com.google.gson.Gson; +import com.google.gson.annotations.SerializedName; +import com.sun.jersey.api.client.Client; +import com.sun.jersey.api.client.ClientResponse; +import com.sun.jersey.api.client.WebResource; +import com.sun.jersey.api.client.config.ClientConfig; +import com.sun.jersey.api.client.config.DefaultClientConfig; +import com.sun.jersey.core.util.MultivaluedMapImpl; + +/** + * The util class for elastistor's storage plugin codebase. + * + * @author amit.das@cloudbyte.com + * @author punith.s@cloudbyte.com + * + */ +public class ElastistorUtil { + + private static final Logger s_logger = Logger.getLogger(ElastistorUtil.class); + + + /** + * Elastistor REST API Param Keys. These should match exactly with the + * elastistor API commands' params. + */ + public static final String REST_PARAM_COMMAND = "command"; + public static final String REST_PARAM_APIKEY = "apikey"; + public static final String REST_PARAM_KEYWORD = "keyword"; + public static final String REST_PARAM_ID = "id"; + public static final String REST_PARAM_QUOTA_SIZE = "quotasize"; + public static final String REST_PARAM_READONLY = "readonly"; + public static final String REST_PARAM_RESPONSE = "response"; + public static final String REST_PARAM_POOLID = "poolid"; + public static final String REST_PARAM_ACCOUNTID = "accountid"; + public static final String REST_PARAM_GATEWAY = "router"; + public static final String REST_PARAM_SUBNET = "subnet"; + public static final String REST_PARAM_INTERFACE = "tntinterface"; + public static final String REST_PARAM_IPADDRESS = "ipaddress"; + public static final String REST_PARAM_JOBID = "jobId"; + public static final String REST_PARAM_FORECEDELETE = "forcedelete"; + public static final String REST_PARAM_TSM_THROUGHPUT = "totalthroughput"; + public static final String REST_PARAM_NAME = "name"; + public static final String REST_PARAM_NOOFCOPIES = "noofcopies"; + public static final String REST_PARAM_RECORDSIZE = "recordsize"; + public static final String REST_PARAM_TOTALIOPS = "totaliops"; + public static final String REST_PARAM_LATENCY = "latency"; + public static final String REST_PARAM_BLOCKSIZE = "blocksize"; + public static final String REST_PARAM_GRACEALLOWED = "graceallowed"; + public static final String REST_PARAM_IOPS = "iops"; + public static final String REST_PARAM_THROUGHPUT = "throughput"; + public static final String REST_PARAM_MEMLIMIT= "memlimit"; + public static final String REST_PARAM_NETWORKSPEED = "networkspeed"; + public static final String REST_PARAM_TSMID = "tsmid"; + public static final String REST_PARAM_DATASETID = "datasetid"; + public static final String REST_PARAM_QOSGROUPID = "qosgroupid"; + public static final String REST_PARAM_DEDUPLICATION = "deduplication"; + public static final String REST_PARAM_COMPRESSION = "compression"; + public static final String REST_PARAM_SYNC = "sync"; + public static final String REST_PARAM_MOUNTPOINT= "mountpoint"; + public static final String REST_PARAM_CASESENSITIVITY = "casesensitivity"; + public static final String REST_PARAM_UNICODE = "unicode"; + public static final String REST_PARAM_PROTOCOLTYPE= "protocoltype"; + public static final String REST_PARAM_AUTHNETWORK = "authnetwork"; + public static final String REST_PARAM_MAPUSERSTOROOT = "mapuserstoroot"; + + /** + * Constants related to elastistor which are persisted in cloudstack + * databases as keys. + */ + public static final String ES_SUBNET = "essubnet"; + public static final String ES_INTERFACE = "estntinterface"; + public static final String ES_GATEWAY = "esdefaultgateway"; + public static final String ES_PROVIDER_NAME = "elastistor"; + public static final String ES_ACCOUNT_ID = "esAccountId"; + public static final String ES_POOL_ID = "esPoolId"; + public static final String ES_ACCOUNT_NAME = "esAccountName"; + public static final String ES_STORAGE_IP = "esStorageIp"; + public static final String ES_STORAGE_PORT = "esStoragePort"; + public static final String ES_STORAGE_TYPE = "esStorageType"; + public static final String ES_MANAGEMENT_IP = "esMgmtIp"; + public static final String ES_MANAGEMENT_PORT = "esMgmtPort"; + public static final String ES_API_KEY = "esApiKey"; + public static final String ES_VOLUME_ID = "esVolumeId"; + public static final String ES_VOLUME_GROUP_ID = "esVolumeGroupId"; + public static final String ES_FILE_SYSTEM_ID = "esFilesystemId"; + + /** + * Values from configuration that are required for every invocation of + * ElastiCenter API. These might in turn be saved as DB updates along with + * above keys. + */ + public static String s_esIPVAL = ""; + public static String s_esAPIKEYVAL = ""; + public static String s_esACCOUNTIDVAL = ""; + public static String s_esPOOLIDVAL = ""; + public static String s_esSUBNETVAL = ""; + public static String s_esINTERFACEVAL = ""; + public static String s_esGATEWAYVAL = ""; + + /** + * hardcoded constants for elastistor api calls. + */ + private static final String ES_NOOFCOPIES_VAL = "1"; + private static final String ES_BLOCKSIZE_VAL = "4K"; + private static final String ES_LATENCY_VAL = "15"; + private static final String ES_GRACEALLOWED_VAL = "false"; + private static final String ES_MEMLIMIT_VAL = "0"; + private static final String ES_NETWORKSPEED_VAL = "0"; + private static final String ES_DEDUPLICATION_VAL = "off"; + private static final String ES_COMPRESSION_VAL = "off"; + private static final String ES_CASESENSITIVITY_VAL = "sensitive"; + private static final String ES_READONLY_VAL = "off"; + private static final String ES_UNICODE_VAL = "off"; + private static final String ES_AUTHNETWORK_VAL = "all"; + private static final String ES_MAPUSERSTOROOT_VAL = "yes"; + private static final String ES_SYNC_VAL = "always"; + + + /** + * Private constructor s.t. its never instantiated. + */ + private ElastistorUtil() { + + } + + /** + * This intializes a new jersey restclient for http call with elasticenter + */ + public static ElastiCenterClient getElastistorRestClient(String managementIp , String apiKey) { + ElastiCenterClient restclient = null; + try { + + restclient = new ElastiCenterClient(managementIp, apiKey); + + } catch (InvalidCredentialsException e) { + throw new CloudRuntimeException("InvalidCredentialsException", e); + } catch (InvalidParameterException e) { + throw new CloudRuntimeException("InvalidParameterException", e); + } catch (SSLHandshakeException e) { + throw new CloudRuntimeException("SSLHandshakeException", e); + } catch (ServiceUnavailableException e) { + throw new CloudRuntimeException("ServiceUnavailableException", e); + } + return restclient; + } + + public static void setElastistorApiKey(String value) { + s_esAPIKEYVAL = value; + } + + public static void setElastistorManagementIp(String value) { + s_esIPVAL = value; + } + + public static void setElastistorPoolId(String value) { + s_esPOOLIDVAL = value; + } + + public static void setElastistorAccountId(String value) { + s_esACCOUNTIDVAL = value; + } + + public static void setElastistorGateway(String value) { + s_esGATEWAYVAL = value; + } + + public static void setElastistorInterface(String value) { + s_esINTERFACEVAL = value; + } + + public static void setElastistorSubnet(String value) { + s_esSUBNETVAL = value; + } + + /** + * This creates a new tenant storage machine(TSM) for the given storagepool ip in elastistor. + */ + public static CreateTsmCmdResponse createElastistorTsm(String storagePoolName, String storageIp, Long capacityBytes, Long capacityIops) throws Throwable { + + String totalthroughput = String.valueOf(capacityIops*4); + String totaliops = String.valueOf(capacityIops); + + String quotasize = convertCapacityBytes(capacityBytes); + + CreateTsmCmd createTsmCmd = new CreateTsmCmd(); + + if ( null != ElastistorUtil.s_esACCOUNTIDVAL ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_ACCOUNTID, ElastistorUtil.s_esACCOUNTIDVAL); + if ( null != totalthroughput ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_TSM_THROUGHPUT, totalthroughput); + if ( null != ElastistorUtil.s_esPOOLIDVAL ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_POOLID, ElastistorUtil.s_esPOOLIDVAL); + if ( null != storagePoolName ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_NAME, "TSM"+storagePoolName); + if ( null != quotasize ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_QUOTA_SIZE, quotasize); + if ( null != storageIp ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_IPADDRESS, storageIp); + if ( null != ElastistorUtil.s_esSUBNETVAL ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_SUBNET, ElastistorUtil.s_esSUBNETVAL); + if ( null != ElastistorUtil.s_esGATEWAYVAL ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_GATEWAY, ElastistorUtil.s_esGATEWAYVAL); + if ( null != ElastistorUtil.s_esINTERFACEVAL ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_INTERFACE, ElastistorUtil.s_esINTERFACEVAL); + if ( null != ElastistorUtil.ES_NOOFCOPIES_VAL ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_NOOFCOPIES, ElastistorUtil.ES_NOOFCOPIES_VAL); + if ( null != ElastistorUtil.ES_BLOCKSIZE_VAL ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_RECORDSIZE, ElastistorUtil.ES_BLOCKSIZE_VAL); + if ( null != totaliops ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_TOTALIOPS, totaliops); + if ( null != ElastistorUtil.ES_LATENCY_VAL ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_LATENCY, ElastistorUtil.ES_LATENCY_VAL); + if ( null != ElastistorUtil.ES_BLOCKSIZE_VAL ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_BLOCKSIZE, ElastistorUtil.ES_BLOCKSIZE_VAL); + if ( null != ElastistorUtil.ES_GRACEALLOWED_VAL ) createTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_GRACEALLOWED, ElastistorUtil.ES_GRACEALLOWED_VAL); + + CreateTsmCmdResponse cmdResponse; + + try { + cmdResponse = (CreateTsmCmdResponse) getElastistorRestClient(s_esIPVAL, s_esAPIKEYVAL).executeCommand(createTsmCmd); + + if ( cmdResponse.getTsm().getUuid() == null ){ + throw new CloudRuntimeException("tsm creation failed , contact elatistor admin"); + } + return cmdResponse; + } catch (Exception e) { + throw new CloudRuntimeException("tsm creation failed , contact elatistor admin" + e.toString()); + } + + } + + /** + * This creates the specified volume on the created tsm. + */ + public static CreateVolumeCmdResponse createElastistorVolume(String storagePoolName, CreateTsmCmdResponse cmdResponse, Long capacityBytes, Long capacityIops,String protocoltype, String mountpoint) throws Throwable { + + String datasetid; + String tsmid; + String qosgroupid; + String VolumeName = storagePoolName; + String totaliops = String.valueOf(capacityIops); + String totalthroughput = String.valueOf(capacityIops*4); + + String quotasize = convertCapacityBytes(capacityBytes); + + AddQosGroupCmd addQosGroupCmd = new AddQosGroupCmd(); + + + tsmid = cmdResponse.getTsm().getUuid(); + datasetid = cmdResponse.getTsm().getDatasetid(); + + if (null != VolumeName)addQosGroupCmd.putCommandParameter(ElastistorUtil.REST_PARAM_NAME, "QOS_" + VolumeName); + if (null != totaliops)addQosGroupCmd.putCommandParameter(ElastistorUtil.REST_PARAM_IOPS, totaliops); + if (null != ElastistorUtil.ES_LATENCY_VAL)addQosGroupCmd.putCommandParameter(ElastistorUtil.REST_PARAM_LATENCY, ElastistorUtil.ES_LATENCY_VAL); + if (null != ElastistorUtil.ES_BLOCKSIZE_VAL)addQosGroupCmd.putCommandParameter(ElastistorUtil.REST_PARAM_BLOCKSIZE, ElastistorUtil.ES_BLOCKSIZE_VAL); + if (null != totalthroughput)addQosGroupCmd.putCommandParameter(ElastistorUtil.REST_PARAM_THROUGHPUT, totalthroughput); + if (null != ElastistorUtil.ES_MEMLIMIT_VAL)addQosGroupCmd.putCommandParameter(ElastistorUtil.REST_PARAM_MEMLIMIT, ElastistorUtil.ES_MEMLIMIT_VAL); + if (null != ElastistorUtil.ES_NETWORKSPEED_VAL)addQosGroupCmd.putCommandParameter(ElastistorUtil.REST_PARAM_NETWORKSPEED, ElastistorUtil.ES_NETWORKSPEED_VAL); + if (null != tsmid)addQosGroupCmd.putCommandParameter(ElastistorUtil.REST_PARAM_TSMID, tsmid); + if (null != datasetid)addQosGroupCmd.putCommandParameter(ElastistorUtil.REST_PARAM_DATASETID, datasetid); + if (null != ElastistorUtil.ES_GRACEALLOWED_VAL)addQosGroupCmd.putCommandParameter(ElastistorUtil.REST_PARAM_GRACEALLOWED, ElastistorUtil.ES_GRACEALLOWED_VAL); + + AddQosGroupCmdResponse addQosGroupCmdResponse = (AddQosGroupCmdResponse) getElastistorRestClient(s_esIPVAL, s_esAPIKEYVAL).executeCommand(addQosGroupCmd); + + if (addQosGroupCmdResponse.getQoSGroup().getUuid() == null) { + + throw new CloudRuntimeException("adding qos group failed , contact elatistor admin"); + + } + + else { + + CreateVolumeCmd createVolumeCmd = new CreateVolumeCmd(); + + qosgroupid = addQosGroupCmdResponse.getQoSGroup().getUuid(); + + if (null != ElastistorUtil.s_esACCOUNTIDVAL)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_ACCOUNTID,ElastistorUtil.s_esACCOUNTIDVAL); + if (null != qosgroupid)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_QOSGROUPID, qosgroupid); + if (null != tsmid)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_TSMID, tsmid); + if (null != ElastistorUtil.s_esPOOLIDVAL)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_POOLID,ElastistorUtil.s_esPOOLIDVAL); + if (null != VolumeName)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_NAME, VolumeName); + if (null != quotasize)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_QUOTA_SIZE, quotasize); + if(protocoltype.equalsIgnoreCase("nfs")){ + if ( null != ElastistorUtil.ES_BLOCKSIZE_VAL ) createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_BLOCKSIZE, ElastistorUtil.ES_BLOCKSIZE_VAL); + if ( null != ElastistorUtil.ES_BLOCKSIZE_VAL ) createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_RECORDSIZE, ElastistorUtil.ES_BLOCKSIZE_VAL); + } + else{ + if ( null != ElastistorUtil.ES_BLOCKSIZE_VAL ) createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_BLOCKSIZE, "512B"); + if ( null != ElastistorUtil.ES_BLOCKSIZE_VAL ) createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_RECORDSIZE, "512B"); + } + if (null != ElastistorUtil.ES_DEDUPLICATION_VAL)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_DEDUPLICATION, ElastistorUtil.ES_DEDUPLICATION_VAL); + if (null != ElastistorUtil.ES_SYNC_VAL)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_SYNC, ElastistorUtil.ES_SYNC_VAL); + if (null != ElastistorUtil.ES_COMPRESSION_VAL)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_COMPRESSION, ElastistorUtil.ES_COMPRESSION_VAL); + if (null != ElastistorUtil.ES_NOOFCOPIES_VAL)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_NOOFCOPIES, ElastistorUtil.ES_NOOFCOPIES_VAL); + createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_MOUNTPOINT, mountpoint); + if (null != ElastistorUtil.ES_CASESENSITIVITY_VAL)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_CASESENSITIVITY, ElastistorUtil.ES_CASESENSITIVITY_VAL); + if (null != ElastistorUtil.ES_READONLY_VAL)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_READONLY, ElastistorUtil.ES_READONLY_VAL); + if (null != datasetid)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_DATASETID, datasetid); + if (null != ElastistorUtil.ES_UNICODE_VAL)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_UNICODE, ElastistorUtil.ES_UNICODE_VAL); + createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_PROTOCOLTYPE, protocoltype); + if (null != ElastistorUtil.ES_AUTHNETWORK_VAL)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_AUTHNETWORK, ElastistorUtil.ES_AUTHNETWORK_VAL); + if (null != ElastistorUtil.ES_MAPUSERSTOROOT_VAL)createVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_MAPUSERSTOROOT, ElastistorUtil.ES_MAPUSERSTOROOT_VAL); + + CreateVolumeCmdResponse createVolumeCmdResponse; + try { + createVolumeCmdResponse = (CreateVolumeCmdResponse) getElastistorRestClient(s_esIPVAL, s_esAPIKEYVAL).executeCommand(createVolumeCmd); + + if (createVolumeCmdResponse.getFileSystem().getUuid() == null) { + + throw new CloudRuntimeException("creating volume failed , contact elatistor admin"); + + } else { + return createVolumeCmdResponse; + } + + } catch (Exception e) { + throw new CloudRuntimeException("creating volume failed , contact elatistor admin", e); + } + + } + + } + + /** + * This deletes both the volume and the tsm in elastistor. + */ + public static boolean deleteElastistorVolume(String poolip, String esmanagementip, String esapikey) throws Throwable { + + String esvolumeid = null; + String estsmid = null; + + ListTsmsResponse listTsmsResponse = listTsm(poolip); + + if (listTsmsResponse.getTsmsCount() != 0) { + int i; + + for (i = 0; i < listTsmsResponse.getTsmsCount(); i++) { + if (poolip.compareTo(listTsmsResponse.getTsms().getTsm(i).getIpaddress()) == 0) { + estsmid = listTsmsResponse.getTsms().getTsm(i).getUuid(); + break; + } + } + + if (listTsmsResponse.getTsms().getTsm(i).checkvolume()) { + esvolumeid = listTsmsResponse.getTsms().getTsm(i).getVolumeProperties(0).getid(); + DeleteVolumeResponse deleteVolumeResponse = deleteVolume(esvolumeid, null); + + if (deleteVolumeResponse != null) { + String jobid = deleteVolumeResponse.getJobId(); + int jobstatus = queryAsyncJobResult(jobid); + + if (jobstatus == 1) { + s_logger.info("elastistor volume successfully deleted"); + } else { + s_logger.info("now farce deleting the volume"); + + while (jobstatus != 1) { + DeleteVolumeResponse deleteVolumeResponse1 = deleteVolume(esvolumeid, "true"); + + if (deleteVolumeResponse1 != null) { + String jobid1 = deleteVolumeResponse1.getJobId(); + jobstatus = queryAsyncJobResult(jobid1); + } + } + s_logger.info("elastistor volume successfully deleted"); + } + } + } else { + s_logger.info("no volume present in on the given tsm"); + } + s_logger.info("now trying to delete elastistor tsm"); + + if (estsmid != null) { + DeleteTsmCmd deleteTsmCmd = new DeleteTsmCmd(); + deleteTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_ID,estsmid); + DeleteTsmResponse deleteTsmResponse = (DeleteTsmResponse) getElastistorRestClient(s_esIPVAL, s_esAPIKEYVAL).executeCommand(deleteTsmCmd); + + if (deleteTsmResponse != null) { + String jobstatus = deleteTsmResponse.getJobStatus(); + + if (jobstatus.equalsIgnoreCase("true")) { + s_logger.info("deletion of elastistor tsm successful"); + return true; + } else { + s_logger.info("failed to delete elastistor tsm"); + return false; + } + } else { + s_logger.info("elastistor tsm id not present"); + } + } + else { + s_logger.error("no volume is present in the tsm"); + } + } else { + s_logger.error("List tsm failed, no tsm present in the eastistor for the given IP "); + return false; + } + return false; + + } + + /** + * This give a json response containing the list of tsm's in elastistor. + */ + private static ListTsmsResponse listTsm(String poolip) throws Throwable { + + ListTsmCmd listTsmCmd = new ListTsmCmd(); + + listTsmCmd.putCommandParameter(ElastistorUtil.REST_PARAM_IPADDRESS,poolip); + + ListTsmsResponse listTsmsResponse = (ListTsmsResponse) getElastistorRestClient(s_esIPVAL, s_esAPIKEYVAL).executeCommand(listTsmCmd); + + return listTsmsResponse; + } + + private static DeleteVolumeResponse deleteVolume(String esvolumeid, String forcedelete)throws Throwable { + + DeleteVolumeCmd deleteVolumeCmd = new DeleteVolumeCmd(); + + deleteVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_ID,esvolumeid); + deleteVolumeCmd.putCommandParameter(ElastistorUtil.REST_PARAM_FORECEDELETE, forcedelete); + + DeleteVolumeResponse deleteVolumeResponse = (DeleteVolumeResponse) getElastistorRestClient(s_esIPVAL, s_esAPIKEYVAL).executeCommand(deleteVolumeCmd); + + return deleteVolumeResponse; + } + + private static int queryAsyncJobResult(String jobid) throws Throwable { + + QueryAsyncJobResultCmd asyncJobResultCmd = new QueryAsyncJobResultCmd(); + ElastiCenterClient restclient = getElastistorRestClient(s_esIPVAL, s_esAPIKEYVAL); + + asyncJobResultCmd.putCommandParameter(ElastistorUtil.REST_PARAM_JOBID, jobid); + + QueryAsyncJobResultResponse asyncJobResultResponse = (QueryAsyncJobResultResponse) restclient.executeCommand(asyncJobResultCmd); + + if (asyncJobResultResponse != null) { + int jobstatus = asyncJobResultResponse.getAsync().getJobStatus(); + + while (jobstatus == 0) { + + QueryAsyncJobResultResponse jobResultResponse = (QueryAsyncJobResultResponse) restclient.executeCommand(asyncJobResultCmd); + + jobstatus = jobResultResponse.getAsync().getJobStatus(); + } + return jobstatus; + } + return 0; + + } + + /** + * this method converts the long capacitybytes to string format, which is feasible for elastistor rest api + * 214748364800 = 200G. + */ + private static String convertCapacityBytes(Long capacityBytes){ + + String quotasize; + + if((1099511627776L)>capacityBytes &&(capacityBytes>(1073741824))){ + return quotasize =(String.valueOf(capacityBytes/(1024*1024*1024))+"G"); + }else + { int temp1 = (int) (capacityBytes/(1024*1024*1024)); + int temp2 = temp1/1024; + return quotasize =(String.valueOf(temp2)+"T"); + } + } + + static interface ElastiCenterCommand { + + /* + * Returns the command string to be sent to the ElastiCenter + */ + public String getCommandName(); + + /* + * Utility method to allow the client to validate the input parameters + * before sending to the ElastiCenter. + * + * This command will be executed by the ElastiCenterClient only this method + * returns true. + */ + public boolean validate(); + + /* + * Returns the query parameters that have to be passed to execute the + * command. + * + * Returns null if there are query parameters associated with the command + */ + public MultivaluedMap getCommandParameters(); + + /* + * Adds new key-value pair to the query paramters lists. + */ + public void putCommandParameter(String key, String value); + + /* + * Return an instance of the Response Object Type. + * + * Return null if no response is expected. + */ + public Object getResponseObject(); + } + + private static class BaseCommand implements ElastiCenterCommand { + + private String commandName = null; + private MultivaluedMap commandParameters = null; + private Object responseObject = null; + + /* + * Enforce the Commands to be initialized with command name and optional + * response object + */ + protected BaseCommand(String cmdName, Object responseObj) { + commandName = cmdName; + responseObject = responseObj; + } + + @Override + public String getCommandName() { + return commandName; + } + + @Override + public boolean validate() { + // TODO This method can be extended to do some generic + // validations. + return true; + } + + @Override + public MultivaluedMap getCommandParameters() { + return commandParameters; + } + + @Override + public void putCommandParameter(String key, String value) { + if (null == commandParameters) { + commandParameters = new MultivaluedMapImpl(); + } + commandParameters.add(key, value); + } + + @Override + public Object getResponseObject() { + return responseObject; + } + + } + +/** + * this is a rest client which is used to call the http rest calls to elastistor + * @author punith + * + */ + private static final class ElastiCenterClient { + + public static boolean debug = false; + + private boolean initialized = false; + + private String apiKey = null; + private String elastiCenterAddress = null; + private String responseType = "json"; + private boolean ignoreSSLCertificate = false; + + private String restprotocol = "https://"; + private String restpath = "/client/api"; + private String restdefaultcommand = "listCapabilities"; + + private String queryparamcommand = "command"; + private String queryparamapikey = "apikey"; + private String queryparamresponse = "response"; + + public ElastiCenterClient(String address, String key)throws InvalidCredentialsException, InvalidParameterException,SSLHandshakeException, ServiceUnavailableException { + this.elastiCenterAddress = address; + this.apiKey = key; + this.initialize(); + } + + public void initialize() throws InvalidParameterException, + SSLHandshakeException, InvalidCredentialsException, + ServiceUnavailableException { + + if (apiKey == null || apiKey.trim().isEmpty()) { + throw new InvalidParameterException("Unable to initialize. Please specify a valid API Key."); + } + + if (elastiCenterAddress == null || elastiCenterAddress.trim().isEmpty()) { + // TODO : Validate the format, like valid IP address or hostname. + throw new InvalidParameterException("Unable to initialize. Please specify a valid ElastiCenter IP Address or Hostname."); + } + + if (ignoreSSLCertificate) { + // Create a trust manager that does not validate certificate chains + TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() { + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + public void checkClientTrusted(X509Certificate[] certs, + String authType) { + } + + public void checkServerTrusted(X509Certificate[] certs, + String authType) { + } + } }; + + HostnameVerifier hv = new HostnameVerifier() { + @Override + public boolean verify(String urlHostName, SSLSession session) { + return true; + } + }; + + // Install the all-trusting trust manager + try { + SSLContext sc = SSLContext.getInstance("TLS"); + sc.init(null, trustAllCerts, new SecureRandom()); + HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory()); + HttpsURLConnection.setDefaultHostnameVerifier(hv); + } catch (Exception e) { + ; + } + } + + ListCapabilitiesResponse listCapabilitiesResponse = null; + try { + initialized = true; + listCapabilitiesResponse = (ListCapabilitiesResponse) executeCommand(restdefaultcommand, null, new ListCapabilitiesResponse()); + + } catch (Throwable t) { + initialized = false; + if (t instanceof InvalidCredentialsException) { + throw (InvalidCredentialsException) t; + } else if (t instanceof ServiceUnavailableException) { + throw (ServiceUnavailableException) t; + } else if (t.getCause() instanceof SSLHandshakeException) { + throw new SSLHandshakeException( + "Unable to initialize. An untrusted SSL Certificate was received from " + + elastiCenterAddress + + ". Please verify your truststore or configure ElastiCenterClient to skip the SSL Validation. "); + } else if (t.getCause() instanceof ConnectException) { + throw new ServiceUnavailableException( + "Unable to initialize. Failed to connect to " + + elastiCenterAddress + + ". Please verify the IP Address, Network Connectivity and ensure that Services are running on the ElastiCenter Server. "); + } + throw new ServiceUnavailableException("Unable to initialize. Please contact your ElastiCenter Administrator. Exception " + t.getMessage()); + } + + if (null == listCapabilitiesResponse || null == listCapabilitiesResponse.getCapabilities() || null == listCapabilitiesResponse.getCapabilities().getVersion()) { + initialized = false; + throw new ServiceUnavailableException("Unable to execute command on the server"); + } + + } + + public Object executeCommand(ElastiCenterCommand cmd) throws Throwable { + return executeCommand(cmd.getCommandName(), cmd.getCommandParameters(),cmd.getResponseObject()); + } + + public Object executeCommand(String command,MultivaluedMap params, Object responeObj) throws Throwable { + + if (!initialized) { + throw new IllegalStateException("Error : ElastiCenterClient is not initialized."); + } + + if (command == null || command.trim().isEmpty()) { + throw new InvalidParameterException("No command to execute."); + } + + try { + ClientConfig config = new DefaultClientConfig(); + Client client = Client.create(config); + WebResource webResource = client.resource(UriBuilder.fromUri(restprotocol + elastiCenterAddress + restpath).build()); + + MultivaluedMap queryParams = new MultivaluedMapImpl(); + queryParams.add(queryparamapikey, apiKey); + queryParams.add(queryparamresponse, responseType); + + queryParams.add(queryparamcommand, command); + + if (null != params) { + for (String key : params.keySet()) { + queryParams.add(key, params.getFirst(key)); + } + } + if (debug) { + System.out.println("Command Sent " + command + " : "+ queryParams); + } + ClientResponse response = webResource.queryParams(queryParams).accept(MediaType.APPLICATION_JSON).get(ClientResponse.class); + + if (response.getStatus() >= 300) { + if (debug) + System.out.println("ElastiCenter returned error code : " + response.getStatus()); + if (401 == response.getStatus()) { + throw new InvalidCredentialsException("Please specify a valid API Key."); + } else if (431 == response.getStatus()) { + throw new InvalidParameterException(response.getHeaders().getFirst("X-Description")); + } else if (432 == response.getStatus()) { + throw new InvalidParameterException(command + " does not exist on the ElastiCenter server. Please specify a valid command or contact your ElastiCenter Administrator."); + } else { + throw new ServiceUnavailableException("Internal Error. Please contact your ElastiCenter Administrator."); + } + } else if (null != responeObj) { + String jsonResponse = response.getEntity(String.class); + if (debug) { + System.out.println("Command Response : " + jsonResponse); + } + Gson gson = new Gson(); + return gson.fromJson(jsonResponse, responeObj.getClass()); + } else { + return "Success"; + } + } catch (Throwable t) { + throw t; + } + } + } + + /** + * these are the list of Elastistor rest commands being called from the plugin. + * + */ + private static final class CreateTsmCmd extends BaseCommand { + + public CreateTsmCmd() { + super("createTsm", new CreateTsmCmdResponse()); + + } + + } + + private static final class AddQosGroupCmd extends BaseCommand { + + public AddQosGroupCmd() { + + super("addQosGroup", new AddQosGroupCmdResponse()); + + } + + } + + private static final class CreateVolumeCmd extends BaseCommand { + + public CreateVolumeCmd() { + super("createVolume", new CreateVolumeCmdResponse()); + + } + + } + + private static final class DeleteTsmCmd extends BaseCommand { + + public DeleteTsmCmd() { + super("deleteTsm", new DeleteTsmResponse()); + } + + } + + private static final class DeleteVolumeCmd extends BaseCommand { + + public DeleteVolumeCmd() { + super("deleteFileSystem", new DeleteVolumeResponse()); + } + + } + + private static final class QueryAsyncJobResultCmd extends BaseCommand { + + public QueryAsyncJobResultCmd() { + super("queryAsyncJobResult", new QueryAsyncJobResultResponse()); + } + + } + + private static final class ListTsmCmd extends BaseCommand { + + public ListTsmCmd() { + super("listTsm", new ListTsmsResponse()); + } + + } + + /** + * these are the list of Elastistor rest json response classes for parsing the json response sent by elastistor. + * + */ + public static final class CreateTsmCmdResponse { + + @SerializedName("createTsmResponse") + private TsmWrapper tsmWrapper; + + public Tsm getTsm() { + return tsmWrapper.getTsm(); + } + + } + + public static final class Tsm { + + @SerializedName("id") + private String uuid; + + @SerializedName("name") + private String name; + + @SerializedName("datasetid") + private String datasetid; + + @SerializedName("ipaddress") + private String ipaddress; + + @SerializedName("volumes") + private VolumeProperties[] volumeProperties; + + public String getUuid() { + return uuid; + } + + public String getName() { + return name; + } + + public String getIpaddress() { + return ipaddress; + } + + public String getDatasetid() { + return datasetid; + } + + public boolean checkvolume() { + + if(volumeProperties != null){ + return true; + } + else{ + return false; + } + + } + + public VolumeProperties getVolumeProperties(int i) { + return volumeProperties[i]; + } + + } + + public static final class VolumeProperties { + + @SerializedName("id") + private String id; + + @SerializedName("groupid") + private String groupid; + + @SerializedName("iops") + private String iops; + + @SerializedName("name") + private String name; + + public String getid() { + return id; + } + + public String getQosgroupid() { + return groupid; + } + + public String getName() { + return name; + } + + public String getIops() { + return iops; + } + } + + public static final class TsmWrapper { + + @SerializedName("tsm") + private Tsm tsm; + + public Tsm getTsm() { + return tsm; + } + + } + + public static final class AddQosGroupCmdResponse { + + @SerializedName("addqosgroupresponse") + private QoSGroupWrapper qosGroupWrapper; + + public QoSGroup getQoSGroup() { + return qosGroupWrapper.getQosGroup(); + } + } + + public static final class QoSGroupWrapper { + + @SerializedName("qosgroup") + private QoSGroup qoSGroup; + + public QoSGroup getQosGroup() { + + return qoSGroup; + } + + } + + public static final class QoSGroup { + + @SerializedName("id") + private String uuid; + + @SerializedName("name") + private String name; + + @SerializedName("qosgroupproperties") + private HashMap qosGroupProperties; + + public String getName() { + return name; + } + + public String getUuid() { + return uuid; + } + + public String getIops() { + return qosGroupProperties.get("iops"); + } + + public String getThroughput() { + return qosGroupProperties.get("throughput"); + } + + public String getLatency() { + return qosGroupProperties.get("latency"); + } + } + + public static final class CreateVolumeCmdResponse { + + @SerializedName("adddatasetresponse") + private FileSystemWrapper fileSystemWrapper; + + public FileSystem getFileSystem() { + + return fileSystemWrapper.getFileSystem(); + } + + } + + public static final class FileSystemWrapper { + + @SerializedName("filesystem") + private FileSystem fileSystem; + + public FileSystem getFileSystem() { + return fileSystem; + } + + } + + public static final class FileSystem { + + @SerializedName("id") + private String uuid; + + @SerializedName("name") + private String name; + + @SerializedName("quota") + private String quota; + + @SerializedName("timestamp") + private String timestamp; + + @SerializedName("iqnname") + private String iqnname; + + @SerializedName("filesystemproperties") + private HashMap[] filesystemproperties; + + public String getUuid() { + return uuid; + } + + public String getName() { + return name; + } + + public String getIqn() { + return iqnname; + } + + public String getQuota() { + return quota; + } + + public String getTimestamp() { + return timestamp; + } + + } + + public static final class DeleteTsmResponse { + + @SerializedName("deleteTsmResponse") + private JobId jobId; + + public String getJobStatus() { + return jobId.getJobStatus(); + } + + } + + public static final class JobId { + + @SerializedName("jobid") + private String jobid; + + @SerializedName("success") + private String jobStatus; + + public String getJobid() { + return jobid; + } + + public String getJobStatus() { + return jobStatus; + } + + } + + public static final class DeleteVolumeResponse { + + @SerializedName("deleteFileSystemResponse") + private JobId jobId; + + public String getJobId() { + return jobId.getJobid(); + } + + } + + public static final class ListCapabilitiesResponse { + + @SerializedName("listcapabilitiesresponse") + private Capabilities capabilities; + + public Capabilities getCapabilities() { + return capabilities; + } + } + + public static final class ListTsmsResponse { + + @SerializedName("listTsmResponse") + private Tsms tsms; + + public int getTsmsCount() { + return tsms.getCount(); + } + + public Tsms getTsms() { + return tsms; + } + } + + public static final class Tsms { + + @SerializedName("count") + private int count; + + @SerializedName("listTsm") + private Tsm[] tsms; + + public int getCount() { + return count; + } + + public Tsm getTsm(int i) { + return tsms[i]; + } + } + + public static final class QueryAsyncJobResultResponse { + + @SerializedName("queryasyncjobresultresponse") + private Async async; + + public Async getAsync() { + return async; + } + } + + public static final class Async { + + @SerializedName("jobstatus") + private int jobstatus; + + @SerializedName("cmd") + private String cmd; + + public int getJobStatus() { + return jobstatus; + } + + public String getCmd() { + return cmd; + } + + } + + public static final class Capabilities { + + @SerializedName("capability") + private HashMap capabilites; + + public String getVersion() { + return capabilites.get("cloudByteVersion"); + } + } +} From f109e387916fd6ffda4afe2f1ef79a8ccd6b0eb4 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Tue, 18 Mar 2014 15:01:16 -0700 Subject: [PATCH 025/683] add apache licence header for cloudbyte --- .../ElastistorPrimaryDataStoreDriver.java | 27 ++++++++++++------- .../ElastistorPrimaryDataStoreLifeCycle.java | 18 +++++++++++++ .../provider/ElastistorHostListener.java | 18 +++++++++++++ .../ElastistorPrimaryDataStoreProvider.java | 26 ++++++++++++------ .../datastore/util/ElastistorUtil.java | 26 +++++++++++++----- 5 files changed, 91 insertions(+), 24 deletions(-) diff --git a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/driver/ElastistorPrimaryDataStoreDriver.java b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/driver/ElastistorPrimaryDataStoreDriver.java index f603b349db..99d1e2aaa4 100755 --- a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/driver/ElastistorPrimaryDataStoreDriver.java +++ b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/driver/ElastistorPrimaryDataStoreDriver.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.cloudstack.storage.datastore.driver; @@ -20,15 +38,6 @@ import com.cloud.storage.dao.DiskOfferingDao; import com.cloud.user.AccountManager; -/** - * The implementation class for PrimaryDataStoreDriver. This - * directs the public interface methods to use CloudByte's Elastistor based - * volumes. - * - * @author amit.das@cloudbyte.com - * @author punith.s@cloudbyte.com - * - */ public class ElastistorPrimaryDataStoreDriver extends CloudStackPrimaryDataStoreDriverImpl implements PrimaryDataStoreDriver{ private static final Logger s_logger = Logger.getLogger(ElastistorPrimaryDataStoreDriver.class); diff --git a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/lifecycle/ElastistorPrimaryDataStoreLifeCycle.java b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/lifecycle/ElastistorPrimaryDataStoreLifeCycle.java index 9719ba85d6..aa33b2f1d1 100755 --- a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/lifecycle/ElastistorPrimaryDataStoreLifeCycle.java +++ b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/lifecycle/ElastistorPrimaryDataStoreLifeCycle.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.cloudstack.storage.datastore.lifecycle; import java.util.ArrayList; diff --git a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorHostListener.java b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorHostListener.java index 23ea2ddfb7..de4711a140 100755 --- a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorHostListener.java +++ b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorHostListener.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.cloudstack.storage.datastore.provider; import javax.inject.Inject; diff --git a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorPrimaryDataStoreProvider.java b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorPrimaryDataStoreProvider.java index e0a154a026..e59108299a 100755 --- a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorPrimaryDataStoreProvider.java +++ b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/provider/ElastistorPrimaryDataStoreProvider.java @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.cloudstack.storage.datastore.provider; import java.util.HashSet; @@ -23,14 +41,6 @@ import com.cloud.storage.dao.StoragePoolHostDao; import com.cloud.utils.component.ComponentContext; -/** - * This is the starting point of the elastistor storage plugin. This bean will - * be detected by Spring container & initialized. This will be one of the - * providers available via {@link DataStoreProviderManagerImpl} object. - * - * @author amit.das@cloudbyte.com - * @author punith.s@cloudbyte.com - */ @Component public class ElastistorPrimaryDataStoreProvider implements PrimaryDataStoreProvider { diff --git a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util/ElastistorUtil.java b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util/ElastistorUtil.java index 09b2a309b5..b75d12a6a4 100755 --- a/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util/ElastistorUtil.java +++ b/plugins/storage/volume/cloudbyte/src/org/apache/cloudstack/storage/datastore/util/ElastistorUtil.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.apache.cloudstack.storage.datastore.util; import java.net.ConnectException; @@ -31,13 +50,6 @@ import com.sun.jersey.api.client.config.DefaultClientConfig; import com.sun.jersey.core.util.MultivaluedMapImpl; -/** - * The util class for elastistor's storage plugin codebase. - * - * @author amit.das@cloudbyte.com - * @author punith.s@cloudbyte.com - * - */ public class ElastistorUtil { private static final Logger s_logger = Logger.getLogger(ElastistorUtil.class); From fc8cb754f0c6645bac5f35d8ad3d16e5e17a2d50 Mon Sep 17 00:00:00 2001 From: Rajani Karuturi Date: Mon, 17 Mar 2014 10:23:37 +0530 Subject: [PATCH 026/683] simulator manager impl changes to handle SetMonitorServiceCommand This fixes some of the test cases in the integration test test_assign_vm.py when run against a simulator Signed-off-by: Koushik Das --- .../src/com/cloud/agent/manager/SimulatorManagerImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java index 6fe9b40fa6..cf1429aeb1 100644 --- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java +++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/SimulatorManagerImpl.java @@ -25,6 +25,7 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; +import com.cloud.agent.api.routing.SetMonitorServiceCommand; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; @@ -367,8 +368,8 @@ public Answer simulate(Command cmd, String hostGuid) { } else if (cmd instanceof PvlanSetupCommand) { return _mockNetworkMgr.setupPVLAN((PvlanSetupCommand)cmd); } else if (cmd instanceof StorageSubSystemCommand) { - return this.storageHandler.handleStorageCommands((StorageSubSystemCommand) cmd); - } else if (cmd instanceof VpnUsersCfgCommand || cmd instanceof RemoteAccessVpnCfgCommand) { + return this.storageHandler.handleStorageCommands((StorageSubSystemCommand)cmd); + } else if (cmd instanceof VpnUsersCfgCommand || cmd instanceof RemoteAccessVpnCfgCommand || cmd instanceof SetMonitorServiceCommand) { return new Answer(cmd); } else { s_logger.error("Simulator does not implement command of type " + cmd.toString()); From e35d7292837faa80d7cac47b1e54a87364328431 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Thu, 20 Mar 2014 11:33:37 +0530 Subject: [PATCH 027/683] fix scripts that handle setting up bridge for tunnel network and for distributed routing. Fix ensures there is approproate flag in other config of the network to indicate the bridge type. --- scripts/vm/hypervisor/xenserver/ovstunnel | 4 ++++ server/src/com/cloud/network/vpc/VpcManagerImpl.java | 2 ++ 2 files changed, 6 insertions(+) diff --git a/scripts/vm/hypervisor/xenserver/ovstunnel b/scripts/vm/hypervisor/xenserver/ovstunnel index 98a9d0b82f..fec0072452 100755 --- a/scripts/vm/hypervisor/xenserver/ovstunnel +++ b/scripts/vm/hypervisor/xenserver/ovstunnel @@ -103,6 +103,8 @@ def setup_ovs_bridge(session, args): "bridge=%s" % bridge, "--minimal"]) lib.do_cmd([lib.XE_PATH, "network-param-set", "uuid=%s" % xs_nw_uuid, "other-config:is-ovs-tun-network=True"]) + lib.do_cmd([lib.XE_PATH, "network-param-set", "uuid=%s" % xs_nw_uuid, + "other-config:is-ovs_vpc_distributed_vr_network=False"]) conf_hosts = lib.do_cmd([lib.XE_PATH, "network-param-get", "uuid=%s" % xs_nw_uuid, "param-name=other-config", @@ -155,6 +157,8 @@ def setup_ovs_bridge_for_distributed_routing(session, args): # been configured xs_nw_uuid = lib.do_cmd([lib.XE_PATH, "network-list", "bridge=%s" % bridge, "--minimal"]) + lib.do_cmd([lib.XE_PATH, "network-param-set", "uuid=%s" % xs_nw_uuid, + "other-config:is-ovs-tun-network=False"]) lib.do_cmd([lib.XE_PATH, "network-param-set", "uuid=%s" % xs_nw_uuid, "other-config:is-ovs_vpc_distributed_vr_network=True"]) conf_hosts = lib.do_cmd([lib.XE_PATH, "network-param-get", diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java index 3ccb250dae..39b92f9820 100644 --- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java +++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java @@ -387,8 +387,10 @@ public VpcOffering createVpcOffering(String name, String displayText, List Date: Thu, 20 Mar 2014 16:21:00 +0530 Subject: [PATCH 028/683] persist fact that network can span multiple zones, if network offering has strechedL2Subnet capability and return the zones in which network spans in the networkreponse object --- .../org/apache/cloudstack/api/ApiConstants.java | 3 ++- .../api/response/NetworkResponse.java | 17 +++++++++++++++++ .../orchestration/NetworkOrchestrator.java | 1 + server/src/com/cloud/api/ApiDBUtils.java | 10 ++++++++++ server/src/com/cloud/api/ApiResponseHelper.java | 12 ++++++++++++ 5 files changed, 42 insertions(+), 1 deletion(-) diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index cc2c93bf71..0cfc9b8d03 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -595,7 +595,8 @@ public class ApiConstants { public static final String SUPPORTS_STRECHED_L2_SUBNET = "supportsstrechedl2subnet"; public static final String REGION_LEVEL_VPC = "regionlevelvpc"; public static final String READ_ONLY = "readonly"; - + public static final String STRECHED_L2_SUBNET = "strechedl2subnet"; + public static final String NETWORK_SPANNED_ZONES = "zonesnetworkspans"; public enum HostDetails { all, capacity, events, stats, min; diff --git a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java index bf92aa4f78..beeeb572b3 100644 --- a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java +++ b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java @@ -18,6 +18,7 @@ import java.util.List; +import java.util.Set; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseResponse; @@ -216,6 +217,14 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes @Param(description = "ACL Id associated with the VPC network") private String aclId; + @SerializedName(ApiConstants.STRECHED_L2_SUBNET) + @Param(description = "true if network can span multiple zones") + private Boolean strechedL2Subnet; + + @SerializedName(ApiConstants.NETWORK_SPANNED_ZONES) + @Param(description = "If a network is enabled for 'streched l2 subnet' then represents zones on which network currently spans") + private Set networkSpannedZones; + public Boolean getDisplayNetwork() { return displayNetwork; } @@ -412,4 +421,12 @@ public String getAclId() { public void setAclId(String aclId) { this.aclId = aclId; } + + public void setStrechedL2Subnet(Boolean strechedL2Subnet) { + this.strechedL2Subnet = strechedL2Subnet; + } + + public void setNetworkSpannedZones(Set networkSpannedZones) { + this.networkSpannedZones = networkSpannedZones; + } } diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java index 00c2d1af18..96dafe947d 100755 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java @@ -667,6 +667,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { NetworkVO vo = new NetworkVO(id, network, offering.getId(), guru.getName(), owner.getDomainId(), owner.getId(), relatedFile, name, displayText, predefined .getNetworkDomain(), offering.getGuestType(), plan.getDataCenterId(), plan.getPhysicalNetworkId(), aclType, offering.getSpecifyIpRanges(), vpcId); vo.setDisplayNetwork(isDisplayNetworkEnabled == null ? true : isDisplayNetworkEnabled); + vo.setStrechedL2Network(offering.getSupportsStrechedL2()); networks.add(_networksDao.persist(vo, vo.getGuestType() == Network.GuestType.Isolated, finalizeServicesAndProvidersForNetwork(offering, plan.getPhysicalNetworkId()))); diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java index 432eb941ab..67e47f7bf6 100755 --- a/server/src/com/cloud/api/ApiDBUtils.java +++ b/server/src/com/cloud/api/ApiDBUtils.java @@ -1091,6 +1091,16 @@ public static List listUserVMsByHostId(long hostId) { return s_userVmDao.listByHostId(hostId); } + public static List listUserVMsByNetworkId(long networkId) { + return s_userVmDao.listByNetworkIdAndStates(networkId, VirtualMachine.State.Running, + VirtualMachine.State.Starting, VirtualMachine.State.Stopping, VirtualMachine.State.Unknown, + VirtualMachine.State.Migrating); + } + + public static List listDomainRoutersByNetworkId(long networkId) { + return s_domainRouterDao.findByNetwork(networkId); + } + public static List listZones() { return s_zoneDao.listAll(); } diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index bc496a3497..ed04ec9153 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -2205,6 +2205,18 @@ public NetworkResponse createNetworkResponse(ResponseView view, Network network) } } + response.setStrechedL2Subnet(network.isStrechedL2Network()); + if (network.isStrechedL2Network()) { + Set networkSpannedZones = new HashSet(); + List vmInstances = new ArrayList(); + vmInstances.addAll(ApiDBUtils.listUserVMsByNetworkId(network.getId())); + vmInstances.addAll(ApiDBUtils.listDomainRoutersByNetworkId(network.getId())); + for (VirtualMachine vm : vmInstances) { + DataCenter vmZone = ApiDBUtils.findZoneById(vm.getDataCenterId()); + networkSpannedZones.add(vmZone.getUuid()); + } + response.setNetworkSpannedZones(networkSpannedZones); + } response.setObjectName("network"); return response; } From dd237a8d5397387b3c959069ccfc4a656bb0435f Mon Sep 17 00:00:00 2001 From: Jayapal Date: Thu, 20 Mar 2014 17:21:47 +0530 Subject: [PATCH 029/683] CLOUDSTACK-6250 Review comments fixes for CLOUDSTACK-2692 --- .../network/lb/LoadBalancingRulesService.java | 4 +- .../AssignToLoadBalancerRuleCmd.java | 3 +- .../com/cloud/network/NetworkServiceImpl.java | 9 +- .../network/as/AutoScaleManagerImpl.java | 2 +- .../lb/LoadBalancingRulesManagerImpl.java | 22 +- .../network/lb/AssignToLoadBalancerTest.java | 231 ++++++++++++++++++ 6 files changed, 255 insertions(+), 16 deletions(-) create mode 100644 server/test/com/cloud/network/lb/AssignToLoadBalancerTest.java diff --git a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java index ee1df33cd4..6643de62b4 100644 --- a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java +++ b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java @@ -92,7 +92,7 @@ LoadBalancer createPublicLoadBalancerRule(String xId, String name, String descri boolean deleteLBHealthCheckPolicy(long healthCheckPolicyId, boolean apply); /** - * Assign a virtual machine, or list of virtual machines, to a load balancer. + * Assign a virtual machine or list of virtual machines, or Map of to a load balancer. */ boolean assignToLoadBalancer(long lbRuleId, List vmIds, Map> vmIdIpMap); @@ -151,4 +151,6 @@ LoadBalancer createPublicLoadBalancerRule(String xId, String name, String descri public void updateLBHealthChecks(Scheme scheme) throws ResourceUnavailableException; Map getLbInstances(long lbId); + + boolean isLbRuleMappedToVmGuestIp(String vmSecondaryIp); } diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java index fad2c2a0c1..bc76e978f5 100644 --- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java @@ -119,9 +119,8 @@ public String getEventDescription() { public Map> getVmIdIpListMap() { - Map> vmIdIpsMap = null; + Map> vmIdIpsMap = new HashMap>(); if (vmIdIpMap != null && !vmIdIpMap.isEmpty()) { - vmIdIpsMap = new HashMap>(); Collection idIpsCollection = vmIdIpMap.values(); Iterator iter = idIpsCollection.iterator(); while (iter.hasNext()) { diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java index 1c7786e9f3..f23991cd0c 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -40,6 +40,7 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; +import com.cloud.network.lb.LoadBalancingRulesService; import org.apache.log4j.Logger; import org.apache.cloudstack.acl.ControlledEntity.ACLType; @@ -106,7 +107,6 @@ import com.cloud.network.dao.IPAddressDao; import com.cloud.network.dao.IPAddressVO; import com.cloud.network.dao.LoadBalancerVMMapDao; -import com.cloud.network.dao.LoadBalancerVMMapVO; import com.cloud.network.dao.NetworkDao; import com.cloud.network.dao.NetworkDomainDao; import com.cloud.network.dao.NetworkServiceMapDao; @@ -312,6 +312,9 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { @Inject LoadBalancerVMMapDao _lbVmMapDao; + @Inject + LoadBalancingRulesService _lbService; + int _cidrLimit; boolean _allowSubdomainNetworkAccess; @@ -811,11 +814,9 @@ public boolean releaseSecondaryIpFromNic(long ipAddressId) { throw new InvalidParameterValueException("Can' remove the ip " + secondaryIp + "is associate with static NAT rule public IP address id " + publicIpVO.getId()); } - List lbVmMap = _lbVmMapDao.listByInstanceIp(secondaryIp); - if (lbVmMap != null && lbVmMap.size() != 0) { + if (_lbService.isLbRuleMappedToVmGuestIp(secondaryIp)) { s_logger.debug("VM nic IP " + secondaryIp + " is mapped to load balancing rule"); throw new InvalidParameterValueException("Can't remove the secondary ip " + secondaryIp + " is mapped to load balancing rule"); - } } else if (dc.getNetworkType() == NetworkType.Basic || ntwkOff.getGuestType() == Network.GuestType.Shared) { diff --git a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java index b6e917dac9..e6cbd7c477 100644 --- a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java +++ b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java @@ -1414,7 +1414,7 @@ private boolean assignLBruleToNewVm(long vmId, AutoScaleVmGroupVO asGroup) { } } lstVmId.add(new Long(vmId)); - return _loadBalancingRulesService.assignToLoadBalancer(lbId, lstVmId, null); + return _loadBalancingRulesService.assignToLoadBalancer(lbId, lstVmId, new HashMap>()); } diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java index 8a7e0298b4..f514cbf0e9 100755 --- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java +++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java @@ -937,12 +937,12 @@ public boolean assignToLoadBalancer(long loadBalancerId, List instanceIds, } - if (instanceIds == null && vmIdIpMap == null) { + if (instanceIds == null && vmIdIpMap.isEmpty()) { throw new InvalidParameterValueException("Both instanceids and vmidipmap can't be null"); } // instanceIds and vmIdipmap is passed - if (instanceIds != null && vmIdIpMap != null) { + if (instanceIds != null && !vmIdIpMap.isEmpty()) { for(long instanceId: instanceIds) { if (!vmIdIpMap.containsKey(instanceId)) { vmIdIpMap.put(instanceId, null); @@ -951,7 +951,7 @@ public boolean assignToLoadBalancer(long loadBalancerId, List instanceIds, } //only instanceids list passed - if (instanceIds != null && vmIdIpMap == null){ + if (instanceIds != null && vmIdIpMap.isEmpty()){ vmIdIpMap = new HashMap>(); for (long instanceId: instanceIds){ vmIdIpMap.put(instanceId, null); @@ -978,9 +978,6 @@ public boolean assignToLoadBalancer(long loadBalancerId, List instanceIds, existingVmIdIps.put(mappedInstance.getInstanceId(), ipsList); } - - - final List vmsToAdd = new ArrayList(); // check for conflict @@ -1047,12 +1044,12 @@ public boolean assignToLoadBalancer(long loadBalancerId, List instanceIds, //check if the ips belongs to nic secondary ip for (String ip: vmIpsList) { if(_nicSecondaryIpDao.findByIp4AddressAndNicId(ip,nicInSameNetwork.getId()) == null) { - throw new InvalidParameterValueException("VM ip specified " + ip + " is not belongs to nic in network " + nicInSameNetwork.getNetworkId()); + throw new InvalidParameterValueException("VM ip "+ ip + " specified does not belong to " + + "nic in network " + nicInSameNetwork.getNetworkId()); } } } - if (s_logger.isDebugEnabled()) { s_logger.debug("Adding " + vm + " to the load balancer pool"); } @@ -2316,6 +2313,15 @@ public Map getLbInstances(long lbId) { return dstList; } + @Override + public boolean isLbRuleMappedToVmGuestIp(String vmSecondaryIp) { + List lbVmMap = _lb2VmMapDao.listByInstanceIp(vmSecondaryIp); + if (lbVmMap == null || lbVmMap.isEmpty()) { + return false; + } + return true; + } + @Override public void isLbServiceSupportedInNetwork(long networkId, Scheme scheme) { Network network = _networkDao.findById(networkId); diff --git a/server/test/com/cloud/network/lb/AssignToLoadBalancerTest.java b/server/test/com/cloud/network/lb/AssignToLoadBalancerTest.java new file mode 100644 index 0000000000..f8f96a712f --- /dev/null +++ b/server/test/com/cloud/network/lb/AssignToLoadBalancerTest.java @@ -0,0 +1,231 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package com.cloud.network.lb; + +import com.cloud.domain.DomainVO; +import com.cloud.domain.dao.DomainDao; +import com.cloud.exception.ResourceAllocationException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.network.NetworkModelImpl; +import com.cloud.network.dao.LoadBalancerDao; +import com.cloud.network.dao.LoadBalancerVMMapDao; +import com.cloud.network.dao.LoadBalancerVMMapVO; +import com.cloud.network.dao.LoadBalancerVO; +import com.cloud.network.rules.FirewallRule; +import com.cloud.network.rules.RulesManagerImpl; +import com.cloud.user.Account; +import com.cloud.user.AccountManager; +import com.cloud.user.AccountVO; +import com.cloud.user.UserVO; +import com.cloud.user.dao.AccountDao; +import com.cloud.uservm.UserVm; +import com.cloud.vm.Nic; +import com.cloud.vm.NicVO; +import com.cloud.vm.UserVmVO; +import com.cloud.vm.dao.NicSecondaryIpDao; +import com.cloud.vm.dao.UserVmDao; +import org.apache.cloudstack.api.ResponseGenerator; +import org.apache.cloudstack.api.command.user.loadbalancer.AssignToLoadBalancerRuleCmd; +import org.apache.cloudstack.api.response.SuccessResponse; +import org.apache.cloudstack.context.CallContext; +import org.junit.After; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.Spy; + +import javax.inject.Inject; + +import java.util.UUID; +import java.util.HashMap; +import java.util.Map; +import java.util.List; +import java.util.ArrayList; + +import static org.mockito.Matchers.anyBoolean; +import static org.mockito.Matchers.anyLong; +import static org.mockito.Matchers.anyString; +import static org.mockito.Mockito.when; + +public class AssignToLoadBalancerTest { + + @Inject + AccountManager _accountMgr; + + @Inject + AccountManager _acctMgr; + + @Inject + AccountDao _accountDao; + + @Inject + DomainDao _domainDao; + + @Mock + List _lbvmMapList; + + @Mock + List nic; + + @Mock + UserVmDao userDao; + + @Spy + RulesManagerImpl _rulesMgr = new RulesManagerImpl() { + @Override + public void checkRuleAndUserVm (FirewallRule rule, UserVm userVm, Account caller) { + + } + }; + + + @Spy + NicVO nicvo = new NicVO() { + + }; + + @Spy + NetworkModelImpl _networkModel = new NetworkModelImpl() { + @Override + public List getNics(long vmId) { + nic = new ArrayList(); + nicvo.setNetworkId(204L); + nic.add(nicvo); + return nic; + } + }; + + + LoadBalancingRulesManagerImpl _lbMgr = new LoadBalancingRulesManagerImpl(); + + private AssignToLoadBalancerRuleCmd assignToLbRuleCmd; + private ResponseGenerator responseGenerator; + private SuccessResponse successResponseGenerator; + + @Rule + public ExpectedException expectedException = ExpectedException.none(); + + private static long domainId = 5L; + private static long accountId = 5L; + private static String accountName = "admin"; + + @Before + public void setUp() { + assignToLbRuleCmd = new AssignToLoadBalancerRuleCmd() { + }; + + // ComponentContext.initComponentsLifeCycle(); + AccountVO account = new AccountVO(accountName, domainId, "networkDomain", Account.ACCOUNT_TYPE_NORMAL, "uuid"); + DomainVO domain = new DomainVO("rootDomain", 5L, 5L, "networkDomain"); + + UserVO user = new UserVO(1, "testuser", "password", "firstname", "lastName", "email", "timezone", UUID.randomUUID().toString()); + + CallContext.register(user, account); + + } + + @Test(expected = InvalidParameterValueException.class) + public void testBothArgsEmpty() throws ResourceAllocationException, ResourceUnavailableException, InsufficientCapacityException { + + Map> emptyMap = new HashMap>(); + + LoadBalancerDao lbdao = Mockito.mock(LoadBalancerDao.class); + _lbMgr._lbDao = lbdao; + + when(lbdao.findById(anyLong())).thenReturn(Mockito.mock(LoadBalancerVO.class)); + + _lbMgr.assignToLoadBalancer(1L, null, emptyMap); + + } + + @Test(expected = InvalidParameterValueException.class) + public void testNicIsNotInNw() throws ResourceAllocationException, ResourceUnavailableException, InsufficientCapacityException { + + Map> vmIdIpMap = new HashMap>(); + List secIp = new ArrayList(); + secIp.add("10.1.1.175"); + vmIdIpMap.put(1L,secIp); + + List vmIds = new ArrayList(); + vmIds.add(2L); + + LoadBalancerDao lbDao = Mockito.mock(LoadBalancerDao.class); + LoadBalancerVMMapDao lb2VmMapDao = Mockito.mock(LoadBalancerVMMapDao.class); + UserVmDao userVmDao = Mockito.mock(UserVmDao.class); + + _lbMgr._lbDao = lbDao; + _lbMgr._lb2VmMapDao = lb2VmMapDao; + _lbMgr._vmDao = userVmDao; + _lbvmMapList = new ArrayList<>(); + _lbMgr._rulesMgr = _rulesMgr; + _lbMgr._networkModel = _networkModel; + + when(lbDao.findById(anyLong())).thenReturn(Mockito.mock(LoadBalancerVO.class)); + when(userVmDao.findById(anyLong())).thenReturn(Mockito.mock(UserVmVO.class)); + when(lb2VmMapDao.listByLoadBalancerId(anyLong(), anyBoolean())).thenReturn(_lbvmMapList); + + _lbMgr.assignToLoadBalancer(1L, null, vmIdIpMap); + } + + + @Test(expected = InvalidParameterValueException.class) + public void tesSecIpNotSetToVm() throws ResourceAllocationException, ResourceUnavailableException, InsufficientCapacityException { + + AssignToLoadBalancerRuleCmd assignLbRuleCmd = Mockito.mock(AssignToLoadBalancerRuleCmd.class); + + Map> vmIdIpMap = new HashMap>(); + List secIp = new ArrayList(); + secIp.add("10.1.1.175"); + vmIdIpMap.put(1L,secIp); + + List vmIds = new ArrayList(); + vmIds.add(2L); + + LoadBalancerVO lbVO = new LoadBalancerVO("1", "L1", "Lbrule", 1, 22, 22, "rb", 204, 0, 0, "tcp"); + + LoadBalancerDao lbDao = Mockito.mock(LoadBalancerDao.class); + LoadBalancerVMMapDao lb2VmMapDao = Mockito.mock(LoadBalancerVMMapDao.class); + UserVmDao userVmDao = Mockito.mock(UserVmDao.class); + NicSecondaryIpDao nicSecIpDao = Mockito.mock(NicSecondaryIpDao.class); + + _lbMgr._lbDao = lbDao; + _lbMgr._lb2VmMapDao = lb2VmMapDao; + _lbMgr._vmDao = userVmDao; + _lbMgr._nicSecondaryIpDao = nicSecIpDao; + _lbvmMapList = new ArrayList<>(); + _lbMgr._rulesMgr = _rulesMgr; + _lbMgr._networkModel = _networkModel; + + when(lbDao.findById(anyLong())).thenReturn(lbVO); + when(userVmDao.findById(anyLong())).thenReturn(Mockito.mock(UserVmVO.class)); + when(lb2VmMapDao.listByLoadBalancerId(anyLong(), anyBoolean())).thenReturn(_lbvmMapList); + when (nicSecIpDao.findByIp4AddressAndNicId(anyString(), anyLong())).thenReturn(null); + + _lbMgr.assignToLoadBalancer(1L, null, vmIdIpMap); + } + + @After + public void tearDown() { + CallContext.unregister(); + } + +} \ No newline at end of file From 9e72d89ac1fb608656379a70b89ae858721e9233 Mon Sep 17 00:00:00 2001 From: Alex Hitchins Date: Thu, 20 Mar 2014 14:39:31 +0000 Subject: [PATCH 030/683] Issue CS-5825 Part Resolution --- .../org/apache/cloudstack/storage/volume/VolumeServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java index 68e5a5680e..d56c5539c4 100644 --- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java +++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java @@ -1499,6 +1499,7 @@ public SnapshotInfo takeSnapshot(VolumeInfo volume) { snapshot = snapshotMgr.takeSnapshot(volume); } catch (Exception e) { s_logger.debug("Take snapshot: " + volume.getId() + " failed", e); + throw new ResourceAllocationException("Take snapshot for VolumeId: " + volume.getId() + " failed.", ResourceType.snapshot); } return snapshot; From e06d84e06ea94f13d2c4cf764228dcd19d80a2a7 Mon Sep 17 00:00:00 2001 From: Chris Suich Date: Thu, 20 Mar 2014 15:43:55 -0400 Subject: [PATCH 031/683] Revert "Issue CS-5825 Part Resolution" This reverts commit 9e72d89ac1fb608656379a70b89ae858721e9233 which was breaking the build. --- .../org/apache/cloudstack/storage/volume/VolumeServiceImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java index d56c5539c4..68e5a5680e 100644 --- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java +++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java @@ -1499,7 +1499,6 @@ public SnapshotInfo takeSnapshot(VolumeInfo volume) { snapshot = snapshotMgr.takeSnapshot(volume); } catch (Exception e) { s_logger.debug("Take snapshot: " + volume.getId() + " failed", e); - throw new ResourceAllocationException("Take snapshot for VolumeId: " + volume.getId() + " failed.", ResourceType.snapshot); } return snapshot; From 7a7d9cff0d5bb40284506faa6e34138f97a12428 Mon Sep 17 00:00:00 2001 From: Mike Tutkowski Date: Thu, 20 Mar 2014 12:15:27 -0600 Subject: [PATCH 032/683] CLOUDSTACK-6170 --- .../service/VolumeOrchestrationService.java | 3 + .../orchestration/VolumeOrchestrator.java | 11 ++++ .../src/com/cloud/vm/UserVmManagerImpl.java | 65 +++++++++++++++++++ 3 files changed, 79 insertions(+) diff --git a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java index 095d95408f..3b555e55be 100644 --- a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java +++ b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java @@ -21,6 +21,7 @@ import java.util.Map; import java.util.Set; +import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; import com.cloud.agent.api.to.VirtualMachineTO; @@ -94,6 +95,8 @@ VolumeInfo moveVolume(VolumeInfo volume, long destPoolDcId, Long destPoolPodId, void cleanupVolumes(long vmId) throws ConcurrentOperationException; + void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore); + void disconnectVolumesFromHost(long vmId, long hostId); void migrateVolumes(VirtualMachine vm, VirtualMachineTO vmTo, Host srcHost, Host destHost, Map volumeToPool); diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index b8f9506cdf..767eab2099 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -37,8 +37,10 @@ import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService; import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; +import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore; +import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver; import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotDataFactory; import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo; import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotService; @@ -831,6 +833,15 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } } + @Override + public void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore) { + DataStoreDriver dataStoreDriver = dataStore != null ? dataStore.getDriver() : null; + + if (dataStoreDriver instanceof PrimaryDataStoreDriver) { + ((PrimaryDataStoreDriver)dataStoreDriver).disconnectVolumeFromHost(volumeInfo, host, dataStore); + } + } + @Override public void disconnectVolumesFromHost(long vmId, long hostId) { HostVO host = _hostDao.findById(hostId); diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index b4888a8b58..f92eaca642 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -70,6 +70,8 @@ import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService; import org.apache.cloudstack.engine.service.api.OrchestrationService; +import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; +import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; import org.apache.cloudstack.engine.subsystem.api.storage.TemplateDataFactory; import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory; import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; @@ -81,11 +83,13 @@ import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.framework.jobs.AsyncJobManager; import org.apache.cloudstack.managed.context.ManagedContextRunnable; +import org.apache.cloudstack.storage.command.DettachCommand; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; import com.cloud.agent.AgentManager; import com.cloud.agent.api.Answer; +import com.cloud.agent.api.Command; import com.cloud.agent.api.GetVmDiskStatsAnswer; import com.cloud.agent.api.GetVmDiskStatsCommand; import com.cloud.agent.api.GetVmStatsAnswer; @@ -94,6 +98,8 @@ import com.cloud.agent.api.StartAnswer; import com.cloud.agent.api.VmDiskStatsEntry; import com.cloud.agent.api.VmStatsEntry; +import com.cloud.agent.api.to.DataTO; +import com.cloud.agent.api.to.DiskTO; import com.cloud.agent.api.to.NicTO; import com.cloud.agent.api.to.VirtualMachineTO; import com.cloud.agent.manager.Commands; @@ -199,6 +205,7 @@ import com.cloud.storage.Storage; import com.cloud.storage.Storage.ImageFormat; import com.cloud.storage.Storage.TemplateType; +import com.cloud.storage.DataStoreRole; import com.cloud.storage.StorageManager; import com.cloud.storage.StoragePool; import com.cloud.storage.StoragePoolStatus; @@ -448,6 +455,8 @@ public enum UserVmCloneType { DeploymentPlanningManager _planningMgr; @Inject VolumeApiService _volumeService; + @Inject + DataStoreManager _dataStoreMgr; protected ScheduledExecutorService _executor = null; protected int _expungeInterval; @@ -4651,6 +4660,9 @@ public UserVm restoreVMInternal(Account caller, UserVmVO vm, Long newTemplateId) /* Detach and destory the old root volume */ _volsDao.detachVolume(root.getId()); + + handleManagedStorage(vm, root); + volumeMgr.destroyVolume(root); // For VMware hypervisor since the old root volume is replaced by the new root volume, force expunge old root volume if it has been created in storage @@ -4698,6 +4710,59 @@ public UserVm restoreVMInternal(Account caller, UserVmVO vm, Long newTemplateId) } + private void handleManagedStorage(UserVmVO vm, VolumeVO root) { + StoragePoolVO storagePool = _storagePoolDao.findById(root.getPoolId()); + + if (storagePool.isManaged()) { + Long hostId = vm.getHostId() != null ? vm.getHostId() : vm.getLastHostId(); + + if (hostId != null) { + DataTO volTO = volFactory.getVolume(root.getId()).getTO(); + DiskTO disk = new DiskTO(volTO, root.getDeviceId(), root.getPath(), root.getVolumeType()); + + // it's OK in this case to send a detach command to the host for a root volume as this + // will simply lead to the SR that supports the root volume being removed + DettachCommand cmd = new DettachCommand(disk, vm.getInstanceName()); + + cmd.setManaged(true); + + cmd.setStorageHost(storagePool.getHostAddress()); + cmd.setStoragePort(storagePool.getPort()); + + cmd.set_iScsiName(root.get_iScsiName()); + + Commands cmds = new Commands(Command.OnError.Stop); + + cmds.addCommand(cmd); + + try { + _agentMgr.send(hostId, cmds); + } + catch (Exception ex) { + throw new CloudRuntimeException(ex.getMessage()); + } + + if (!cmds.isSuccessful()) { + for (Answer answer : cmds.getAnswers()) { + if (!answer.getResult()) { + s_logger.warn("Failed to reset vm due to: " + answer.getDetails()); + + throw new CloudRuntimeException("Unable to reset " + vm + " due to " + answer.getDetails()); + } + } + } + + if (hostId != null) { + // root.getPoolId() should be null if the VM we are attaching the disk to has never been started before + DataStore dataStore = root.getPoolId() != null ? _dataStoreMgr.getDataStore(root.getPoolId(), DataStoreRole.Primary) : null; + Host host = this._hostDao.findById(hostId); + + volumeMgr.disconnectVolumeFromHost(volFactory.getVolume(root.getId()), host, dataStore); + } + } + } + } + @Override public void prepareStop(VirtualMachineProfile profile) { UserVmVO vm = _vmDao.findById(profile.getId()); From bd6916661924cefc7c44bc728ee443c2838311e2 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Thu, 20 Mar 2014 15:46:06 -0700 Subject: [PATCH 033/683] Add newly separated admin cmd class in ManagementServerImpl.getCommands. --- .../command/admin/iso/CopyIsoCmdByAdmin.java | 12 +++ .../api/command/user/iso/CopyIsoCmd.java | 3 +- .../cloud/server/ManagementServerImpl.java | 95 ++++++++++++++++++- 3 files changed, 108 insertions(+), 2 deletions(-) create mode 100644 api/src/org/apache/cloudstack/api/command/admin/iso/CopyIsoCmdByAdmin.java diff --git a/api/src/org/apache/cloudstack/api/command/admin/iso/CopyIsoCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/iso/CopyIsoCmdByAdmin.java new file mode 100644 index 0000000000..0475b37155 --- /dev/null +++ b/api/src/org/apache/cloudstack/api/command/admin/iso/CopyIsoCmdByAdmin.java @@ -0,0 +1,12 @@ +package org.apache.cloudstack.api.command.admin.iso; + +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.ResponseObject.ResponseView; +import org.apache.cloudstack.api.command.user.iso.CopyIsoCmd; +import org.apache.cloudstack.api.response.TemplateResponse; + +@APICommand(name = "copyIso", description = "Copies an iso from one zone to another.", responseObject = TemplateResponse.class, responseView = ResponseView.Full, + requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) +public class CopyIsoCmdByAdmin extends CopyIsoCmd { + +} diff --git a/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java b/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java index 21196bcb65..9002624c48 100644 --- a/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/iso/CopyIsoCmd.java @@ -19,10 +19,11 @@ import org.apache.log4j.Logger; import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.ResponseObject.ResponseView; import org.apache.cloudstack.api.command.user.template.CopyTemplateCmd; import org.apache.cloudstack.api.response.TemplateResponse; -@APICommand(name = "copyIso", description = "Copies an iso from one zone to another.", responseObject = TemplateResponse.class, +@APICommand(name = "copyIso", description = "Copies an iso from one zone to another.", responseObject = TemplateResponse.class, responseView = ResponseView.Restricted, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CopyIsoCmd extends CopyTemplateCmd { public static final Logger s_logger = Logger.getLogger(CopyIsoCmd.class.getName()); diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 073cf47a90..7431891e8e 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -51,8 +51,12 @@ import org.apache.cloudstack.api.command.admin.account.DeleteAccountCmd; import org.apache.cloudstack.api.command.admin.account.DisableAccountCmd; import org.apache.cloudstack.api.command.admin.account.EnableAccountCmd; +import org.apache.cloudstack.api.command.admin.account.ListAccountsCmdByAdmin; import org.apache.cloudstack.api.command.admin.account.LockAccountCmd; import org.apache.cloudstack.api.command.admin.account.UpdateAccountCmd; +import org.apache.cloudstack.api.command.admin.address.AssociateIPAddrCmdByAdmin; +import org.apache.cloudstack.api.command.admin.address.ListPublicIpAddressesCmdByAdmin; +import org.apache.cloudstack.api.command.admin.affinitygroup.UpdateVMAffinityGroupCmdByAdmin; import org.apache.cloudstack.api.command.admin.alert.GenerateAlertCmd; import org.apache.cloudstack.api.command.admin.autoscale.CreateCounterCmd; import org.apache.cloudstack.api.command.admin.autoscale.DeleteCounterCmd; @@ -94,8 +98,16 @@ import org.apache.cloudstack.api.command.admin.internallb.ListInternalLoadBalancerElementsCmd; import org.apache.cloudstack.api.command.admin.internallb.StartInternalLBVMCmd; import org.apache.cloudstack.api.command.admin.internallb.StopInternalLBVMCmd; +import org.apache.cloudstack.api.command.admin.iso.AttachIsoCmdByAdmin; +import org.apache.cloudstack.api.command.admin.iso.CopyIsoCmdByAdmin; +import org.apache.cloudstack.api.command.admin.iso.DetachIsoCmdByAdmin; +import org.apache.cloudstack.api.command.admin.iso.ListIsoPermissionsCmdByAdmin; +import org.apache.cloudstack.api.command.admin.iso.ListIsosCmdByAdmin; +import org.apache.cloudstack.api.command.admin.iso.RegisterIsoCmdByAdmin; +import org.apache.cloudstack.api.command.admin.loadbalancer.ListLoadBalancerRuleInstancesCmdByAdmin; import org.apache.cloudstack.api.command.admin.network.AddNetworkDeviceCmd; import org.apache.cloudstack.api.command.admin.network.AddNetworkServiceProviderCmd; +import org.apache.cloudstack.api.command.admin.network.CreateNetworkCmdByAdmin; import org.apache.cloudstack.api.command.admin.network.CreateNetworkOfferingCmd; import org.apache.cloudstack.api.command.admin.network.CreatePhysicalNetworkCmd; import org.apache.cloudstack.api.command.admin.network.CreateStorageNetworkIpRangeCmd; @@ -109,10 +121,12 @@ import org.apache.cloudstack.api.command.admin.network.ListNetworkDeviceCmd; import org.apache.cloudstack.api.command.admin.network.ListNetworkIsolationMethodsCmd; import org.apache.cloudstack.api.command.admin.network.ListNetworkServiceProvidersCmd; +import org.apache.cloudstack.api.command.admin.network.ListNetworksCmdByAdmin; import org.apache.cloudstack.api.command.admin.network.ListPhysicalNetworksCmd; import org.apache.cloudstack.api.command.admin.network.ListStorageNetworkIpRangeCmd; import org.apache.cloudstack.api.command.admin.network.ListSupportedNetworkServicesCmd; import org.apache.cloudstack.api.command.admin.network.ReleaseDedicatedGuestVlanRangeCmd; +import org.apache.cloudstack.api.command.admin.network.UpdateNetworkCmdByAdmin; import org.apache.cloudstack.api.command.admin.network.UpdateNetworkOfferingCmd; import org.apache.cloudstack.api.command.admin.network.UpdateNetworkServiceProviderCmd; import org.apache.cloudstack.api.command.admin.network.UpdatePhysicalNetworkCmd; @@ -178,7 +192,12 @@ import org.apache.cloudstack.api.command.admin.systemvm.StartSystemVMCmd; import org.apache.cloudstack.api.command.admin.systemvm.StopSystemVmCmd; import org.apache.cloudstack.api.command.admin.systemvm.UpgradeSystemVMCmd; +import org.apache.cloudstack.api.command.admin.template.CopyTemplateCmdByAdmin; +import org.apache.cloudstack.api.command.admin.template.CreateTemplateCmdByAdmin; +import org.apache.cloudstack.api.command.admin.template.ListTemplatePermissionsCmdByAdmin; +import org.apache.cloudstack.api.command.admin.template.ListTemplatesCmdByAdmin; import org.apache.cloudstack.api.command.admin.template.PrepareTemplateCmd; +import org.apache.cloudstack.api.command.admin.template.RegisterTemplateCmdByAdmin; import org.apache.cloudstack.api.command.admin.usage.AddTrafficMonitorCmd; import org.apache.cloudstack.api.command.admin.usage.AddTrafficTypeCmd; import org.apache.cloudstack.api.command.admin.usage.DeleteTrafficMonitorCmd; @@ -204,20 +223,47 @@ import org.apache.cloudstack.api.command.admin.vlan.DeleteVlanIpRangeCmd; import org.apache.cloudstack.api.command.admin.vlan.ListVlanIpRangesCmd; import org.apache.cloudstack.api.command.admin.vlan.ReleasePublicIpRangeCmd; +import org.apache.cloudstack.api.command.admin.vm.AddNicToVMCmdByAdmin; import org.apache.cloudstack.api.command.admin.vm.AssignVMCmd; +import org.apache.cloudstack.api.command.admin.vm.DeployVMCmdByAdmin; +import org.apache.cloudstack.api.command.admin.vm.DestroyVMCmdByAdmin; import org.apache.cloudstack.api.command.admin.vm.ExpungeVMCmd; import org.apache.cloudstack.api.command.admin.vm.GetVMUserDataCmd; import org.apache.cloudstack.api.command.admin.vm.ListVMsCmdByAdmin; import org.apache.cloudstack.api.command.admin.vm.MigrateVMCmd; import org.apache.cloudstack.api.command.admin.vm.MigrateVirtualMachineWithVolumeCmd; +import org.apache.cloudstack.api.command.admin.vm.RebootVMCmdByAdmin; import org.apache.cloudstack.api.command.admin.vm.RecoverVMCmd; +import org.apache.cloudstack.api.command.admin.vm.RemoveNicFromVMCmdByAdmin; +import org.apache.cloudstack.api.command.admin.vm.ResetVMPasswordCmdByAdmin; +import org.apache.cloudstack.api.command.admin.vm.ResetVMSSHKeyCmdByAdmin; +import org.apache.cloudstack.api.command.admin.vm.RestoreVMCmdByAdmin; +import org.apache.cloudstack.api.command.admin.vm.ScaleVMCmdByAdmin; +import org.apache.cloudstack.api.command.admin.vm.StartVMCmdByAdmin; +import org.apache.cloudstack.api.command.admin.vm.StopVMCmdByAdmin; +import org.apache.cloudstack.api.command.admin.vm.UpdateDefaultNicForVMCmdByAdmin; +import org.apache.cloudstack.api.command.admin.vm.UpdateVMCmdByAdmin; +import org.apache.cloudstack.api.command.admin.vm.UpgradeVMCmdByAdmin; +import org.apache.cloudstack.api.command.admin.vmsnapshot.RevertToVMSnapshotCmdByAdmin; +import org.apache.cloudstack.api.command.admin.volume.AttachVolumeCmdByAdmin; +import org.apache.cloudstack.api.command.admin.volume.CreateVolumeCmdByAdmin; +import org.apache.cloudstack.api.command.admin.volume.DetachVolumeCmdByAdmin; +import org.apache.cloudstack.api.command.admin.volume.ListVolumesCmdByAdmin; +import org.apache.cloudstack.api.command.admin.volume.MigrateVolumeCmdByAdmin; +import org.apache.cloudstack.api.command.admin.volume.ResizeVolumeCmdByAdmin; +import org.apache.cloudstack.api.command.admin.volume.UpdateVolumeCmdByAdmin; +import org.apache.cloudstack.api.command.admin.volume.UploadVolumeCmdByAdmin; import org.apache.cloudstack.api.command.admin.vpc.CreatePrivateGatewayCmd; +import org.apache.cloudstack.api.command.admin.vpc.CreateVPCCmdByAdmin; import org.apache.cloudstack.api.command.admin.vpc.CreateVPCOfferingCmd; import org.apache.cloudstack.api.command.admin.vpc.DeletePrivateGatewayCmd; import org.apache.cloudstack.api.command.admin.vpc.DeleteVPCOfferingCmd; +import org.apache.cloudstack.api.command.admin.vpc.ListVPCsCmdByAdmin; +import org.apache.cloudstack.api.command.admin.vpc.UpdateVPCCmdByAdmin; import org.apache.cloudstack.api.command.admin.vpc.UpdateVPCOfferingCmd; import org.apache.cloudstack.api.command.admin.zone.CreateZoneCmd; import org.apache.cloudstack.api.command.admin.zone.DeleteZoneCmd; +import org.apache.cloudstack.api.command.admin.zone.ListZonesCmdByAdmin; import org.apache.cloudstack.api.command.admin.zone.MarkDefaultZoneForAccountCmd; import org.apache.cloudstack.api.command.admin.zone.UpdateZoneCmd; import org.apache.cloudstack.api.command.user.account.AddAccountToProjectCmd; @@ -2770,7 +2816,6 @@ public List> getCommands() { cmdList.add(ExpungeVMCmd.class); cmdList.add(GetVMPasswordCmd.class); cmdList.add(ListVMsCmd.class); - cmdList.add(ListVMsCmdByAdmin.class); cmdList.add(ScaleVMCmd.class); cmdList.add(RebootVMCmd.class); cmdList.add(RemoveNicFromVMCmd.class); @@ -2898,6 +2943,54 @@ public List> getCommands() { cmdList.add(UpdateRemoteAccessVpnCmd.class); cmdList.add(UpdateVpnConnectionCmd.class); cmdList.add(UpdateVpnGatewayCmd.class); + // separated admin commands + cmdList.add(ListAccountsCmdByAdmin.class); + cmdList.add(ListZonesCmdByAdmin.class); + cmdList.add(ListTemplatesCmdByAdmin.class); + cmdList.add(CreateTemplateCmdByAdmin.class); + cmdList.add(CopyTemplateCmdByAdmin.class); + cmdList.add(RegisterTemplateCmdByAdmin.class); + cmdList.add(ListTemplatePermissionsCmdByAdmin.class); + cmdList.add(RegisterIsoCmdByAdmin.class); + cmdList.add(CopyIsoCmdByAdmin.class); + cmdList.add(ListIsosCmdByAdmin.class); + cmdList.add(AttachIsoCmdByAdmin.class); + cmdList.add(DetachIsoCmdByAdmin.class); + cmdList.add(ListIsoPermissionsCmdByAdmin.class); + cmdList.add(UpdateVMAffinityGroupCmdByAdmin.class); + cmdList.add(AddNicToVMCmdByAdmin.class); + cmdList.add(RemoveNicFromVMCmdByAdmin.class); + cmdList.add(UpdateDefaultNicForVMCmdByAdmin.class); + cmdList.add(ListLoadBalancerRuleInstancesCmdByAdmin.class); + cmdList.add(DeployVMCmdByAdmin.class); + cmdList.add(DestroyVMCmdByAdmin.class); + cmdList.add(RebootVMCmdByAdmin.class); + cmdList.add(ResetVMPasswordCmdByAdmin.class); + cmdList.add(ResetVMSSHKeyCmdByAdmin.class); + cmdList.add(RestoreVMCmdByAdmin.class); + cmdList.add(ScaleVMCmdByAdmin.class); + cmdList.add(StartVMCmdByAdmin.class); + cmdList.add(StopVMCmdByAdmin.class); + cmdList.add(UpdateVMCmdByAdmin.class); + cmdList.add(UpgradeVMCmdByAdmin.class); + cmdList.add(RevertToVMSnapshotCmdByAdmin.class); + cmdList.add(ListVMsCmdByAdmin.class); + cmdList.add(AttachVolumeCmdByAdmin.class); + cmdList.add(CreateVolumeCmdByAdmin.class); + cmdList.add(DetachVolumeCmdByAdmin.class); + cmdList.add(MigrateVolumeCmdByAdmin.class); + cmdList.add(ResizeVolumeCmdByAdmin.class); + cmdList.add(UpdateVolumeCmdByAdmin.class); + cmdList.add(UploadVolumeCmdByAdmin.class); + cmdList.add(ListVolumesCmdByAdmin.class); + cmdList.add(AssociateIPAddrCmdByAdmin.class); + cmdList.add(ListPublicIpAddressesCmdByAdmin.class); + cmdList.add(CreateNetworkCmdByAdmin.class); + cmdList.add(UpdateNetworkCmdByAdmin.class); + cmdList.add(ListNetworksCmdByAdmin.class); + cmdList.add(CreateVPCCmdByAdmin.class); + cmdList.add(ListVPCsCmdByAdmin.class); + cmdList.add(UpdateVPCCmdByAdmin.class); return cmdList; } From dcfe77845c3b90b4f9b1b91ac62e797655ed8d36 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Thu, 20 Mar 2014 16:28:47 -0700 Subject: [PATCH 034/683] Revert "CLOUDSTACK-6170" This reverts commit 7a7d9cff0d5bb40284506faa6e34138f97a12428. --- .../service/VolumeOrchestrationService.java | 3 - .../orchestration/VolumeOrchestrator.java | 11 ---- .../src/com/cloud/vm/UserVmManagerImpl.java | 65 ------------------- 3 files changed, 79 deletions(-) diff --git a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java index 3b555e55be..095d95408f 100644 --- a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java +++ b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java @@ -21,7 +21,6 @@ import java.util.Map; import java.util.Set; -import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; import com.cloud.agent.api.to.VirtualMachineTO; @@ -95,8 +94,6 @@ VolumeInfo moveVolume(VolumeInfo volume, long destPoolDcId, Long destPoolPodId, void cleanupVolumes(long vmId) throws ConcurrentOperationException; - void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore); - void disconnectVolumesFromHost(long vmId, long hostId); void migrateVolumes(VirtualMachine vm, VirtualMachineTO vmTo, Host srcHost, Host destHost, Map volumeToPool); diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index 767eab2099..b8f9506cdf 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -37,10 +37,8 @@ import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService; import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; -import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore; -import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver; import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotDataFactory; import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo; import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotService; @@ -833,15 +831,6 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } } - @Override - public void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore) { - DataStoreDriver dataStoreDriver = dataStore != null ? dataStore.getDriver() : null; - - if (dataStoreDriver instanceof PrimaryDataStoreDriver) { - ((PrimaryDataStoreDriver)dataStoreDriver).disconnectVolumeFromHost(volumeInfo, host, dataStore); - } - } - @Override public void disconnectVolumesFromHost(long vmId, long hostId) { HostVO host = _hostDao.findById(hostId); diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index f92eaca642..b4888a8b58 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -70,8 +70,6 @@ import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService; import org.apache.cloudstack.engine.service.api.OrchestrationService; -import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; -import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; import org.apache.cloudstack.engine.subsystem.api.storage.TemplateDataFactory; import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory; import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; @@ -83,13 +81,11 @@ import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.framework.jobs.AsyncJobManager; import org.apache.cloudstack.managed.context.ManagedContextRunnable; -import org.apache.cloudstack.storage.command.DettachCommand; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; import com.cloud.agent.AgentManager; import com.cloud.agent.api.Answer; -import com.cloud.agent.api.Command; import com.cloud.agent.api.GetVmDiskStatsAnswer; import com.cloud.agent.api.GetVmDiskStatsCommand; import com.cloud.agent.api.GetVmStatsAnswer; @@ -98,8 +94,6 @@ import com.cloud.agent.api.StartAnswer; import com.cloud.agent.api.VmDiskStatsEntry; import com.cloud.agent.api.VmStatsEntry; -import com.cloud.agent.api.to.DataTO; -import com.cloud.agent.api.to.DiskTO; import com.cloud.agent.api.to.NicTO; import com.cloud.agent.api.to.VirtualMachineTO; import com.cloud.agent.manager.Commands; @@ -205,7 +199,6 @@ import com.cloud.storage.Storage; import com.cloud.storage.Storage.ImageFormat; import com.cloud.storage.Storage.TemplateType; -import com.cloud.storage.DataStoreRole; import com.cloud.storage.StorageManager; import com.cloud.storage.StoragePool; import com.cloud.storage.StoragePoolStatus; @@ -455,8 +448,6 @@ public enum UserVmCloneType { DeploymentPlanningManager _planningMgr; @Inject VolumeApiService _volumeService; - @Inject - DataStoreManager _dataStoreMgr; protected ScheduledExecutorService _executor = null; protected int _expungeInterval; @@ -4660,9 +4651,6 @@ public UserVm restoreVMInternal(Account caller, UserVmVO vm, Long newTemplateId) /* Detach and destory the old root volume */ _volsDao.detachVolume(root.getId()); - - handleManagedStorage(vm, root); - volumeMgr.destroyVolume(root); // For VMware hypervisor since the old root volume is replaced by the new root volume, force expunge old root volume if it has been created in storage @@ -4710,59 +4698,6 @@ public UserVm restoreVMInternal(Account caller, UserVmVO vm, Long newTemplateId) } - private void handleManagedStorage(UserVmVO vm, VolumeVO root) { - StoragePoolVO storagePool = _storagePoolDao.findById(root.getPoolId()); - - if (storagePool.isManaged()) { - Long hostId = vm.getHostId() != null ? vm.getHostId() : vm.getLastHostId(); - - if (hostId != null) { - DataTO volTO = volFactory.getVolume(root.getId()).getTO(); - DiskTO disk = new DiskTO(volTO, root.getDeviceId(), root.getPath(), root.getVolumeType()); - - // it's OK in this case to send a detach command to the host for a root volume as this - // will simply lead to the SR that supports the root volume being removed - DettachCommand cmd = new DettachCommand(disk, vm.getInstanceName()); - - cmd.setManaged(true); - - cmd.setStorageHost(storagePool.getHostAddress()); - cmd.setStoragePort(storagePool.getPort()); - - cmd.set_iScsiName(root.get_iScsiName()); - - Commands cmds = new Commands(Command.OnError.Stop); - - cmds.addCommand(cmd); - - try { - _agentMgr.send(hostId, cmds); - } - catch (Exception ex) { - throw new CloudRuntimeException(ex.getMessage()); - } - - if (!cmds.isSuccessful()) { - for (Answer answer : cmds.getAnswers()) { - if (!answer.getResult()) { - s_logger.warn("Failed to reset vm due to: " + answer.getDetails()); - - throw new CloudRuntimeException("Unable to reset " + vm + " due to " + answer.getDetails()); - } - } - } - - if (hostId != null) { - // root.getPoolId() should be null if the VM we are attaching the disk to has never been started before - DataStore dataStore = root.getPoolId() != null ? _dataStoreMgr.getDataStore(root.getPoolId(), DataStoreRole.Primary) : null; - Host host = this._hostDao.findById(hostId); - - volumeMgr.disconnectVolumeFromHost(volFactory.getVolume(root.getId()), host, dataStore); - } - } - } - } - @Override public void prepareStop(VirtualMachineProfile profile) { UserVmVO vm = _vmDao.findById(profile.getId()); From 8e513e8659be8cab02643c2540274478d1d6ff0c Mon Sep 17 00:00:00 2001 From: Mike Tutkowski Date: Thu, 20 Mar 2014 12:15:27 -0600 Subject: [PATCH 035/683] CLOUDSTACK-6170 --- .../service/VolumeOrchestrationService.java | 3 + .../orchestration/VolumeOrchestrator.java | 11 ++++ .../src/com/cloud/vm/UserVmManagerImpl.java | 65 +++++++++++++++++++ .../test/com/cloud/vm/UserVmManagerTest.java | 29 +++++++++ 4 files changed, 108 insertions(+) diff --git a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java index 095d95408f..3b555e55be 100644 --- a/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java +++ b/engine/api/src/org/apache/cloudstack/engine/orchestration/service/VolumeOrchestrationService.java @@ -21,6 +21,7 @@ import java.util.Map; import java.util.Set; +import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; import com.cloud.agent.api.to.VirtualMachineTO; @@ -94,6 +95,8 @@ VolumeInfo moveVolume(VolumeInfo volume, long destPoolDcId, Long destPoolPodId, void cleanupVolumes(long vmId) throws ConcurrentOperationException; + void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore); + void disconnectVolumesFromHost(long vmId, long hostId); void migrateVolumes(VirtualMachine vm, VirtualMachineTO vmTo, Host srcHost, Host destHost, Map volumeToPool); diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index b8f9506cdf..767eab2099 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -37,8 +37,10 @@ import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService; import org.apache.cloudstack.engine.subsystem.api.storage.ChapInfo; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; +import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStore; +import org.apache.cloudstack.engine.subsystem.api.storage.PrimaryDataStoreDriver; import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotDataFactory; import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo; import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotService; @@ -831,6 +833,15 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } } + @Override + public void disconnectVolumeFromHost(VolumeInfo volumeInfo, Host host, DataStore dataStore) { + DataStoreDriver dataStoreDriver = dataStore != null ? dataStore.getDriver() : null; + + if (dataStoreDriver instanceof PrimaryDataStoreDriver) { + ((PrimaryDataStoreDriver)dataStoreDriver).disconnectVolumeFromHost(volumeInfo, host, dataStore); + } + } + @Override public void disconnectVolumesFromHost(long vmId, long hostId) { HostVO host = _hostDao.findById(hostId); diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index b4888a8b58..f92eaca642 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -70,6 +70,8 @@ import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService; import org.apache.cloudstack.engine.service.api.OrchestrationService; +import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; +import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; import org.apache.cloudstack.engine.subsystem.api.storage.TemplateDataFactory; import org.apache.cloudstack.engine.subsystem.api.storage.VolumeDataFactory; import org.apache.cloudstack.engine.subsystem.api.storage.VolumeInfo; @@ -81,11 +83,13 @@ import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.framework.jobs.AsyncJobManager; import org.apache.cloudstack.managed.context.ManagedContextRunnable; +import org.apache.cloudstack.storage.command.DettachCommand; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; import com.cloud.agent.AgentManager; import com.cloud.agent.api.Answer; +import com.cloud.agent.api.Command; import com.cloud.agent.api.GetVmDiskStatsAnswer; import com.cloud.agent.api.GetVmDiskStatsCommand; import com.cloud.agent.api.GetVmStatsAnswer; @@ -94,6 +98,8 @@ import com.cloud.agent.api.StartAnswer; import com.cloud.agent.api.VmDiskStatsEntry; import com.cloud.agent.api.VmStatsEntry; +import com.cloud.agent.api.to.DataTO; +import com.cloud.agent.api.to.DiskTO; import com.cloud.agent.api.to.NicTO; import com.cloud.agent.api.to.VirtualMachineTO; import com.cloud.agent.manager.Commands; @@ -199,6 +205,7 @@ import com.cloud.storage.Storage; import com.cloud.storage.Storage.ImageFormat; import com.cloud.storage.Storage.TemplateType; +import com.cloud.storage.DataStoreRole; import com.cloud.storage.StorageManager; import com.cloud.storage.StoragePool; import com.cloud.storage.StoragePoolStatus; @@ -448,6 +455,8 @@ public enum UserVmCloneType { DeploymentPlanningManager _planningMgr; @Inject VolumeApiService _volumeService; + @Inject + DataStoreManager _dataStoreMgr; protected ScheduledExecutorService _executor = null; protected int _expungeInterval; @@ -4651,6 +4660,9 @@ public UserVm restoreVMInternal(Account caller, UserVmVO vm, Long newTemplateId) /* Detach and destory the old root volume */ _volsDao.detachVolume(root.getId()); + + handleManagedStorage(vm, root); + volumeMgr.destroyVolume(root); // For VMware hypervisor since the old root volume is replaced by the new root volume, force expunge old root volume if it has been created in storage @@ -4698,6 +4710,59 @@ public UserVm restoreVMInternal(Account caller, UserVmVO vm, Long newTemplateId) } + private void handleManagedStorage(UserVmVO vm, VolumeVO root) { + StoragePoolVO storagePool = _storagePoolDao.findById(root.getPoolId()); + + if (storagePool.isManaged()) { + Long hostId = vm.getHostId() != null ? vm.getHostId() : vm.getLastHostId(); + + if (hostId != null) { + DataTO volTO = volFactory.getVolume(root.getId()).getTO(); + DiskTO disk = new DiskTO(volTO, root.getDeviceId(), root.getPath(), root.getVolumeType()); + + // it's OK in this case to send a detach command to the host for a root volume as this + // will simply lead to the SR that supports the root volume being removed + DettachCommand cmd = new DettachCommand(disk, vm.getInstanceName()); + + cmd.setManaged(true); + + cmd.setStorageHost(storagePool.getHostAddress()); + cmd.setStoragePort(storagePool.getPort()); + + cmd.set_iScsiName(root.get_iScsiName()); + + Commands cmds = new Commands(Command.OnError.Stop); + + cmds.addCommand(cmd); + + try { + _agentMgr.send(hostId, cmds); + } + catch (Exception ex) { + throw new CloudRuntimeException(ex.getMessage()); + } + + if (!cmds.isSuccessful()) { + for (Answer answer : cmds.getAnswers()) { + if (!answer.getResult()) { + s_logger.warn("Failed to reset vm due to: " + answer.getDetails()); + + throw new CloudRuntimeException("Unable to reset " + vm + " due to " + answer.getDetails()); + } + } + } + + if (hostId != null) { + // root.getPoolId() should be null if the VM we are attaching the disk to has never been started before + DataStore dataStore = root.getPoolId() != null ? _dataStoreMgr.getDataStore(root.getPoolId(), DataStoreRole.Primary) : null; + Host host = this._hostDao.findById(hostId); + + volumeMgr.disconnectVolumeFromHost(volFactory.getVolume(root.getId()), host, dataStore); + } + } + } + } + @Override public void prepareStop(VirtualMachineProfile profile) { UserVmVO vm = _vmDao.findById(profile.getId()); diff --git a/server/test/com/cloud/vm/UserVmManagerTest.java b/server/test/com/cloud/vm/UserVmManagerTest.java index 43010a3f64..b67c164144 100755 --- a/server/test/com/cloud/vm/UserVmManagerTest.java +++ b/server/test/com/cloud/vm/UserVmManagerTest.java @@ -50,6 +50,8 @@ import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; +import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; +import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; import com.cloud.capacity.CapacityManager; import com.cloud.configuration.ConfigurationManager; @@ -141,6 +143,8 @@ public class UserVmManagerTest { EntityManager _entityMgr; @Mock ResourceLimitService _resourceLimitMgr; + @Mock + PrimaryDataStoreDao _storagePoolDao; @Before public void setup() { @@ -162,6 +166,7 @@ public void setup() { _userVmMgr._resourceLimitMgr = _resourceLimitMgr; _userVmMgr._scaleRetry = 2; _userVmMgr._entityMgr = _entityMgr; + _userVmMgr._storagePoolDao = _storagePoolDao; doReturn(3L).when(_account).getId(); doReturn(8L).when(_vmMock).getAccountId(); @@ -214,6 +219,12 @@ public void testRestoreVMF2() throws ResourceUnavailableException, InsufficientC Account account = new AccountVO("testaccount", 1L, "networkdomain", (short)0, "uuid"); UserVO user = new UserVO(1, "testuser", "password", "firstname", "lastName", "email", "timezone", UUID.randomUUID().toString()); + StoragePoolVO storagePool = new StoragePoolVO(); + + storagePool.setManaged(false); + + when(_storagePoolDao.findById(anyLong())).thenReturn(storagePool); + CallContext.register(user, account); try { _userVmMgr.restoreVMInternal(_account, _vmMock, null); @@ -245,6 +256,12 @@ public void testRestoreVMF3() throws ResourceUnavailableException, InsufficientC Account account = new AccountVO("testaccount", 1L, "networkdomain", (short)0, "uuid"); UserVO user = new UserVO(1, "testuser", "password", "firstname", "lastName", "email", "timezone", UUID.randomUUID().toString()); + StoragePoolVO storagePool = new StoragePoolVO(); + + storagePool.setManaged(false); + + when(_storagePoolDao.findById(anyLong())).thenReturn(storagePool); + CallContext.register(user, account); try { _userVmMgr.restoreVMInternal(_account, _vmMock, null); @@ -282,6 +299,12 @@ public void testRestoreVMF4() throws ResourceUnavailableException, InsufficientC Account account = new AccountVO("testaccount", 1L, "networkdomain", (short)0, "uuid"); UserVO user = new UserVO(1, "testuser", "password", "firstname", "lastName", "email", "timezone", UUID.randomUUID().toString()); + StoragePoolVO storagePool = new StoragePoolVO(); + + storagePool.setManaged(false); + + when(_storagePoolDao.findById(anyLong())).thenReturn(storagePool); + CallContext.register(user, account); try { _userVmMgr.restoreVMInternal(_account, _vmMock, 14L); @@ -321,6 +344,12 @@ public void testRestoreVMF5() throws ResourceUnavailableException, InsufficientC Account account = new AccountVO("testaccount", 1L, "networkdomain", (short)0, "uuid"); UserVO user = new UserVO(1, "testuser", "password", "firstname", "lastName", "email", "timezone", UUID.randomUUID().toString()); + StoragePoolVO storagePool = new StoragePoolVO(); + + storagePool.setManaged(false); + + when(_storagePoolDao.findById(anyLong())).thenReturn(storagePool); + CallContext.register(user, account); try { _userVmMgr.restoreVMInternal(_account, _vmMock, 14L); From 90646ad070dc533ea810d0b62a7375f9c67a8436 Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 20 Mar 2014 14:18:59 +0000 Subject: [PATCH 036/683] Renamed static fields to comply with coding conventions. Signed-off-by: Alena Prokharchyk --- .../internallb/ListInternalLoadBalancerElementsCmd.java | 4 ++-- .../api/command/admin/network/CreateNetworkOfferingCmd.java | 6 +++--- .../admin/network/ListSupportedNetworkServicesCmd.java | 4 ++-- .../api/command/admin/network/UpdateNetworkOfferingCmd.java | 4 ++-- .../command/admin/offering/CreateServiceOfferingCmd.java | 4 ++-- .../command/admin/router/ListVirtualRouterElementsCmd.java | 4 ++-- .../cloudstack/api/command/admin/storage/AddS3Cmd.java | 4 ++-- .../command/admin/usage/ListTrafficTypeImplementorsCmd.java | 4 ++-- .../api/command/admin/usage/ListTrafficTypesCmd.java | 4 ++-- .../api/command/admin/vpc/CreateVPCOfferingCmd.java | 4 ++-- .../api/command/admin/vpc/UpdateVPCOfferingCmd.java | 4 ++-- .../api/command/user/network/ListNetworkOfferingsCmd.java | 4 ++-- .../api/command/user/network/ListNetworksCmd.java | 4 ++-- .../api/command/user/vpc/ListVPCOfferingsCmd.java | 4 ++-- .../cloudstack/api/command/user/vpc/RestartVPCCmd.java | 4 ++-- .../cloudstack/api/command/user/vpc/UpdateVPCCmd.java | 4 ++-- 16 files changed, 33 insertions(+), 33 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLoadBalancerElementsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLoadBalancerElementsCmd.java index 489b64325f..8f62b41969 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLoadBalancerElementsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/internallb/ListInternalLoadBalancerElementsCmd.java @@ -47,7 +47,7 @@ responseHasSensitiveInfo = false) public class ListInternalLoadBalancerElementsCmd extends BaseListCmd { public static final Logger s_logger = Logger.getLogger(ListInternalLoadBalancerElementsCmd.class.getName()); - private static final String Name = "listinternalloadbalancerelementsresponse"; + private static final String s_name = "listinternalloadbalancerelementsresponse"; @Inject private InternalLoadBalancerElementService _service; @@ -88,7 +88,7 @@ public Boolean getEnabled() { @Override public String getCommandName() { - return Name; + return s_name; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java index cbc1936697..6dd4260d5f 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java @@ -45,7 +45,7 @@ requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateNetworkOfferingCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(CreateNetworkOfferingCmd.class.getName()); - private static final String Name = "createnetworkofferingresponse"; + private static final String s_name = "createnetworkofferingresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// @@ -165,7 +165,7 @@ public Integer getNetworkRate() { } public static String getName() { - return Name; + return s_name; } public Long getServiceOfferingId() { @@ -282,7 +282,7 @@ public Map getDetails() { ///////////////////////////////////////////////////// @Override public String getCommandName() { - return Name; + return s_name; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/ListSupportedNetworkServicesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/ListSupportedNetworkServicesCmd.java index 612c733a34..39e99a43a6 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/network/ListSupportedNetworkServicesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/network/ListSupportedNetworkServicesCmd.java @@ -41,7 +41,7 @@ responseHasSensitiveInfo = false) public class ListSupportedNetworkServicesCmd extends BaseListCmd { public static final Logger s_logger = Logger.getLogger(ListSupportedNetworkServicesCmd.class.getName()); - private static final String Name = "listsupportednetworkservicesresponse"; + private static final String s_name = "listsupportednetworkservicesresponse"; @Parameter(name = ApiConstants.PROVIDER, type = CommandType.STRING, description = "network service provider name") private String providerName; @@ -74,7 +74,7 @@ public String getServiceName() { ///////////////////////////////////////////////////// @Override public String getCommandName() { - return Name; + return s_name; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java index f650b4ffb0..411da4fd36 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/network/UpdateNetworkOfferingCmd.java @@ -33,7 +33,7 @@ requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpdateNetworkOfferingCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(UpdateNetworkOfferingCmd.class.getName()); - private static final String Name = "updatenetworkofferingresponse"; + private static final String s_name = "updatenetworkofferingresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// @@ -110,7 +110,7 @@ public Boolean getKeepAliveEnabled() { ///////////////////////////////////////////////////// @Override public String getCommandName() { - return Name; + return s_name; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java index 78101fb11a..69bb1e96b1 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java @@ -38,7 +38,7 @@ requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateServiceOfferingCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(CreateServiceOfferingCmd.class.getName()); - private static final String Name = "createserviceofferingresponse"; + private static final String s_name = "createserviceofferingresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// @@ -257,7 +257,7 @@ public Integer getHypervisorSnapshotReserve() { @Override public String getCommandName() { - return Name; + return s_name; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/admin/router/ListVirtualRouterElementsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/router/ListVirtualRouterElementsCmd.java index 62c6da5ee2..24bbf5ae2e 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/router/ListVirtualRouterElementsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/router/ListVirtualRouterElementsCmd.java @@ -44,7 +44,7 @@ requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListVirtualRouterElementsCmd extends BaseListCmd { public static final Logger s_logger = Logger.getLogger(ListNetworkOfferingsCmd.class.getName()); - private static final String Name = "listvirtualrouterelementsresponse"; + private static final String s_name = "listvirtualrouterelementsresponse"; // TODO, VirtualRouterElementServer is not singleton in system! @Inject @@ -95,7 +95,7 @@ public Boolean getEnabled() { @Override public String getCommandName() { - return Name; + return s_name; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/admin/storage/AddS3Cmd.java b/api/src/org/apache/cloudstack/api/command/admin/storage/AddS3Cmd.java index 8a82e89d7a..4164394f5e 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/storage/AddS3Cmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/storage/AddS3Cmd.java @@ -57,7 +57,7 @@ public final class AddS3Cmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(AddS3Cmd.class.getName()); - private static final String COMMAND_NAME = "adds3response"; + private static final String s_name = "adds3response"; @Parameter(name = S3_ACCESS_KEY, type = STRING, required = true, description = "S3 access key") private String accessKey; @@ -190,7 +190,7 @@ public int hashCode() { @Override public String getCommandName() { - return COMMAND_NAME; + return s_name; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypeImplementorsCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypeImplementorsCmd.java index a1ff29fd00..bd634bbe5c 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypeImplementorsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypeImplementorsCmd.java @@ -45,7 +45,7 @@ responseHasSensitiveInfo = false) public class ListTrafficTypeImplementorsCmd extends BaseListCmd { public static final Logger s_logger = Logger.getLogger(ListTrafficTypeImplementorsCmd.class); - private static final String Name = "listtraffictypeimplementorsresponse"; + private static final String s_name = "listtraffictypeimplementorsresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// @@ -89,6 +89,6 @@ public long getEntityOwnerId() { @Override public String getCommandName() { - return Name; + return s_name; } } diff --git a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java index 33ee29611d..fd0635959b 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/usage/ListTrafficTypesCmd.java @@ -38,7 +38,7 @@ requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListTrafficTypesCmd extends BaseListCmd { public static final Logger s_logger = Logger.getLogger(ListTrafficTypesCmd.class.getName()); - private static final String Name = "listtraffictypesresponse"; + private static final String s_name = "listtraffictypesresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// @@ -67,7 +67,7 @@ public Long getPhysicalNetworkId() { ///////////////////////////////////////////////////// @Override public String getCommandName() { - return Name; + return s_name; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java index 5b3090bd75..25d4ae318d 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java @@ -43,7 +43,7 @@ requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd { public static final Logger s_logger = Logger.getLogger(CreateVPCOfferingCmd.class.getName()); - private static final String Name = "createvpcofferingresponse"; + private static final String s_name = "createvpcofferingresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// @@ -159,7 +159,7 @@ public String getEventDescription() { @Override public String getCommandName() { - return Name; + return s_name; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java index 8b05a7a5a2..5af47d3a4c 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/UpdateVPCOfferingCmd.java @@ -34,7 +34,7 @@ requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpdateVPCOfferingCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(UpdateVPCOfferingCmd.class.getName()); - private static final String Name = "updatevpcofferingresponse"; + private static final String s_name = "updatevpcofferingresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// @@ -77,7 +77,7 @@ public String getState() { ///////////////////////////////////////////////////// @Override public String getCommandName() { - return Name; + return s_name; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java index a08e28fb6d..6ac0f395b7 100644 --- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworkOfferingsCmd.java @@ -36,7 +36,7 @@ requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListNetworkOfferingsCmd extends BaseListCmd { public static final Logger s_logger = Logger.getLogger(ListNetworkOfferingsCmd.class.getName()); - private static final String Name = "listnetworkofferingsresponse"; + private static final String s_name = "listnetworkofferingsresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// @@ -182,7 +182,7 @@ public Boolean getForVpc() { ///////////////////////////////////////////////////// @Override public String getCommandName() { - return Name; + return s_name; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java index a5de9155cf..86f3ba2ad6 100644 --- a/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/network/ListNetworksCmd.java @@ -40,7 +40,7 @@ requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListNetworksCmd extends BaseListTaggedResourcesCmd { public static final Logger s_logger = Logger.getLogger(ListNetworksCmd.class.getName()); - private static final String Name = "listnetworksresponse"; + private static final String s_name = "listnetworksresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// @@ -155,7 +155,7 @@ public Boolean getDisplay() { ///////////////////////////////////////////////////// @Override public String getCommandName() { - return Name; + return s_name; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCOfferingsCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCOfferingsCmd.java index 66ea17654a..e76afc92cd 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCOfferingsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpc/ListVPCOfferingsCmd.java @@ -34,7 +34,7 @@ requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class ListVPCOfferingsCmd extends BaseListCmd { public static final Logger s_logger = Logger.getLogger(ListVPCOfferingsCmd.class.getName()); - private static final String Name = "listvpcofferingsresponse"; + private static final String s_name = "listvpcofferingsresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// @@ -110,7 +110,7 @@ public void execute() { @Override public String getCommandName() { - return Name; + return s_name; } } diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java index e1a5306866..84e790c3b2 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpc/RestartVPCCmd.java @@ -40,7 +40,7 @@ requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class RestartVPCCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(RestartVPCCmd.class.getName()); - private static final String Name = "restartvpcresponse"; + private static final String s_name = "restartvpcresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// @@ -62,7 +62,7 @@ public Long getId() { ///////////////////////////////////////////////////// @Override public String getCommandName() { - return Name; + return s_name; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java index e4956031f5..94d0e6efcd 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpc/UpdateVPCCmd.java @@ -39,7 +39,7 @@ requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class UpdateVPCCmd extends BaseAsyncCustomIdCmd { public static final Logger s_logger = Logger.getLogger(UpdateVPCCmd.class.getName()); - private static final String Name = "updatevpcresponse"; + private static final String s_name = "updatevpcresponse"; ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// @@ -82,7 +82,7 @@ public Boolean getDisplayVpc() { ///////////////////////////////////////////////////// @Override public String getCommandName() { - return Name; + return s_name; } @Override From 403bdf107f0ca52c2b326da7412871859dfe4a54 Mon Sep 17 00:00:00 2001 From: Konstantina Chremmou Date: Thu, 20 Mar 2014 15:20:53 +0000 Subject: [PATCH 037/683] Added version info to command and response parameters introduced in 4.4. Renamed newly introduced parameter StoragePoolReponse.overProvisionFactor to comply with coding conventions. Signed-off-by: Alena Prokharchyk --- .../command/admin/offering/CreateServiceOfferingCmd.java | 9 +++++---- .../api/command/admin/vpc/CreateVPCOfferingCmd.java | 2 +- .../user/autoscale/ListAutoScaleVmProfilesCmd.java | 2 +- .../user/firewall/UpdatePortForwardingRuleCmd.java | 2 +- .../user/loadbalancer/AssignToLoadBalancerRuleCmd.java | 5 ++++- .../cloudstack/api/command/user/vm/DeployVMCmd.java | 5 ++++- .../api/command/user/volume/ListVolumesCmd.java | 6 +++++- .../api/command/user/volume/UpdateVolumeCmd.java | 5 ++++- .../apache/cloudstack/api/response/AccountResponse.java | 2 +- .../cloudstack/api/response/DiskOfferingResponse.java | 4 ++-- .../org/apache/cloudstack/api/response/HostResponse.java | 2 +- .../cloudstack/api/response/NetworkOfferingResponse.java | 2 +- .../apache/cloudstack/api/response/NetworkResponse.java | 4 ++-- .../cloudstack/api/response/ServiceOfferingResponse.java | 8 ++++---- .../cloudstack/api/response/StoragePoolResponse.java | 6 +++--- .../apache/cloudstack/api/response/UserVmResponse.java | 6 +++--- .../cloudstack/api/response/VpcOfferingResponse.java | 4 ++-- .../org/apache/cloudstack/api/response/VpcResponse.java | 4 ++-- 18 files changed, 46 insertions(+), 32 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java index 69bb1e96b1..6cd5d84a07 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/offering/CreateServiceOfferingCmd.java @@ -118,19 +118,20 @@ public class CreateServiceOfferingCmd extends BaseCmd { @Parameter(name = ApiConstants.IOPS_WRITE_RATE, type = CommandType.LONG, required = false, description = "io requests write rate of the disk offering") private Long iopsWriteRate; - @Parameter(name = ApiConstants.CUSTOMIZED_IOPS, type = CommandType.BOOLEAN, required = false, description = "whether compute offering iops is custom or not") + @Parameter(name = ApiConstants.CUSTOMIZED_IOPS, type = CommandType.BOOLEAN, required = false, description = "whether compute offering iops is custom or not", since = "4.4") private Boolean customizedIops; - @Parameter(name = ApiConstants.MIN_IOPS, type = CommandType.LONG, required = false, description = "min iops of the compute offering") + @Parameter(name = ApiConstants.MIN_IOPS, type = CommandType.LONG, required = false, description = "min iops of the compute offering", since = "4.4") private Long minIops; - @Parameter(name = ApiConstants.MAX_IOPS, type = CommandType.LONG, required = false, description = "max iops of the compute offering") + @Parameter(name = ApiConstants.MAX_IOPS, type = CommandType.LONG, required = false, description = "max iops of the compute offering", since = "4.4") private Long maxIops; @Parameter(name = ApiConstants.HYPERVISOR_SNAPSHOT_RESERVE, type = CommandType.INTEGER, required = false, - description = "Hypervisor snapshot reserve space as a percent of a volume (for managed storage using Xen or VMware)") + description = "Hypervisor snapshot reserve space as a percent of a volume (for managed storage using Xen or VMware)", + since = "4.4") private Integer hypervisorSnapshotReserve; ///////////////////////////////////////////////////// diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java index 25d4ae318d..13e4c0e04b 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java @@ -66,7 +66,7 @@ public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd { + "If not specified, the provider for the service will be mapped to the default provider on the physical network") private Map serviceProviderList; - @Parameter(name = ApiConstants.SERVICE_CAPABILITY_LIST, type = CommandType.MAP, description = "desired service capabilities as part of vpc offering") + @Parameter(name = ApiConstants.SERVICE_CAPABILITY_LIST, type = CommandType.MAP, description = "desired service capabilities as part of vpc offering", since = "4.4") private Map serviceCapabilitystList; @Parameter(name = ApiConstants.SERVICE_OFFERING_ID, diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java index 6bb33fd009..554b48854a 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/ListAutoScaleVmProfilesCmd.java @@ -51,7 +51,7 @@ public class ListAutoScaleVmProfilesCmd extends BaseListProjectAndAccountResourc @Parameter(name = ApiConstants.TEMPLATE_ID, type = CommandType.UUID, entityType = TemplateResponse.class, description = "the templateid of the autoscale vm profile") private Long templateId; - @Parameter(name = ApiConstants.SERVICE_OFFERING_ID, type = CommandType.UUID, entityType = ServiceOfferingResponse.class, description = "list profiles by service offering id") + @Parameter(name = ApiConstants.SERVICE_OFFERING_ID, type = CommandType.UUID, entityType = ServiceOfferingResponse.class, description = "list profiles by service offering id", since = "4.4") private Long serviceOffId; @Parameter(name = ApiConstants.OTHER_DEPLOY_PARAMS, type = CommandType.STRING, description = "the otherdeployparameters of the autoscale vm profile") diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java index 2f50ddbb46..78525ba0d8 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java @@ -46,7 +46,7 @@ public class UpdatePortForwardingRuleCmd extends BaseAsyncCustomIdCmd { ///////////////////////////////////////////////////// //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, required = true, description = "the ID of the port forwarding rule") + @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, required = true, description = "the ID of the port forwarding rule", since = "4.4") private Long id; @Parameter(name = ApiConstants.PRIVATE_IP, type = CommandType.STRING, description = "the private IP address of the port forwarding rule") diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java index bc76e978f5..6a69792be3 100644 --- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java @@ -70,7 +70,10 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd { description = "the list of IDs of the virtual machine that are being assigned to the load balancer rule(i.e. virtualMachineIds=1,2,3)") private List virtualMachineIds; - @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID_IP, type = CommandType.MAP, description = "VM ID and IP map, vmidipmap[0].vmid=1 vmidipmap[0].ip=10.1.1.75") + @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID_IP, + type = CommandType.MAP, + description = "VM ID and IP map, vmidipmap[0].vmid=1 vmidipmap[0].ip=10.1.1.75", + since = "4.4") private Map vmIdIpMap; ///////////////////////////////////////////////////// diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java index 1414774122..cc91013d5f 100755 --- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java @@ -121,7 +121,10 @@ public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd { @Parameter(name = ApiConstants.SIZE, type = CommandType.LONG, description = "the arbitrary size for the DATADISK volume. Mutually exclusive with diskOfferingId") private Long size; - @Parameter(name = ApiConstants.ROOT_DISK_SIZE, type = CommandType.LONG, description = "Optional field to resize root disk on deploy. Only applies to template-based deployments. Analogous to details[0].rootdisksize, which takes precedence over this parameter if both are provided") + @Parameter(name = ApiConstants.ROOT_DISK_SIZE, + type = CommandType.LONG, + description = "Optional field to resize root disk on deploy. Only applies to template-based deployments. Analogous to details[0].rootdisksize, which takes precedence over this parameter if both are provided", + since = "4.4") private Long rootdisksize; @Parameter(name = ApiConstants.GROUP, type = CommandType.STRING, description = "an optional group for the virtual machine") diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java index bd169b5ba4..cc218f7197 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/ListVolumesCmd.java @@ -76,7 +76,11 @@ public class ListVolumesCmd extends BaseListTaggedResourcesCmd { authorized = {RoleType.Admin}) private Long storageId; - @Parameter(name = ApiConstants.DISK_OFFERING_ID, type = CommandType.UUID, entityType = DiskOfferingResponse.class, description = "list volumes by disk offering") + @Parameter(name = ApiConstants.DISK_OFFERING_ID, + type = CommandType.UUID, + entityType = DiskOfferingResponse.class, + description = "list volumes by disk offering", + since = "4.4") private Long diskOfferingId; @Parameter(name = ApiConstants.DISPLAY_VOLUME, type = CommandType.BOOLEAN, description = "list resources by display flag; only ROOT admin is eligible to pass this parameter", since = "4.4", authorized = {RoleType.Admin}) diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java index 45b9ecd26f..3ad6f47d27 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/UpdateVolumeCmd.java @@ -54,7 +54,10 @@ public class UpdateVolumeCmd extends BaseAsyncCustomIdCmd { @Parameter(name = ApiConstants.PATH, type = CommandType.STRING, description = "The path of the volume") private String path; - @Parameter(name = ApiConstants.CHAIN_INFO, type = CommandType.STRING, description = "The chain info of the volume") + @Parameter(name = ApiConstants.CHAIN_INFO, + type = CommandType.STRING, + description = "The chain info of the volume", + since = "4.4") private String chainInfo; @Parameter(name = ApiConstants.STORAGE_ID, diff --git a/api/src/org/apache/cloudstack/api/response/AccountResponse.java b/api/src/org/apache/cloudstack/api/response/AccountResponse.java index 991b162ac1..2e50c51858 100644 --- a/api/src/org/apache/cloudstack/api/response/AccountResponse.java +++ b/api/src/org/apache/cloudstack/api/response/AccountResponse.java @@ -240,7 +240,7 @@ public class AccountResponse extends BaseResponse implements ResourceLimitAndCou private Boolean isDefault; @SerializedName(ApiConstants.IAM_GROUPS) - @Param(description = "the list of acl groups that account belongs to") + @Param(description = "the list of acl groups that account belongs to", since = "4.4") private List groups; @Override diff --git a/api/src/org/apache/cloudstack/api/response/DiskOfferingResponse.java b/api/src/org/apache/cloudstack/api/response/DiskOfferingResponse.java index 0894eeced3..91bd441353 100644 --- a/api/src/org/apache/cloudstack/api/response/DiskOfferingResponse.java +++ b/api/src/org/apache/cloudstack/api/response/DiskOfferingResponse.java @@ -74,7 +74,7 @@ public class DiskOfferingResponse extends BaseResponse { private Long maxIops; @SerializedName(ApiConstants.HYPERVISOR_SNAPSHOT_RESERVE) - @Param(description = "Hypervisor snapshot reserve space as a percent of a volume (for managed storage using Xen or VMware)") + @Param(description = "Hypervisor snapshot reserve space as a percent of a volume (for managed storage using Xen or VMware)", since = "4.4") private Integer hypervisorSnapshotReserve; @SerializedName(ApiConstants.TAGS) @@ -102,7 +102,7 @@ public class DiskOfferingResponse extends BaseResponse { private Long iopsWriteRate; @SerializedName("cacheMode") - @Param(description = "the cache mode to use for this disk offering. none, writeback or writethrough") + @Param(description = "the cache mode to use for this disk offering. none, writeback or writethrough", since = "4.4") private String cacheMode; @SerializedName("displayoffering") diff --git a/api/src/org/apache/cloudstack/api/response/HostResponse.java b/api/src/org/apache/cloudstack/api/response/HostResponse.java index 1fbc6684e1..008631ff7d 100644 --- a/api/src/org/apache/cloudstack/api/response/HostResponse.java +++ b/api/src/org/apache/cloudstack/api/response/HostResponse.java @@ -137,7 +137,7 @@ public class HostResponse extends BaseResponse { private Long memoryUsed; @SerializedName(ApiConstants.GPUGROUP) - @Param(description = "GPU cards present in the host", responseObject = GpuResponse.class) + @Param(description = "GPU cards present in the host", responseObject = GpuResponse.class, since = "4.4") private List gpuGroup; @SerializedName("disksizetotal") diff --git a/api/src/org/apache/cloudstack/api/response/NetworkOfferingResponse.java b/api/src/org/apache/cloudstack/api/response/NetworkOfferingResponse.java index 55ca2ce886..5a5ceef1fb 100644 --- a/api/src/org/apache/cloudstack/api/response/NetworkOfferingResponse.java +++ b/api/src/org/apache/cloudstack/api/response/NetworkOfferingResponse.java @@ -117,7 +117,7 @@ public class NetworkOfferingResponse extends BaseResponse { private Integer concurrentConnections; @SerializedName(ApiConstants.SUPPORTS_STRECHED_L2_SUBNET) - @Param(description = "true if network offering supports network that span multiple zones") + @Param(description = "true if network offering supports network that span multiple zones", since = "4.4") private Boolean supportsStrechedL2Subnet; public void setId(String id) { diff --git a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java index beeeb572b3..40c90729cd 100644 --- a/api/src/org/apache/cloudstack/api/response/NetworkResponse.java +++ b/api/src/org/apache/cloudstack/api/response/NetworkResponse.java @@ -218,11 +218,11 @@ public class NetworkResponse extends BaseResponse implements ControlledEntityRes private String aclId; @SerializedName(ApiConstants.STRECHED_L2_SUBNET) - @Param(description = "true if network can span multiple zones") + @Param(description = "true if network can span multiple zones", since = "4.4") private Boolean strechedL2Subnet; @SerializedName(ApiConstants.NETWORK_SPANNED_ZONES) - @Param(description = "If a network is enabled for 'streched l2 subnet' then represents zones on which network currently spans") + @Param(description = "If a network is enabled for 'streched l2 subnet' then represents zones on which network currently spans", since = "4.4") private Set networkSpannedZones; public Boolean getDisplayNetwork() { diff --git a/api/src/org/apache/cloudstack/api/response/ServiceOfferingResponse.java b/api/src/org/apache/cloudstack/api/response/ServiceOfferingResponse.java index d371f9a925..764ade510a 100644 --- a/api/src/org/apache/cloudstack/api/response/ServiceOfferingResponse.java +++ b/api/src/org/apache/cloudstack/api/response/ServiceOfferingResponse.java @@ -107,19 +107,19 @@ public class ServiceOfferingResponse extends BaseResponse { private Integer networkRate; @SerializedName("iscustomizediops") - @Param(description = "true if disk offering uses custom iops, false otherwise") + @Param(description = "true if disk offering uses custom iops, false otherwise", since = "4.4") private Boolean customizedIops; @SerializedName(ApiConstants.MIN_IOPS) - @Param(description = "the min iops of the disk offering") + @Param(description = "the min iops of the disk offering", since = "4.4") private Long minIops; @SerializedName(ApiConstants.MAX_IOPS) - @Param(description = "the max iops of the disk offering") + @Param(description = "the max iops of the disk offering", since = "4.4") private Long maxIops; @SerializedName(ApiConstants.HYPERVISOR_SNAPSHOT_RESERVE) - @Param(description = "Hypervisor snapshot reserve space as a percent of a volume (for managed storage using Xen or VMware)") + @Param(description = "Hypervisor snapshot reserve space as a percent of a volume (for managed storage using Xen or VMware)", since = "4.4") private Integer hypervisorSnapshotReserve; @SerializedName("diskBytesReadRate") diff --git a/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java b/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java index 98c90e2fd3..3571866fe7 100644 --- a/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java +++ b/api/src/org/apache/cloudstack/api/response/StoragePoolResponse.java @@ -108,8 +108,8 @@ public class StoragePoolResponse extends BaseResponse { private String scope; @SerializedName("overprovisionfactor") - @Param(description = "the overprovisionfactor for the storage pool") - private String overprovisionfactor; + @Param(description = "the overprovisionfactor for the storage pool", since = "4.4") + private String overProvisionFactor; @SerializedName(ApiConstants.HYPERVISOR) @Param(description = "the hypervisor type of the storage pool") @@ -307,6 +307,6 @@ public void setSuitableForMigration(Boolean suitableForMigration) { } public void setOverProvisionFactor(String overProvisionFactor) { - this.overprovisionfactor = overProvisionFactor; + this.overProvisionFactor = overProvisionFactor; } } diff --git a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java index d6ce84f495..9fe3475f57 100644 --- a/api/src/org/apache/cloudstack/api/response/UserVmResponse.java +++ b/api/src/org/apache/cloudstack/api/response/UserVmResponse.java @@ -141,11 +141,11 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp private String serviceOfferingName; @SerializedName(ApiConstants.DISK_OFFERING_ID) - @Param(description = "the ID of the disk offering of the virtual machine") + @Param(description = "the ID of the disk offering of the virtual machine", since = "4.4") private String diskOfferingId; @SerializedName("diskofferingname") - @Param(description = "the name of the disk offering of the virtual machine") + @Param(description = "the name of the disk offering of the virtual machine", since = "4.4") private String diskOfferingName; @SerializedName("forvirtualnetwork") @@ -165,7 +165,7 @@ public class UserVmResponse extends BaseResponse implements ControlledEntityResp private Integer memory; @SerializedName(ApiConstants.VGPU) - @Param(description = "the vgpu type used by the virtual machine") + @Param(description = "the vgpu type used by the virtual machine", since = "4.4") private String vgpu; @SerializedName("cpuused") diff --git a/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java b/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java index de5adef611..512746fb6a 100644 --- a/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java +++ b/api/src/org/apache/cloudstack/api/response/VpcOfferingResponse.java @@ -60,11 +60,11 @@ public class VpcOfferingResponse extends BaseResponse { private List services; @SerializedName(ApiConstants.DISTRIBUTED_VPC_ROUTER) - @Param(description = " indicates if the vpc offering supports distributed router for one-hop forwarding") + @Param(description = " indicates if the vpc offering supports distributed router for one-hop forwarding", since = "4.4") private Boolean supportsDistributedRouter; @SerializedName((ApiConstants.SUPPORTS_REGION_LEVEL_VPC)) - @Param(description = " indicated if the offering can support region level vpc") + @Param(description = " indicated if the offering can support region level vpc", since = "4.4") private Boolean supportsRegionLevelVpc; public void setId(String id) { diff --git a/api/src/org/apache/cloudstack/api/response/VpcResponse.java b/api/src/org/apache/cloudstack/api/response/VpcResponse.java index d86045408c..d1afdfb816 100644 --- a/api/src/org/apache/cloudstack/api/response/VpcResponse.java +++ b/api/src/org/apache/cloudstack/api/response/VpcResponse.java @@ -112,11 +112,11 @@ public class VpcResponse extends BaseResponse implements ControlledEntityRespons private Boolean forDisplay; @SerializedName(ApiConstants.DISTRIBUTED_VPC_ROUTER) - @Param(description = "is VPC uses distributed router for one hop forwarding and host based network ACL's") + @Param(description = "is VPC uses distributed router for one hop forwarding and host based network ACL's", since = "4.4") private boolean usesDistributedRouter; @SerializedName((ApiConstants.REGION_LEVEL_VPC)) - @Param(description = "true if VPC is region level") + @Param(description = "true if VPC is region level", since = "4.4") private Boolean regionLevelVpc; public void setId(String id) { From 0d160e81984e8a8e64dfab38e02fe7308f9e21cf Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Fri, 21 Mar 2014 13:26:47 -0700 Subject: [PATCH 038/683] CLOUDSTACK-6272: Fix recover/restore VM actions -Label recoverVirtualMachine as 'Recover VM' -Label restoreVirtualMachine as 'Reinstall VM' -Change confirmation text for restoreVirtualMachine to be more explicit -Change restoreVirtualMachine icon to 'recycle' symbol, to avoid confusion with the reboot VM icon --- .../classes/resources/messages.properties | 4 ++++ ui/dictionary.jsp | 4 ++++ ui/images/sprites.png | Bin 211543 -> 212064 bytes ui/scripts/instances.js | 13 ++++++------- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index 8329325ba4..9cf9fc12ac 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -14,6 +14,10 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. +label.reinstall.vm=Reinstall VM +message.reinstall.vm=NOTE: Proceed with caution. This will cause the VM to be reinstalled from the template; data on the root disk will be lost. Extra data volumes, if any, will not be touched. +label.recover.vm=Recover VM +message.recover.vm=Please confirm that you would like to recover this VM. label.port=Port label.remove.ldap=Remove LDAP label.configure.ldap=Configure LDAP diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp index 074db7f061..ebe71b6a87 100644 --- a/ui/dictionary.jsp +++ b/ui/dictionary.jsp @@ -25,6 +25,10 @@ under the License. <% long now = System.currentTimeMillis(); %> diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index 8bb9d6f121..1b82188fd7 100644 --- a/ui/scripts/configuration.js +++ b/ui/scripts/configuration.js @@ -502,17 +502,17 @@ //custom fields (begin) if (args.$form.find('.form-item[rel=cpuNumber]').css("display") != "none") { $.extend(data, { - cpuNumber: args.data.cpuNumber + cpuNumber: args.data.cpuNumber }); } if (args.$form.find('.form-item[rel=cpuSpeed]').css("display") != "none") { $.extend(data, { - cpuSpeed: args.data.cpuSpeed + cpuSpeed: args.data.cpuSpeed }); } if (args.$form.find('.form-item[rel=memory]').css("display") != "none") { $.extend(data, { - memory: args.data.memory + memory: args.data.memory }); } //custom fields (end) @@ -773,9 +773,9 @@ memory: { label: 'label.memory.mb', converter: function(args) { - if (args == undefined) - return ''; - else + if (args == undefined) + return ''; + else return cloudStack.converters.convertBytes(args * 1024 * 1024); } }, @@ -877,9 +877,9 @@ var item = json.listserviceofferingsresponse.serviceoffering[0]; if (item.deploymentplanner != null && item.serviceofferingdetails != null) { - if (item.deploymentplanner == 'ImplicitDedicationPlanner' && item.serviceofferingdetails.ImplicitDedicationMode != null) { - item.plannerMode = item.serviceofferingdetails.ImplicitDedicationMode; - } + if (item.deploymentplanner == 'ImplicitDedicationPlanner' && item.serviceofferingdetails.ImplicitDedicationMode != null) { + item.plannerMode = item.serviceofferingdetails.ImplicitDedicationMode; + } } if (item.serviceofferingdetails != null) { @@ -1334,9 +1334,9 @@ memory: { label: 'label.memory.mb', converter: function(args) { - if (args == undefined) - return ''; - else + if (args == undefined) + return ''; + else return cloudStack.converters.convertBytes(args * 1024 * 1024); } }, @@ -2052,6 +2052,7 @@ var $lbType = args.$form.find('.form-item[rel=lbType]'); var $serviceofferingid = args.$form.find('.form-item[rel=serviceofferingid]'); var $conservemode = args.$form.find('.form-item[rel=conservemode]'); + var $supportsstrechedl2subnet = args.$form.find('.form-item[rel=supportsstrechedl2subnet]'); var $serviceSourceNatRedundantRouterCapabilityCheckbox = args.$form.find('.form-item[rel="service.SourceNat.redundantRouterCapabilityCheckbox"]'); var hasAdvancedZones = false; @@ -2199,7 +2200,7 @@ /* - when service(s) has VPC Virtual Router as provider: + when service(s) has VPC Virtual Router as provider: (1) conserve mode is set to unchecked and grayed out. (2) redundant router capability checkbox is set to unchecked and grayed out. (3) remove Firewall service, SecurityGroup service. @@ -2231,43 +2232,43 @@ //CS-16612 show all services regardless of guestIpType(Shared/Isolated) /* - //hide/show service fields ***** (begin) ***** - var serviceFieldsToHide = []; - if($guestTypeField.val() == 'Shared') { //Shared network offering - serviceFieldsToHide = [ - 'service.SourceNat.isEnabled', - 'service.PortForwarding.isEnabled', - 'service.Firewall.isEnabled', - 'service.Vpn.isEnabled' - ]; - if(havingVpcVirtualRouterForAtLeastOneService == true) { //add SecurityGroup to to-hide-list - serviceFieldsToHide.push('service.SecurityGroup.isEnabled'); - } - else { //remove SecurityGroup from to-hide-list - var temp = $.map(serviceFieldsToHide, function(item) { - if (item != 'service.SecurityGroup.isEnabled') { - return item; - } - }); - serviceFieldsToHide = temp; - } - } - else { //Isolated network offering - serviceFieldsToHide = [ - 'service.SecurityGroup.isEnabled' - ]; - if(havingVpcVirtualRouterForAtLeastOneService == true) { //add firewall to to-hide-list - serviceFieldsToHide.push('service.Firewall.isEnabled'); - } - else { //remove firewall from to-hide-list - var temp = $.map(serviceFieldsToHide, function(item) { - if (item != 'service.Firewall.isEnabled') { - return item; - } - }); - serviceFieldsToHide = temp; - } - } + //hide/show service fields ***** (begin) ***** + var serviceFieldsToHide = []; + if($guestTypeField.val() == 'Shared') { //Shared network offering + serviceFieldsToHide = [ + 'service.SourceNat.isEnabled', + 'service.PortForwarding.isEnabled', + 'service.Firewall.isEnabled', + 'service.Vpn.isEnabled' + ]; + if(havingVpcVirtualRouterForAtLeastOneService == true) { //add SecurityGroup to to-hide-list + serviceFieldsToHide.push('service.SecurityGroup.isEnabled'); + } + else { //remove SecurityGroup from to-hide-list + var temp = $.map(serviceFieldsToHide, function(item) { + if (item != 'service.SecurityGroup.isEnabled') { + return item; + } + }); + serviceFieldsToHide = temp; + } + } + else { //Isolated network offering + serviceFieldsToHide = [ + 'service.SecurityGroup.isEnabled' + ]; + if(havingVpcVirtualRouterForAtLeastOneService == true) { //add firewall to to-hide-list + serviceFieldsToHide.push('service.Firewall.isEnabled'); + } + else { //remove firewall from to-hide-list + var temp = $.map(serviceFieldsToHide, function(item) { + if (item != 'service.Firewall.isEnabled') { + return item; + } + }); + serviceFieldsToHide = temp; + } + } */ @@ -2355,6 +2356,13 @@ args.$form.find('.form-item[rel=\"service.StaticNat.associatePublicIP\"]').hide(); args.$form.find('.form-item[rel=\"service.StaticNat.associatePublicIP\"]').find('input[type=checkbox]').attr('checked', false); } + + //StretchedL2Subnet checkbox should be displayed only when 'Connectivity' service is checked + if (args.$form.find('.form-item[rel=\"service.Connectivity.isEnabled\"]').find('input[type=checkbox]').is(':checked')) { + $supportsstrechedl2subnet.css('display', 'inline-block'); + } else { + $supportsstrechedl2subnet.hide(); + } }); args.$form.change(); @@ -2392,7 +2400,7 @@ }); } }, - */ + */ guestIpType: { label: 'label.guest.type', @@ -2728,6 +2736,12 @@ }, //show or hide upon checked services and selected providers above (end) + supportsstrechedl2subnet: { + label: 'label.supportsstrechedl2subnet', + isBoolean: true, + isChecked: false, + isHidden: true + }, conservemode: { label: 'label.conserve.mode', @@ -2830,7 +2844,7 @@ inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilitytype'] = 'lbSchemes'; inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = 'internal'; serviceCapabilityIndex++; - } + } } else if (value != '') { // Normal data inputData[key] = value; } @@ -2838,7 +2852,7 @@ for (var key1 in inputData) { /* When capability ElasticIp=true is passed to API, if capability associatePublicIP is not passed to API, cloudStack API will assume associatePublicIP=true. - So, UI has to explicitly pass associatePublicIP=false to API if its checkbox is unchecked. */ + So, UI has to explicitly pass associatePublicIP=false to API if its checkbox is unchecked. */ if (inputData[key1] == 'ElasticIp') { //ElasticIp checkbox is checked var associatePublicIPExists = false; for (var key2 in inputData) { @@ -2852,11 +2866,25 @@ inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].service'] = 'StaticNat'; inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilitytype'] = 'associatePublicIP'; inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = false; //associatePublicIP checkbox is unchecked + serviceCapabilityIndex++; } break; //break key1 for loop } } + //passing supportsstrechedl2subnet's value as capability + for (var k in inputData) { + if (k == 'supportsstrechedl2subnet' && ("Connectivity" in serviceProviderMap)) { + inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].service'] = 'Connectivity'; + inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilitytype'] = 'StretchedL2Subnet'; + inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = true; + serviceCapabilityIndex++; + break; + } + } + //removing supportsstrechedl2subnet from parameters, it has been set as capability + delete inputData['supportsstrechedl2subnet']; + // Make supported services list inputData['supportedServices'] = $.map(serviceProviderMap, function(value, key) { return key; @@ -3191,6 +3219,10 @@ traffictype: { label: 'label.traffic.type' }, + supportsstrechedl2subnet: { + label: 'label.supportsstrechedl2subnet', + converter: cloudStack.converters.toBooleanText + }, supportedServices: { label: 'label.supported.services' }, @@ -3216,6 +3248,561 @@ return service.name; }).join(', '), + serviceCapabilities: $.map(item.service, function(service) { + return service.provider ? $.map(service.provider, function(capability) { + return service.name + ': ' + capability.name; + }).join(', ') : null; + }).join(', ') + }) + }); + } + }); + } + } + } + } + } + }, + + vpcOfferings: { + type: 'select', + title: 'label.menu.vpc.offerings', + listView: { + id: 'vpcOfferings', + label: 'label.menu.vpc.offerings', + fields: { + name: { + label: 'label.name' + }, + state: { + label: 'label.state', + indicator: { + 'Enabled': 'on', + 'Disabled': 'off', + 'Destroyed': 'off' + } + } + }, + + dataProvider: function(args) { + var data = {}; + listViewDataProvider(args, data); + + $.ajax({ + url: createURL('listVPCOfferings'), + data: data, + success: function(json) { + var items = json.listvpcofferingsresponse.vpcoffering; + args.response.success({ + actionFilter: vpcOfferingActionfilter, + data: items + }); + }, + error: function(data) { + args.response.error(parseXMLHttpResponse(data)); + } + }); + }, + + actions: { + add: { + label: 'label.add.vpc.offering', + + createForm: { + title: 'label.add.vpc.offering', + + preFilter: function(args) { + var hasAdvancedZones = false; + + // Check whether there are any advanced zones + $.ajax({ + url: createURL('listZones'), + data: { + listAll: true + }, + async: false, + success: function(json) { + var zones = json.listzonesresponse.zone; + if (zones != null && zones.length > 0) { + for (var i = 0; i < zones.length; i++) { + if (zones[i].networktype == "Advanced") + hasAdvancedZones = true; + } + } + } + }); + + args.$form.bind('change', function() { //when any field in the dialog is changed + + var $providers = args.$form.find('.dynamic-input select'); + var $optionsOfProviders = $providers.find('option'); + + $providers.each(function() { + //if selected option is disabled, select the first enabled option instead + if ($(this).find('option:selected:disabled').length > 0) { + $(this).val($(this).find('option:first')); + } + }); + }); + + args.$form.change(); + }, + + fields: { + name: { + label: 'label.name', + validation: { + required: true + }, + docID: 'helpVpcOfferingName' + }, + + displayText: { + label: 'label.description', + validation: { + required: true + }, + docID: 'helpVpcOfferingDescription' + }, + + supportedServices: { + label: 'label.supported.services', + + dynamic: function(args) { + var networkServiceObjs = []; + networkServiceObjs.push({ + name: 'Dhcp', + provider: [{name: 'VpcVirtualRouter'}] + }); + networkServiceObjs.push({ + name: 'Dns', + provider: [{name: 'VpcVirtualRouter'}] + }); + networkServiceObjs.push({ + name: 'Lb', + provider: [{name: 'VpcVirtualRouter'}] + }); + networkServiceObjs.push({ + name: 'Gateway', + provider: [{name: 'VpcVirtualRouter'}] + }); + networkServiceObjs.push({ + name: 'StaticNat', + provider: [{name: 'VpcVirtualRouter'}] + }); + networkServiceObjs.push({ + name: 'SourceNat', + provider: [{name: 'VpcVirtualRouter'}] + }); + networkServiceObjs.push({ + name: 'NetworkACL', + provider: [{name: 'VpcVirtualRouter'}] + }); + networkServiceObjs.push({ + name: 'PortForwarding', + provider: [{name: 'VpcVirtualRouter'}] + }); + networkServiceObjs.push({ + name: 'UserData', + provider: [{name: 'VpcVirtualRouter'}] + }); + networkServiceObjs.push({ + name: 'Vpn', + provider: [{name: 'VpcVirtualRouter'}] + }); + + networkServiceObjs.push({ + name: 'Connectivity', + provider: [ + {name: 'NiciraNvp'}, + {name: 'Ovs'}, + {name: 'JuniperContrailVpcRouter'} + ] + }); + + serviceFields = []; + var fields = {}; + $(networkServiceObjs).each(function() { + var serviceName = this.name; + var providerObjs = this.provider; + var serviceDisplayName; + + // Sanitize names + switch (serviceName) { + case 'Vpn': + serviceDisplayName = dictionary['label.vpn']; + break; + case 'Dhcp': + serviceDisplayName = dictionary['label.dhcp']; + break; + case 'Dns': + serviceDisplayName = dictionary['label.dns']; + break; + case 'Lb': + serviceDisplayName = dictionary['label.load.balancer']; + break; + case 'SourceNat': + serviceDisplayName = dictionary['label.source.nat']; + break; + case 'StaticNat': + serviceDisplayName = dictionary['label.static.nat']; + break; + case 'PortForwarding': + serviceDisplayName = dictionary['label.port.forwarding']; + break; + case 'UserData': + serviceDisplayName = dictionary['label.user.data']; + break; + default: + serviceDisplayName = serviceName; + break; + } + + var id = { + isEnabled: 'service' + '.' + serviceName + '.' + 'isEnabled', + capabilities: 'service' + '.' + serviceName + '.' + 'capabilities', + provider: 'service' + '.' + serviceName + '.' + 'provider' + }; + + serviceCheckboxNames.push(id.isEnabled); + + fields[id.isEnabled] = { + label: serviceDisplayName, + isBoolean: true, + }; + + serviceFields.push(id.isEnabled); + + fields[id.provider] = { + label: serviceDisplayName + ' Provider', + isHidden: true, + dependsOn: id.isEnabled, + select: function(args) { + var items = []; + $(providerObjs).each(function() { + items.push({ + id: this.name, + description: this.name + }); + }); + args.response.success({ + data: items + }); + } + } + }); + + args.response.success({ + fields: fields + }); + } + }, //end of supportedservices field + + "service.Connectivity.regionLevelVpcCapabilityCheckbox": { + label: 'label.regionlevelvpc', + isHidden: true, + dependsOn: 'service.Connectivity.isEnabled', + isBoolean: true + }, + + "service.Connectivity.distributedRouterCapabilityCheckbox": { + label: 'label.distributedrouter', + isHidden: true, + dependsOn: 'service.Connectivity.isEnabled', + isBoolean: true + } + },//end of fields + }, //end of createForm + + action: function(args) { + var formData = args.data; + var inputData = {}; + var serviceProviderMap = {}; + var serviceCapabilityIndex = 0; + + $.each(formData, function(key, value) { + var serviceData = key.split('.'); + + if (serviceData.length > 1) { + if (serviceData[0] == 'service' && + serviceData[2] == 'isEnabled' && + value == 'on') { // Services field + + serviceProviderMap[serviceData[1]] = formData[ + 'service.' + serviceData[1] + '.provider' + ]; + } else if ((key == 'service.Connectivity.regionLevelVpcCapabilityCheckbox') && ("Connectivity" in serviceProviderMap)) { + inputData['serviceCapabilityList[' + serviceCapabilityIndex + '].service'] = 'Connectivity'; + inputData['serviceCapabilityList[' + serviceCapabilityIndex + '].capabilitytype'] = "RegionLevelVpc"; + inputData['serviceCapabilityList[' + serviceCapabilityIndex + '].capabilityvalue'] = true; + serviceCapabilityIndex++; + } else if ((key == 'service.Connectivity.distributedRouterCapabilityCheckbox') && ("Connectivity" in serviceProviderMap)) { + inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].service'] = 'Connectivity'; + inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilitytype'] = 'DistributedRouter'; + inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = true; + serviceCapabilityIndex++; + } + } else if (value != '') { // Normal data + inputData[key] = value; + } + }); + + // Make supported services list + inputData['supportedServices'] = $.map(serviceProviderMap, function(value, key) { + return key; + }).join(','); + + + // Make service provider map + var serviceProviderIndex = 0; + $.each(serviceProviderMap, function(key, value) { + inputData['serviceProviderList[' + serviceProviderIndex + '].service'] = key; + inputData['serviceProviderList[' + serviceProviderIndex + '].provider'] = value; + serviceProviderIndex++; + }); + + $.ajax({ + url: createURL('createVPCOffering'), + data: inputData, + dataType: 'json', + async: true, + success: function(data) { + var item = data.createvpcofferingresponse; + + args.response.success({ + data: item, + actionFilter: vpcOfferingActionfilter + }); + }, + + error: function(data) { + args.response.error(parseXMLHttpResponse(data)); + } + }); + }, + + notification: { + poll: function(args) { + args.complete({ + actionFilter: vpcOfferingActionfilter + }); + } + }, + + messages: { + notification: function(args) { + return 'Added VPC offering'; + } + } + } + }, + + reorder: cloudStack.api.actions.sort('updateVPCOffering', 'vpcOfferings'), + + detailView: { + name: 'label.vpc.offering.details', + actions: { + edit: { + label: 'label.edit', + action: function(args) { + var data = { + id: args.context.vpcOfferings[0].id, + name: args.data.name, + displaytext: args.data.displaytext, + availability: args.data.availability + }; + + $.ajax({ + url: createURL('updateVPCOffering'), + data: data, + success: function(json) { + var item = json.updatevpcofferingresponse.vpcoffering; + args.response.success({ + data: item + }); + }, + error: function(data) { + args.response.error(parseXMLHttpResponse(data)); + } + }); + } + }, + + enable: { + label: 'label.enable.vpc.offering', + messages: { + confirm: function(args) { + return 'message.confirm.enable.vpc.offering'; + }, + notification: function(args) { + return 'message.enabling.vpc.offering'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateVPCOffering&id=" + args.context.vpcOfferings[0].id + "&state=Enabled"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updatevpcofferingresponse.vpcoffering; + args.response.success(); + }, + error: function(data) { + args.response.error(parseXMLHttpResponse(data)); + } + }); + }, + notification: { + poll: function(args) { + args.complete({ + data: { + state: 'Enabled' + } + }); + } + } + }, + + disable: { + label: 'label.disable.vpc.offering', + messages: { + confirm: function(args) { + return 'message.confirm.disable.vpc.offering'; + }, + notification: function(args) { + return 'message.disabling.vpc.offering'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("updateVPCOffering&id=" + args.context.vpcOfferings[0].id + "&state=Disabled"), + dataType: "json", + async: true, + success: function(json) { + var item = json.updatevpcofferingresponse.vpcoffering; + args.response.success(); + }, + error: function(data) { + args.response.error(parseXMLHttpResponse(data)); + } + }); + }, + notification: { + poll: function(args) { + args.complete({ + data: { + state: 'Disabled' + } + }); + } + } + }, + + remove: { + label: 'label.remove.vpc.offering', + action: function(args) { + $.ajax({ + url: createURL('deleteVPCOffering'), + data: { + id: args.context.vpcOfferings[0].id + }, + success: function(json) { + args.response.success(); + }, + error: function(data) { + args.response.error(parseXMLHttpResponse(data)); + } + }); + }, + messages: { + confirm: function() { + return 'message.confirm.remove.vpc.offering'; + }, + notification: function() { + return 'label.remove.vpc.offering'; + } + }, + notification: { + poll: function(args) { + args.complete({ + data: { + state: 'Destroyed' + }, + actionFilter: vpcOfferingActionfilter + }); + } + } + } + }, + tabs: { + details: { + title: 'label.details', + + fields: [{ + name: { + label: 'label.name', + isEditable: true, + validation: { + required: true + } + } + }, { + id: { + label: 'label.id' + }, + displaytext: { + label: 'label.description', + isEditable: true, + validation: { + required: true + } + }, + state: { + label: 'label.state' + }, + + isdefault: { //created by system by default + label: 'label.created.by.system', + converter: cloudStack.converters.toBooleanText + }, + + supportedServices: { + label: 'label.supported.services' + }, + serviceCapabilities: { + label: 'label.service.capabilities' + }, + distributedvpcrouter: { + label: 'label.vpc.distributedvpcrouter', + converter: cloudStack.converters.toBooleanText + }, + supportsregionLevelvpc: { + label: 'label.vpc.supportsregionlevelvpc', + converter: cloudStack.converters.toBooleanText + }, + serviceCapabilities: { + label: 'label.service.capabilities' + }, + tags: { + label: 'label.tags' + } + + }], + + dataProvider: function(args) { + $.ajax({ + url: createURL('listVPCOfferings&id=' + args.context.vpcOfferings[0].id), + dataType: "json", + async: true, + success: function(json) { + var item = json.listvpcofferingsresponse.vpcoffering[0]; + args.response.success({ + actionFilter: vpcOfferingActionfilter, + data: $.extend(item, { + supportedServices: $.map(item.service, function(service) { + return service.name; + }).join(', '), + serviceCapabilities: $.map(item.service, function(service) { return service.provider ? $.map(service.provider, function(capability) { return service.name + ': ' + capability.name; @@ -3232,7 +3819,8 @@ } } } - }; +} + var serviceOfferingActionfilter = function(args) { var jsonObj = args.context.item; @@ -3278,4 +3866,24 @@ return allowedActions; }; + var vpcOfferingActionfilter = function(args) { + var jsonObj = args.context.item; + + if (jsonObj.state == 'Destroyed') + return []; + + var allowedActions = []; + allowedActions.push("edit"); + + if (jsonObj.state == "Enabled") + allowedActions.push("disable"); + else if (jsonObj.state == "Disabled") + allowedActions.push("enable"); + + if (jsonObj.isdefault == false) + allowedActions.push("remove"); + + return allowedActions; + }; + })(cloudStack, jQuery); diff --git a/ui/scripts/docs.js b/ui/scripts/docs.js index df4bcf0144..abda45b8a2 100755 --- a/ui/scripts/docs.js +++ b/ui/scripts/docs.js @@ -1211,5 +1211,13 @@ cloudStack.docs = { helpLdapGroupName: { desc: 'The group name from which you want to import LDAP users', externalLink: '' + }, + helpVpcOfferingName: { + desc: 'Any desired name for the VPC offering', + externalLink: '' + }, + helpVpcOfferingDescription: { + desc: 'A short description of the offering that can be displayed to users', + externalLink: '' } }; diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 6462d2ad93..f0141b6efd 100755 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -5178,7 +5178,16 @@ url: createURL('listVPCs'), data: data, success: function(json) { - var items = json.listvpcsresponse.vpc; + var items = json.listvpcsresponse.vpc ? json.listvpcsresponse.vpc : { }; + + //If we are coming from Home > Regions, show only regional vpcs + if (args.context.regions) + items = $.grep( + items, + function (vpc, i) { + return vpc.regionlevelvpc; + }); + args.response.success({ data: items }); @@ -5272,30 +5281,49 @@ data: items }); } + }, + vpcoffering: { + label: 'label.vpc.offering', + validation: { + required: true + }, + + select: function(args) { + var data = { + listAll: true + }; + $.ajax({ + url: createURL('listVPCOfferings'), + data: { + listAll: true + }, + success: function(json) { + var offerings = json.listvpcofferingsresponse.vpcoffering ? json.listvpcofferingsresponse.vpcoffering : []; + var filteredofferings = $.grep(offerings, function(offering) { + return offering.state == 'Enabled'; + }); + args.response.success({ + data: $.map(filteredofferings, function(vpco) { + return { + id: vpco.id, + description: vpco.name + }; + }) + }); + } + }); + } } } }, action: function(args) { - var vpcOfferingName; - if (args.data.publicLoadBalancerProvider == 'VpcVirtualRouter') - vpcOfferingName = 'Default VPC offering'; - else if (args.data.publicLoadBalancerProvider == 'Netscaler') - vpcOfferingName = 'Default VPC offering with Netscaler'; - - $.ajax({ - url: createURL('listVPCOfferings'), - data: { - name: vpcOfferingName - }, - success: function(json) { - var vpcofferingid = json.listvpcofferingsresponse.vpcoffering[0].id; - + var vpcOfferingName = args.data.vpcoffering var dataObj = { name: args.data.name, displaytext: args.data.displaytext, zoneid: args.data.zoneid, cidr: args.data.cidr, - vpcofferingid: vpcofferingid + vpcofferingid: args.data.vpcoffering }; if (args.data.networkdomain != null && args.data.networkdomain.length > 0) @@ -5323,8 +5351,6 @@ args.response.error(parseXMLHttpResponse(data)); } }); - } - }); }, notification: { diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js index 66dae8c1a1..368c1bfb2f 100644 --- a/ui/scripts/regions.js +++ b/ui/scripts/regions.js @@ -147,6 +147,9 @@ viewAll: [{ path: 'regions.GSLB', label: 'GSLB' + }, { + path: 'network.vpc', + label: 'label.regionlevelvpc' }, { path: 'regions.portableIpRanges', label: 'Portable IP', diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index 50e12f921f..34cec7b67e 100644 --- a/ui/scripts/ui/dialog.js +++ b/ui/scripts/ui/dialog.js @@ -223,7 +223,10 @@ }); if ($dependsOn.is('[type=checkbox]')) { - var isReverse = args.form.fields[dependsOn].isReverse; + + var isReverse = false; + if (args.form.fields[dependsOn]) + isReverse = args.form.fields[dependsOn].isReverse; // Checkbox $dependsOn.bind('click', function(event) { diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index 73d34dfb6c..020b9d70aa 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -3955,13 +3955,51 @@ } }); } + }, + + zoneid: { + label: 'label.zone', + validation: { + required: true + }, + isHidden: true, + + select: function(args) { + //var $zoneSelect = $(".ui-dialog-content").find('select.zoneid'); + var $zoneSelect = args.$select.closest('form').find('[rel=zoneid]'); + if (!args.context.regions) { + $zoneSelect.hide(); + args.response.success({ + data: [] + }); + } + else { + $zoneSelect.css('display', 'inline-block'); + $.ajax({ + url: createURL('listZones'), + success: function(json) { + var zones = $.grep(json.listzonesresponse.zone, function(zone) { + return (zone.networktype == 'Advanced'); + }); + + args.response.success({ + data: $.map(zones, function(zone) { + return { + id: zone.id, + description: zone.name + }; + }) + }); + } + }); + } + } } } }, action: function(args) { var dataObj = { - zoneId: args.context.vpc[0].zoneid, vpcid: args.context.vpc[0].id, domainid: args.context.vpc[0].domainid, account: args.context.vpc[0].account, @@ -3972,6 +4010,16 @@ netmask: args.data.netmask }; + if (args.context.regions) + $.extend(dataObj, { + zoneId: args.data.zoneid + }) + else + $.extend(dataObj, { + zoneId: args.context.vpc[0].zoneid + }); + + if (args.data.aclid != '') $.extend(dataObj, { aclid: args.data.aclid From beb26237bceabfc3ebeae57431f9affb21d041e5 Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Thu, 17 Apr 2014 15:52:28 -0700 Subject: [PATCH 286/683] Create form: Store passed JSON object in select options, for plugin use --- ui/scripts/ui/dialog.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index 34cec7b67e..7a903fdca0 100644 --- a/ui/scripts/ui/dialog.js +++ b/ui/scripts/ui/dialog.js @@ -287,6 +287,7 @@ var $option = $(' + + net.sf.ehcache + ehcache-core + org.apache.cloudstack cloud-utils diff --git a/services/iam/server/resources/META-INF/cloudstack/core/spring-iam-server-context.xml b/services/iam/server/resources/META-INF/cloudstack/core/spring-iam-server-context.xml index c9f383f4f5..4994a3400b 100644 --- a/services/iam/server/resources/META-INF/cloudstack/core/spring-iam-server-context.xml +++ b/services/iam/server/resources/META-INF/cloudstack/core/spring-iam-server-context.xml @@ -35,6 +35,13 @@ - + + + + + + + + diff --git a/services/iam/server/src/org/apache/cloudstack/iam/api/IAMService.java b/services/iam/server/src/org/apache/cloudstack/iam/api/IAMService.java index 20326e974c..3a470ee677 100644 --- a/services/iam/server/src/org/apache/cloudstack/iam/api/IAMService.java +++ b/services/iam/server/src/org/apache/cloudstack/iam/api/IAMService.java @@ -18,7 +18,6 @@ import java.util.List; - import org.apache.cloudstack.iam.api.IAMPolicyPermission.Permission; import com.cloud.utils.Pair; @@ -90,4 +89,11 @@ List listPolicyPermissionByAccessAndEntity(long policyId, S List listRecursiveIAMPoliciesByGroup(long groupId); + /* Interface used for cache IAM checkAccess result */ + void addToIAMCache(Object accessKey, Object allowDeny); + + Object getFromIAMCache(Object accessKey); + + void invalidateIAMCache(); + } diff --git a/services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java b/services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java index c35ac1d273..796ae43624 100644 --- a/services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java +++ b/services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java @@ -18,9 +18,15 @@ import java.util.ArrayList; import java.util.List; +import java.util.Map; import javax.ejb.Local; import javax.inject.Inject; +import javax.naming.ConfigurationException; + +import net.sf.ehcache.Cache; +import net.sf.ehcache.CacheManager; +import net.sf.ehcache.Element; import org.apache.log4j.Logger; @@ -38,6 +44,7 @@ import org.apache.cloudstack.iam.server.dao.IAMPolicyPermissionDao; import com.cloud.exception.InvalidParameterValueException; +import com.cloud.utils.NumbersUtil; import com.cloud.utils.Pair; import com.cloud.utils.component.Manager; import com.cloud.utils.component.ManagerBase; @@ -82,6 +89,62 @@ public class IAMServiceImpl extends ManagerBase implements IAMService, Manager { @Inject IAMPolicyPermissionDao _policyPermissionDao; + private Cache _iamCache; + + private void createIAMCache(final Map params) { + final String value = (String)params.get("cache.size"); + + if (value != null) { + final CacheManager cm = CacheManager.create(); + final int maxElements = NumbersUtil.parseInt(value, 0); + final int live = NumbersUtil.parseInt((String)params.get("cache.time.to.live"), 300); + final int idle = NumbersUtil.parseInt((String)params.get("cache.time.to.idle"), 300); + _iamCache = new Cache(getName(), maxElements, false, live == -1, live == -1 ? Integer.MAX_VALUE : live, idle); + cm.addCache(_iamCache); + s_logger.info("IAM Cache created: " + _iamCache.toString()); + } else { + _iamCache = null; + } + } + + @Override + public void addToIAMCache(Object accessKey, Object allowDeny) { + if (_iamCache != null) { + try { + s_logger.debug("Put IAM access check for " + accessKey + " in cache"); + _iamCache.put(new Element(accessKey, allowDeny)); + } catch (final Exception e) { + s_logger.debug("Can't put " + accessKey + " to IAM cache", e); + } + } + } + + @Override + public void invalidateIAMCache() { + //This may need to use event bus to publish to other MS, but event bus now is missing this functionality to handle PublishScope.GLOBAL + if (_iamCache != null) { + s_logger.debug("Invalidate IAM cache"); + _iamCache.removeAll(); + } + } + + @Override + public Object getFromIAMCache(Object accessKey) { + if (_iamCache != null) { + final Element element = _iamCache.get(accessKey); + return element == null ? null : element.getObjectValue(); + } + return null; + } + + @Override + public boolean configure(final String name, final Map params) throws ConfigurationException { + boolean result = super.configure(name, params); + // create IAM cache + createIAMCache(params); + return result; + } + @DB @Override public IAMGroup createIAMGroup(String iamGroupName, String description, String path) { @@ -111,7 +174,7 @@ public boolean deleteIAMGroup(final Long iamGroupId) { Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) { - // remove this group related entry in acl_group_role_map + // remove this group related entry in acl_group_policy_map List groupPolicyMap = _aclGroupPolicyMapDao.listByGroupId(grp.getId()); if (groupPolicyMap != null) { for (IAMGroupPolicyMapVO gr : groupPolicyMap) { @@ -132,6 +195,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } }); + invalidateIAMCache(); return true; } @@ -184,6 +248,8 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } } }); + + invalidateIAMCache(); return group; } @@ -210,6 +276,8 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } } }); + + invalidateIAMCache(); return group; } @@ -345,7 +413,7 @@ public boolean deleteIAMPolicy(final long iamPolicyId) { Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) { - // remove this role related entry in acl_group_role_map + // remove this policy related entry in acl_group_policy_map List groupPolicyMap = _aclGroupPolicyMapDao.listByPolicyId(policy.getId()); if (groupPolicyMap != null) { for (IAMGroupPolicyMapVO gr : groupPolicyMap) { @@ -374,6 +442,8 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } }); + invalidateIAMCache(); + return true; } @@ -536,6 +606,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } }); + invalidateIAMCache(); return group; } @@ -568,6 +639,8 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } } }); + + invalidateIAMCache(); return group; } @@ -594,6 +667,8 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } } }); + + invalidateIAMCache(); } @Override @@ -617,6 +692,8 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } } }); + + invalidateIAMCache(); } @DB @@ -639,6 +716,8 @@ public IAMPolicy addIAMPermissionToIAMPolicy(long iamPolicyId, String entityType recursive); _policyPermissionDao.persist(permit); } + + invalidateIAMCache(); return policy; } @@ -660,6 +739,8 @@ public IAMPolicy removeIAMPermissionFromIAMPolicy(long iamPolicyId, String entit // not removed yet _policyPermissionDao.remove(permit.getId()); } + + invalidateIAMCache(); return policy; } @@ -682,6 +763,8 @@ public void doInTransactionWithoutResult(TransactionStatus status) { } } }); + + invalidateIAMCache(); } @DB @@ -702,6 +785,7 @@ public IAMPolicy resetIAMPolicy(long iamPolicyId) { permissionSC.setParameters("policyId", iamPolicyId); _policyPermissionDao.expunge(permissionSC); + invalidateIAMCache(); return policy; } From cadefb1aeb2e1d973c9dcf38e7f793adc50599d6 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Wed, 7 May 2014 16:57:10 -0700 Subject: [PATCH 399/683] CLOUDSTACK-6601: added "forDisplay" parameter to listLoadBalancerRules API --- .../loadbalancer/ListLoadBalancerRulesCmd.java | 15 +++++++++++++-- .../network/lb/LoadBalancingRulesManagerImpl.java | 6 ++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRulesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRulesCmd.java index 013deb730e..df6c989464 100644 --- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRulesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLoadBalancerRulesCmd.java @@ -19,8 +19,7 @@ import java.util.ArrayList; import java.util.List; -import org.apache.log4j.Logger; - +import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseListTaggedResourcesCmd; @@ -32,6 +31,7 @@ import org.apache.cloudstack.api.response.NetworkResponse; import org.apache.cloudstack.api.response.UserVmResponse; import org.apache.cloudstack.api.response.ZoneResponse; +import org.apache.log4j.Logger; import com.cloud.network.rules.LoadBalancer; import com.cloud.utils.Pair; @@ -71,6 +71,9 @@ public class ListLoadBalancerRulesCmd extends BaseListTaggedResourcesCmd { @Parameter(name = ApiConstants.NETWORK_ID, type = CommandType.UUID, entityType = NetworkResponse.class, description = "list by network id the rule belongs to") private Long networkId; + @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "list resources by display flag; only ROOT admin is eligible to pass this parameter", since = "4.4", authorized = {RoleType.Admin}) + private Boolean display; + // /////////////////////////////////////////////////// // ///////////////// Accessors /////////////////////// // /////////////////////////////////////////////////// @@ -99,6 +102,14 @@ public Long getNetworkId() { return networkId; } + @Override + public Boolean getDisplay() { + if (display != null) { + return display; + } + return super.getDisplay(); + } + // /////////////////////////////////////////////////// // ///////////// API Implementation/////////////////// // /////////////////////////////////////////////////// diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java index b932e14000..05fb32597e 100755 --- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java +++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java @@ -2250,6 +2250,7 @@ public Pair, Integer> searchForLoadBalancers(ListLo Long instanceId = cmd.getVirtualMachineId(); Long networkId = cmd.getNetworkId(); Map tags = cmd.getTags(); + Boolean forDisplay = cmd.getDisplay(); Account caller = CallContext.current().getCallingAccount(); List permittedDomains = new ArrayList(); @@ -2273,6 +2274,7 @@ public Pair, Integer> searchForLoadBalancers(ListLo sb.and("sourceIpAddress", sb.entity().getSourceIpAddressId(), SearchCriteria.Op.EQ); sb.and("networkId", sb.entity().getNetworkId(), SearchCriteria.Op.EQ); sb.and("scheme", sb.entity().getScheme(), SearchCriteria.Op.EQ); + sb.and("display", sb.entity().isDisplay(), SearchCriteria.Op.EQ); if (instanceId != null) { SearchBuilder lbVMSearch = _lb2VmMapDao.createSearchBuilder(); @@ -2342,6 +2344,10 @@ public Pair, Integer> searchForLoadBalancers(ListLo } } + if (forDisplay != null) { + sc.setParameters("display", forDisplay); + } + //list only Public load balancers using this command sc.setParameters("scheme", Scheme.Public); From 84135cd302ab5fb944a28e73b394d02a8d1c17e2 Mon Sep 17 00:00:00 2001 From: Saksham Srivastava Date: Wed, 7 May 2014 13:53:43 +0530 Subject: [PATCH 400/683] CLOUDSTACK-6575: Deploy VM failed with NPE while using custom compute offering --- engine/schema/src/com/cloud/service/ServiceOfferingVO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/schema/src/com/cloud/service/ServiceOfferingVO.java b/engine/schema/src/com/cloud/service/ServiceOfferingVO.java index 3be0aaa774..0ea68b9a63 100755 --- a/engine/schema/src/com/cloud/service/ServiceOfferingVO.java +++ b/engine/schema/src/com/cloud/service/ServiceOfferingVO.java @@ -173,7 +173,7 @@ public ServiceOfferingVO(ServiceOfferingVO offering) { offering.getUseLocalStorage(), offering.getSystemUse(), true, - offering.isCustomizedIops(), + offering.isCustomizedIops()== null ? false:offering.isCustomizedIops(), offering.getDomainId()); cpu = offering.getCpu(); ramSize = offering.getRamSize(); From c013813426874ae0cc1ac2b23238415652955901 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Wed, 7 May 2014 21:08:14 -0400 Subject: [PATCH 401/683] CLOUDSTACK-6580: Adding listall parameter while listing Account in createUserApiClient --- tools/marvin/marvin/cloudstackTestClient.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py index 9fe559dcff..bc49530d43 100644 --- a/tools/marvin/marvin/cloudstackTestClient.py +++ b/tools/marvin/marvin/cloudstackTestClient.py @@ -326,6 +326,7 @@ def __createUserApiClient(self, UserName, DomainName, acctType=0): cmd = listAccounts.listAccountsCmd() cmd.name = UserName cmd.domainid = domId + cmd.listall = True try: accounts = self.__apiClient.listAccounts(cmd) acctId = accounts[0].id From 0ca013e64701f2deb54c5b2068b6d4e3c10f8340 Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Thu, 8 May 2014 11:33:37 +0200 Subject: [PATCH 402/683] Revert "CLOUDSTACK-6485: private gateway network should not be associated with vpc" This reverts commit 69add34ad0f07674f5ed560ef708b706e038a3dd. --- server/src/com/cloud/network/NetworkServiceImpl.java | 6 +++--- server/src/com/cloud/network/vpc/VpcManagerImpl.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java index 05c2725b6a..d8ce98e105 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -3977,9 +3977,9 @@ public Network doInTransaction(TransactionStatus status) throws ResourceAllocati } else { s_logger.debug("Private network already exists: " + privateNetwork); //Do not allow multiple private gateways with same Vlan within a VPC - if (vpcId != null && vpcId.equals(privateNetwork.getVpcId())) { - throw new InvalidParameterValueException("Private network for the vlan: " + uriString + " and cidr " + cidr + " already exists " + "for Vpc " + vpcId - + " in zone " + _entityMgr.findById(DataCenter.class, pNtwk.getDataCenterId()).getName()); + if (vpcId.equals(privateNetwork.getVpcId())) { + throw new InvalidParameterValueException("Private network for the vlan: " + uriString + " and cidr " + cidr + " already exists " + "for Vpc " + vpcId + + " in zone " + _entityMgr.findById(DataCenter.class, pNtwk.getDataCenterId()).getName()); } } diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java index ad078fc96b..9e02fd797c 100644 --- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java +++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java @@ -1588,9 +1588,9 @@ public VpcGatewayVO doInTransaction(TransactionStatus status) throws ResourceAll if (privateNtwk == null) { s_logger.info("creating new network for vpc " + vpc + " using broadcast uri: " + broadcastUri); String networkName = "vpc-" + vpc.getName() + "-privateNetwork"; - /* vpcid should not be set on the new network as it is not part of the vpc but an outside net */ - privateNtwk = _ntwkSvc.createPrivateNetwork(networkName, networkName, physicalNetworkIdFinal, broadcastUri, ipAddress, null, - gateway, netmask, gatewayOwnerId, null, isSourceNat, networkOfferingId); + privateNtwk = + _ntwkSvc.createPrivateNetwork(networkName, networkName, physicalNetworkIdFinal, broadcastUri, ipAddress, null, gateway, netmask, + gatewayOwnerId, vpcId, isSourceNat, networkOfferingId); } else { // create the nic/ip as createPrivateNetwork doesn''t do that work for us now s_logger.info("found and using existing network for vpc " + vpc + ": " + broadcastUri); DataCenterVO dc = _dcDao.lockRow(physNetFinal.getDataCenterId(), true); From 52257bc418476c361a831b9a0ada68a8b746bce9 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Thu, 8 May 2014 15:41:21 +0530 Subject: [PATCH 403/683] CLOUDSTACK-6608:OVS distributed firewall: default ACL rule is not getting applied when a tier in VPC is created. fix ensures, VpcRoutingPolicyUpdate is send when network rules are programmed when network tier in VPC is created --- server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java b/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java index ad47df14cc..d808c3fbc9 100644 --- a/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java +++ b/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java @@ -491,8 +491,12 @@ public boolean applyACLItemsToNetwork(long networkId, List rul foundProvider = true; s_logger.debug("Applying NetworkACL for network: " + network.getId() + " with Network ACL service provider"); handled = element.applyNetworkACLs(network, rules); - if (handled) + if (handled) { + // publish message on message bus, so that network elements implementing distributed routing + // capability can act on the event + _messageBus.publish(_name, "Network_ACL_Replaced", PublishScope.LOCAL, network); break; + } } if (!foundProvider) { s_logger.debug("Unable to find NetworkACL service provider for network: " + network.getId()); From 2301ceb143b24731f5b211b797a7cc4d5a7912fe Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Thu, 8 May 2014 15:48:22 +0530 Subject: [PATCH 404/683] CLOUDSTACK-6609: OVS distributed routing: ensure tunnels are created if not created already when OvsVpcPhysicalTopologyConfigCommand update is recived Currently if the tunnel creation fails, there is no retry logic. Fix ensures OvsVpcPhysicalTopologyConfigCommand updates as an opputiunity to ensure proper tunnels are established between the hosts. --- .../network/ovs/OvsTunnelManagerImpl.java | 32 +++- .../ovs/dao/VpcDistributedRouterSeqNoVO.java | 23 ++- .../xenserver/cloudstack_pluginlib.py | 155 +++++++++++++++++- scripts/vm/hypervisor/xenserver/ovstunnel | 139 ++-------------- setup/db/db/schema-430to440.sql | 3 +- 5 files changed, 203 insertions(+), 149 deletions(-) diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java index 6fd7d6de9b..2405f87632 100644 --- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java +++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java @@ -710,7 +710,7 @@ private void handleVmStateChange(VMInstanceVO vm) { String bridgeName=generateBridgeNameForVpc(vpcId); OvsVpcPhysicalTopologyConfigCommand topologyConfigCommand = prepareVpcTopologyUpdate(vpcId); - topologyConfigCommand.setSequenceNumber(getNextSequenceNumber(vpcId)); + topologyConfigCommand.setSequenceNumber(getNextTopologyUpdateSequenceNumber(vpcId)); // send topology change update to VPC spanned hosts for (Long id: vpcSpannedHostIds) { @@ -820,7 +820,7 @@ public void onPublishMessage(String senderAddress, String subject, Object args) if (network.getVpcId() != null && isVpcEnabledForDistributedRouter(network.getVpcId())) { long vpcId = network.getVpcId(); OvsVpcRoutingPolicyConfigCommand cmd = prepareVpcRoutingPolicyUpdate(vpcId); - cmd.setSequenceNumber(getNextSequenceNumber(vpcId)); + cmd.setSequenceNumber(getNextRoutingPolicyUpdateSequenceNumber(vpcId)); // get the list of hosts on which VPC spans (i.e hosts that need to be aware of VPC // network ACL update) @@ -901,7 +901,7 @@ private boolean sendVpcRoutingPolicyChangeUpdate(OvsVpcRoutingPolicyConfigComman } } - private long getNextSequenceNumber(final long vpcId) { + private long getNextTopologyUpdateSequenceNumber(final long vpcId) { try { return Transaction.execute(new TransactionCallback() { @@ -913,9 +913,31 @@ public Long doInTransaction(TransactionStatus status) { _vpcDrSeqNoDao.persist(seqVo); } seqVo = _vpcDrSeqNoDao.lockRow(seqVo.getId(), true); - seqVo.incrSequenceNo(); + seqVo.incrTopologyUpdateSequenceNo(); _vpcDrSeqNoDao.update(seqVo.getId(), seqVo); - return seqVo.getSequenceNo(); + return seqVo.getTopologyUpdateSequenceNo(); + } + }); + } finally { + + } + } + + private long getNextRoutingPolicyUpdateSequenceNumber(final long vpcId) { + + try { + return Transaction.execute(new TransactionCallback() { + @Override + public Long doInTransaction(TransactionStatus status) { + VpcDistributedRouterSeqNoVO seqVo = _vpcDrSeqNoDao.findByVpcId(vpcId); + if (seqVo == null) { + seqVo = new VpcDistributedRouterSeqNoVO(vpcId); + _vpcDrSeqNoDao.persist(seqVo); + } + seqVo = _vpcDrSeqNoDao.lockRow(seqVo.getId(), true); + seqVo.incrPolicyUpdateSequenceNo(); + _vpcDrSeqNoDao.update(seqVo.getId(), seqVo); + return seqVo.getPolicyUpdateSequenceNo(); } }); } finally { diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/VpcDistributedRouterSeqNoVO.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/VpcDistributedRouterSeqNoVO.java index d87a2c4dc5..613af812d5 100644 --- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/VpcDistributedRouterSeqNoVO.java +++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/dao/VpcDistributedRouterSeqNoVO.java @@ -37,8 +37,11 @@ public class VpcDistributedRouterSeqNoVO implements InternalIdentity { @Column(name = "vpc_id", updatable = false, nullable = false) private Long vpcId; - @Column(name = "sequence_no") - long sequenceNo = 0; + @Column(name = "topology_update_sequence_no") + long topologyUpdateSequenceNo = 0; + + @Column(name = "routing_policy__update_sequence_no") + long policyUpdateSequenceNo = 0; protected VpcDistributedRouterSeqNoVO() { @@ -62,11 +65,19 @@ public void setVpcId(Long vpcId) { this.vpcId = vpcId; } - public long getSequenceNo() { - return sequenceNo; + public long getTopologyUpdateSequenceNo() { + return topologyUpdateSequenceNo; + } + + public void incrTopologyUpdateSequenceNo() { + topologyUpdateSequenceNo++; + } + + public long getPolicyUpdateSequenceNo() { + return policyUpdateSequenceNo; } - public void incrSequenceNo() { - sequenceNo++; + public void incrPolicyUpdateSequenceNo() { + policyUpdateSequenceNo++; } } diff --git a/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py b/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py index fb28cae406..b93f87b170 100644 --- a/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py +++ b/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py @@ -344,8 +344,139 @@ def get_acl(vpcconfig, required_acl_id): return acl return None -# Configures the bridge created for a VPC enabled for distributed routing. Management server sends VPC physical topology -# details. Based on the VPC physical topology L2 lookup table and L3 lookup tables are updated by this function. +def check_tunnel_exists(bridge, tunnel_name): + res = do_cmd([VSCTL_PATH, "port-to-br", tunnel_name]) + return res == bridge + +def create_tunnel(bridge, remote_ip, gre_key, src_host, dst_host, network_uuid): + + logging.debug("Creating tunnel from host %s" %src_host + " to host %s" %dst_host + " with GRE key %s" %gre_key) + + res = check_switch() + if res != "SUCCESS": + logging.debug("Openvswitch running: NO") + return "FAILURE:%s" % res + + # We need to keep the name below 14 characters + # src and target are enough - consider a fixed length hash + name = "t%s-%s-%s" % (gre_key, src_host, dst_host) + + # Verify the xapi bridge to be created + # NOTE: Timeout should not be necessary anymore + wait = [VSCTL_PATH, "--timeout=30", "wait-until", "bridge", + bridge, "--", "get", "bridge", bridge, "name"] + res = do_cmd(wait) + if bridge not in res: + logging.debug("WARNING:Can't find bridge %s for creating " + + "tunnel!" % bridge) + return "FAILURE:NO_BRIDGE" + logging.debug("bridge %s for creating tunnel - VERIFIED" % bridge) + tunnel_setup = False + drop_flow_setup = False + try: + # Create a port and configure the tunnel interface for it + add_tunnel = [VSCTL_PATH, "add-port", bridge, + name, "--", "set", "interface", + name, "type=gre", "options:key=%s" % gre_key, + "options:remote_ip=%s" % remote_ip] + do_cmd(add_tunnel) + tunnel_setup = True + # verify port + verify_port = [VSCTL_PATH, "get", "port", name, "interfaces"] + res = do_cmd(verify_port) + # Expecting python-style list as output + iface_list = [] + if len(res) > 2: + iface_list = res.strip()[1:-1].split(',') + if len(iface_list) != 1: + logging.debug("WARNING: Unexpected output while verifying " + + "port %s on bridge %s" % (name, bridge)) + return "FAILURE:VERIFY_PORT_FAILED" + + # verify interface + iface_uuid = iface_list[0] + verify_interface_key = [VSCTL_PATH, "get", "interface", + iface_uuid, "options:key"] + verify_interface_ip = [VSCTL_PATH, "get", "interface", + iface_uuid, "options:remote_ip"] + + key_validation = do_cmd(verify_interface_key) + ip_validation = do_cmd(verify_interface_ip) + + if not gre_key in key_validation or not remote_ip in ip_validation: + logging.debug("WARNING: Unexpected output while verifying " + + "interface %s on bridge %s" % (name, bridge)) + return "FAILURE:VERIFY_INTERFACE_FAILED" + logging.debug("Tunnel interface validated:%s" % verify_interface_ip) + cmd_tun_ofport = [VSCTL_PATH, "get", "interface", + iface_uuid, "ofport"] + tun_ofport = do_cmd(cmd_tun_ofport) + # Ensure no trailing LF + if tun_ofport.endswith('\n'): + tun_ofport = tun_ofport[:-1] + # find xs network for this bridge, verify is used for ovs tunnel network + xs_nw_uuid = do_cmd([XE_PATH, "network-list", + "bridge=%s" % bridge, "--minimal"]) + ovs_tunnel_network = False + try: + ovs_tunnel_network = do_cmd([XE_PATH,"network-param-get", + "uuid=%s" % xs_nw_uuid, + "param-name=other-config", + "param-key=is-ovs-tun-network", "--minimal"]) + except: + pass + + ovs_vpc_distributed_vr_network = False + try: + ovs_vpc_distributed_vr_network = do_cmd([XE_PATH,"network-param-get", + "uuid=%s" % xs_nw_uuid, + "param-name=other-config", + "param-key=is-ovs-vpc-distributed-vr-network", "--minimal"]) + except: + pass + + if ovs_tunnel_network == 'True': + # add flow entryies for dropping broadcast coming in from gre tunnel + add_flow(bridge, priority=1000, in_port=tun_ofport, + dl_dst='ff:ff:ff:ff:ff:ff', actions='drop') + add_flow(bridge, priority=1000, in_port=tun_ofport, + nw_dst='224.0.0.0/24', actions='drop') + drop_flow_setup = True + logging.debug("Broadcast drop rules added") + + if ovs_vpc_distributed_vr_network == 'True': + # add flow rules for dropping broadcast coming in from tunnel ports + add_flow(bridge, priority=1000, in_port=tun_ofport, table=0, + dl_dst='ff:ff:ff:ff:ff:ff', actions='drop') + add_flow(bridge, priority=1000, in_port=tun_ofport, table=0, + nw_dst='224.0.0.0/24', actions='drop') + + # add flow rule to send the traffic from tunnel ports to L2 switching table only + add_flow(bridge, priority=1100, in_port=tun_ofport, table=0, actions='resubmit(,1)') + + # mark tunnel interface with network id for which this tunnel was created + do_cmd([VSCTL_PATH, "set", "interface", name, "options:cloudstack-network-id=%s" % network_uuid]) + update_flooding_rules_on_port_plug_unplug(bridge, name, 'online', network_uuid) + + logging.debug("Successfully created tunnel from host %s" %src_host + " to host %s" %dst_host + + " with GRE key %s" %gre_key) + return "SUCCESS:%s creation succeeded" % name + except: + logging.debug("An unexpected error occured. Rolling back") + if tunnel_setup: + logging.debug("Deleting GRE interface") + # Destroy GRE port and interface + del_port(bridge, name) + if drop_flow_setup: + # Delete flows + logging.debug("Deleting flow entries from GRE interface") + del_flows(bridge, in_port=tun_ofport) + # This will not cancel the original exception + raise + +# Configures the bridge created for a VPC that is enabled for distributed routing. Management server sends VPC +# physical topology details (which VM from which tier running on which host etc). Based on the VPC physical topology L2 +# lookup table and L3 lookup tables are updated by this function. def configure_vpc_bridge_for_network_topology(bridge, this_host_id, json_config, sequence_no): vpconfig = jsonLoader(json.loads(json_config)).vpc @@ -412,8 +543,13 @@ def configure_vpc_bridge_for_network_topology(bridge, this_host_id, json_config, network = get_network_details(vpconfig, nic.networkuuid) gre_key = network.grekey - # generate tunnel name as per the tunnel naming convention and get the OF port + # generate tunnel name as per the tunnel naming convention tunnel_name = "t%s-%s-%s" % (gre_key, this_host_id, host.hostid) + + # check if tunnel exists already, if not create a tunnel from this host to remote host + if not check_tunnel_exists(bridge, tunnel_name): + create_tunnel(bridge, host.ipaddress, gre_key, this_host_id, host.hostid, network.networkuuid) + of_port = get_ofport_for_vif(tunnel_name) # Add flow rule in L2 look up table, if packet's destination mac matches MAC of the VM's nic @@ -441,10 +577,10 @@ def configure_vpc_bridge_for_network_topology(bridge, this_host_id, json_config, del_flows(bridge, table=L3_LOOKUP_TABLE) ofspec.seek(0) - logging.debug("Adding below flows rules L2 & L3 lookup tables:\n" + ofspec.read()) + logging.debug("Adding below flows rules in L2 & L3 lookup tables:\n" + ofspec.read()) + ofspec.close() # update bridge with the flow-rules for L2 lookup and L3 lookup in the file in one attempt - ofspec.close() do_cmd([OFCTL_PATH, 'add-flows', bridge, ofspec_filename]) # now that we updated the bridge with flow rules close and delete the file. @@ -460,8 +596,9 @@ def configure_vpc_bridge_for_network_topology(bridge, this_host_id, json_config, os.remove(ofspec_filename) raise error_message -# Configures the bridge created for a VPC enabled for distributed firewall. Management server sends VPC routing policies -# details. Based on the VPC routing policies ingress ACL table and egress ACL tables are updated by this function. +# Configures the bridge created for a VPC that is enabled for distributed firewall. Management server sends VPC routing +# policy (network ACL applied on the tiers etc) details. Based on the VPC routing policies ingress ACL table and +# egress ACL tables are updated by this function. def configure_vpc_bridge_for_routing_policies(bridge, json_config, sequence_no): vpconfig = jsonLoader(json.loads(json_config)).vpc @@ -564,9 +701,9 @@ def configure_vpc_bridge_for_routing_policies(bridge, json_config, sequence_no): ofspec.seek(0) logging.debug("Adding below flows rules Ingress & Egress ACL tables:\n" + ofspec.read()) + ofspec.close() # update bridge with the flow-rules for ingress and egress ACL's added in the file in one attempt - ofspec.close() do_cmd([OFCTL_PATH, 'add-flows', bridge, ofspec_filename]) # now that we updated the bridge with flow rules delete the file. @@ -658,9 +795,9 @@ class tier_ports: ofspec.seek(0) logging.debug("Adding below flows rules L2 flooding table: \n" + ofspec.read()) + ofspec.close() # update bridge with the flow-rules for broadcast rules added in the file in one attempt - ofspec.close() do_cmd([OFCTL_PATH, 'add-flows', bridge, ofspec_filename]) # now that we updated the bridge with flow rules delete the file. diff --git a/scripts/vm/hypervisor/xenserver/ovstunnel b/scripts/vm/hypervisor/xenserver/ovstunnel index 358cd5493b..c95fc20721 100755 --- a/scripts/vm/hypervisor/xenserver/ovstunnel +++ b/scripts/vm/hypervisor/xenserver/ovstunnel @@ -193,7 +193,8 @@ def setup_ovs_bridge_for_distributed_routing(session, args): lib.add_flow(bridge, priority=0, table=lib.INGRESS_ACL_TABLE, actions='drop') # initialize the sequence number for the bridge - lib.do_cmd([lib.VSCTL_PATH, "set", "bridge", bridge, "other-config:sequence-number=0"]) + lib.do_cmd([lib.VSCTL_PATH, "set", "bridge", bridge, "other-config:topology-update-sequence-number=0"]) + lib.do_cmd([lib.VSCTL_PATH, "set", "bridge", bridge, "other-config:route-policy-update-sequence-number=0"]) result = "SUCCESS: successfully setup bridge with flow rules" @@ -232,128 +233,7 @@ def create_tunnel(session, args): dst_host = args.pop("to") network_uuid = args.pop("cloudstack-network-id") - logging.debug("Entering create_tunnel") - - res = lib.check_switch() - if res != "SUCCESS": - logging.debug("Openvswitch running: NO") - return "FAILURE:%s" % res - - # We need to keep the name below 14 characters - # src and target are enough - consider a fixed length hash - name = "t%s-%s-%s" % (gre_key, src_host, dst_host) - - # Verify the xapi bridge to be created - # NOTE: Timeout should not be necessary anymore - wait = [lib.VSCTL_PATH, "--timeout=30", "wait-until", "bridge", - bridge, "--", "get", "bridge", bridge, "name"] - res = lib.do_cmd(wait) - if bridge not in res: - logging.debug("WARNING:Can't find bridge %s for creating " + - "tunnel!" % bridge) - return "FAILURE:NO_BRIDGE" - logging.debug("bridge %s for creating tunnel - VERIFIED" % bridge) - tunnel_setup = False - drop_flow_setup = False - try: - # Create a port and configure the tunnel interface for it - add_tunnel = [lib.VSCTL_PATH, "add-port", bridge, - name, "--", "set", "interface", - name, "type=gre", "options:key=%s" % gre_key, - "options:remote_ip=%s" % remote_ip] - lib.do_cmd(add_tunnel) - tunnel_setup = True - # verify port - verify_port = [lib.VSCTL_PATH, "get", "port", name, "interfaces"] - res = lib.do_cmd(verify_port) - # Expecting python-style list as output - iface_list = [] - if len(res) > 2: - iface_list = res.strip()[1:-1].split(',') - if len(iface_list) != 1: - logging.debug("WARNING: Unexpected output while verifying " + - "port %s on bridge %s" % (name, bridge)) - return "FAILURE:VERIFY_PORT_FAILED" - - # verify interface - iface_uuid = iface_list[0] - verify_interface_key = [lib.VSCTL_PATH, "get", "interface", - iface_uuid, "options:key"] - verify_interface_ip = [lib.VSCTL_PATH, "get", "interface", - iface_uuid, "options:remote_ip"] - - key_validation = lib.do_cmd(verify_interface_key) - ip_validation = lib.do_cmd(verify_interface_ip) - - if not gre_key in key_validation or not remote_ip in ip_validation: - logging.debug("WARNING: Unexpected output while verifying " + - "interface %s on bridge %s" % (name, bridge)) - return "FAILURE:VERIFY_INTERFACE_FAILED" - logging.debug("Tunnel interface validated:%s" % verify_interface_ip) - cmd_tun_ofport = [lib.VSCTL_PATH, "get", "interface", - iface_uuid, "ofport"] - tun_ofport = lib.do_cmd(cmd_tun_ofport) - # Ensure no trailing LF - if tun_ofport.endswith('\n'): - tun_ofport = tun_ofport[:-1] - # find xs network for this bridge, verify is used for ovs tunnel network - xs_nw_uuid = lib.do_cmd([lib.XE_PATH, "network-list", - "bridge=%s" % bridge, "--minimal"]) - ovs_tunnel_network = False - try: - ovs_tunnel_network = lib.do_cmd([lib.XE_PATH,"network-param-get", - "uuid=%s" % xs_nw_uuid, - "param-name=other-config", - "param-key=is-ovs-tun-network", "--minimal"]) - except: - pass - - ovs_vpc_distributed_vr_network = False - try: - ovs_vpc_distributed_vr_network = lib.do_cmd([lib.XE_PATH,"network-param-get", - "uuid=%s" % xs_nw_uuid, - "param-name=other-config", - "param-key=is-ovs-vpc-distributed-vr-network", "--minimal"]) - except: - pass - - if ovs_tunnel_network == 'True': - # add flow entryies for dropping broadcast coming in from gre tunnel - lib.add_flow(bridge, priority=1000, in_port=tun_ofport, - dl_dst='ff:ff:ff:ff:ff:ff', actions='drop') - lib.add_flow(bridge, priority=1000, in_port=tun_ofport, - nw_dst='224.0.0.0/24', actions='drop') - drop_flow_setup = True - logging.debug("Broadcast drop rules added") - - if ovs_vpc_distributed_vr_network == 'True': - # add flow rules for dropping broadcast coming in from tunnel ports - lib.add_flow(bridge, priority=1000, in_port=tun_ofport, table=0, - dl_dst='ff:ff:ff:ff:ff:ff', actions='drop') - lib.add_flow(bridge, priority=1000, in_port=tun_ofport, table=0, - nw_dst='224.0.0.0/24', actions='drop') - - # add flow rule to send the traffic from tunnel ports to L2 switching table only - lib.add_flow(bridge, priority=1100, in_port=tun_ofport, table=0, actions='resubmit(,1)') - - # mark tunnel interface with network id for which this tunnel was created - lib.do_cmd([lib.VSCTL_PATH, "set", "interface", name, "options:cloudstack-network-id=%s" % network_uuid]) - lib.update_flooding_rules_on_port_plug_unplug(bridge, name, 'online', network_uuid) - - return "SUCCESS:%s" % name - except: - logging.debug("An unexpected error occured. Rolling back") - if tunnel_setup: - logging.debug("Deleting GRE interface") - # Destroy GRE port and interface - lib.del_port(bridge, name) - if drop_flow_setup: - # Delete flows - logging.debug("Deleting flow entries from GRE interface") - lib.del_flows(bridge, in_port=tun_ofport) - # This will not cancel the original exception - raise - + return lib.create_tunnel(bridge, remote_ip, gre_key, src_host, dst_host, network_uuid) @echo def destroy_tunnel(session, args): @@ -414,10 +294,11 @@ def configure_ovs_bridge_for_network_topology(session, args): sequence_no = args.pop("seq-no") # get the last update sequence number - last_seq_no = lib.do_cmd([lib.VSCTL_PATH, "get", "bridge", bridge, "other-config:sequence-number"]) + last_seq_no = lib.do_cmd([lib.VSCTL_PATH, "get", "bridge", bridge, "other-config:topology-update-sequence-number"]) last_seq_no = last_seq_no[1:-1] if long(sequence_no) > long(last_seq_no): - lib.do_cmd([lib.VSCTL_PATH, "set", "bridge", bridge, "other-config:sequence-number=%s"%sequence_no]) + lib.do_cmd([lib.VSCTL_PATH, "set", "bridge", bridge, + "other-config:topology-update-sequence-number=%s"%sequence_no]) return lib.configure_vpc_bridge_for_network_topology(bridge, this_host_id, json_config, sequence_no) else: return "SUCCESS: Ignoring the update with the sequence number %s" %sequence_no + " as there is already recent" \ @@ -430,10 +311,12 @@ def configure_ovs_bridge_for_routing_policies(session, args): sequence_no = args.pop("seq-no") # get the last update sequence number - last_seq_no = lib.do_cmd([lib.VSCTL_PATH, "get", "bridge", bridge, "other-config:sequence-number"]) + last_seq_no = lib.do_cmd([lib.VSCTL_PATH, "get", "bridge", bridge, + "other-config:route-policy-update-sequence-number"]) last_seq_no = last_seq_no[1:-1] if long(sequence_no) > long(last_seq_no): - lib.do_cmd([lib.VSCTL_PATH, "set", "bridge", bridge, "other-config:sequence-number=%s"%sequence_no]) + lib.do_cmd([lib.VSCTL_PATH, "set", "bridge", bridge, + "other-config:route-policy-update-sequence-number=%s"%sequence_no]) return lib.configure_vpc_bridge_for_routing_policies(bridge, json_config, sequence_no) else: return "SUCCESS: Ignoring the update with the sequence number %s" %sequence_no + " as there is already recent" \ @@ -448,4 +331,4 @@ if __name__ == "__main__": "getLabel": getLabel, "setup_ovs_bridge_for_distributed_routing": setup_ovs_bridge_for_distributed_routing, "configure_ovs_bridge_for_network_topology": configure_ovs_bridge_for_network_topology, - "configure_ovs_bridge_for_routing_policies": configure_ovs_bridge_for_routing_policies}) + "configure_ovs_bridge_for_routing_policies": configure_ovs_bridge_for_routing_policies}) \ No newline at end of file diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index cca6e1fc1f..8cb8221e61 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -1647,7 +1647,8 @@ INSERT INTO `cloud`.`configuration`(category, instance, component, name, value, CREATE TABLE `cloud`.`op_vpc_distributed_router_sequence_no` ( `id` bigint unsigned UNIQUE NOT NULL AUTO_INCREMENT COMMENT 'id', `vpc_id` bigint unsigned NOT NULL COMMENT 'vpc id.', - `sequence_no` bigint unsigned COMMENT 'seq number to be sent to agent, uniquely identifies topology or routing policy updates', + `topology_update_sequence_no` bigint unsigned COMMENT 'sequence number to be sent to hypervisor, uniquely identifies a VPC topology update', + `routing_policy__update_sequence_no` bigint unsigned COMMENT 'sequence number to be sent to hypervisor, uniquely identifies a routing policy update', PRIMARY KEY (`id`), UNIQUE `u_op_vpc_distributed_router_sequence_no_vpc_id`(`vpc_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; From 17810b0e95ce6418b6809ab5d3dd436659120721 Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Thu, 8 May 2014 14:46:33 +0530 Subject: [PATCH 405/683] CLOUDSTACK-6544: [Automation] Failed to create template for ROOT volume in Xen, with Exception: callHostPlugin failed --- scripts/vm/hypervisor/xenserver/xenserver62/patch | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/vm/hypervisor/xenserver/xenserver62/patch b/scripts/vm/hypervisor/xenserver/xenserver62/patch index 13f4f939c5..03cdfadbb2 100644 --- a/scripts/vm/hypervisor/xenserver/xenserver62/patch +++ b/scripts/vm/hypervisor/xenserver/xenserver62/patch @@ -28,6 +28,7 @@ # If [source path] does not start with '/' or '~', then it is relative path to the location of the patch file. vmops=..,0755,/etc/xapi.d/plugins vmopspremium=..,0755,/etc/xapi.d/plugins +vmopsSnapshot=..,0755,/etc/xapi.d/plugins xen-ovs-vif-flows.rules=..,0644,/etc/udev/rules.d ovs-vif-flows.py=..,0755,/etc/xapi.d/plugins cloudstack_plugins.conf=..,0644,/etc/xensource From 7734ece8f1455c6ad39546b4f204257223036716 Mon Sep 17 00:00:00 2001 From: santhosh Date: Thu, 8 May 2014 16:30:33 +1000 Subject: [PATCH 406/683] Fixed few issues for userapiclient and port issue Signed-off-by: santhosh Signed-off-by: Koushik Das --- tools/marvin/marvin/cloudstackTestClient.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py index bc49530d43..72ce7d34d1 100644 --- a/tools/marvin/marvin/cloudstackTestClient.py +++ b/tools/marvin/marvin/cloudstackTestClient.py @@ -125,7 +125,8 @@ def __createApiClient(self): ''' Step1 : Create a CS Connection Object ''' - self.__csConnection = CSConnection(self.__mgmtDetails, + mgmt_details = self.__mgmtDetails + self.__csConnection = CSConnection(mgmt_details, self.__asyncTimeOut, self.__logger) @@ -138,7 +139,7 @@ def __createApiClient(self): Step3: If API Key is not provided as part of Management Details, then verify and register ''' - if self.__mgmtDetails.apiKey is None: + if mgmt_details.apiKey is None: list_user = listUsers.listUsersCmd() list_user.account = "admin" list_user_res = self.__apiClient.listUsers(list_user) @@ -153,7 +154,6 @@ def __createApiClient(self): if api_key is None: ret = self.__getKeys(user_id) if ret != FAILED: - mgmt_details = self.__mgmtDetails mgmt_details.apiKey = ret[0] mgmt_details.securityKey = ret[1] else: @@ -310,7 +310,7 @@ def __createUserApiClient(self, UserName, DomainName, acctType=0): try: if not self.isAdminContext(): return self.__apiClient - + mgmt_details = self.__mgmtDetails listDomain = listDomains.listDomainsCmd() listDomain.listall = True listDomain.name = DomainName @@ -354,21 +354,20 @@ def __createUserApiClient(self, UserName, DomainName, acctType=0): if apiKey is None: ret = self.__getKeys(userId) if ret != FAILED: - mgtDetails = self.__mgmtDetails - mgtDetails.apiKey = ret[0] - mgtDetails.securityKey = ret[1] + mgmt_details.apiKey = ret[0] + mgmt_details.securityKey = ret[1] else: self.__logger.error("__createUserApiClient: " "User API Client Creation." " While Registering User Failed") return FAILED else: - mgtDetails = self.__mgmtDetails - mgtDetails.apiKey = apiKey - mgtDetails.securityKey = securityKey + mgmt_details.port = 8080 + mgmt_details.apiKey = apiKey + mgmt_details.securityKey = securityKey newUserConnection =\ - CSConnection(mgtDetails, + CSConnection(mgmt_details, self.__csConnection.asyncTimeout, self.__csConnection.logger) self.__userApiClient = CloudStackAPIClient(newUserConnection) From f784f274be8aec7c8d07bcb4b569df1c6c3380af Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Thu, 8 May 2014 16:05:38 +0530 Subject: [PATCH 407/683] CLOUDSTACK-6551: [Automation] Failed to revert vm snapshot in xen --- .../com/cloud/hypervisor/xen/resource/Xenserver625Resource.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java index d290194aa7..258540f417 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/Xenserver625Resource.java @@ -148,7 +148,7 @@ protected String revertToSnapshot(Connection conn, VM vmSnapshot, String vmName, String oldVmUuid, Boolean snapshotMemory, String hostUUID) throws Types.XenAPIException, XmlRpcException { - String results = callHostPluginAsync(conn, "cloud-plugin-storage", + String results = callHostPluginAsync(conn, "vmopsSnapshot", "revert_memory_snapshot", 10 * 60 * 1000, "snapshotUUID", vmSnapshot.getUuid(conn), "vmName", vmName, "oldVmUuid", oldVmUuid, "snapshotMemory", snapshotMemory.toString(), "hostUUID", hostUUID); From b9bdaf9d31803cd080475e27da56695c3293c4ca Mon Sep 17 00:00:00 2001 From: Min Chen Date: Thu, 8 May 2014 15:19:23 -0700 Subject: [PATCH 408/683] CLOUDSTACK-6598:IAM - listAccount() retrurns "Caller cannot be passed as NULL to IAM!" when domain deletion is in progress. --- .../ResourceLimitManagerImpl.java | 6 ++++ .../com/cloud/user/AccountManagerImpl.java | 31 +++++++++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java b/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java index 2b5d976587..0c0c588d96 100755 --- a/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java +++ b/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java @@ -325,6 +325,9 @@ public long findCorrectResourceLimitForAccount(long accountId, Long limit, Resou } Account account = _accountDao.findById(accountId); + if (account == null) { + return max; + } // Check if limit is configured for account if (limit != null) { @@ -633,6 +636,9 @@ public ResourceLimitVO updateResourceLimit(Long accountId, Long domainId, Intege if (accountId != null) { Account account = _entityMgr.findById(Account.class, accountId); + if (account == null) { + throw new InvalidParameterValueException("Unable to find account " + accountId); + } if (account.getId() == Account.ACCOUNT_ID_SYSTEM) { throw new InvalidParameterValueException("Can't update system account"); } diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java index 22be83c80e..3ff9bd2daa 100755 --- a/server/src/com/cloud/user/AccountManagerImpl.java +++ b/server/src/com/cloud/user/AccountManagerImpl.java @@ -363,6 +363,9 @@ public AccountVO getSystemAccount() { public boolean isAdmin(Long accountId) { if (accountId != null) { AccountVO acct = _accountDao.findById(accountId); + if (acct == null) { + return false; //account is deleted or does not exist + } if ((isRootAdmin(accountId)) || (isDomainAdmin(accountId)) || (isResourceDomainAdmin(accountId))) { return true; } else if (acct.getType() == Account.ACCOUNT_TYPE_READ_ONLY_ADMIN) { @@ -377,6 +380,9 @@ public boolean isAdmin(Long accountId) { public boolean isRootAdmin(Long accountId) { if (accountId != null) { AccountVO acct = _accountDao.findById(accountId); + if (acct == null) { + return false; //account is deleted or does not exist + } for (SecurityChecker checker : _securityCheckers) { try { if (checker.checkAccess(acct, null, null, "SystemCapability")) { @@ -397,6 +403,9 @@ public boolean isRootAdmin(Long accountId) { public boolean isDomainAdmin(Long accountId) { if (accountId != null) { AccountVO acct = _accountDao.findById(accountId); + if (acct == null) { + return false; //account is deleted or does not exist + } for (SecurityChecker checker : _securityCheckers) { try { if (checker.checkAccess(acct, null, null, "DomainCapability")) { @@ -425,6 +434,9 @@ public boolean isNormalUser(long accountId) { public boolean isResourceDomainAdmin(Long accountId) { if (accountId != null) { AccountVO acct = _accountDao.findById(accountId); + if (acct == null) { + return false; //account is deleted or does not exist + } for (SecurityChecker checker : _securityCheckers) { try { if (checker.checkAccess(acct, null, null, "DomainResourceCapability")) { @@ -443,6 +455,9 @@ public boolean isResourceDomainAdmin(Long accountId) { public boolean isInternalAccount(long accountId) { Account account = _accountDao.findById(accountId); + if (account == null) { + return false; //account is deleted or does not exist + } if (isRootAdmin(accountId) || (account.getType() == Account.ACCOUNT_ID_SYSTEM)) { return true; } @@ -1138,6 +1153,9 @@ public UserAccount updateUser(UpdateUserCmd cmd) { // If the account is an admin type, return an error. We do not allow this Account account = _accountDao.findById(user.getAccountId()); + if (account == null) { + throw new InvalidParameterValueException("unable to find user account " + user.getAccountId()); + } // don't allow updating project account if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) { @@ -1145,7 +1163,7 @@ public UserAccount updateUser(UpdateUserCmd cmd) { } // don't allow updating system account - if (account != null && (account.getId() == Account.ACCOUNT_ID_SYSTEM)) { + if (account.getId() == Account.ACCOUNT_ID_SYSTEM) { throw new PermissionDeniedException("user id : " + id + " is system account, update is not allowed"); } @@ -1252,6 +1270,9 @@ public UserAccount disableUser(long userId) { } Account account = _accountDao.findById(user.getAccountId()); + if (account == null) { + throw new InvalidParameterValueException("unable to find user account " + user.getAccountId()); + } // don't allow disabling user belonging to project's account if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) { @@ -1291,6 +1312,9 @@ public UserAccount enableUser(final long userId) { } Account account = _accountDao.findById(user.getAccountId()); + if (account == null) { + throw new InvalidParameterValueException("unable to find user account " + user.getAccountId()); + } if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) { throw new InvalidParameterValueException("Unable to find active user by id " + userId); @@ -1339,6 +1363,9 @@ public UserAccount lockUser(long userId) { } Account account = _accountDao.findById(user.getAccountId()); + if (account == null) { + throw new InvalidParameterValueException("unable to find user account " + user.getAccountId()); + } // don't allow to lock user of the account of type Project if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) { @@ -1404,7 +1431,7 @@ boolean deleteUserAccount(long accountId) { // If the user is a System user, return an error. We do not allow this AccountVO account = _accountDao.findById(accountId); - if (account.getRemoved() != null) { + if (account == null || account.getRemoved() != null) { s_logger.info("The account:" + account.getAccountName() + " is already removed"); return true; } From da0545ff869682181cf3a6d54d9459d70fe8e93d Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Thu, 8 May 2014 15:36:25 -0700 Subject: [PATCH 409/683] CLOUDSTACK-6530: Make Network and Volume implement Displayable interface. Iterate over all first class entities in the context to decide the display property for event display. --- api/src/com/cloud/network/Network.java | 6 ++- api/src/com/cloud/network/NetworkProfile.java | 5 +++ .../com/cloud/network/rules/FirewallRule.java | 4 +- api/src/com/cloud/storage/Volume.java | 6 ++- .../apache/cloudstack/api/BaseAsyncCmd.java | 24 ----------- .../org/apache/cloudstack/api/BaseCmd.java | 40 ++++++++++++++++++- .../user/network/CreateNetworkCmd.java | 8 ++++ .../api/command/user/vm/UpdateVMCmd.java | 10 ----- .../api/command/user/vm/UpgradeVMCmd.java | 5 --- .../command/user/volume/CreateVolumeCmd.java | 8 ++++ .../command/user/volume/DeleteVolumeCmd.java | 5 --- .../src/com/cloud/network/dao/NetworkVO.java | 5 +++ .../src/com/cloud/storage/VolumeVO.java | 9 +++++ .../storage/volume/VolumeObject.java | 5 +++ 14 files changed, 92 insertions(+), 48 deletions(-) diff --git a/api/src/com/cloud/network/Network.java b/api/src/com/cloud/network/Network.java index ef3bcdf51c..885bffef98 100644 --- a/api/src/com/cloud/network/Network.java +++ b/api/src/com/cloud/network/Network.java @@ -22,6 +22,7 @@ import java.util.List; import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.Displayable; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; @@ -34,7 +35,7 @@ /** * owned by an account. */ -public interface Network extends ControlledEntity, StateObject, InternalIdentity, Identity, Serializable { +public interface Network extends ControlledEntity, StateObject, InternalIdentity, Identity, Serializable, Displayable { public enum GuestType { Shared, Isolated @@ -327,8 +328,11 @@ public void setIp6Address(String ip6Address) { boolean getSpecifyIpRanges(); + @Deprecated boolean getDisplayNetwork(); + boolean isDisplay(); + String getGuruName(); /** diff --git a/api/src/com/cloud/network/NetworkProfile.java b/api/src/com/cloud/network/NetworkProfile.java index db3cba56e1..1b806d56de 100644 --- a/api/src/com/cloud/network/NetworkProfile.java +++ b/api/src/com/cloud/network/NetworkProfile.java @@ -248,6 +248,11 @@ public boolean getDisplayNetwork() { return displayNetwork; } + @Override + public boolean isDisplay(){ + return displayNetwork; + } + @Override public Long getVpcId() { return vpcId; diff --git a/api/src/com/cloud/network/rules/FirewallRule.java b/api/src/com/cloud/network/rules/FirewallRule.java index b02257b7c8..4346e2f665 100644 --- a/api/src/com/cloud/network/rules/FirewallRule.java +++ b/api/src/com/cloud/network/rules/FirewallRule.java @@ -19,10 +19,11 @@ import java.util.List; import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.Displayable; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; -public interface FirewallRule extends ControlledEntity, Identity, InternalIdentity { +public interface FirewallRule extends ControlledEntity, Identity, InternalIdentity, Displayable { enum Purpose { Firewall, PortForwarding, LoadBalancing, Vpn, StaticNat, NetworkACL, } @@ -87,6 +88,7 @@ enum TrafficType { */ TrafficType getTrafficType(); + @Override boolean isDisplay(); } diff --git a/api/src/com/cloud/storage/Volume.java b/api/src/com/cloud/storage/Volume.java index 304dbcfe34..a78049b5c9 100755 --- a/api/src/com/cloud/storage/Volume.java +++ b/api/src/com/cloud/storage/Volume.java @@ -19,6 +19,7 @@ import java.util.Date; import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.Displayable; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; @@ -26,7 +27,7 @@ import com.cloud.utils.fsm.StateMachine2; import com.cloud.utils.fsm.StateObject; -public interface Volume extends ControlledEntity, Identity, InternalIdentity, BasedOn, StateObject { +public interface Volume extends ControlledEntity, Identity, InternalIdentity, BasedOn, StateObject, Displayable { enum Type { UNKNOWN, ROOT, SWAP, DATADISK, ISO }; @@ -191,5 +192,8 @@ enum Event { Integer getHypervisorSnapshotReserve(); + @Deprecated boolean isDisplayVolume(); + + boolean isDisplay(); } diff --git a/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java b/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java index 82886aa1b4..6b83d39dc9 100644 --- a/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java +++ b/api/src/org/apache/cloudstack/api/BaseAsyncCmd.java @@ -17,8 +17,6 @@ package org.apache.cloudstack.api; -import com.cloud.event.EventTypes; -import org.apache.cloudstack.context.CallContext; import org.apache.log4j.Logger; /** @@ -95,26 +93,4 @@ public Object getJob() { return job; } - @Override - public boolean isDisplay(){ - - // Get entity Class from the event name. Eg. - Volume.class - final CallContext ctx = CallContext.current(); - Class entityClass = EventTypes.getEntityClassForEvent(getEventType()); - boolean isDisplay = true; - - try{ - // If the entity Class implements Displayable interface then see the flag from VO - if (entityClass != null && Displayable.class.isAssignableFrom(entityClass)){ - Object objVO =_entityMgr.findById(entityClass, (Long)ctx.getContextParameter(entityClass.getName())); - isDisplay = ((Displayable)objVO).isDisplay(); - ctx.setEventDisplayEnabled(isDisplay); - } - }catch (Exception e){ - s_logger.trace("Caught exception while finding the display property, defaulting to true and moving on " +e); - } - - return isDisplay; - } - } diff --git a/api/src/org/apache/cloudstack/api/BaseCmd.java b/api/src/org/apache/cloudstack/api/BaseCmd.java index 6a4b4a8f3a..ed7e983981 100644 --- a/api/src/org/apache/cloudstack/api/BaseCmd.java +++ b/api/src/org/apache/cloudstack/api/BaseCmd.java @@ -361,6 +361,44 @@ public void validateSpecificParameters(final Map params){ * @return display flag */ public boolean isDisplay(){ - return true; + CallContext context = CallContext.current(); + Map contextMap = context.getContextParameters(); + boolean isDisplay = true; + + // Iterate over all the first class entities in context and check their display property. + for(Map.Entry entry : contextMap.entrySet()){ + try{ + Object key = entry.getKey(); + Class clz = Class.forName((String)key); + if(Displayable.class.isAssignableFrom(clz)){ + final Object objVO = _entityMgr.findById(clz, getInternalId(entry.getValue())); + isDisplay = ((Displayable) objVO).isDisplay(); + } + + // If the flag is false break immediately + if(!isDisplay) + break; + } catch (Exception e){ + s_logger.trace("Caught exception while checking first class entities for display property, continuing on", e); + } + } + + context.setEventDisplayEnabled(isDisplay); + return isDisplay; + } + + private static Long getInternalId(Object internalIdObj){ + Long internalId = null; + + // In case its an async job the value would be a string because of json deserialization + if(internalIdObj instanceof String){ + internalId = Long.valueOf((String) internalIdObj); + }else if (internalIdObj instanceof Long){ + internalId = (Long) internalIdObj; + } + + return internalId; + } + } diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java index 43c3d1b09e..40bf5875f5 100644 --- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkCmd.java @@ -212,6 +212,14 @@ public Boolean getDisplayNetwork() { return displayNetwork; } + @Override + public boolean isDisplay() { + if(displayNetwork == null) + return true; + else + return displayNetwork; + } + public Long getZoneId() { Long physicalNetworkId = getPhysicalNetworkId(); diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java index b437305134..7938c56671 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpdateVMCmd.java @@ -150,16 +150,6 @@ public long getEntityOwnerId() { return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked } - @Override - public boolean isDisplay(){ - UserVm userVm = _entityMgr.findById(UserVm.class, getId()); - if (userVm != null) { - return userVm.isDisplayVm(); - } - - return true; // no info means true - } - @Override public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException { CallContext.current().setEventDetails("Vm Id: " + getId()); diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java index dec924358a..b10555556b 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/UpgradeVMCmd.java @@ -117,11 +117,6 @@ public long getEntityOwnerId() { return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked } - @Override - public boolean isDisplay(){ - return _userVmService.isDisplayResourceEnabled(getId()); - } - @Override public void execute() throws ResourceAllocationException { CallContext.current().setEventDetails("Vm Id: " + getId()); diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java index 90c1a165ab..dc912610b4 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java @@ -161,6 +161,14 @@ public Boolean getDisplayVolume() { return displayVolume; } + @Override + public boolean isDisplay() { + if(displayVolume == null) + return true; + else + return displayVolume; + } + public Long getVirtualMachineId() { return virtualMachineId; } diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java index 3e267b94e1..0b0c1b7303 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/DeleteVolumeCmd.java @@ -79,11 +79,6 @@ public long getEntityOwnerId() { return Account.ACCOUNT_ID_SYSTEM; // no account info given, parent this command to SYSTEM so ERROR events are tracked } - @Override - public boolean isDisplay(){ - return _volumeService.isDisplayResourceEnabled(getId()); - } - @Override public void execute() throws ConcurrentOperationException { CallContext.current().setEventDetails("Volume Id: " + getId()); diff --git a/engine/schema/src/com/cloud/network/dao/NetworkVO.java b/engine/schema/src/com/cloud/network/dao/NetworkVO.java index 6bb3902394..6883a3b185 100644 --- a/engine/schema/src/com/cloud/network/dao/NetworkVO.java +++ b/engine/schema/src/com/cloud/network/dao/NetworkVO.java @@ -577,6 +577,11 @@ public void setDisplayNetwork(boolean displayNetwork) { this.displayNetwork = displayNetwork; } + @Override + public boolean isDisplay(){ + return displayNetwork; + } + @Override public void setNetworkACLId(Long networkACLId) { this.networkACLId = networkACLId; diff --git a/engine/schema/src/com/cloud/storage/VolumeVO.java b/engine/schema/src/com/cloud/storage/VolumeVO.java index 9f27c231f0..50b235e6c9 100755 --- a/engine/schema/src/com/cloud/storage/VolumeVO.java +++ b/engine/schema/src/com/cloud/storage/VolumeVO.java @@ -552,6 +552,15 @@ public boolean isDisplayVolume() { return displayVolume; } + @Override + public boolean isDisplay(){ + return displayVolume; + } + + public void setDisplay(boolean display){ + this.displayVolume = display; + } + public void setDisplayVolume(boolean displayVolume) { this.displayVolume = displayVolume; } diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java index 385f8e63e9..0e7d5cc368 100644 --- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java +++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java @@ -167,6 +167,11 @@ public boolean isDisplayVolume() { return volumeVO.isDisplayVolume(); } + @Override + public boolean isDisplay() { + return volumeVO.isDisplay(); + } + public long getVolumeId() { return volumeVO.getId(); } From 3187411f9f6d61d50aa73614f991c4866f5f0375 Mon Sep 17 00:00:00 2001 From: ynojima Date: Thu, 8 May 2014 16:48:18 -0600 Subject: [PATCH 410/683] CLOUDSTACK-6614 bugfix: systemvm template build failed because of src iso link is broken --- tools/appliance/definitions/systemvm64template/definition.rb | 2 +- tools/appliance/definitions/systemvmtemplate/definition.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/appliance/definitions/systemvm64template/definition.rb b/tools/appliance/definitions/systemvm64template/definition.rb index bea2fdebbe..f9308a0558 100644 --- a/tools/appliance/definitions/systemvm64template/definition.rb +++ b/tools/appliance/definitions/systemvm64template/definition.rb @@ -4,7 +4,7 @@ :disk_size => '2500', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian_64', :iso_file => "debian-7.4.0-amd64-netinst.iso", - :iso_src => "http://ftp.acc.umu.se/mirror/cdimage/release/7.4.0/amd64/iso-cd/debian-7.4.0-amd64-netinst.iso", + :iso_src => "http://cdimage.debian.org/mirror/cdimage/archive/7.4.0/amd64/iso-cd/debian-7.4.0-amd64-netinst.iso", :iso_md5 => "e7e9433973f082a297793c3c5010b2c5", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ diff --git a/tools/appliance/definitions/systemvmtemplate/definition.rb b/tools/appliance/definitions/systemvmtemplate/definition.rb index c8b24d6268..fcaab4d0c3 100644 --- a/tools/appliance/definitions/systemvmtemplate/definition.rb +++ b/tools/appliance/definitions/systemvmtemplate/definition.rb @@ -4,7 +4,7 @@ :disk_size => '2500', :disk_format => 'VDI', :hostiocache => 'off', :os_type_id => 'Debian', :iso_file => "debian-7.4.0-i386-netinst.iso", - :iso_src => "http://ftp.acc.umu.se/mirror/cdimage/release/7.4.0/i386/iso-cd/debian-7.4.0-i386-netinst.iso", + :iso_src => "http://cdimage.debian.org/mirror/cdimage/archive/7.4.0/i386/iso-cd/debian-7.4.0-i386-netinst.iso", :iso_md5 => "7339b668a81b417ac023d73739dc6a03", :iso_download_timeout => "1000", :boot_wait => "10", :boot_cmd_sequence => [ From e8e0449ed4eaa489d53b43c0137833a660b6d6cf Mon Sep 17 00:00:00 2001 From: Min Chen Date: Thu, 8 May 2014 23:08:32 -0700 Subject: [PATCH 411/683] CLOUDSTACK-6613:IAM: authorizeSecurityGroupIngress fails when SG Name is passed. --- .../AuthorizeSecurityGroupEgressCmd.java | 3 +- .../AuthorizeSecurityGroupIngressCmd.java | 3 +- server/src/com/cloud/api/ApiServer.java | 52 +++++++++++-------- .../api/dispatch/ParamProcessWorker.java | 3 +- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java index aef0a7c738..9909bf3085 100644 --- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupEgressCmd.java @@ -95,7 +95,8 @@ public class AuthorizeSecurityGroupEgressCmd extends BaseAsyncCmd { @Parameter(name=ApiConstants.SECURITY_GROUP_ID, type=CommandType.UUID, description="The ID of the security group. Mutually exclusive with securityGroupName parameter", entityType=SecurityGroupResponse.class) private Long securityGroupId; - @ACL(accessType = AccessType.OperateEntry) + // This @ACL will not work, since we don't have a way to convert this parameter to the entity like securityGroupId. + //@ACL(accessType = AccessType.OperateEntry) @Parameter(name=ApiConstants.SECURITY_GROUP_NAME, type=CommandType.STRING, description="The name of the security group. Mutually exclusive with securityGroupName parameter") private String securityGroupName; diff --git a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java index 188df6e111..3549d5139d 100644 --- a/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/securitygroup/AuthorizeSecurityGroupIngressCmd.java @@ -95,7 +95,8 @@ public class AuthorizeSecurityGroupIngressCmd extends BaseAsyncCmd { @Parameter(name=ApiConstants.SECURITY_GROUP_ID, type=CommandType.UUID, description="The ID of the security group. Mutually exclusive with securityGroupName parameter", entityType=SecurityGroupResponse.class) private Long securityGroupId; - @ACL(accessType = AccessType.OperateEntry) + // This @ACL will not work, since we don't have a way to convert this parameter to the entity like securityGroupId. + //@ACL(accessType = AccessType.OperateEntry) @Parameter(name=ApiConstants.SECURITY_GROUP_NAME, type=CommandType.STRING, description="The name of the security group. Mutually exclusive with securityGroupName parameter") private String securityGroupName; diff --git a/server/src/com/cloud/api/ApiServer.java b/server/src/com/cloud/api/ApiServer.java index a99d6836d8..18eb4d96f3 100755 --- a/server/src/com/cloud/api/ApiServer.java +++ b/server/src/com/cloud/api/ApiServer.java @@ -96,10 +96,14 @@ import org.apache.cloudstack.api.ResponseObject; import org.apache.cloudstack.api.ResponseObject.ResponseView; import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.command.admin.account.ListAccountsCmdByAdmin; import org.apache.cloudstack.api.command.admin.host.ListHostsCmd; import org.apache.cloudstack.api.command.admin.router.ListRoutersCmd; import org.apache.cloudstack.api.command.admin.storage.ListStoragePoolsCmd; import org.apache.cloudstack.api.command.admin.user.ListUsersCmd; +import org.apache.cloudstack.api.command.admin.vm.ListVMsCmdByAdmin; +import org.apache.cloudstack.api.command.admin.volume.ListVolumesCmdByAdmin; +import org.apache.cloudstack.api.command.admin.zone.ListZonesCmdByAdmin; import org.apache.cloudstack.api.command.user.account.ListAccountsCmd; import org.apache.cloudstack.api.command.user.account.ListProjectAccountsCmd; import org.apache.cloudstack.api.command.user.event.ListEventsCmd; @@ -138,8 +142,8 @@ import com.cloud.domain.DomainVO; import com.cloud.domain.dao.DomainDao; import com.cloud.event.ActionEventUtils; -import com.cloud.event.EventTypes; import com.cloud.event.EventCategory; +import com.cloud.event.EventTypes; import com.cloud.exception.AccountLimitException; import com.cloud.exception.CloudAuthenticationException; import com.cloud.exception.InsufficientCapacityException; @@ -210,7 +214,7 @@ public class ApiServer extends ManagerBase implements HttpRequestHandler, ApiSer private static Map>> s_apiNameCmdClassMap = new HashMap>>(); private static ExecutorService s_executor = new ThreadPoolExecutor(10, 150, 60, TimeUnit.SECONDS, new LinkedBlockingQueue(), new NamedThreadFactory( - "ApiServer")); + "ApiServer")); @Inject MessageBus _messageBus; @@ -442,7 +446,7 @@ public void checkCharacterInkParams(final Map params) { final Matcher matcher = pattern.matcher(value[0]); if (matcher.find()) { throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Received value " + value[0] + " for parameter " + key + - " is invalid, contains illegal ASCII non-printable characters"); + " is invalid, contains illegal ASCII non-printable characters"); } } stringMap.put(key, value[0]); @@ -506,7 +510,7 @@ public String handleRequest(final Map params, final String responseType, final S StringUtils.cleanString(response)); } else - buildAuditTrail(auditTrailSb, command[0], response); + buildAuditTrail(auditTrailSb, command[0], response); } else { if (!command[0].equalsIgnoreCase("login") && !command[0].equalsIgnoreCase("logout")) { final String errorString = "Unknown API command: " + command[0]; @@ -612,7 +616,7 @@ private String queueCommand(final BaseCmd cmdObj, final Map para objectUuid = createCmd.getEntityUuid(); params.put("id", objectId.toString()); Class entityClass = EventTypes.getEntityClassForEvent(createCmd.getEventType()); - if(entityClass != null) + if (entityClass != null) ctx.putContextParameter(entityClass.getName(), objectId); } else { // Extract the uuid before params are processed and id reflects internal db id @@ -628,7 +632,7 @@ private String queueCommand(final BaseCmd cmdObj, final Map para if (caller != null) { params.put("ctxAccountId", String.valueOf(caller.getId())); } - if(objectUuid != null){ + if (objectUuid != null) { params.put("uuid", objectUuid); } @@ -637,14 +641,14 @@ private String queueCommand(final BaseCmd cmdObj, final Map para // Add the resource id in the call context, also add some other first class object ids (for now vm) if available. // TODO - this should be done for all the uuids passed in the cmd - so should be moved where uuid to id conversion happens. - if(EventTypes.getEntityForEvent(asyncCmd.getEventType()) != null){ + if (EventTypes.getEntityForEvent(asyncCmd.getEventType()) != null) { ctx.putContextParameter(EventTypes.getEntityForEvent(asyncCmd.getEventType()), objectUuid); } // save the scheduled event final Long eventId = - ActionEventUtils.onScheduledActionEvent((callerUserId == null) ? User.UID_SYSTEM : callerUserId, asyncCmd.getEntityOwnerId(), asyncCmd.getEventType(), - asyncCmd.getEventDescription(), asyncCmd.isDisplay(), startEventId); + ActionEventUtils.onScheduledActionEvent((callerUserId == null) ? User.UID_SYSTEM : callerUserId, asyncCmd.getEntityOwnerId(), asyncCmd.getEventType(), + asyncCmd.getEventDescription(), asyncCmd.isDisplay(), startEventId); if (startEventId == 0) { // There was no create event before, set current event id as start eventId startEventId = eventId; @@ -681,13 +685,15 @@ private String queueCommand(final BaseCmd cmdObj, final Map para // if the command is of the listXXXCommand, we will need to also return the // the job id and status if possible // For those listXXXCommand which we have already created DB views, this step is not needed since async job is joined in their db views. - if (cmdObj instanceof BaseListCmd && !(cmdObj instanceof ListVMsCmd) && !(cmdObj instanceof ListRoutersCmd) && !(cmdObj instanceof ListSecurityGroupsCmd) && - !(cmdObj instanceof ListTagsCmd) && !(cmdObj instanceof ListEventsCmd) && !(cmdObj instanceof ListVMGroupsCmd) && !(cmdObj instanceof ListProjectsCmd) && - !(cmdObj instanceof ListProjectAccountsCmd) && !(cmdObj instanceof ListProjectInvitationsCmd) && !(cmdObj instanceof ListHostsCmd) && - !(cmdObj instanceof ListVolumesCmd) && !(cmdObj instanceof ListUsersCmd) && !(cmdObj instanceof ListAccountsCmd) && - !(cmdObj instanceof ListStoragePoolsCmd) && !(cmdObj instanceof ListDiskOfferingsCmd) && !(cmdObj instanceof ListServiceOfferingsCmd) && - !(cmdObj instanceof ListZonesCmd)) { - buildAsyncListResponse((BaseListCmd) cmdObj, caller); + if (cmdObj instanceof BaseListCmd && !(cmdObj instanceof ListVMsCmd) && !(cmdObj instanceof ListVMsCmdByAdmin) && !(cmdObj instanceof ListRoutersCmd) + && !(cmdObj instanceof ListSecurityGroupsCmd) && + !(cmdObj instanceof ListTagsCmd) && !(cmdObj instanceof ListEventsCmd) && !(cmdObj instanceof ListVMGroupsCmd) && !(cmdObj instanceof ListProjectsCmd) && + !(cmdObj instanceof ListProjectAccountsCmd) && !(cmdObj instanceof ListProjectInvitationsCmd) && !(cmdObj instanceof ListHostsCmd) && + !(cmdObj instanceof ListVolumesCmd) && !(cmdObj instanceof ListVolumesCmdByAdmin) && !(cmdObj instanceof ListUsersCmd) && !(cmdObj instanceof ListAccountsCmd) + && !(cmdObj instanceof ListAccountsCmdByAdmin) && + !(cmdObj instanceof ListStoragePoolsCmd) && !(cmdObj instanceof ListDiskOfferingsCmd) && !(cmdObj instanceof ListServiceOfferingsCmd) && + !(cmdObj instanceof ListZonesCmd) && !(cmdObj instanceof ListZonesCmdByAdmin)) { + buildAsyncListResponse((BaseListCmd)cmdObj, caller); } SerializationContext.current().setUuidTranslation(true); @@ -861,7 +867,7 @@ public boolean verifyRequest(final Map requestParameters, fina if (user.getState() != Account.State.enabled || !account.getState().equals(Account.State.enabled)) { s_logger.info("disabled or locked user accessing the api, userid = " + user.getId() + "; name = " + user.getUsername() + "; state: " + user.getState() + - "; accountState: " + account.getState()); + "; accountState: " + account.getState()); return false; } @@ -917,7 +923,7 @@ public Long fetchDomainId(final String domainUUID) { @Override public void loginUser(final HttpSession session, final String username, final String password, Long domainId, final String domainPath, final String loginIpAddress, - final Map requestParameters) throws CloudAuthenticationException { + final Map requestParameters) throws CloudAuthenticationException { // We will always use domainId first. If that does not exist, we will use domain name. If THAT doesn't exist // we will default to ROOT if (domainId == null) { @@ -1006,7 +1012,7 @@ public boolean verifyUser(final Long userId) { } if ((user == null) || (user.getRemoved() != null) || !user.getState().equals(Account.State.enabled) || (account == null) || - !account.getState().equals(Account.State.enabled)) { + !account.getState().equals(Account.State.enabled)) { s_logger.warn("Deleted/Disabled/Locked user with id=" + userId + " attempting to access public API"); return false; } @@ -1102,10 +1108,10 @@ public ListenerThread(final ApiServer requestHandler, final int port) { _params = new BasicHttpParams(); _params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 30000) - .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024) - .setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false) - .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true) - .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "HttpComponents/1.1"); + .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024) + .setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK, false) + .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true) + .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "HttpComponents/1.1"); // Set up the HTTP protocol processor final BasicHttpProcessor httpproc = new BasicHttpProcessor(); diff --git a/server/src/com/cloud/api/dispatch/ParamProcessWorker.java b/server/src/com/cloud/api/dispatch/ParamProcessWorker.java index d862660641..ba5bebff64 100644 --- a/server/src/com/cloud/api/dispatch/ParamProcessWorker.java +++ b/server/src/com/cloud/api/dispatch/ParamProcessWorker.java @@ -155,7 +155,8 @@ public void processParameters(final BaseCmd cmd, final Map params) { // for maps, specify access to be checkd on key or value. // Find the controlled entity DBid by uuid - if (parameterAnnotation.entityType() != null) { + if (parameterAnnotation.entityType() != null && parameterAnnotation.entityType().length > 0 + && parameterAnnotation.entityType()[0].getAnnotation(EntityReference.class) != null) { final Class[] entityList = parameterAnnotation.entityType()[0].getAnnotation(EntityReference.class).value(); // Check if the parameter type is a single From 704f6d8279c314a165199804ee43eaac4b0d482a Mon Sep 17 00:00:00 2001 From: Anshul Gangwar Date: Fri, 9 May 2014 14:32:36 +0530 Subject: [PATCH 412/683] CLOUDSTACK-6399: When there are no vms running on hyperv host, then agent was returning null. In that case cloudstack was not doing anything and not updating the state of the vms to stopped. Now the agent returns empty list of hostvmstatereport. Management server will then update the vm state to stopped (instead of not acting upon the return state). --- .../resource/HypervDirectConnectResource.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java index 7888e43896..1816bafa68 100644 --- a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java +++ b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java @@ -90,10 +90,10 @@ import com.cloud.agent.api.StartCommand; import com.cloud.agent.api.StartupCommand; import com.cloud.agent.api.StartupRoutingCommand; -import com.cloud.agent.api.UnPlugNicAnswer; -import com.cloud.agent.api.UnPlugNicCommand; import com.cloud.agent.api.StartupRoutingCommand.VmState; import com.cloud.agent.api.StartupStorageCommand; +import com.cloud.agent.api.UnPlugNicAnswer; +import com.cloud.agent.api.UnPlugNicCommand; import com.cloud.agent.api.UnsupportedAnswer; import com.cloud.agent.api.check.CheckSshAnswer; import com.cloud.agent.api.check.CheckSshCommand; @@ -355,8 +355,12 @@ public final ArrayList> requestHostVmStateReport() { } s_logger.debug("HostVmStateReportCommand received response " + s_gson.toJson(result)); - if (!result.isEmpty()) { - return result; + if (result != null) { + if (!result.isEmpty()) { + return result; + } else { + return new ArrayList>(); + } } return null; } @@ -364,7 +368,7 @@ public final ArrayList> requestHostVmStateReport() { protected HashMap getHostVmStateReport() { final HashMap vmStates = new HashMap(); ArrayList> vmList = requestHostVmStateReport(); - if (vmList == null || vmList.isEmpty()) { + if (vmList == null) { return null; } From 4106aa07214209631ab9e6223c7efe4580ac30bf Mon Sep 17 00:00:00 2001 From: Anshul Gangwar Date: Fri, 9 May 2014 14:49:32 +0530 Subject: [PATCH 413/683] CLOUDSTACK-6620: Fixed null pointer exception in hyperv agent in getting vmstats, when all vms are deleted from outside --- .../hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs index 7dbb8c14fa..372f848868 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs @@ -2685,6 +2685,10 @@ public KvpExchangeComponentSettingData GetKvpSettings(VirtualSystemSettingData v public void GetSummaryInfo(Dictionary vmProcessorInfo, List vmsToInspect) { + if (vmsToInspect == null || vmsToInspect.Count == 0) + { + return; + } // Process info available from WMI, // See http://msdn.microsoft.com/en-us/library/hh850062(v=vs.85).aspx uint[] requestedInfo = new uint[] { // TODO: correct? From 98df3e55b93df9f30b5767b20c0a4a6f1336406a Mon Sep 17 00:00:00 2001 From: Devdeep Singh Date: Fri, 9 May 2014 15:54:56 +0530 Subject: [PATCH 414/683] CLOUDSTACK-6622: After a volume was live migrated, the destination smb storage path was added to the folder column. For an smb share the smb credentials are in the query string of the path. Before adding the path, smb shares query string should be cleaned up. --- .../storage/motion/AncientDataMotionStrategy.java | 9 ++++++++- .../storage/motion/HypervStorageMotionStrategy.java | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java index fbdacfa5aa..415a0772df 100644 --- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java +++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java @@ -63,6 +63,7 @@ import com.cloud.storage.DataStoreRole; import com.cloud.storage.StoragePool; import com.cloud.storage.VolumeVO; +import com.cloud.storage.Storage.StoragePoolType; import com.cloud.storage.dao.VolumeDao; import com.cloud.utils.NumbersUtil; import com.cloud.utils.db.DB; @@ -389,10 +390,16 @@ protected Answer migrateVolumeToPool(DataObject srcData, DataObject destData) { VolumeVO volumeVo = volDao.findById(volume.getId()); Long oldPoolId = volume.getPoolId(); volumeVo.setPath(((MigrateVolumeAnswer)answer).getVolumePath()); - volumeVo.setFolder(destPool.getPath()); volumeVo.setPodId(destPool.getPodId()); volumeVo.setPoolId(destPool.getId()); volumeVo.setLastPoolId(oldPoolId); + // For SMB, pool credentials are also stored in the uri query string. We trim the query string + // part here to make sure the credentials do not get stored in the db unencrypted. + String folder = destPool.getPath(); + if (destPool.getPoolType() == StoragePoolType.SMB && folder != null && folder.contains("?")) { + folder = folder.substring(0, folder.indexOf("?")); + } + volumeVo.setFolder(folder); volDao.update(volume.getId(), volumeVo); } diff --git a/plugins/hypervisors/hyperv/src/org/apache/cloudstack/storage/motion/HypervStorageMotionStrategy.java b/plugins/hypervisors/hyperv/src/org/apache/cloudstack/storage/motion/HypervStorageMotionStrategy.java index 011bd1292c..8a1c414fb4 100644 --- a/plugins/hypervisors/hyperv/src/org/apache/cloudstack/storage/motion/HypervStorageMotionStrategy.java +++ b/plugins/hypervisors/hyperv/src/org/apache/cloudstack/storage/motion/HypervStorageMotionStrategy.java @@ -50,6 +50,7 @@ import com.cloud.hypervisor.Hypervisor.HypervisorType; import com.cloud.storage.StoragePool; import com.cloud.storage.VolumeVO; +import com.cloud.storage.Storage.StoragePoolType; import com.cloud.storage.dao.VolumeDao; import com.cloud.utils.Pair; import com.cloud.utils.exception.CloudRuntimeException; @@ -161,10 +162,17 @@ private void updateVolumePathsAfterMigration(Map volumeTo VolumeVO volumeVO = volDao.findById(volume.getId()); Long oldPoolId = volumeVO.getPoolId(); volumeVO.setPath(volumeTo.getPath()); - volumeVO.setFolder(pool.getPath()); volumeVO.setPodId(pool.getPodId()); volumeVO.setPoolId(pool.getId()); volumeVO.setLastPoolId(oldPoolId); + // For SMB, pool credentials are also stored in the uri query string. We trim the query string + // part here to make sure the credentials do not get stored in the db unencrypted. + String folder = pool.getPath(); + if (pool.getPoolType() == StoragePoolType.SMB && folder != null && folder.contains("?")) { + folder = folder.substring(0, folder.indexOf("?")); + } + volumeVO.setFolder(folder); + volDao.update(volume.getId(), volumeVO); updated = true; break; From cc0ed93a135e3ff0409b690fa484c4c98afff23e Mon Sep 17 00:00:00 2001 From: Girish Shilamkar Date: Fri, 9 May 2014 00:35:13 -0400 Subject: [PATCH 415/683] Fixed test_pvlan.py to get correct zone id --- test/integration/smoke/test_pvlan.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/integration/smoke/test_pvlan.py b/test/integration/smoke/test_pvlan.py index b4353678e4..a1c146b09a 100644 --- a/test/integration/smoke/test_pvlan.py +++ b/test/integration/smoke/test_pvlan.py @@ -38,8 +38,12 @@ class TestPVLAN(cloudstackTestCase): vlan = 1234 isolatedpvlan = 567 - def setUp(self): - self.apiClient = self.testClient.getApiClient() + @classmethod + def setUpClass(cls): + cls.testClient = super(TestPVLAN, cls).getClsTestClient() + cls.apiClient = cls.testClient.getApiClient() + cls.zone = get_zone(cls.apiClient, cls.testClient.getZoneForTests()) + cls.zoneId = cls.zone.id @attr(tags = ["advanced", "selfservice"]) def test_create_pvlan_network(self): From 550493cec318a7ab2c0d5376183263ef2efba58e Mon Sep 17 00:00:00 2001 From: santhosh Date: Thu, 8 May 2014 20:21:09 +1000 Subject: [PATCH 416/683] Added fix for CLOUDSTACK-6548 Signed-off-by: santhosh Signed-off-by: Daan Hoogland --- server/src/com/cloud/network/NetworkServiceImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java index d8ce98e105..ec9fa12b14 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -3968,12 +3968,16 @@ public Network doInTransaction(TransactionStatus status) throws ResourceAllocati DataCenterVO dc = _dcDao.lockRow(pNtwk.getDataCenterId(), true); //check if we need to create guest network - Network privateNetwork = _networksDao.getPrivateNetwork(uriString, cidr, networkOwnerId, pNtwk.getDataCenterId(), networkOfferingId); + Network privateNetwork = _networksDao.getPrivateNetwork(uriString, cidr, networkOwnerId, pNtwk.getDataCenterId(), networkOfferingId); if (privateNetwork == null) { //create Guest network - privateNetwork = _networkMgr.createGuestNetwork(ntwkOffFinal.getId(), networkName, displayText, gateway, cidr, uriString, null, owner, null, pNtwk, + privateNetwork = _networkMgr.createGuestNetwork(ntwkOffFinal.getId(), networkName, displayText, gateway, cidr, uriString, null, owner, null, pNtwk, pNtwk.getDataCenterId(), ACLType.Account, null, vpcId, null, null, true, null); - s_logger.debug("Created private network " + privateNetwork); + if (privateNetwork != null) { + s_logger.debug("Successfully created guest network " + privateNetwork); + } else { + throw new CloudRuntimeException("Creating guest network failed"); + } } else { s_logger.debug("Private network already exists: " + privateNetwork); //Do not allow multiple private gateways with same Vlan within a VPC From 4f0820b86505e2b07fda62bbdaee66c2bab9d01c Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Fri, 9 May 2014 16:51:34 +0200 Subject: [PATCH 417/683] be able to remove vpc as owning entity of a network --- engine/schema/src/com/cloud/network/dao/NetworkVO.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/schema/src/com/cloud/network/dao/NetworkVO.java b/engine/schema/src/com/cloud/network/dao/NetworkVO.java index 6883a3b185..8c0466fbfa 100644 --- a/engine/schema/src/com/cloud/network/dao/NetworkVO.java +++ b/engine/schema/src/com/cloud/network/dao/NetworkVO.java @@ -605,4 +605,8 @@ public boolean isStrechedL2Network() { public void setStrechedL2Network(boolean strechedL2Network) { this.strechedL2Network = strechedL2Network; } + + public void setVpcId(long vpcId) { + this.vpcId = vpcId; + } } From 0c40adfc4a9620ed29604f7aedbde0e1a077a68f Mon Sep 17 00:00:00 2001 From: Girish Shilamkar Date: Fri, 9 May 2014 22:26:51 +0530 Subject: [PATCH 418/683] While listing Public IP listall should always be true --- tools/marvin/marvin/lib/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py index cd113f8608..03b03b61e3 100644 --- a/tools/marvin/marvin/lib/base.py +++ b/tools/marvin/marvin/lib/base.py @@ -1397,8 +1397,7 @@ def list(cls, apiclient, **kwargs): cmd = listPublicIpAddresses.listPublicIpAddressesCmd() [setattr(cmd, k, v) for k, v in kwargs.items()] - if 'account' in kwargs.keys() and 'domainid' in kwargs.keys(): - cmd.listall=True + cmd.listall=True return(apiclient.listPublicIpAddresses(cmd)) From f2c3114bf829a7e4bb3566a1d766fd403ced8b8c Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Fri, 9 May 2014 10:12:56 -0700 Subject: [PATCH 419/683] CLOUDSTACK-6530: Make more networking entities implement Displayable interface. --- api/src/com/cloud/network/IpAddress.java | 4 +++- api/src/com/cloud/network/RemoteAccessVpn.java | 4 +++- .../com/cloud/network/Site2SiteVpnConnection.java | 4 +++- api/src/com/cloud/network/Site2SiteVpnGateway.java | 4 +++- api/src/com/cloud/network/as/AutoScaleVmGroup.java | 4 +++- api/src/com/cloud/network/as/AutoScaleVmProfile.java | 4 +++- .../com/cloud/network/rules/HealthCheckPolicy.java | 7 +++---- .../com/cloud/network/rules/StickinessPolicy.java | 7 +++---- api/src/com/cloud/network/vpc/NetworkACL.java | 4 +++- api/src/com/cloud/network/vpc/NetworkACLItem.java | 4 +++- .../api/command/user/address/AssociateIPAddrCmd.java | 9 +++++++++ .../user/autoscale/CreateAutoScaleVmGroupCmd.java | 9 +++++++++ .../user/autoscale/CreateAutoScaleVmProfileCmd.java | 9 +++++++++ .../loadbalancer/CreateLBHealthCheckPolicyCmd.java | 9 +++++++++ .../loadbalancer/CreateLBStickinessPolicyCmd.java | 9 +++++++++ .../user/loadbalancer/CreateLoadBalancerRuleCmd.java | 11 ++++++++--- .../command/user/network/CreateNetworkACLCmd.java | 10 ++++++++++ .../user/network/CreateNetworkACLListCmd.java | 11 ++++++++--- .../user/network/UpdateNetworkACLItemCmd.java | 12 +++++++++--- .../command/user/vpn/CreateRemoteAccessVpnCmd.java | 10 +++++++--- .../api/command/user/vpn/CreateVpnConnectionCmd.java | 10 ++++++++++ .../api/command/user/vpn/CreateVpnGatewayCmd.java | 10 ++++++++++ 22 files changed, 137 insertions(+), 28 deletions(-) diff --git a/api/src/com/cloud/network/IpAddress.java b/api/src/com/cloud/network/IpAddress.java index 5aae784279..f831e275c7 100644 --- a/api/src/com/cloud/network/IpAddress.java +++ b/api/src/com/cloud/network/IpAddress.java @@ -19,6 +19,7 @@ import java.util.Date; import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.Displayable; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; @@ -35,7 +36,7 @@ * - DomainId = domain of the account owner. * - Allocated = time it was allocated. */ -public interface IpAddress extends ControlledEntity, Identity, InternalIdentity { +public interface IpAddress extends ControlledEntity, Identity, InternalIdentity, Displayable { enum State { Allocating, // The IP Address is being propagated to other network elements and is not ready for use yet. Allocated, // The IP address is in used. @@ -85,6 +86,7 @@ enum Purpose { Long getNetworkId(); + @Override boolean isDisplay(); } diff --git a/api/src/com/cloud/network/RemoteAccessVpn.java b/api/src/com/cloud/network/RemoteAccessVpn.java index 4d7e4d49b1..25b4fbbcde 100644 --- a/api/src/com/cloud/network/RemoteAccessVpn.java +++ b/api/src/com/cloud/network/RemoteAccessVpn.java @@ -17,10 +17,11 @@ package com.cloud.network; import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.Displayable; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; -public interface RemoteAccessVpn extends ControlledEntity, InternalIdentity, Identity { +public interface RemoteAccessVpn extends ControlledEntity, InternalIdentity, Identity, Displayable { enum State { Added, Running, Removed } @@ -39,5 +40,6 @@ enum State { State getState(); + @Override boolean isDisplay(); } diff --git a/api/src/com/cloud/network/Site2SiteVpnConnection.java b/api/src/com/cloud/network/Site2SiteVpnConnection.java index 81e8180119..cfc439abcd 100644 --- a/api/src/com/cloud/network/Site2SiteVpnConnection.java +++ b/api/src/com/cloud/network/Site2SiteVpnConnection.java @@ -19,9 +19,10 @@ import java.util.Date; import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.Displayable; import org.apache.cloudstack.api.InternalIdentity; -public interface Site2SiteVpnConnection extends ControlledEntity, InternalIdentity { +public interface Site2SiteVpnConnection extends ControlledEntity, InternalIdentity, Displayable { enum State { Pending, Connected, Disconnected, Error, } @@ -43,5 +44,6 @@ enum State { public boolean isPassive(); + @Override boolean isDisplay(); } diff --git a/api/src/com/cloud/network/Site2SiteVpnGateway.java b/api/src/com/cloud/network/Site2SiteVpnGateway.java index bae12597f2..57037d6b64 100644 --- a/api/src/com/cloud/network/Site2SiteVpnGateway.java +++ b/api/src/com/cloud/network/Site2SiteVpnGateway.java @@ -19,16 +19,18 @@ import java.util.Date; import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.Displayable; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; -public interface Site2SiteVpnGateway extends ControlledEntity, Identity, InternalIdentity { +public interface Site2SiteVpnGateway extends ControlledEntity, Identity, InternalIdentity, Displayable { public long getAddrId(); public long getVpcId(); public Date getRemoved(); + @Override boolean isDisplay(); } diff --git a/api/src/com/cloud/network/as/AutoScaleVmGroup.java b/api/src/com/cloud/network/as/AutoScaleVmGroup.java index 14c761593b..cf2c15c421 100644 --- a/api/src/com/cloud/network/as/AutoScaleVmGroup.java +++ b/api/src/com/cloud/network/as/AutoScaleVmGroup.java @@ -20,9 +20,10 @@ import java.util.Date; import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.Displayable; import org.apache.cloudstack.api.InternalIdentity; -public interface AutoScaleVmGroup extends ControlledEntity, InternalIdentity { +public interface AutoScaleVmGroup extends ControlledEntity, InternalIdentity, Displayable { String State_New = "new"; String State_Revoke = "revoke"; @@ -53,6 +54,7 @@ public interface AutoScaleVmGroup extends ControlledEntity, InternalIdentity { String getUuid(); + @Override boolean isDisplay(); } diff --git a/api/src/com/cloud/network/as/AutoScaleVmProfile.java b/api/src/com/cloud/network/as/AutoScaleVmProfile.java index 6e0b5ffb91..495446a6e8 100644 --- a/api/src/com/cloud/network/as/AutoScaleVmProfile.java +++ b/api/src/com/cloud/network/as/AutoScaleVmProfile.java @@ -20,6 +20,7 @@ import java.util.List; import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.api.Displayable; import org.apache.cloudstack.api.InternalIdentity; import com.cloud.utils.Pair; @@ -27,7 +28,7 @@ /** * AutoScaleVmProfile */ -public interface AutoScaleVmProfile extends ControlledEntity, InternalIdentity { +public interface AutoScaleVmProfile extends ControlledEntity, InternalIdentity, Displayable { @Override public long getId(); @@ -48,6 +49,7 @@ public interface AutoScaleVmProfile extends ControlledEntity, InternalIdentity { public long getAutoScaleUserId(); + @Override boolean isDisplay(); } diff --git a/api/src/com/cloud/network/rules/HealthCheckPolicy.java b/api/src/com/cloud/network/rules/HealthCheckPolicy.java index 2b1b68bbc8..f7562e8e89 100644 --- a/api/src/com/cloud/network/rules/HealthCheckPolicy.java +++ b/api/src/com/cloud/network/rules/HealthCheckPolicy.java @@ -16,12 +16,13 @@ // under the License. package com.cloud.network.rules; +import org.apache.cloudstack.api.Displayable; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; /** */ -public interface HealthCheckPolicy extends InternalIdentity, Identity { +public interface HealthCheckPolicy extends InternalIdentity, Identity, Displayable { public long getLoadBalancerId(); @@ -39,9 +40,7 @@ public interface HealthCheckPolicy extends InternalIdentity, Identity { public boolean isRevoke(); - /** - * @return - */ + @Override boolean isDisplay(); } diff --git a/api/src/com/cloud/network/rules/StickinessPolicy.java b/api/src/com/cloud/network/rules/StickinessPolicy.java index c7700718ba..7f956f98d4 100644 --- a/api/src/com/cloud/network/rules/StickinessPolicy.java +++ b/api/src/com/cloud/network/rules/StickinessPolicy.java @@ -18,6 +18,7 @@ import java.util.List; +import org.apache.cloudstack.api.Displayable; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; @@ -25,7 +26,7 @@ /** */ -public interface StickinessPolicy extends InternalIdentity, Identity { +public interface StickinessPolicy extends InternalIdentity, Identity, Displayable { public long getLoadBalancerId(); @@ -39,9 +40,7 @@ public interface StickinessPolicy extends InternalIdentity, Identity { public List> getParams(); /* get params in Map format */ - /** - * @return - */ + @Override boolean isDisplay(); } diff --git a/api/src/com/cloud/network/vpc/NetworkACL.java b/api/src/com/cloud/network/vpc/NetworkACL.java index 3ebee146ed..193a48c60f 100644 --- a/api/src/com/cloud/network/vpc/NetworkACL.java +++ b/api/src/com/cloud/network/vpc/NetworkACL.java @@ -17,9 +17,10 @@ package com.cloud.network.vpc; +import org.apache.cloudstack.api.Displayable; import org.apache.cloudstack.api.InternalIdentity; -public interface NetworkACL extends InternalIdentity { +public interface NetworkACL extends InternalIdentity, Displayable { public static final long DEFAULT_DENY = 1; public static final long DEFAULT_ALLOW = 2; @@ -34,5 +35,6 @@ public interface NetworkACL extends InternalIdentity { String getName(); + @Override boolean isDisplay(); } diff --git a/api/src/com/cloud/network/vpc/NetworkACLItem.java b/api/src/com/cloud/network/vpc/NetworkACLItem.java index faa4d273c9..8e288a2b96 100644 --- a/api/src/com/cloud/network/vpc/NetworkACLItem.java +++ b/api/src/com/cloud/network/vpc/NetworkACLItem.java @@ -18,9 +18,10 @@ import java.util.List; +import org.apache.cloudstack.api.Displayable; import org.apache.cloudstack.api.InternalIdentity; -public interface NetworkACLItem extends InternalIdentity { +public interface NetworkACLItem extends InternalIdentity, Displayable { String getUuid(); @@ -73,6 +74,7 @@ enum Action { */ TrafficType getTrafficType(); + @Override boolean isDisplay(); } diff --git a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java index 091229f681..48fe43ee84 100644 --- a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java @@ -202,10 +202,19 @@ public Long getNetworkId() { } } + @Deprecated public Boolean getDisplayIp() { return display; } + @Override + public boolean isDisplay() { + if(display == null) + return true; + else + return display; + } + @Override public long getEntityOwnerId() { Account caller = CallContext.current().getCallingAccount(); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java index 1fd0029e34..0308c1710c 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmGroupCmd.java @@ -184,10 +184,19 @@ public ApiCommandJobType getInstanceType() { return ApiCommandJobType.AutoScaleVmGroup; } + @Deprecated public Boolean getDisplay() { return display; } + @Override + public boolean isDisplay() { + if(display == null) + return true; + else + return display; + } + @Override public void create() throws ResourceAllocationException { AutoScaleVmGroup result = _autoScaleService.createAutoScaleVmGroup(this); diff --git a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java index 189217a202..447085e79b 100644 --- a/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/autoscale/CreateAutoScaleVmProfileCmd.java @@ -131,10 +131,19 @@ public Long getTemplateId() { return templateId; } + @Deprecated public Boolean getDisplay() { return display; } + @Override + public boolean isDisplay() { + if(display == null) + return true; + else + return display; + } + public Map getCounterParamList() { return counterParamList; } diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java index b48722661e..f6eb48e800 100644 --- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBHealthCheckPolicyCmd.java @@ -97,10 +97,19 @@ public class CreateLBHealthCheckPolicyCmd extends BaseAsyncCreateCmd { // ///////////////// Accessors /////////////////////// // /////////////////////////////////////////////////// + @Deprecated public Boolean getDisplay() { return display; } + @Override + public boolean isDisplay() { + if(display == null) + return true; + else + return display; + } + public Long getLbRuleId() { return lbRuleId; } diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java index 5ea571722b..152f6612f0 100644 --- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLBStickinessPolicyCmd.java @@ -82,10 +82,19 @@ public class CreateLBStickinessPolicyCmd extends BaseAsyncCreateCmd { // ///////////////// Accessors /////////////////////// // /////////////////////////////////////////////////// + @Deprecated public Boolean getDisplay() { return display; } + @Override + public boolean isDisplay() { + if(display == null) + return true; + else + return display; + } + public Long getLbRuleId() { return lbRuleId; } diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java index a405913f78..7c371928d9 100644 --- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/CreateLoadBalancerRuleCmd.java @@ -124,8 +124,13 @@ public class CreateLoadBalancerRuleCmd extends BaseAsyncCreateCmd /*implements L /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// - public Boolean getDisplay() { - return display; + @Override + public boolean isDisplay() { + if (display != null) { + return display; + } else { + return true; + } } public String getAlgorithm() { @@ -309,7 +314,7 @@ public void create() { try { LoadBalancer result = _lbService.createPublicLoadBalancerRule(getXid(), getName(), getDescription(), getSourcePortStart(), getSourcePortEnd(), getDefaultPortStart(), - getDefaultPortEnd(), getSourceIpAddressId(), getProtocol(), getAlgorithm(), getNetworkId(), getEntityOwnerId(), getOpenFirewall(), getLbProtocol(), getDisplay()); + getDefaultPortEnd(), getSourceIpAddressId(), getProtocol(), getAlgorithm(), getNetworkId(), getEntityOwnerId(), getOpenFirewall(), getLbProtocol(), isDisplay()); this.setEntityId(result.getId()); this.setEntityUuid(result.getUuid()); } catch (NetworkRuleConflictException e) { diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java index e47fa8b2cf..b4d54896d9 100644 --- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLCmd.java @@ -103,10 +103,20 @@ public class CreateNetworkACLCmd extends BaseAsyncCreateCmd { // /////////////////////////////////////////////////// // ///////////////// Accessors /////////////////////// // /////////////////////////////////////////////////// + @Deprecated public Boolean getDisplay() { return display; } + @Override + public boolean isDisplay() { + if (display != null) { + return display; + } else { + return true; + } + } + public String getProtocol() { String p = protocol.trim(); // Deal with ICMP(protocol number 1) specially because it need to be paired with icmp type and code diff --git a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java index 07156cf944..9aa0bab5ae 100644 --- a/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/network/CreateNetworkACLListCmd.java @@ -77,8 +77,13 @@ public Long getVpcId() { return vpcId; } - public Boolean getDisplay() { - return display; + @Override + public boolean isDisplay() { + if (display != null) { + return display; + } else { + return true; + } } // /////////////////////////////////////////////////// @@ -92,7 +97,7 @@ public String getCommandName() { @Override public void create() { - NetworkACL result = _networkACLService.createNetworkACL(getName(), getDescription(), getVpcId(), getDisplay()); + NetworkACL result = _networkACLService.createNetworkACL(getName(), getDescription(), getVpcId(), isDisplay()); setEntityId(result.getId()); setEntityUuid(result.getUuid()); } diff --git a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java index eb095df209..59ae05df40 100644 --- a/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/network/UpdateNetworkACLItemCmd.java @@ -88,8 +88,14 @@ public class UpdateNetworkACLItemCmd extends BaseAsyncCustomIdCmd { // /////////////////////////////////////////////////// // ///////////////// Accessors /////////////////////// // /////////////////////////////////////////////////// - public Boolean getDisplay() { - return display; + + @Override + public boolean isDisplay() { + if (display != null) { + return display; + } else { + return true; + } } public Long getId() { @@ -172,7 +178,7 @@ public void execute() throws ResourceUnavailableException { CallContext.current().setEventDetails("Rule Id: " + getId()); NetworkACLItem aclItem = _networkACLService.updateNetworkACLItem(getId(), getProtocol(), getSourceCidrList(), getTrafficType(), getAction(), getNumber(), getSourcePortStart(), - getSourcePortEnd(), getIcmpCode(), getIcmpType(), this.getCustomId(), this.getDisplay()); + getSourcePortEnd(), getIcmpCode(), getIcmpType(), this.getCustomId(), this.isDisplay()); if (aclItem == null) { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update network ACL Item"); } diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java index 2883b1999d..14b781d236 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java @@ -145,7 +145,7 @@ public String getEventType() { @Override public void create() { try { - RemoteAccessVpn vpn = _ravService.createRemoteAccessVpn(publicIpId, ipRange, getOpenFirewall(), getDisplay()); + RemoteAccessVpn vpn = _ravService.createRemoteAccessVpn(publicIpId, ipRange, getOpenFirewall(), isDisplay()); if (vpn != null) { setEntityId(vpn.getServerAddressId()); // find uuid for server ip address @@ -198,7 +198,11 @@ private IpAddress getIp() { return ip; } - public Boolean getDisplay() { - return display; + @Override + public boolean isDisplay() { + if(display == null) + return true; + else + return display; } } diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java index 71245c340a..6c08a42325 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnConnectionCmd.java @@ -87,10 +87,20 @@ public boolean isPassive() { return passive; } + @Deprecated public Boolean getDisplay() { return display; } + @Override + public boolean isDisplay() { + if (display != null) { + return display; + } else { + return true; + } + } + ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java index d5b5edbeee..fb933ba832 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java @@ -60,10 +60,20 @@ public Long getVpcId() { return vpcId; } + @Deprecated public Boolean getDisplay() { return display; } + @Override + public boolean isDisplay() { + if (display != null) { + return display; + } else { + return true; + } + } + ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// From 4889031492e543c318fcd639d7491cfb2013eb76 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Fri, 9 May 2014 11:10:26 -0700 Subject: [PATCH 420/683] CLOUDSTACK-6600: fix a bug in IAM cache in constructing cache key. --- .../apache/cloudstack/iam/RoleBasedEntityAccessChecker.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java b/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java index eaa4302a4e..f0df1327ab 100644 --- a/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java +++ b/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java @@ -66,6 +66,9 @@ private String buildAccessCacheKey(Account caller, ControlledEntity entity, Acce String entityType = null; if (entity != null && entity.getEntityType() != null) { entityType = entity.getEntityType().getSimpleName(); + if (entity instanceof InternalIdentity) { + entityType += ((InternalIdentity)entity).getId(); + } } key.append(entityType != null ? entityType : "null"); key.append("-"); @@ -91,7 +94,7 @@ public boolean checkAccess(Account caller, ControlledEntity entity, AccessType a String accessKey = buildAccessCacheKey(caller, entity, accessType, action); CheckAccessResult allowDeny = (CheckAccessResult)_iamSrv.getFromIAMCache(accessKey); if (allowDeny != null) { - s_logger.debug("IAM access check for " + accessKey + " from cache"); + s_logger.debug("IAM access check for " + accessKey + " from cache: " + allowDeny.isAllow()); if (allowDeny.isAllow()) { return true; } else { From 9782970ef8fe0584d8bc0c5c5023d2cc5b9ed0c0 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 9 May 2014 13:18:28 -0700 Subject: [PATCH 421/683] CLOUDSTACK-6626: UI - fix a bug that g_userid was not declared. --- ui/scripts/sharedFunctions.js | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index 4d4344e152..2f7ef0aa85 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -18,6 +18,7 @@ var g_mySession = null; var g_sessionKey = null; var g_role = null; // roles - root, domain-admin, ro-admin, user var g_username = null; +var g_userid = null; var g_account = null; var g_domainid = null; var g_loginCmdText = null; From f447a2c38c15ad5b7844237e72ab551149f46bfb Mon Sep 17 00:00:00 2001 From: Min Chen Date: Fri, 9 May 2014 16:39:23 -0700 Subject: [PATCH 422/683] CLOUDSTACK-6617: [Automation] detach / resize volume test cases failing with permission error. --- .../cloudstack/iam/RoleBasedEntityAccessChecker.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java b/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java index f0df1327ab..7b3d967ffd 100644 --- a/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java +++ b/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java @@ -290,16 +290,16 @@ private class CheckAccessResult { boolean allow; String denyMsg; - public CheckAccessResult(boolean allow) { - this(allow, null); + public CheckAccessResult(boolean aw) { + this(aw, null); } public CheckAccessResult(String msg) { this(false, msg); } - public CheckAccessResult(boolean allow, String msg) { - allow = allow; + public CheckAccessResult(boolean aw, String msg) { + allow = aw; denyMsg = msg; } @@ -307,8 +307,8 @@ public boolean isAllow() { return allow; } - public void setAllow(boolean allow) { - this.allow = allow; + public void setAllow(boolean aw) { + allow = aw; } From a7dd5aae55c1f6059aea324760f2800537f5d294 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Fri, 9 May 2014 18:24:54 -0700 Subject: [PATCH 423/683] CLOUDSTACK-6628:[Automation] Create PF rulw API failing with error "database id can only provided by VO objects". --- .../command/user/firewall/CreatePortForwardingRuleCmd.java | 7 ++++++- server/src/com/cloud/network/rules/RulesManagerImpl.java | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java index f18767e1da..91146ac32f 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java @@ -19,8 +19,11 @@ import java.util.List; import org.apache.log4j.Logger; +import org.bouncycastle.util.IPAddress; import org.apache.cloudstack.acl.RoleType; +import org.apache.cloudstack.acl.SecurityChecker.AccessType; +import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -48,7 +51,7 @@ import com.cloud.vm.VirtualMachine; @APICommand(name = "createPortForwardingRule", description = "Creates a port forwarding rule", responseObject = FirewallRuleResponse.class, entityType = {FirewallRule.class, - VirtualMachine.class}, + VirtualMachine.class, IPAddress.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements PortForwardingRule { public static final Logger s_logger = Logger.getLogger(CreatePortForwardingRuleCmd.class.getName()); @@ -59,6 +62,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P // ////////////// API parameters ///////////////////// // /////////////////////////////////////////////////// + @ACL(accessType = AccessType.OperateEntry) @Parameter(name = ApiConstants.IP_ADDRESS_ID, type = CommandType.UUID, entityType = IPAddressResponse.class, @@ -96,6 +100,7 @@ public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements P description = "the ending port of port forwarding rule's private port range") private Integer publicEndPort; + @ACL(accessType = AccessType.OperateEntry) @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, entityType = UserVmResponse.class, diff --git a/server/src/com/cloud/network/rules/RulesManagerImpl.java b/server/src/com/cloud/network/rules/RulesManagerImpl.java index 573c820673..f6a87bf457 100755 --- a/server/src/com/cloud/network/rules/RulesManagerImpl.java +++ b/server/src/com/cloud/network/rules/RulesManagerImpl.java @@ -195,6 +195,7 @@ public void checkRuleAndUserVm(FirewallRule rule, UserVm userVm, Account caller) throw new InvalidParameterValueException("Invalid user vm: " + userVm.getId()); } + // This same owner check is actually not needed, since multiple entities OperateEntry trick guarantee that if (rule.getAccountId() != userVm.getAccountId()) { throw new InvalidParameterValueException("New rule " + rule + " and vm id=" + userVm.getId() + " belong to different accounts"); } @@ -267,8 +268,8 @@ public PortForwardingRule createPortForwardingRule(final PortForwardingRule rule if (vm == null) { throw new InvalidParameterValueException("Unable to create port forwarding rule on address " + ipAddress + ", invalid virtual machine id specified (" + vmId + ")."); - } else { - checkRuleAndUserVm(rule, vm, caller); + } else if (vm.getState() == VirtualMachine.State.Destroyed || vm.getState() == VirtualMachine.State.Expunging) { + throw new InvalidParameterValueException("Invalid user vm: " + vm.getId()); } // Verify that vm has nic in the network From 4466ed1ce18fd5391b2b96fa551c171ae7e09723 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Sat, 10 May 2014 00:26:46 -0400 Subject: [PATCH 424/683] Fixing few issues in Multiple IPs test cases --- .../component/test_multiple_ips_per_nic.py | 22 ++++++++++--------- tools/marvin/marvin/config/test_data.py | 21 ++++++++++++++++++ 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/test/integration/component/test_multiple_ips_per_nic.py b/test/integration/component/test_multiple_ips_per_nic.py index 1b1cd82794..2db15e5da5 100644 --- a/test/integration/component/test_multiple_ips_per_nic.py +++ b/test/integration/component/test_multiple_ips_per_nic.py @@ -164,11 +164,11 @@ def setUpClass(cls): cls.services["service_offering"] ) cls._cleanup = [cls.service_offering] - cls.services["shared_network_offering"]["specifyVlan"] = "True" - cls.services["shared_network_offering"]["specifyIpRanges"] = "True" + cls.services["shared_network_offering_all_services"]["specifyVlan"] = "True" + cls.services["shared_network_offering_all_services"]["specifyIpRanges"] = "True" cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client, - cls.services["shared_network_offering"]) + cls.services["shared_network_offering_all_services"]) cls._cleanup.append(cls.shared_network_offering) cls.mode = cls.zone.networktype if cls.mode.lower() == "advanced": @@ -464,7 +464,7 @@ def test_operations_non_root_admin_api_client(self, value): try: ipaddress_1 = NIC.addIp(apiclient, id=virtual_machine.nic[0].id) except Exception as e: - self.fail("Failed while adding secondary IP to NIC of vm %s" % virtual_machine.id) + self.fail("Failed while adding secondary IP to NIC of vm %s: %s" % (virtual_machine.id, e)) try: NIC.list(apiclient, virtualmachineid=virtual_machine.id) @@ -515,10 +515,11 @@ def setUpClass(cls): cls.services["service_offering"] ) cls._cleanup = [cls.service_offering] - cls.services["shared_network_offering"]["specifyVlan"] = "True" - cls.services["shared_network_offering"]["specifyIpRanges"] = "True" + cls.services["shared_network_offering_all_services"]["specifyVlan"] = "True" + cls.services["shared_network_offering_all_services"]["specifyIpRanges"] = "True" - cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client, cls.services["shared_network_offering"]) + cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client, + cls.services["shared_network_offering_all_services"]) cls._cleanup.append(cls.shared_network_offering) cls.mode = cls.zone.networktype if cls.mode.lower() == "advanced": @@ -889,10 +890,11 @@ def setUpClass(cls): cls.services["service_offering"] ) cls._cleanup = [cls.service_offering] - cls.services["shared_network_offering"]["specifyVlan"] = "True" - cls.services["shared_network_offering"]["specifyIpRanges"] = "True" + cls.services["shared_network_offering_all_services"]["specifyVlan"] = "True" + cls.services["shared_network_offering_all_services"]["specifyIpRanges"] = "True" - cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client, cls.services["shared_network_offering"]) + cls.shared_network_offering = CreateEnabledNetworkOffering(cls.api_client, + cls.services["shared_network_offering_all_services"]) cls._cleanup.append(cls.shared_network_offering) cls.mode = cls.zone.networktype if cls.mode.lower() == "advanced": diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py index 73a5965bbc..fbf5e25d26 100644 --- a/tools/marvin/marvin/config/test_data.py +++ b/tools/marvin/marvin/config/test_data.py @@ -277,6 +277,27 @@ "UserData": "VirtualRouter" } }, + "shared_network_offering_all_services": { + "name":"shaared network offering with services enabled", + "displaytext": "Shard network offering", + "guestiptype": "Shared", + "supportedservices": "Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat", + "specifyVlan" : "False", + "specifyIpRanges" : "False", + "traffictype": "GUEST", + "serviceProviderList" : { + "Dhcp": "VirtualRouter", + "Dns": "VirtualRouter", + "UserData": "VirtualRouter", + "SourceNat": "VirtualRouter", + "PortForwarding": "VirtualRouter", + "Vpn": "VirtualRouter", + "Firewall": "VirtualRouter", + "Lb": "VirtualRouter", + "UserData": "VirtualRouter", + "StaticNat": "VirtualRouter" + } + }, "shared_network_offering_sg": { "name": "MySharedOffering-sg", "displaytext": "MySharedOffering-sg", From c12b28fc37b76fff6854f4f6bc068a634f1710bc Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Sun, 11 May 2014 20:32:04 -0700 Subject: [PATCH 425/683] CLOUDSTACK-6633: listVolumes should return template/iso info for root volumes --- .../api/response/VolumeResponse.java | 70 +++++++++++++++++++ .../api/query/dao/VolumeJoinDaoImpl.java | 8 +++ .../com/cloud/api/query/vo/VolumeJoinVO.java | 42 +++++++++++ setup/db/db/schema-430to440.sql | 16 +++-- 4 files changed, 132 insertions(+), 4 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/response/VolumeResponse.java b/api/src/org/apache/cloudstack/api/response/VolumeResponse.java index 45c15daa6a..c3e214fb10 100644 --- a/api/src/org/apache/cloudstack/api/response/VolumeResponse.java +++ b/api/src/org/apache/cloudstack/api/response/VolumeResponse.java @@ -60,6 +60,30 @@ public class VolumeResponse extends BaseResponse implements ControlledViewEntity @Param(description = "id of the virtual machine") private String virtualMachineId; + @SerializedName("isoid") + @Param(description = "the ID of the ISO attached to the virtual machine") + private String isoId; + + @SerializedName("isoname") + @Param(description = "the name of the ISO attached to the virtual machine") + private String isoName; + + @SerializedName("isodisplaytext") + @Param(description = "an alternate display text of the ISO attached to the virtual machine") + private String isoDisplayText; + + @SerializedName(ApiConstants.TEMPLATE_ID) + @Param(description = "the ID of the template for the virtual machine. A -1 is returned if the virtual machine was created from an ISO file.") + private String templateId; + + @SerializedName("templatename") + @Param(description = "the name of the template for the virtual machine") + private String templateName; + + @SerializedName("templatedisplaytext") + @Param(description = " an alternate display text of the template for the virtual machine") + private String templateDisplayText; + @SerializedName("vmname") @Param(description = "name of the virtual machine") private String virtualMachineName; @@ -443,5 +467,51 @@ public boolean isNeedQuiescevm() { return this.needQuiescevm; } + public String getIsoId() { + return isoId; + } + + public void setIsoId(String isoId) { + this.isoId = isoId; + } + + public String getIsoName() { + return isoName; + } + + public void setIsoName(String isoName) { + this.isoName = isoName; + } + + public String getIsoDisplayText() { + return isoDisplayText; + } + + public void setIsoDisplayText(String isoDisplayText) { + this.isoDisplayText = isoDisplayText; + } + + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(String templateName) { + this.templateName = templateName; + } + + public String getTemplateDisplayText() { + return templateDisplayText; + } + + public void setTemplateDisplayText(String templateDisplayText) { + this.templateDisplayText = templateDisplayText; + } } diff --git a/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java index 8a0431baaa..9e1ee37ceb 100644 --- a/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java @@ -215,6 +215,14 @@ public VolumeResponse newVolumeResponse(ResponseView view, VolumeJoinVO volume) volResponse.setDisplayVolume(volume.isDisplayVolume()); volResponse.setChainInfo(volume.getChainInfo()); + volResponse.setTemplateId(volume.getTemplateUuid()); + volResponse.setTemplateName(volume.getTemplateName()); + volResponse.setTemplateDisplayText(volume.getTemplateDisplayText()); + + volResponse.setIsoId(volume.getIsoUuid()); + volResponse.setIsoName(volume.getIsoName()); + volResponse.setIsoDisplayText(volume.getIsoDisplayText()); + // set async job if (volume.getJobId() != null) { volResponse.setJobId(volume.getJobUuid()); diff --git a/server/src/com/cloud/api/query/vo/VolumeJoinVO.java b/server/src/com/cloud/api/query/vo/VolumeJoinVO.java index 8165d68f80..cb6dc4d1b6 100644 --- a/server/src/com/cloud/api/query/vo/VolumeJoinVO.java +++ b/server/src/com/cloud/api/query/vo/VolumeJoinVO.java @@ -212,12 +212,30 @@ public class VolumeJoinVO extends BaseViewVO implements ControlledViewEntity { @Column(name = "template_uuid") private String templateUuid; + @Column(name = "template_name") + private String templateName; + + @Column(name = "template_display_text", length = 4096) + private String templateDisplayText; + @Column(name = "extractable") private boolean extractable; @Column(name = "template_type") private Storage.TemplateType templateType; + @Column(name = "iso_id", updatable = true, nullable = true, length = 17) + private long isoId; + + @Column(name = "iso_uuid") + private String isoUuid; + + @Column(name = "iso_name") + private String isoName; + + @Column(name = "iso_display_text", length = 4096) + private String isoDisplayText; + @Column(name = "job_id") private Long jobId; @@ -494,6 +512,30 @@ public Storage.TemplateType getTemplateType() { return templateType; } + public String getTemplateName() { + return templateName; + } + + public String getTemplateDisplayText() { + return templateDisplayText; + } + + public long getIsoId() { + return isoId; + } + + public String getIsoUuid() { + return isoUuid; + } + + public String getIsoName() { + return isoName; + } + + public String getIsoDisplayText() { + return isoDisplayText; + } + public Long getJobId() { return jobId; } diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index 8cb8221e61..89db04a2e9 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -128,9 +128,9 @@ CREATE VIEW `cloud`.`volume_view` AS volumes.attached, volumes.removed, volumes.pod_id, - volumes.display_volume, + volumes.display_volume, volumes.format, - volumes.path, + volumes.path, volumes.chain_info, account.id account_id, account.uuid account_uuid, @@ -146,7 +146,7 @@ CREATE VIEW `cloud`.`volume_view` AS data_center.id data_center_id, data_center.uuid data_center_uuid, data_center.name data_center_name, - data_center.networktype data_center_type, + data_center.networktype data_center_type, vm_instance.id vm_id, vm_instance.uuid vm_uuid, vm_instance.name vm_name, @@ -177,6 +177,12 @@ CREATE VIEW `cloud`.`volume_view` AS vm_template.uuid template_uuid, vm_template.extractable, vm_template.type template_type, + vm_template.name template_name, + vm_template.display_text template_display_text, + iso.id iso_id, + iso.uuid iso_uuid, + iso.name iso_name, + iso.display_text iso_display_text, resource_tags.id tag_id, resource_tags.uuid tag_uuid, resource_tags.key tag_key, @@ -214,7 +220,9 @@ CREATE VIEW `cloud`.`volume_view` AS left join `cloud`.`cluster` ON storage_pool.cluster_id = cluster.id left join - `cloud`.`vm_template` ON volumes.template_id = vm_template.id OR volumes.iso_id = vm_template.id + `cloud`.`vm_template` ON volumes.template_id = vm_template.id + left join + `cloud`.`vm_template` iso ON iso.id = volumes.iso_id left join `cloud`.`resource_tags` ON resource_tags.resource_id = volumes.id and resource_tags.resource_type = 'Volume' From be73571c74084a31819c150dfca2ca28bd13e64b Mon Sep 17 00:00:00 2001 From: Min Chen Date: Sun, 11 May 2014 23:12:35 -0700 Subject: [PATCH 426/683] CLOUDSTACK-6628: Fix IpAddress import typo. --- .../api/command/user/firewall/CreatePortForwardingRuleCmd.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java index 91146ac32f..6fb120fa8b 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java @@ -19,7 +19,6 @@ import java.util.List; import org.apache.log4j.Logger; -import org.bouncycastle.util.IPAddress; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; @@ -51,7 +50,7 @@ import com.cloud.vm.VirtualMachine; @APICommand(name = "createPortForwardingRule", description = "Creates a port forwarding rule", responseObject = FirewallRuleResponse.class, entityType = {FirewallRule.class, - VirtualMachine.class, IPAddress.class}, + VirtualMachine.class, IpAddress.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class CreatePortForwardingRuleCmd extends BaseAsyncCreateCmd implements PortForwardingRule { public static final Logger s_logger = Logger.getLogger(CreatePortForwardingRuleCmd.class.getName()); From aaa2f5932ba8f7d3ef08ad5176744811589176f5 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Sun, 11 May 2014 19:08:19 -0400 Subject: [PATCH 427/683] CLOUDSTACK-5674: Fixed cloudstackConnection.py to return FAILED in case of well handled exceptions returning from server having jobresultcode as 530 --- tools/marvin/marvin/cloudstackConnection.py | 24 +++++++++------------ tools/marvin/marvin/codes.py | 2 ++ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/tools/marvin/marvin/cloudstackConnection.py b/tools/marvin/marvin/cloudstackConnection.py index 8044da7ec6..1ff8381a43 100644 --- a/tools/marvin/marvin/cloudstackConnection.py +++ b/tools/marvin/marvin/cloudstackConnection.py @@ -21,26 +21,18 @@ import hmac import hashlib import time -from cloudstackAPI import * +from cloudstackAPI import queryAsyncJobResult import jsonHelper from marvin.codes import ( FAILED, - INVALID_RESPONSE, - INVALID_INPUT, JOB_FAILED, - JOB_INPROGRESS, JOB_CANCELLED, - JOB_SUCCEEDED + JOB_SUCCEEDED, + JOB_NO_EXCEPTION, + JOB_EXCEPTION_OCCURED ) -from requests import ( - ConnectionError, - HTTPError, - Timeout, - RequestException -) -from marvin.cloudstackException import ( - InvalidParameterException, - GetDetailExceptionInfo) +from marvin.cloudstackException import (GetDetailExceptionInfo, + InvalidParameterException) class CSConnection(object): @@ -100,6 +92,7 @@ def __poll(self, jobid, response_cmd): start_time = time.time() end_time = time.time() async_response = FAILED + jobresultcode = JOB_NO_EXCEPTION self.logger.debug("=== Jobid: %s Started ===" % (str(jobid))) while timeout > 0: async_response = self.\ @@ -109,6 +102,7 @@ def __poll(self, jobid, response_cmd): if job_status in [JOB_FAILED, JOB_CANCELLED, JOB_SUCCEEDED]: + jobresultcode = async_response.jobresultcode break time.sleep(5) timeout -= 5 @@ -122,6 +116,8 @@ def __poll(self, jobid, response_cmd): "TotalTime:%s===" % (str(jobid), str(time.ctime(start_time)), str(time.ctime(end_time)), str(tot_time))) + if jobresultcode == JOB_EXCEPTION_OCCURED: + async_response = FAILED return async_response except Exception as e: self.__lastError = e diff --git a/tools/marvin/marvin/codes.py b/tools/marvin/marvin/codes.py index ef49c0c3c8..0619374bf7 100644 --- a/tools/marvin/marvin/codes.py +++ b/tools/marvin/marvin/codes.py @@ -60,6 +60,8 @@ JOB_SUCCEEDED = 1 JOB_FAILED = 2 JOB_CANCELLED = 3 +JOB_EXCEPTION_OCCURED = 530 +JOB_NO_EXCEPTION = 0 ''' User Related Codes ''' From afd9d4e7567007604e15761a33ce9314149f7e21 Mon Sep 17 00:00:00 2001 From: santhosh Date: Mon, 12 May 2014 20:57:52 +1000 Subject: [PATCH 428/683] CLOUDSTACK-6627 catch exception instead of checking response Signed-off-by: santhosh Signed-off-by: Daan Hoogland --- test/integration/smoke/test_pvlan.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/smoke/test_pvlan.py b/test/integration/smoke/test_pvlan.py index a1c146b09a..9178e624c3 100644 --- a/test/integration/smoke/test_pvlan.py +++ b/test/integration/smoke/test_pvlan.py @@ -81,5 +81,5 @@ def test_create_pvlan_network(self): createNetworkCmd.startipv6="fc00:1234::10" createNetworkCmd.endipv6="fc00:1234::20" err = 0 - createNetworkResponse = self.apiClient.createNetwork(createNetworkCmd) - self.assertEqual(createNetworkResponse, FAILED, "Creating PVLAN with IPv6 should fail") + with self.assertRaises(Exception): + self.apiClient.createNetwork(createNetworkCmd) From c20acc6a4451dd0f3eba1beeb52e215f000b59d9 Mon Sep 17 00:00:00 2001 From: Gabor Apati-Nagy Date: Tue, 6 May 2014 10:44:07 +0100 Subject: [PATCH 429/683] CLOUDSTACK-6565: [UI] New Zones tab for Templates and ISOs --- .../classes/resources/messages.properties | 1 + ui/css/cloudstack3.css | 7 +- ui/dictionary.jsp | 2 + ui/scripts/templates.js | 617 ++++++++++-------- 4 files changed, 362 insertions(+), 265 deletions(-) mode change 100644 => 100755 ui/css/cloudstack3.css diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index 94b5d7ce55..b422c7cb70 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -1270,6 +1270,7 @@ label.zone.type=Zone Type label.zone.wide=Zone-Wide label.zone=Zone label.zones=Zones +label.multiplezones=Multiple Zones label.zoneWizard.trafficType.guest=Guest\: Traffic between end-user virtual machines label.zoneWizard.trafficType.management=Management\: Traffic between CloudStack\\\\'s internal resources, including any components that communicate with the Management Server, such as hosts and CloudStack system VMs label.zoneWizard.trafficType.public=Public\: Traffic between the internet and virtual machines in the cloud. diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css old mode 100644 new mode 100755 index cb9fa3521f..d7ed1afb09 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -1298,6 +1298,11 @@ div.panel div.list-view div.data-table table { border-left: 1px solid #CACACA; } +.detail-view div#details-tab-zones div.list-view div.data-table table td div.disabled { + display: none; +} + + div.panel div.list-view div.fixed-header { position: absolute; top: 29px; @@ -1313,7 +1318,7 @@ div.panel div.list-view div.fixed-header { .detail-view div.list-view div.fixed-header { width: 703px !important; top: 49px !important; - left: 32px !important; + left: 25px !important; background: #FFFFFF; } diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp index 9cc030ad95..334215f6f7 100644 --- a/ui/dictionary.jsp +++ b/ui/dictionary.jsp @@ -1236,6 +1236,8 @@ dictionary = { 'label.yes': '', 'label.zone.details': '', 'label.zone': '', +'label.zones': '', +'label.multiplezones': '', 'label.zone.id': '', 'label.zone.name': '', 'label.zone.step.1.title': '', diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index 67cc2fb99e..814e76baed 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -53,7 +53,7 @@ name: { label: 'label.name' }, - zonename: { + zones: { label: 'label.zone' }, hypervisor: { @@ -601,9 +601,31 @@ data: data, success: function(json) { var items = json.listtemplatesresponse.template; + var itemsView = []; + + $(items).each(function(index, item) { + var existing = $.grep(itemsView, function(it){ + return it != null && it.id !=null && it.id == item.id; + }); + + if (existing.length == 0) { + itemsView.push({ + id: item.id, + name: item.name, + description: item.description, + zones: item.zonename, + zoneids: [item.zoneid] + }); + } + else { + existing[0].zones = 'label.multiplezones'; + existing[0].zoneids.push(item.zoneid); + } + }); + args.response.success({ actionFilter: templateActionfilter, - data: items + data: itemsView }); } }); @@ -749,91 +771,6 @@ } }, - copyTemplate: { - label: 'label.action.copy.template', - messages: { - confirm: function(args) { - return 'message.copy.template.confirm'; - }, - success: function(args) { - return 'message.template.copying'; - }, - notification: function(args) { - return 'label.action.copy.template'; - } - }, - createForm: { - title: 'label.action.copy.template', - desc: '', - fields: { - destinationZoneId: { - label: 'label.destination.zone', - docID: 'helpCopyTemplateDestination', - validation: { - required: true - }, - select: function(args) { - $.ajax({ - url: createURL("listZones&available=true"), - dataType: "json", - async: true, - success: function(json) { - var zoneObjs = []; - var items = json.listzonesresponse.zone; - if (items != null) { - for (var i = 0; i < items.length; i++) { - if (items[i].id != args.context.templates[0].zoneid) { //destination zone must be different from source zone - zoneObjs.push({ - id: items[i].id, - description: items[i].name - }); - } - } - } - args.response.success({ - data: zoneObjs - }); - } - }); - } - } - } - }, - action: function(args) { - var data = { - id: args.context.templates[0].id, - destzoneid: args.data.destinationZoneId - }; - if (args.context.templates[0].zoneid != undefined) { - $.extend(data, { - sourcezoneid: args.context.templates[0].zoneid - }); - } - - $.ajax({ - url: createURL('copyTemplate'), - data: data, - success: function(json) { - var jid = json.copytemplateresponse.jobid; - args.response.success({ - _custom: { - jobId: jid, - getUpdatedItem: function(json) { - return {}; //nothing in this template needs to be updated - }, - getActionFilter: function() { - return templateActionfilter; - } - } - }); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - }, - downloadTemplate: { label: 'label.action.download.template', messages: { @@ -880,40 +817,6 @@ } }, - remove: { - label: 'label.action.delete.template', - messages: { - confirm: function(args) { - return 'message.action.delete.template'; - }, - notification: function(args) { - return 'label.action.delete.template'; - } - }, - action: function(args) { - var array1 = []; - if (args.context.templates[0].zoneid != null) - array1.push("&zoneid=" + args.context.templates[0].zoneid); - - $.ajax({ - url: createURL("deleteTemplate&id=" + args.context.templates[0].id + array1.join("")), - dataType: "json", - async: true, - success: function(json) { - var jid = json.deletetemplateresponse.jobid; - args.response.success({ - _custom: { - jobId: jid - } - }); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - } - }, tabs: { details: { @@ -943,14 +846,6 @@ } } }, { - isready: { - label: 'state.ready', - converter: cloudStack.converters.toBooleanText - }, - status: { - label: 'label.status' - }, - hypervisor: { label: 'label.hypervisor' }, @@ -1050,9 +945,6 @@ } }, - zonename: { - label: 'label.zone.name' - }, crossZones: { label: 'label.cross.zones', converter: cloudStack.converters.toBooleanText @@ -1082,9 +974,6 @@ id: { label: 'label.id' - }, - zoneid: { - label: 'label.zone.id' } }], @@ -1120,6 +1009,160 @@ } }); } + }, + + zones: { + title: 'label.zones', + listView: { + id: 'zones', + fields: { + zonename: { + label: 'label.name' + }, + status: { + label: 'label.status' + }, + isready: { + label: 'state.ready', + converter: cloudStack.converters.toBooleanText + } + }, + hideSearchBar: true, + actions: { + remove: { + label: 'label.action.delete.template', + messages: { + confirm: function(args) { + return 'message.action.delete.template'; + }, + notification: function(args) { + return 'label.action.delete.template'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteTemplate&id=" + args.context.templates[0].id + "&zoneid=" + args.context.zones[0].zoneid), + dataType: "json", + async: true, + success: function(json) { + var jid = json.deletetemplateresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + copyTemplate: { + label: 'label.action.copy.template', + messages: { + confirm: function(args) { + return 'message.copy.template.confirm'; + }, + success: function(args) { + return 'message.template.copying'; + }, + notification: function(args) { + return 'label.action.copy.template'; + } + }, + createForm: { + title: 'label.action.copy.template', + desc: '', + fields: { + destinationZoneId: { + label: 'label.destination.zone', + docID: 'helpCopyTemplateDestination', + validation: { + required: true + }, + select: function(args) { + $.ajax({ + url: createURL("listZones&available=true"), + dataType: "json", + async: true, + success: function(json) { + var zoneObjs = []; + var items = json.listzonesresponse.zone; + if (items != null) { + for (var i = 0; i < items.length; i++) { + if ($.inArray(items[i].id, args.context.templates[0].zoneids) == -1) { //destination zones should not contain zones where the template is already available + zoneObjs.push({ + id: items[i].id, + description: items[i].name + }); + } + } + } + args.response.success({ + data: zoneObjs + }); + } + }); + } + } + } + }, + action: function(args) { + var data = { + id: args.context.templates[0].id, + destzoneid: args.data.destinationZoneId + }; + $.extend(data, { + sourcezoneid: args.context.templates[0].zoneid + }); + + $.ajax({ + url: createURL('copyTemplate'), + data: data, + success: function(json) { + var jid = json.copytemplateresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + return {}; //nothing in this template needs to be updated + }, + getActionFilter: function() { + return templateActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + + dataProvider: function(args) { + var jsonObj = args.context.templates[0]; + var apiCmd = "listTemplates&templatefilter=self&id=" + jsonObj.id; + + $.ajax({ + url: createURL(apiCmd), + dataType: "json", + success: function(json) { + var templates = json.listtemplatesresponse.template; + var zones = []; + zones = templates; + + args.response.success({ + actionFilter: templateActionfilter, + data: zones + }); + } + }); + } + + } } } } @@ -1154,7 +1197,7 @@ name: { label: 'label.name' }, - zonename: { + zones: { label: 'label.zone' } }, @@ -1434,9 +1477,30 @@ data: data, success: function(json) { var items = json.listisosresponse.iso; + + var itemsView = []; + $(items).each(function(index, item) { + var existing = $.grep(itemsView, function(it){ + return it != null && it.id !=null && it.id == item.id; + }); + if (existing.length == 0) { + itemsView.push({ + id: item.id, + name: item.name, + description: item.description, + zones: item.zonename, + zoneids: [item.zoneid] + }); + } + else { + existing[0].zones = 'Multiple Zones'; + existing[0].zoneids.push(item.zoneid); + } + } +); args.response.success({ actionFilter: isoActionfilter, - data: items + data: itemsView }); } }); @@ -1531,85 +1595,6 @@ }); } }, - - copyISO: { - label: 'label.action.copy.ISO', - messages: { - notification: function(args) { - return 'Copying ISO'; - } - }, - createForm: { - title: 'label.action.copy.ISO', - desc: 'label.action.copy.ISO', - fields: { - destinationZoneId: { - label: 'label.destination.zone', - validation: { - required: true - }, - select: function(args) { - $.ajax({ - url: createURL("listZones&available=true"), - dataType: "json", - async: true, - success: function(json) { - var zoneObjs = []; - var items = json.listzonesresponse.zone; - if (items != null) { - for (var i = 0; i < items.length; i++) { - if (items[i].id != args.context.isos[0].zoneid) { //destination zone must be different from source zone - zoneObjs.push({ - id: items[i].id, - description: items[i].name - }); - } - } - } - args.response.success({ - data: zoneObjs - }); - } - }); - } - } - } - }, - action: function(args) { - var data = { - id: args.context.isos[0].id, - destzoneid: args.data.destinationZoneId - }; - if (args.context.isos[0].zoneid != undefined) { - $.extend(data, { - sourcezoneid: args.context.isos[0].zoneid - }); - } - - $.ajax({ - url: createURL('copyIso'), - data: data, - success: function(json) { - var jid = json.copytemplateresponse.jobid; - args.response.success({ - _custom: { - jobId: jid, - getUpdatedItem: function(json) { - return {}; //nothing in this ISO needs to be updated - }, - getActionFilter: function() { - return isoActionfilter; - } - } - }); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - }, - downloadISO: { label: 'label.action.download.ISO', messages: { @@ -1654,42 +1639,7 @@ notification: { poll: pollAsyncJobResult } - }, - - remove: { - label: 'label.action.delete.ISO', - messages: { - confirm: function(args) { - return 'message.action.delete.ISO'; - }, - notification: function(args) { - return 'label.action.delete.ISO'; - } - }, - action: function(args) { - var array1 = []; - if (args.context.isos[0].zoneid != null) - array1.push("&zoneid=" + args.context.isos[0].zoneid); - - $.ajax({ - url: createURL("deleteIso&id=" + args.context.isos[0].id + array1.join("")), - dataType: "json", - async: true, - success: function(json) { - var jid = json.deleteisosresponse.jobid; - args.response.success({ - _custom: { - jobId: jid - } - }); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } } - }, tabs: { @@ -1708,12 +1658,6 @@ id: { label: 'ID' }, - zonename: { - label: 'label.zone.name' - }, - zoneid: { - label: 'label.zone.id' - }, displaytext: { label: 'label.description', isEditable: true, @@ -1721,13 +1665,6 @@ required: true } }, - isready: { - label: 'state.Ready', - converter: cloudStack.converters.toBooleanText - }, - status: { - label: 'label.status' - }, size: { label: 'label.size', converter: function(args) { @@ -1834,6 +1771,158 @@ }); } + }, + zones: { + title: 'label.zones', + listView: { + id: 'zones', + fields: { + zonename: { + label: 'label.name' + }, + status: { + label: 'label.status' + }, + isready: { + label: 'state.ready', + converter: cloudStack.converters.toBooleanText + } + }, + hideSearchBar: true, + actions: { + copyISO: { + label: 'label.action.copy.ISO', + messages: { + notification: function(args) { + return 'Copying ISO'; + } + }, + createForm: { + title: 'label.action.copy.ISO', + desc: 'label.action.copy.ISO', + fields: { + destinationZoneId: { + label: 'label.destination.zone', + validation: { + required: true + }, + select: function(args) { + $.ajax({ + url: createURL("listZones&available=true"), + dataType: "json", + async: true, + success: function(json) { + var zoneObjs = []; + var items = json.listzonesresponse.zone; + if (items != null) { + for (var i = 0; i < items.length; i++) { + if ($.inArray(items[i].id, args.context.isos[0].zoneids) == -1) { //destination zones should not contain zones where the ISO is already available + zoneObjs.push({ + id: items[i].id, + description: items[i].name + }); + } + } + } + args.response.success({ + data: zoneObjs + }); + } + }); + } + } + } + }, + action: function(args) { + var data = { + id: args.context.isos[0].id, + destzoneid: args.data.destinationZoneId + }; + if (args.context.isos[0].zoneid != undefined) { + $.extend(data, { + sourcezoneid: args.context.isos[0].zoneid + }); + } + + $.ajax({ + url: createURL('copyIso'), + data: data, + success: function(json) { + var jid = json.copytemplateresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + return {}; //nothing in this ISO needs to be updated + }, + getActionFilter: function() { + return isoActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + remove: { + label: 'label.action.delete.ISO', + messages: { + confirm: function(args) { + return 'message.action.delete.ISO'; + }, + notification: function(args) { + return 'label.action.delete.ISO'; + } + }, + action: function(args) { + var array1 = []; + if (args.context.isos[0].zoneid != null) + array1.push("&zoneid=" + args.context.isos[0].zoneid); + + $.ajax({ + url: createURL("deleteIso&id=" + args.context.isos[0].id + "&zoneid=" + args.context.zones[0].zoneid), + dataType: "json", + async: true, + success: function(json) { + var jid = json.deleteisosresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + + dataProvider: function(args) { + var jsonObj = args.context.isos[0]; + var apiCmd = "listIsos&isofilter=self&id=" + jsonObj.id; + + $.ajax({ + url: createURL(apiCmd), + dataType: "json", + success: function(json) { + var isos = json.listisosresponse.iso; + var zones = []; + zones = isos; + + args.response.success({ + actionFilter: isoActionfilter, + data: zones + }); + } + }); + } + } } } } From 8bb3efcd53086628b1ef26a24222f7f2cbf0206e Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 12 May 2014 12:24:04 -0700 Subject: [PATCH 430/683] Revert "CLOUDSTACK-6565: [UI] New Zones tab for Templates and ISOs" This reverts commit c20acc6a4451dd0f3eba1beeb52e215f000b59d9. --- .../classes/resources/messages.properties | 1 - ui/css/cloudstack3.css | 7 +- ui/dictionary.jsp | 2 - ui/scripts/templates.js | 617 ++++++++---------- 4 files changed, 265 insertions(+), 362 deletions(-) mode change 100755 => 100644 ui/css/cloudstack3.css diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index b422c7cb70..94b5d7ce55 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -1270,7 +1270,6 @@ label.zone.type=Zone Type label.zone.wide=Zone-Wide label.zone=Zone label.zones=Zones -label.multiplezones=Multiple Zones label.zoneWizard.trafficType.guest=Guest\: Traffic between end-user virtual machines label.zoneWizard.trafficType.management=Management\: Traffic between CloudStack\\\\'s internal resources, including any components that communicate with the Management Server, such as hosts and CloudStack system VMs label.zoneWizard.trafficType.public=Public\: Traffic between the internet and virtual machines in the cloud. diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css old mode 100755 new mode 100644 index d7ed1afb09..cb9fa3521f --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -1298,11 +1298,6 @@ div.panel div.list-view div.data-table table { border-left: 1px solid #CACACA; } -.detail-view div#details-tab-zones div.list-view div.data-table table td div.disabled { - display: none; -} - - div.panel div.list-view div.fixed-header { position: absolute; top: 29px; @@ -1318,7 +1313,7 @@ div.panel div.list-view div.fixed-header { .detail-view div.list-view div.fixed-header { width: 703px !important; top: 49px !important; - left: 25px !important; + left: 32px !important; background: #FFFFFF; } diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp index 334215f6f7..9cc030ad95 100644 --- a/ui/dictionary.jsp +++ b/ui/dictionary.jsp @@ -1236,8 +1236,6 @@ dictionary = { 'label.yes': '', 'label.zone.details': '', 'label.zone': '', -'label.zones': '', -'label.multiplezones': '', 'label.zone.id': '', 'label.zone.name': '', 'label.zone.step.1.title': '', diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index 814e76baed..67cc2fb99e 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -53,7 +53,7 @@ name: { label: 'label.name' }, - zones: { + zonename: { label: 'label.zone' }, hypervisor: { @@ -601,31 +601,9 @@ data: data, success: function(json) { var items = json.listtemplatesresponse.template; - var itemsView = []; - - $(items).each(function(index, item) { - var existing = $.grep(itemsView, function(it){ - return it != null && it.id !=null && it.id == item.id; - }); - - if (existing.length == 0) { - itemsView.push({ - id: item.id, - name: item.name, - description: item.description, - zones: item.zonename, - zoneids: [item.zoneid] - }); - } - else { - existing[0].zones = 'label.multiplezones'; - existing[0].zoneids.push(item.zoneid); - } - }); - args.response.success({ actionFilter: templateActionfilter, - data: itemsView + data: items }); } }); @@ -771,6 +749,91 @@ } }, + copyTemplate: { + label: 'label.action.copy.template', + messages: { + confirm: function(args) { + return 'message.copy.template.confirm'; + }, + success: function(args) { + return 'message.template.copying'; + }, + notification: function(args) { + return 'label.action.copy.template'; + } + }, + createForm: { + title: 'label.action.copy.template', + desc: '', + fields: { + destinationZoneId: { + label: 'label.destination.zone', + docID: 'helpCopyTemplateDestination', + validation: { + required: true + }, + select: function(args) { + $.ajax({ + url: createURL("listZones&available=true"), + dataType: "json", + async: true, + success: function(json) { + var zoneObjs = []; + var items = json.listzonesresponse.zone; + if (items != null) { + for (var i = 0; i < items.length; i++) { + if (items[i].id != args.context.templates[0].zoneid) { //destination zone must be different from source zone + zoneObjs.push({ + id: items[i].id, + description: items[i].name + }); + } + } + } + args.response.success({ + data: zoneObjs + }); + } + }); + } + } + } + }, + action: function(args) { + var data = { + id: args.context.templates[0].id, + destzoneid: args.data.destinationZoneId + }; + if (args.context.templates[0].zoneid != undefined) { + $.extend(data, { + sourcezoneid: args.context.templates[0].zoneid + }); + } + + $.ajax({ + url: createURL('copyTemplate'), + data: data, + success: function(json) { + var jid = json.copytemplateresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + return {}; //nothing in this template needs to be updated + }, + getActionFilter: function() { + return templateActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + downloadTemplate: { label: 'label.action.download.template', messages: { @@ -817,6 +880,40 @@ } }, + remove: { + label: 'label.action.delete.template', + messages: { + confirm: function(args) { + return 'message.action.delete.template'; + }, + notification: function(args) { + return 'label.action.delete.template'; + } + }, + action: function(args) { + var array1 = []; + if (args.context.templates[0].zoneid != null) + array1.push("&zoneid=" + args.context.templates[0].zoneid); + + $.ajax({ + url: createURL("deleteTemplate&id=" + args.context.templates[0].id + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var jid = json.deletetemplateresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, tabs: { details: { @@ -846,6 +943,14 @@ } } }, { + isready: { + label: 'state.ready', + converter: cloudStack.converters.toBooleanText + }, + status: { + label: 'label.status' + }, + hypervisor: { label: 'label.hypervisor' }, @@ -945,6 +1050,9 @@ } }, + zonename: { + label: 'label.zone.name' + }, crossZones: { label: 'label.cross.zones', converter: cloudStack.converters.toBooleanText @@ -974,6 +1082,9 @@ id: { label: 'label.id' + }, + zoneid: { + label: 'label.zone.id' } }], @@ -1009,160 +1120,6 @@ } }); } - }, - - zones: { - title: 'label.zones', - listView: { - id: 'zones', - fields: { - zonename: { - label: 'label.name' - }, - status: { - label: 'label.status' - }, - isready: { - label: 'state.ready', - converter: cloudStack.converters.toBooleanText - } - }, - hideSearchBar: true, - actions: { - remove: { - label: 'label.action.delete.template', - messages: { - confirm: function(args) { - return 'message.action.delete.template'; - }, - notification: function(args) { - return 'label.action.delete.template'; - } - }, - action: function(args) { - $.ajax({ - url: createURL("deleteTemplate&id=" + args.context.templates[0].id + "&zoneid=" + args.context.zones[0].zoneid), - dataType: "json", - async: true, - success: function(json) { - var jid = json.deletetemplateresponse.jobid; - args.response.success({ - _custom: { - jobId: jid - } - }); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - }, - copyTemplate: { - label: 'label.action.copy.template', - messages: { - confirm: function(args) { - return 'message.copy.template.confirm'; - }, - success: function(args) { - return 'message.template.copying'; - }, - notification: function(args) { - return 'label.action.copy.template'; - } - }, - createForm: { - title: 'label.action.copy.template', - desc: '', - fields: { - destinationZoneId: { - label: 'label.destination.zone', - docID: 'helpCopyTemplateDestination', - validation: { - required: true - }, - select: function(args) { - $.ajax({ - url: createURL("listZones&available=true"), - dataType: "json", - async: true, - success: function(json) { - var zoneObjs = []; - var items = json.listzonesresponse.zone; - if (items != null) { - for (var i = 0; i < items.length; i++) { - if ($.inArray(items[i].id, args.context.templates[0].zoneids) == -1) { //destination zones should not contain zones where the template is already available - zoneObjs.push({ - id: items[i].id, - description: items[i].name - }); - } - } - } - args.response.success({ - data: zoneObjs - }); - } - }); - } - } - } - }, - action: function(args) { - var data = { - id: args.context.templates[0].id, - destzoneid: args.data.destinationZoneId - }; - $.extend(data, { - sourcezoneid: args.context.templates[0].zoneid - }); - - $.ajax({ - url: createURL('copyTemplate'), - data: data, - success: function(json) { - var jid = json.copytemplateresponse.jobid; - args.response.success({ - _custom: { - jobId: jid, - getUpdatedItem: function(json) { - return {}; //nothing in this template needs to be updated - }, - getActionFilter: function() { - return templateActionfilter; - } - } - }); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - } - }, - - dataProvider: function(args) { - var jsonObj = args.context.templates[0]; - var apiCmd = "listTemplates&templatefilter=self&id=" + jsonObj.id; - - $.ajax({ - url: createURL(apiCmd), - dataType: "json", - success: function(json) { - var templates = json.listtemplatesresponse.template; - var zones = []; - zones = templates; - - args.response.success({ - actionFilter: templateActionfilter, - data: zones - }); - } - }); - } - - } } } } @@ -1197,7 +1154,7 @@ name: { label: 'label.name' }, - zones: { + zonename: { label: 'label.zone' } }, @@ -1477,30 +1434,9 @@ data: data, success: function(json) { var items = json.listisosresponse.iso; - - var itemsView = []; - $(items).each(function(index, item) { - var existing = $.grep(itemsView, function(it){ - return it != null && it.id !=null && it.id == item.id; - }); - if (existing.length == 0) { - itemsView.push({ - id: item.id, - name: item.name, - description: item.description, - zones: item.zonename, - zoneids: [item.zoneid] - }); - } - else { - existing[0].zones = 'Multiple Zones'; - existing[0].zoneids.push(item.zoneid); - } - } -); args.response.success({ actionFilter: isoActionfilter, - data: itemsView + data: items }); } }); @@ -1595,6 +1531,85 @@ }); } }, + + copyISO: { + label: 'label.action.copy.ISO', + messages: { + notification: function(args) { + return 'Copying ISO'; + } + }, + createForm: { + title: 'label.action.copy.ISO', + desc: 'label.action.copy.ISO', + fields: { + destinationZoneId: { + label: 'label.destination.zone', + validation: { + required: true + }, + select: function(args) { + $.ajax({ + url: createURL("listZones&available=true"), + dataType: "json", + async: true, + success: function(json) { + var zoneObjs = []; + var items = json.listzonesresponse.zone; + if (items != null) { + for (var i = 0; i < items.length; i++) { + if (items[i].id != args.context.isos[0].zoneid) { //destination zone must be different from source zone + zoneObjs.push({ + id: items[i].id, + description: items[i].name + }); + } + } + } + args.response.success({ + data: zoneObjs + }); + } + }); + } + } + } + }, + action: function(args) { + var data = { + id: args.context.isos[0].id, + destzoneid: args.data.destinationZoneId + }; + if (args.context.isos[0].zoneid != undefined) { + $.extend(data, { + sourcezoneid: args.context.isos[0].zoneid + }); + } + + $.ajax({ + url: createURL('copyIso'), + data: data, + success: function(json) { + var jid = json.copytemplateresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + return {}; //nothing in this ISO needs to be updated + }, + getActionFilter: function() { + return isoActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + downloadISO: { label: 'label.action.download.ISO', messages: { @@ -1639,7 +1654,42 @@ notification: { poll: pollAsyncJobResult } + }, + + remove: { + label: 'label.action.delete.ISO', + messages: { + confirm: function(args) { + return 'message.action.delete.ISO'; + }, + notification: function(args) { + return 'label.action.delete.ISO'; + } + }, + action: function(args) { + var array1 = []; + if (args.context.isos[0].zoneid != null) + array1.push("&zoneid=" + args.context.isos[0].zoneid); + + $.ajax({ + url: createURL("deleteIso&id=" + args.context.isos[0].id + array1.join("")), + dataType: "json", + async: true, + success: function(json) { + var jid = json.deleteisosresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } } + }, tabs: { @@ -1658,6 +1708,12 @@ id: { label: 'ID' }, + zonename: { + label: 'label.zone.name' + }, + zoneid: { + label: 'label.zone.id' + }, displaytext: { label: 'label.description', isEditable: true, @@ -1665,6 +1721,13 @@ required: true } }, + isready: { + label: 'state.Ready', + converter: cloudStack.converters.toBooleanText + }, + status: { + label: 'label.status' + }, size: { label: 'label.size', converter: function(args) { @@ -1771,158 +1834,6 @@ }); } - }, - zones: { - title: 'label.zones', - listView: { - id: 'zones', - fields: { - zonename: { - label: 'label.name' - }, - status: { - label: 'label.status' - }, - isready: { - label: 'state.ready', - converter: cloudStack.converters.toBooleanText - } - }, - hideSearchBar: true, - actions: { - copyISO: { - label: 'label.action.copy.ISO', - messages: { - notification: function(args) { - return 'Copying ISO'; - } - }, - createForm: { - title: 'label.action.copy.ISO', - desc: 'label.action.copy.ISO', - fields: { - destinationZoneId: { - label: 'label.destination.zone', - validation: { - required: true - }, - select: function(args) { - $.ajax({ - url: createURL("listZones&available=true"), - dataType: "json", - async: true, - success: function(json) { - var zoneObjs = []; - var items = json.listzonesresponse.zone; - if (items != null) { - for (var i = 0; i < items.length; i++) { - if ($.inArray(items[i].id, args.context.isos[0].zoneids) == -1) { //destination zones should not contain zones where the ISO is already available - zoneObjs.push({ - id: items[i].id, - description: items[i].name - }); - } - } - } - args.response.success({ - data: zoneObjs - }); - } - }); - } - } - } - }, - action: function(args) { - var data = { - id: args.context.isos[0].id, - destzoneid: args.data.destinationZoneId - }; - if (args.context.isos[0].zoneid != undefined) { - $.extend(data, { - sourcezoneid: args.context.isos[0].zoneid - }); - } - - $.ajax({ - url: createURL('copyIso'), - data: data, - success: function(json) { - var jid = json.copytemplateresponse.jobid; - args.response.success({ - _custom: { - jobId: jid, - getUpdatedItem: function(json) { - return {}; //nothing in this ISO needs to be updated - }, - getActionFilter: function() { - return isoActionfilter; - } - } - }); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - }, - - remove: { - label: 'label.action.delete.ISO', - messages: { - confirm: function(args) { - return 'message.action.delete.ISO'; - }, - notification: function(args) { - return 'label.action.delete.ISO'; - } - }, - action: function(args) { - var array1 = []; - if (args.context.isos[0].zoneid != null) - array1.push("&zoneid=" + args.context.isos[0].zoneid); - - $.ajax({ - url: createURL("deleteIso&id=" + args.context.isos[0].id + "&zoneid=" + args.context.zones[0].zoneid), - dataType: "json", - async: true, - success: function(json) { - var jid = json.deleteisosresponse.jobid; - args.response.success({ - _custom: { - jobId: jid - } - }); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - } - }, - - dataProvider: function(args) { - var jsonObj = args.context.isos[0]; - var apiCmd = "listIsos&isofilter=self&id=" + jsonObj.id; - - $.ajax({ - url: createURL(apiCmd), - dataType: "json", - success: function(json) { - var isos = json.listisosresponse.iso; - var zones = []; - zones = isos; - - args.response.success({ - actionFilter: isoActionfilter, - data: zones - }); - } - }); - } - } } } } From 0d7ddc4337568939f47de875f1a03f39b54e3b30 Mon Sep 17 00:00:00 2001 From: Gabor Apati-Nagy Date: Thu, 8 May 2014 16:27:02 +0100 Subject: [PATCH 431/683] CLOUDSTACK-6606: Fixed: create network offering dailog box has greyed out (not selectable) providers for the connectivity service. --- ui/scripts/configuration.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index 1aeb90a481..53cd0c3257 100644 --- a/ui/scripts/configuration.js +++ b/ui/scripts/configuration.js @@ -2097,7 +2097,7 @@ } else { //Isolated network offering $useVpc.css('display', 'inline-block'); } - var $providers = $useVpcCb.closest('form').find('.dynamic-input select'); + var $providers = $useVpcCb.closest('form').find('.dynamic-input select[name!="service.Connectivity.provider"]'); var $optionsOfProviders = $providers.find('option'); //p.s. Netscaler is supported in both vpc and non-vpc if ($useVpc.is(':visible') && $useVpcCb.is(':checked')) { //*** vpc *** From f4c726d7b842636e665ba4ca3616688e2b26192b Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 12 May 2014 15:33:40 -0700 Subject: [PATCH 432/683] CLOUDSTACK-6379: UI > fix a bug that domain admin failed to be created when current login doesn't have visibility to root domain object. --- ui/scripts/accounts.js | 3 +- ui/scripts/accountsWizard.js | 67 +++++------------------------------- 2 files changed, 10 insertions(+), 60 deletions(-) diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index 935ba92ebe..4eaa401113 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -17,8 +17,7 @@ (function(cloudStack) { var domainObjs; - var rootDomainId; - + cloudStack.sections.accounts = { title: 'label.accounts', id: 'accounts', diff --git a/ui/scripts/accountsWizard.js b/ui/scripts/accountsWizard.js index d84fbfa59b..e02a04eea8 100644 --- a/ui/scripts/accountsWizard.js +++ b/ui/scripts/accountsWizard.js @@ -16,6 +16,8 @@ // under the License. (function(cloudStack, $) { + var rootDomainId; + cloudStack.accountsWizard = { informationWithinLdap: { @@ -75,20 +77,9 @@ validation: { required: true }, - select: function(args) { - var data = {}; - - if (args.context.users) { // In accounts section - data.listAll = true; - } else if (args.context.domains) { // In domain section (use specific domain) - data.id = args.context.domains[0].id; - } - + select: function(args) { $.ajax({ - url: createURL("listDomains"), - data: data, - dataType: "json", - async: false, + url: createURL("listDomains"), success: function(json) { var items = []; domainObjs = json.listdomainsresponse.domain; @@ -204,8 +195,10 @@ } var accountType = args.data.accounttype; - if (args.data.accounttype == "1" && args.data.domainid != rootDomainId) { //if account type is admin, but domain is not Root domain - accountType = "2"; // Change accounttype from root-domain("1") to domain-admin("2") + if (accountType == "1") { //if "admin" is selected in account type dropdown + if (rootDomainId == undefined || args.data.domainid != rootDomainId ) { //but current login has no visibility to root domain object, or the selected domain is not root domain + accountType = "2"; // change accountType from root-domain("1") to domain-admin("2") + } } array1.push("&accounttype=" + accountType); @@ -268,48 +261,6 @@ } }); } - } - /* - action: function(args) { - var array1 = []; - - var username = args.data.username; - - array1.push("&domainid=" + args.data.domainid); - - if (args.data.account != null && args.data.account.length != 0) { - array1.push("&account=" + args.data.account); - } - - if (args.data.accounttype == "1" && args.data.domainid != rootDomainId) { - args.data.accounttype = "2"; - } - array1.push("&accountType=" + args.data.accounttype); - - if (args.data.timezone != null && args.data.timezone.length != 0) { - array1.push("&timezone=" + args.data.timezone); - } - if (args.data.networkdomain != null && args.data.networkdomain != 0) { - array1.push("&networkDomain=" + args.data.networkdomain); - } - - for (var i = 0; i < username.length; i++) { - $.ajax({ - url: createURL("ldapCreateAccount&username=" + username[i] + array1.join("")), - dataType: "json", - async: false, - success: function(json) { - var item = json.createaccountresponse.account; - args.response.success({ - data: item - }); - }, - error: function(XMLHttpResponse) { - args.response.error(parseXMLHttpResponse(XMLHttpResponse)); - } - }); - } - } - */ + } }; }(cloudStack, jQuery)); \ No newline at end of file From 7e6390d3c845d9a0c918aa525b5cbfb2aa7fb3c5 Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Thu, 1 May 2014 15:40:04 -0700 Subject: [PATCH 433/683] CLOUDSTACK-6647: appending instance name with custom supplied info that contains - character can break vmsync. --- api/src/com/cloud/vm/VirtualMachineName.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/api/src/com/cloud/vm/VirtualMachineName.java b/api/src/com/cloud/vm/VirtualMachineName.java index 4bbcb64ebc..e6c2fbaab1 100755 --- a/api/src/com/cloud/vm/VirtualMachineName.java +++ b/api/src/com/cloud/vm/VirtualMachineName.java @@ -18,8 +18,6 @@ import java.util.Formatter; -import com.cloud.dc.Vlan; - /** * VM Name. */ @@ -52,26 +50,16 @@ public static boolean isValidVmName(String vmName) { public static boolean isValidVmName(String vmName, String instance) { String[] tokens = vmName.split(SEPARATOR); - /*Some vms doesn't have vlan/vnet id*/ - if (tokens.length != 5 && tokens.length != 4) { - return false; - } - if (!tokens[0].equals("i")) { + if (tokens.length <= 1) { return false; } - try { - Long.parseLong(tokens[1]); - Long.parseLong(tokens[2]); - if (tokens.length == 5 && !Vlan.UNTAGGED.equalsIgnoreCase(tokens[4])) { - Long.parseLong(tokens[4], 16); - } - } catch (NumberFormatException e) { + if (!tokens[0].equals("i")) { return false; } - return instance == null || instance.equals(tokens[3]); + return true; } public static String getVmName(long vmId, long userId, String instance) { From 4adee0a55e36045f2fd76b35b1cc7de14cb3493a Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Mon, 12 May 2014 18:25:18 -0700 Subject: [PATCH 434/683] CLOUDSTACK-6607: Correct the result of VpcNetworkUsage Blank or not shouldn't be used to indicate command is failure or not. --- .../xen/resource/XenServer56Resource.java | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java index 1bdcc3dfe8..8031f59776 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer56Resource.java @@ -16,25 +16,6 @@ // under the License. package com.cloud.hypervisor.xen.resource; -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import javax.ejb.Local; - -import org.apache.log4j.Logger; -import org.apache.xmlrpc.XmlRpcException; - -import com.xensource.xenapi.Connection; -import com.xensource.xenapi.Host; -import com.xensource.xenapi.Network; -import com.xensource.xenapi.PIF; -import com.xensource.xenapi.Types.IpConfigurationMode; -import com.xensource.xenapi.Types.XenAPIException; -import com.xensource.xenapi.VLAN; -import com.xensource.xenapi.VM; - import com.cloud.agent.api.Answer; import com.cloud.agent.api.CheckOnHostAnswer; import com.cloud.agent.api.CheckOnHostCommand; @@ -45,9 +26,26 @@ import com.cloud.agent.api.NetworkUsageCommand; import com.cloud.agent.api.StartupCommand; import com.cloud.resource.ServerResource; +import com.cloud.utils.ExecutionResult; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.script.Script; import com.cloud.utils.ssh.SSHCmdHelper; +import com.xensource.xenapi.Connection; +import com.xensource.xenapi.Host; +import com.xensource.xenapi.Network; +import com.xensource.xenapi.PIF; +import com.xensource.xenapi.Types.IpConfigurationMode; +import com.xensource.xenapi.Types.XenAPIException; +import com.xensource.xenapi.VLAN; +import com.xensource.xenapi.VM; +import org.apache.log4j.Logger; +import org.apache.xmlrpc.XmlRpcException; + +import javax.ejb.Local; +import java.io.File; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; @Local(value = ServerResource.class) public class XenServer56Resource extends CitrixResourceBase { @@ -178,11 +176,15 @@ protected NetworkUsageAnswer VPCNetworkUsage(NetworkUsageCommand cmd) { return new NetworkUsageAnswer(cmd, "success", 0L, 0L); } - String result = executeInVR(cmd.getPrivateIP(), "vpc_netusage.sh", args).getDetails(); + ExecutionResult result = executeInVR(cmd.getPrivateIP(), "vpc_netusage.sh", args); + String detail = result.getDetails(); + if (!result.isSuccess()) { + throw new Exception(" vpc network usage plugin call failed "); + } if (option.equals("get") || option.equals("vpn")) { long[] stats = new long[2]; - if (result != null) { - String[] splitResult = result.split(":"); + if (detail != null) { + String[] splitResult = detail.split(":"); int i = 0; while (i < splitResult.length - 1) { stats[0] += (new Long(splitResult[i++])).longValue(); @@ -191,9 +193,6 @@ protected NetworkUsageAnswer VPCNetworkUsage(NetworkUsageCommand cmd) { return new NetworkUsageAnswer(cmd, "success", stats[0], stats[1]); } } - if (result == null || result.isEmpty()) { - throw new Exception(" vpc network usage plugin call failed "); - } return new NetworkUsageAnswer(cmd, "success", 0L, 0L); } catch (Exception ex) { s_logger.warn("Failed to get network usage stats due to ", ex); From a3e9d0ff12deb36fa304795a089345869cc29a08 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Mon, 12 May 2014 18:26:53 -0700 Subject: [PATCH 435/683] CLOUDSTACK-5501: Allow one vpn customer gateway with multiple connections This restriction was purposely avoid confusion of VPN setup, but later found too strictly and cause troubles for deployment. Removed after testing one customer gateway with multiple connections. --- .../src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java index 1d6ed22b41..a34aa6c7e8 100644 --- a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java +++ b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java @@ -264,13 +264,9 @@ public Site2SiteVpnConnection createVpnConnection(CreateVpnConnectionCmd cmd) th } if (_vpnConnectionDao.findByVpnGatewayIdAndCustomerGatewayId(vpnGatewayId, customerGatewayId) != null) { - throw new InvalidParameterValueException("The vpn connection with customer gateway id " + customerGatewayId + " or vpn gateway id " + vpnGatewayId + + throw new InvalidParameterValueException("The vpn connection with customer gateway id " + customerGatewayId + " and vpn gateway id " + vpnGatewayId + " already existed!"); } - if (_vpnConnectionDao.findByCustomerGatewayId(customerGatewayId) != null) { - throw new InvalidParameterValueException("The vpn connection with specified customer gateway id " + customerGatewayId + " already exists!"); - } - String[] cidrList = customerGateway.getGuestCidrList().split(","); // Remote sub nets cannot overlap VPC's sub net From 900415b1d847ab4f2ccca75452adc1db009bb261 Mon Sep 17 00:00:00 2001 From: santhosh Date: Tue, 13 May 2014 15:12:14 +1000 Subject: [PATCH 436/683] Fixed CLOUDSTACK-6648 vm_ha cases were failing because of improper zone and test data passed. Fixed them now. Signed-off-by: santhosh Signed-off-by: Koushik Das --- test/integration/smoke/test_vm_ha.py | 45 ++++--------------------- tools/marvin/marvin/config/test_data.py | 21 ++++++++---- 2 files changed, 21 insertions(+), 45 deletions(-) diff --git a/test/integration/smoke/test_vm_ha.py b/test/integration/smoke/test_vm_ha.py index f549243729..406394635c 100644 --- a/test/integration/smoke/test_vm_ha.py +++ b/test/integration/smoke/test_vm_ha.py @@ -35,51 +35,18 @@ from nose.plugins.attrib import attr -class TestData(object): - """Test data object that is required to create resources - """ - def __init__(self): - self.testdata = { - #data to create an account - "account": { - "email": "test@test.com", - "firstname": "Test", - "lastname": "User", - "username": "test", - "password": "password", - }, - #data reqd for virtual machine creation - "virtual_machine" : { - "name" : "testvm", - "displayname" : "Test VM", - }, - #small service offering - "service_offering": { - "hasmall": { - "name": "HA Small Instance", - "displaytext": "HA Small Instance", - "cpunumber": 1, - "cpuspeed": 100, - "memory": 256, - "hosttags": "ha", - "offerha": True, - }, - }, - "ostype": 'CentOS 5.3 (64-bit)', - } - - class TestDeployVMHA(cloudstackTestCase): """Test VM HA """ def setUp(self): - self.testdata = TestData().testdata + self.testdata = self.testClient.getParsedTestDataConfig() self.apiclient = self.testClient.getApiClient() # Get Zone, Domain and Default Built-in template - self.domain = get_domain(self.apiclient, self.testdata) - self.zone = get_zone(self.apiclient, self.testdata) + self.domain = get_domain(self.apiclient) + self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests()) + self.testdata["mode"] = self.zone.networktype self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"]) @@ -95,7 +62,7 @@ def setUp(self): self.assertTrue(isinstance(self.hosts, list) and len(self.hosts) >= 2, msg = "Atleast 2 hosts required in cluster for VM HA test") #update host tags for host in self.hosts: - Host.update(self.apiclient, id=host.id, hosttags=self.testdata["service_offering"]["hasmall"]["hosttags"]) + Host.update(self.apiclient, id=host.id, hosttags=self.testdata["service_offerings"]["hasmall"]["hosttags"]) #create a user account self.account = Account.create( @@ -106,7 +73,7 @@ def setUp(self): #create a service offering self.service_offering = ServiceOffering.create( self.apiclient, - self.testdata["service_offering"]["hasmall"] + self.testdata["service_offerings"]["hasmall"] ) #deploy ha vm self.virtual_machine = VirtualMachine.create( diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py index fbf5e25d26..7001c423d2 100644 --- a/tools/marvin/marvin/config/test_data.py +++ b/tools/marvin/marvin/config/test_data.py @@ -109,7 +109,16 @@ "cpunumber": 1, "cpuspeed": 100, "memory": 512, - } + }, + "hasmall": { + "name": "HA Small Instance", + "displaytext": "HA Small Instance", + "cpunumber": 1, + "cpuspeed": 100, + "memory": 256, + "hosttags": "ha", + "offerha": True, + }, }, "disk_offering": { "name": "Disk offering", @@ -278,14 +287,14 @@ } }, "shared_network_offering_all_services": { - "name":"shaared network offering with services enabled", + "name": "shaared network offering with services enabled", "displaytext": "Shard network offering", "guestiptype": "Shared", "supportedservices": "Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat", - "specifyVlan" : "False", - "specifyIpRanges" : "False", + "specifyVlan": "False", + "specifyIpRanges": "False", "traffictype": "GUEST", - "serviceProviderList" : { + "serviceProviderList": { "Dhcp": "VirtualRouter", "Dns": "VirtualRouter", "UserData": "VirtualRouter", @@ -531,7 +540,7 @@ "Lb": "VirtualRouter", "UserData": "VirtualRouter", "StaticNat": "VirtualRouter" - } + } }, "fwrule": { "startport": 22, From 594f66d12521c6a3a07475e37e7ab0f09d247b19 Mon Sep 17 00:00:00 2001 From: Amogh Vasekar Date: Mon, 12 May 2014 22:43:06 -0700 Subject: [PATCH 437/683] This patch disallows deleting / modifying system defined guest OS mappings Local env 1. Create user defined mapping 2. Delete / modify user defined mapping. Should pass 3. Delete / modify system defined mapping. Should fail Signed off by :- Nitin Mehta --- .../apache/cloudstack/api/ApiConstants.java | 1 + .../api/response/GuestOSResponse.java | 13 +++++++++++ .../api/response/GuestOsMappingResponse.java | 12 ++++++++++ .../storage/dao/GuestOSHypervisorDao.java | 2 ++ .../storage/dao/GuestOSHypervisorDaoImpl.java | 22 +++++++++++++++++++ .../src/com/cloud/api/ApiResponseHelper.java | 2 ++ .../cloud/server/ManagementServerImpl.java | 18 ++++++++++++++- 7 files changed, 69 insertions(+), 1 deletion(-) diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index 70e1984420..850e67e64b 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -290,6 +290,7 @@ public class ApiConstants { public static final String SPECIFY_VLAN = "specifyvlan"; public static final String IS_DEFAULT = "isdefault"; public static final String IS_SYSTEM = "issystem"; + public static final String IS_USER_DEFINED = "isuserdefined"; public static final String AVAILABILITY = "availability"; public static final String NETWORKRATE = "networkrate"; public static final String HOST_TAGS = "hosttags"; diff --git a/api/src/org/apache/cloudstack/api/response/GuestOSResponse.java b/api/src/org/apache/cloudstack/api/response/GuestOSResponse.java index 9737d6073a..6822288a86 100644 --- a/api/src/org/apache/cloudstack/api/response/GuestOSResponse.java +++ b/api/src/org/apache/cloudstack/api/response/GuestOSResponse.java @@ -39,6 +39,10 @@ public class GuestOSResponse extends BaseResponse { @Param(description = "the name/description of the OS type") private String description; + @SerializedName(ApiConstants.IS_USER_DEFINED) + @Param(description = "is the guest OS user defined") + private String isUserDefined; + public String getId() { return id; } @@ -62,4 +66,13 @@ public String getDescription() { public void setDescription(String description) { this.description = description; } + + public String getIsUserDefined() { + return isUserDefined; + } + + public void setIsUserDefined(String isUserDefined) { + this.isUserDefined = isUserDefined; + } + } diff --git a/api/src/org/apache/cloudstack/api/response/GuestOsMappingResponse.java b/api/src/org/apache/cloudstack/api/response/GuestOsMappingResponse.java index a0f7d1d0ed..583768d47b 100644 --- a/api/src/org/apache/cloudstack/api/response/GuestOsMappingResponse.java +++ b/api/src/org/apache/cloudstack/api/response/GuestOsMappingResponse.java @@ -52,6 +52,18 @@ public class GuestOsMappingResponse extends BaseResponse { @Param(description = "hypervisor specific name for the Guest OS") private String osNameForHypervisor; + @SerializedName(ApiConstants.IS_USER_DEFINED) + @Param(description = "is the mapping user defined") + private String isUserDefined; + + public String getIsUserDefined() { + return isUserDefined; + } + + public void setIsUserDefined(String isUserDefined) { + this.isUserDefined = isUserDefined; + } + public String getId() { return id; } diff --git a/engine/schema/src/com/cloud/storage/dao/GuestOSHypervisorDao.java b/engine/schema/src/com/cloud/storage/dao/GuestOSHypervisorDao.java index 5b6e7198f0..a777516526 100644 --- a/engine/schema/src/com/cloud/storage/dao/GuestOSHypervisorDao.java +++ b/engine/schema/src/com/cloud/storage/dao/GuestOSHypervisorDao.java @@ -27,4 +27,6 @@ public interface GuestOSHypervisorDao extends GenericDao guestOsSearch; protected final SearchBuilder mappingSearch; + protected final SearchBuilder userDefinedMappingSearch; protected GuestOSHypervisorDaoImpl() { guestOsSearch = createSearchBuilder(); @@ -45,6 +46,13 @@ protected GuestOSHypervisorDaoImpl() { mappingSearch.and("hypervisor_type", mappingSearch.entity().getHypervisorType(), SearchCriteria.Op.EQ); mappingSearch.and("hypervisor_version", mappingSearch.entity().getHypervisorVersion(), SearchCriteria.Op.EQ); mappingSearch.done(); + + userDefinedMappingSearch = createSearchBuilder(); + userDefinedMappingSearch.and("guest_os_id", userDefinedMappingSearch.entity().getGuestOsId(), SearchCriteria.Op.EQ); + userDefinedMappingSearch.and("hypervisor_type", userDefinedMappingSearch.entity().getHypervisorType(), SearchCriteria.Op.EQ); + userDefinedMappingSearch.and("hypervisor_version", userDefinedMappingSearch.entity().getHypervisorVersion(), SearchCriteria.Op.EQ); + userDefinedMappingSearch.and("is_user_defined", userDefinedMappingSearch.entity().getIsUserDefined(), SearchCriteria.Op.EQ); + userDefinedMappingSearch.done(); } @Override @@ -68,6 +76,20 @@ public GuestOSHypervisorVO findByOsIdAndHypervisor(long guestOsId, String hyperv return findOneBy(sc); } + @Override + public GuestOSHypervisorVO findByOsIdAndHypervisorAndUserDefined(long guestOsId, String hypervisorType, String hypervisorVersion, boolean isUserDefined) { + SearchCriteria sc = userDefinedMappingSearch.create(); + String version = "default"; + if (!(hypervisorVersion == null || hypervisorVersion.isEmpty())) { + version = hypervisorVersion; + } + sc.setParameters("guest_os_id", guestOsId); + sc.setParameters("hypervisor_type", hypervisorType); + sc.setParameters("hypervisor_version", version); + sc.setParameters("is_user_defined", isUserDefined); + return findOneBy(sc); + } + @Override public boolean removeGuestOsMapping(Long id) { GuestOSHypervisorVO guestOsHypervisor = findById(id); diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index d8e26d8f8b..7c342d8432 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -3158,6 +3158,7 @@ public GuestOSResponse createGuestOSResponse(GuestOS guestOS) { GuestOSResponse response = new GuestOSResponse(); response.setDescription(guestOS.getDisplayName()); response.setId(guestOS.getUuid()); + response.setIsUserDefined(Boolean.valueOf(guestOS.getIsUserDefined()).toString()); GuestOSCategoryVO category = ApiDBUtils.findGuestOsCategoryById(guestOS.getCategoryId()); if (category != null) { response.setOsCategoryId(category.getUuid()); @@ -3174,6 +3175,7 @@ public GuestOsMappingResponse createGuestOSMappingResponse(GuestOSHypervisor gue response.setHypervisor(guestOSHypervisor.getHypervisorType()); response.setHypervisorVersion(guestOSHypervisor.getHypervisorVersion()); response.setOsNameForHypervisor((guestOSHypervisor.getGuestOsName())); + response.setIsUserDefined(Boolean.valueOf(guestOSHypervisor.getIsUserDefined()).toString()); GuestOS guestOs = ApiDBUtils.findGuestOSById(guestOSHypervisor.getGuestOsId()); if (guestOs != null) { response.setOsStdName(guestOs.getDisplayName()); diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index da25298601..4a4c74a93c 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -2029,7 +2029,7 @@ else if (osStdName != null) { throw new InvalidParameterValueException("Unable to find the guest OS by name or UUID"); } //check for duplicates - GuestOSHypervisorVO duplicate = _guestOSHypervisorDao.findByOsIdAndHypervisor(guestOs.getId(), hypervisorType.toString(), hypervisorVersion); + GuestOSHypervisorVO duplicate = _guestOSHypervisorDao.findByOsIdAndHypervisorAndUserDefined(guestOs.getId(), hypervisorType.toString(), hypervisorVersion, true); if (duplicate != null) { throw new InvalidParameterValueException("Mapping from hypervisor : " + hypervisorType.toString() + ", version : " + hypervisorVersion + " and guest OS : " @@ -2096,6 +2096,10 @@ public GuestOS updateGuestOs(UpdateGuestOsCmd cmd) { throw new InvalidParameterValueException("Guest OS not found. Please specify a valid ID for the Guest OS"); } + if (!guestOsHandle.getIsUserDefined()) { + throw new InvalidParameterValueException("Unable to modify system defined guest OS"); + } + //Check if update is needed if (displayName.equals(guestOsHandle.getDisplayName())) { return guestOsHandle; @@ -2127,6 +2131,10 @@ public boolean removeGuestOs(RemoveGuestOsCmd cmd) { throw new InvalidParameterValueException("Guest OS not found. Please specify a valid ID for the Guest OS"); } + if (!guestOs.getIsUserDefined()) { + throw new InvalidParameterValueException("Unable to remove system defined guest OS"); + } + return _guestOSDao.remove(id); } @@ -2143,6 +2151,10 @@ public GuestOSHypervisor updateGuestOsMapping(UpdateGuestOsMappingCmd cmd) { throw new InvalidParameterValueException("Guest OS Mapping not found. Please specify a valid ID for the Guest OS Mapping"); } + if (!guestOsHypervisorHandle.getIsUserDefined()) { + throw new InvalidParameterValueException("Unable to modify system defined Guest OS mapping"); + } + GuestOSHypervisorVO guestOsHypervisor = _guestOSHypervisorDao.createForUpdate(id); guestOsHypervisor.setGuestOsName(osNameForHypervisor); if (_guestOSHypervisorDao.update(id, guestOsHypervisor)) { @@ -2164,6 +2176,10 @@ public boolean removeGuestOsMapping(RemoveGuestOsMappingCmd cmd) { throw new InvalidParameterValueException("Guest OS Mapping not found. Please specify a valid ID for the Guest OS Mapping"); } + if (!guestOsHypervisorHandle.getIsUserDefined()) { + throw new InvalidParameterValueException("Unable to remove system defined Guest OS mapping"); + } + return _guestOSHypervisorDao.removeGuestOsMapping(id); } From 260e06d64c07c6e5f3c133d8bdc2779fad62c672 Mon Sep 17 00:00:00 2001 From: Rajesh Battala Date: Tue, 13 May 2014 11:39:14 +0530 Subject: [PATCH 438/683] CLOUDSTACK-6519 [Hyper-V] while adding VM to Network it should throw error when it is in running state --- .../hyperv/resource/HypervDirectConnectResource.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java index 1816bafa68..f29839dc72 100644 --- a/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java +++ b/plugins/hypervisors/hyperv/src/com/cloud/hypervisor/hyperv/resource/HypervDirectConnectResource.java @@ -531,6 +531,10 @@ private PlugNicAnswer execute(PlugNicCommand cmd) { try { String vmName = cmd.getVmName(); + if(cmd.getVMType() == VirtualMachine.Type.User) { + s_logger.error("Vm in Running state cannot be added to new network.Nic cannot be plugged to VM in running state"); + return new PlugNicAnswer(cmd, false, "Vm in Running state cannot be added to new network.Nic cannot be plugged to VM in running state"); + } NicTO nic = cmd.getNic(); URI broadcastUri = nic.getBroadcastUri(); if (BroadcastDomainType.getSchemeValue(broadcastUri) != BroadcastDomainType.Vlan) { From 2334d9a1f3bd5ecc51cdeeff0512e95c93b7ead1 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Tue, 13 May 2014 14:08:16 -0700 Subject: [PATCH 439/683] CLOUDSTACK-6659: fixed the name for the updateIpAddress API command --- .../cloudstack/api/command/user/address/UpdateIPAddrCmd.java | 2 +- client/tomcatconf/commands.properties.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java index 99bb1afd5f..c64b6411c5 100644 --- a/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/address/UpdateIPAddrCmd.java @@ -38,7 +38,7 @@ import com.cloud.network.IpAddress; import com.cloud.user.Account; -@APICommand(name = "updatePublicIpAddress", description = "Updates an ip address", responseObject = IPAddressResponse.class, +@APICommand(name = "updateIpAddress", description = "Updates an ip address", responseObject = IPAddressResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, entityType = { IpAddress.class }) public class UpdateIPAddrCmd extends BaseAsyncCustomIdCmd { public static final Logger s_logger = Logger.getLogger(UpdateIPAddrCmd.class.getName()); diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in index d151724aef..da3fbfc00d 100644 --- a/client/tomcatconf/commands.properties.in +++ b/client/tomcatconf/commands.properties.in @@ -146,7 +146,7 @@ listDedicatedGuestVlanRanges=1 associateIpAddress=15 disassociateIpAddress=15 listPublicIpAddresses=15 -updatePublicIpAddress=15 +updateIpAddress=15 #### firewall commands listPortForwardingRules=15 From d32f5c70d26ce82561bbdce962fd881a644ab81c Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Fri, 14 Mar 2014 13:36:43 -0700 Subject: [PATCH 440/683] CLOUDSTACK-6241: Fix default route for IPv6 network when IPv4 not used (cherry picked from commit e406adc0810b22ded0964080946f019be1337b52) --- systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh b/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh index 8e7ddac8fd..70c95a88ad 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh +++ b/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh @@ -184,7 +184,7 @@ then echo "$ipv6 $host" >> $HOSTS fi -if [ "$dflt" != "" ] +if [ "$dflt" != "" -a "$ipv4" != "" ] then #make sure dnsmasq looks into options file sed -i /dhcp-optsfile/d /etc/dnsmasq.conf From e7e1ae254af8588a90bee56f5dcd1175c64ffd5e Mon Sep 17 00:00:00 2001 From: Sanjay Tripathi Date: Tue, 13 May 2014 15:00:11 +0530 Subject: [PATCH 441/683] CLOUDSTACK-6649: CS is not giving the system-wide capacity for GPU reosurce. --- .../com/cloud/agent/api/VgpuTypesInfo.java | 8 ++- api/src/com/cloud/capacity/Capacity.java | 1 + .../cloudstack/api/response/HostResponse.java | 1 + .../com/cloud/gpu/dao/HostGpuGroupsDao.java | 2 +- .../src/com/cloud/gpu/dao/VGPUTypesDao.java | 47 +++++++++------- .../com/cloud/gpu/dao/VGPUTypesDaoImpl.java | 54 ++++++++++++++++++- .../src/com/cloud/vm/dao/VMInstanceDao.java | 3 ++ .../com/cloud/vm/dao/VMInstanceDaoImpl.java | 46 ++++++++++++++++ .../xen/resource/XenServer620SP1Resource.java | 2 +- server/src/com/cloud/api/ApiDBUtils.java | 10 ++++ .../src/com/cloud/api/ApiResponseHelper.java | 40 ++++++++++++++ ui/scripts/sharedFunctions.js | 2 + ui/scripts/ui-custom/zoneChart.js | 3 ++ 13 files changed, 195 insertions(+), 24 deletions(-) diff --git a/api/src/com/cloud/agent/api/VgpuTypesInfo.java b/api/src/com/cloud/agent/api/VgpuTypesInfo.java index ed54c5af0f..85ffc18982 100644 --- a/api/src/com/cloud/agent/api/VgpuTypesInfo.java +++ b/api/src/com/cloud/agent/api/VgpuTypesInfo.java @@ -18,6 +18,7 @@ public class VgpuTypesInfo { private String modelName; + private String groupName; private Long maxHeads; private Long videoRam; private Long maxResolutionX; @@ -30,6 +31,10 @@ public String getModelName() { return modelName; } + public String getGroupName() { + return groupName; + } + public Long getVideoRam() { return videoRam; } @@ -66,8 +71,9 @@ public void setMaxVmCapacity(Long maxCapacity) { this.maxCapacity = maxCapacity; } - public VgpuTypesInfo(String modelName, Long videoRam, Long maxHeads, Long maxResolutionX, Long maxResolutionY, Long maxVgpuPerGpu, + public VgpuTypesInfo(String groupName, String modelName, Long videoRam, Long maxHeads, Long maxResolutionX, Long maxResolutionY, Long maxVgpuPerGpu, Long remainingCapacity, Long maxCapacity) { + this.groupName = groupName; this.modelName = modelName; this.videoRam = videoRam; this.maxHeads = maxHeads; diff --git a/api/src/com/cloud/capacity/Capacity.java b/api/src/com/cloud/capacity/Capacity.java index c1c5d8fa9b..2fbc1d6eef 100755 --- a/api/src/com/cloud/capacity/Capacity.java +++ b/api/src/com/cloud/capacity/Capacity.java @@ -30,6 +30,7 @@ public interface Capacity extends InternalIdentity, Identity { public static final short CAPACITY_TYPE_VLAN = 7; public static final short CAPACITY_TYPE_DIRECT_ATTACHED_PUBLIC_IP = 8; public static final short CAPACITY_TYPE_LOCAL_STORAGE = 9; + public static final short CAPACITY_TYPE_GPU = 19; public Long getHostOrPoolId(); diff --git a/api/src/org/apache/cloudstack/api/response/HostResponse.java b/api/src/org/apache/cloudstack/api/response/HostResponse.java index 008631ff7d..d7638dee0f 100644 --- a/api/src/org/apache/cloudstack/api/response/HostResponse.java +++ b/api/src/org/apache/cloudstack/api/response/HostResponse.java @@ -328,6 +328,7 @@ public void setMemoryUsed(Long memoryUsed) { public void setGpuGroups(List gpuGroup) { this.gpuGroup = gpuGroup; } + public void setDiskSizeTotal(Long diskSizeTotal) { this.diskSizeTotal = diskSizeTotal; } diff --git a/engine/schema/src/com/cloud/gpu/dao/HostGpuGroupsDao.java b/engine/schema/src/com/cloud/gpu/dao/HostGpuGroupsDao.java index 5864144397..8e4f2f742a 100644 --- a/engine/schema/src/com/cloud/gpu/dao/HostGpuGroupsDao.java +++ b/engine/schema/src/com/cloud/gpu/dao/HostGpuGroupsDao.java @@ -24,7 +24,7 @@ public interface HostGpuGroupsDao extends GenericDao { /** - * Find host device by hostId and PCI ID + * Find host device by hostId and groupName * @param hostId the host * @param groupName GPU group * @return HostGpuGroupsVO diff --git a/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDao.java b/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDao.java index 25f3085ed3..94d97c0073 100644 --- a/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDao.java +++ b/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDao.java @@ -25,25 +25,34 @@ public interface VGPUTypesDao extends GenericDao { - /** - * Find VGPU types by group Id - * @param groupId of the GPU group - * @return list of VGPUTypesVO - */ - List listByGroupId(long groupId); + /** + * List zonewide/podwide/clusterwide GPU card capacities. + * @param zoneId + * @param podId + * @param clusterId + * @return Custom Query result + */ + List listGPUCapacities(Long zoneId, Long podId, Long clusterId); - /** - * Find VGPU type by group Id and VGPU type - * @param groupId of the GPU group - * @param vgpuType name of VGPU type - * @return VGPUTypesVO - */ - VGPUTypesVO findByGroupIdVGPUType(long groupId, String vgpuType); + /** + * Find VGPU types by group Id + * @param groupId of the GPU group + * @return list of VGPUTypesVO + */ + List listByGroupId(long groupId); - /** - * Save the list of enabled VGPU types - * @param hostId the host - * @param groupDetails with enabled VGPU types - */ - void persist(long hostId, HashMap> groupDetails); + /** + * Find VGPU type by group Id and VGPU type + * @param groupId of the GPU group + * @param vgpuType name of VGPU type + * @return VGPUTypesVO + */ + VGPUTypesVO findByGroupIdVGPUType(long groupId, String vgpuType); + + /** + * Save the list of enabled VGPU types + * @param hostId the host + * @param groupDetails with enabled VGPU types + */ + void persist(long hostId, HashMap> groupDetails); } diff --git a/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDaoImpl.java b/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDaoImpl.java index 81a1945ac7..96e3a6277f 100644 --- a/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDaoImpl.java +++ b/engine/schema/src/com/cloud/gpu/dao/VGPUTypesDaoImpl.java @@ -16,6 +16,10 @@ //under the License. package com.cloud.gpu.dao; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -33,6 +37,8 @@ import com.cloud.utils.db.GenericDaoBase; import com.cloud.utils.db.SearchBuilder; import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.TransactionLegacy; +import com.cloud.utils.exception.CloudRuntimeException; @Component @Local(value = VGPUTypesDao.class) @@ -41,11 +47,14 @@ public class VGPUTypesDaoImpl extends GenericDaoBase implemen private final SearchBuilder _searchByGroupId; private final SearchBuilder _searchByGroupIdVGPUType; - // private final SearchBuilder _searchByHostId; - // private final SearchBuilder _searchForStaleEntries; @Inject protected HostGpuGroupsDao _hostGpuGroupsDao; + private static final String LIST_ZONE_POD_CLUSTER_WIDE_GPU_CAPACITIES = + "SELECT host_gpu_groups.group_name, vgpu_type, max_vgpu_per_pgpu, SUM(remaining_capacity) AS remaining_capacity, SUM(max_capacity) AS total_capacity FROM" + + " `cloud`.`vgpu_types` INNER JOIN `cloud`.`host_gpu_groups` ON vgpu_types.gpu_group_id = host_gpu_groups.id INNER JOIN `cloud`.`host`" + + " ON host_gpu_groups.host_id = host.id WHERE host.type = 'Routing' AND host.data_center_id = ?"; + public VGPUTypesDaoImpl() { _searchByGroupId = createSearchBuilder(); @@ -58,6 +67,47 @@ public VGPUTypesDaoImpl() { _searchByGroupIdVGPUType.done(); } + @Override + public List listGPUCapacities(Long dcId, Long podId, Long clusterId) { + StringBuilder finalQuery = new StringBuilder(); + TransactionLegacy txn = TransactionLegacy.currentTxn(); + PreparedStatement pstmt = null; + List resourceIdList = new ArrayList(); + ArrayList result = new ArrayList(); + + resourceIdList.add(dcId); + finalQuery.append(LIST_ZONE_POD_CLUSTER_WIDE_GPU_CAPACITIES); + + if (podId != null) { + finalQuery.append(" AND host.pod_id = ?"); + resourceIdList.add(podId); + } + + if (clusterId != null) { + finalQuery.append(" AND host.cluster_id = ?"); + resourceIdList.add(clusterId); + } + finalQuery.append(" GROUP BY host_gpu_groups.group_name, vgpu_type"); + + try { + pstmt = txn.prepareAutoCloseStatement(finalQuery.toString()); + for (int i = 0; i < resourceIdList.size(); i++) { + pstmt.setLong(1 + i, resourceIdList.get(i)); + } + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) { + + VgpuTypesInfo gpuCapacity = new VgpuTypesInfo(rs.getString(1), rs.getString(2), null, null, null, null, rs.getLong(3), rs.getLong(4), rs.getLong(5)); + result.add(gpuCapacity); + } + return result; + } catch (SQLException e) { + throw new CloudRuntimeException("DB Exception on: " + finalQuery, e); + } catch (Throwable e) { + throw new CloudRuntimeException("Caught: " + finalQuery, e); + } + } + @Override public List listByGroupId(long groupId) { SearchCriteria sc = _searchByGroupId.create(); diff --git a/engine/schema/src/com/cloud/vm/dao/VMInstanceDao.java b/engine/schema/src/com/cloud/vm/dao/VMInstanceDao.java index 453d222cdf..6ba7c36521 100644 --- a/engine/schema/src/com/cloud/vm/dao/VMInstanceDao.java +++ b/engine/schema/src/com/cloud/vm/dao/VMInstanceDao.java @@ -17,6 +17,7 @@ package com.cloud.vm.dao; import java.util.Date; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -133,4 +134,6 @@ public interface VMInstanceDao extends GenericDao, StateDao< void resetVmPowerStateTracking(long instanceId); void resetHostPowerStateTracking(long hostId); + + HashMap countVgpuVMs(Long dcId, Long podId, Long clusterId); } diff --git a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java index cc05f53605..bcd6fa78a7 100644 --- a/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/dao/VMInstanceDaoImpl.java @@ -115,6 +115,13 @@ public class VMInstanceDaoImpl extends GenericDaoBase implem private static final String ORDER_HOSTS_NUMBER_OF_VMS_FOR_ACCOUNT_PART2 = " GROUP BY host.id ORDER BY 2 ASC "; + private static final String COUNT_VMS_BASED_ON_VGPU_TYPES1 = + "SELECT pci, type, SUM(vmcount) FROM (SELECT MAX(IF(offering.name = 'pciDevice',value,'')) AS pci, MAX(IF(offering.name = 'vgpuType', value,'')) " + + "AS type, COUNT(DISTINCT vm.id) AS vmcount FROM service_offering_details offering INNER JOIN vm_instance vm ON offering.service_offering_id = vm.service_offering_id " + + "INNER JOIN `cloud`.`host` ON vm.host_id = host.id WHERE vm.state = 'Running' AND host.data_center_id = ? "; + private static final String COUNT_VMS_BASED_ON_VGPU_TYPES2 = + "GROUP BY offering.service_offering_id) results GROUP BY pci, type"; + @Inject protected HostDao _hostDao; @@ -640,6 +647,45 @@ public List listHostIdsByVmCount(long dcId, Long podId, Long clusterId, lo } } + @Override + public HashMap countVgpuVMs(Long dcId, Long podId, Long clusterId) { + StringBuilder finalQuery = new StringBuilder(); + TransactionLegacy txn = TransactionLegacy.currentTxn(); + PreparedStatement pstmt = null; + List resourceIdList = new ArrayList(); + HashMap result = new HashMap(); + + resourceIdList.add(dcId); + finalQuery.append(COUNT_VMS_BASED_ON_VGPU_TYPES1); + + if (podId != null) { + finalQuery.append(" AND host.pod_id = ?"); + resourceIdList.add(podId); + } + + if (clusterId != null) { + finalQuery.append(" AND host.cluster_id = ?"); + resourceIdList.add(clusterId); + } + finalQuery.append(COUNT_VMS_BASED_ON_VGPU_TYPES2); + + try { + pstmt = txn.prepareAutoCloseStatement(finalQuery.toString()); + for (int i = 0; i < resourceIdList.size(); i++) { + pstmt.setLong(1 + i, resourceIdList.get(i)); + } + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) { + result.put(rs.getString(1).concat(rs.getString(2)), rs.getLong(3)); + } + return result; + } catch (SQLException e) { + throw new CloudRuntimeException("DB Exception on: " + finalQuery, e); + } catch (Throwable e) { + throw new CloudRuntimeException("Caught: " + finalQuery, e); + } + } + @Override public Long countRunningByAccount(long accountId) { SearchCriteria sc = CountRunningByAccount.create(); diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer620SP1Resource.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer620SP1Resource.java index 8e9bfa92a7..3e50ef22b9 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer620SP1Resource.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/XenServer620SP1Resource.java @@ -122,7 +122,7 @@ protected HashMap> getGPUGroupDetails(Con entry.setMaxVmCapacity(maxCapacity); gpuCapacity.put(record.modelName, entry); } else { - VgpuTypesInfo vgpuTypeRecord = new VgpuTypesInfo(record.modelName, record.framebufferSize, record.maxHeads, + VgpuTypesInfo vgpuTypeRecord = new VgpuTypesInfo(null, record.modelName, record.framebufferSize, record.maxHeads, record.maxResolutionX, record.maxResolutionY, maxCapacity, remainingCapacity, maxCapacity); gpuCapacity.put(record.modelName, vgpuTypeRecord); } diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java index 296a1f4bb0..a953cd645e 100755 --- a/server/src/com/cloud/api/ApiDBUtils.java +++ b/server/src/com/cloud/api/ApiDBUtils.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.EnumSet; +import java.util.HashMap; import java.util.List; import java.util.ListIterator; import java.util.Map; @@ -64,6 +65,7 @@ import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; +import com.cloud.agent.api.VgpuTypesInfo; import com.cloud.api.query.dao.AccountJoinDao; import com.cloud.api.query.dao.AffinityGroupJoinDao; import com.cloud.api.query.dao.AsyncJobJoinDao; @@ -1101,6 +1103,14 @@ public static List getGpuGroups(long hostId) { return s_hostGpuGroupsDao.listByHostId(hostId); } + public static List getGpuCapacites(Long zoneId, Long podId, Long clusterId) { + return s_vgpuTypesDao.listGPUCapacities(zoneId, podId, clusterId); + } + + public static HashMap getVgpuVmsCount(Long zoneId, Long podId, Long clusterId) { + return s_vmDao.countVgpuVMs(zoneId, podId, clusterId); + } + public static List getVgpus(long groupId) { return s_vgpuTypesDao.listByGroupId(groupId); } diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 7c342d8432..4ce9fa6be6 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -150,6 +150,7 @@ import org.apache.cloudstack.usage.UsageService; import org.apache.cloudstack.usage.UsageTypes; +import com.cloud.agent.api.VgpuTypesInfo; import com.cloud.api.query.ViewResponseHelper; import com.cloud.api.query.vo.AccountJoinVO; import com.cloud.api.query.vo.AsyncJobJoinVO; @@ -193,6 +194,7 @@ import com.cloud.event.Event; import com.cloud.exception.InvalidParameterValueException; import com.cloud.exception.PermissionDeniedException; +import com.cloud.gpu.GPU; import com.cloud.host.Host; import com.cloud.host.HostVO; import com.cloud.hypervisor.HypervisorCapabilities; @@ -1735,6 +1737,44 @@ public List createCapacityResponse(List re capacityResponses.add(capacityResponse); } + List gpuCapacities; + if ((gpuCapacities = ApiDBUtils.getGpuCapacites(result.get(0).getDataCenterId(), result.get(0).getPodId(), result.get(0).getClusterId())) != null) { + HashMap vgpuVMs = ApiDBUtils.getVgpuVmsCount(result.get(0).getDataCenterId(), result.get(0).getPodId(), result.get(0).getClusterId()); + + float capacityUsed = 0; + long capacityMax = 0; + for (VgpuTypesInfo capacity : gpuCapacities) { + if (vgpuVMs.containsKey(capacity.getGroupName().concat(capacity.getModelName()))) { + capacityUsed += (float)vgpuVMs.get(capacity.getGroupName().concat(capacity.getModelName())) / capacity.getMaxVpuPerGpu(); + } + if (capacity.getModelName().equals(GPU.vGPUType.passthrough.toString())) { + capacityMax += capacity.getMaxCapacity(); + } + } + + DataCenter zone = ApiDBUtils.findZoneById(result.get(0).getDataCenterId()); + CapacityResponse capacityResponse = new CapacityResponse(); + if (zone != null) { + capacityResponse.setZoneId(zone.getUuid()); + capacityResponse.setZoneName(zone.getName()); + } + if (result.get(0).getPodId() != null) { + HostPodVO pod = ApiDBUtils.findPodById(result.get(0).getPodId()); + capacityResponse.setPodId(pod.getUuid()); + capacityResponse.setPodName(pod.getName()); + } + if (result.get(0).getClusterId() != null) { + ClusterVO cluster = ApiDBUtils.findClusterById(result.get(0).getClusterId()); + capacityResponse.setClusterId(cluster.getUuid()); + capacityResponse.setClusterName(cluster.getName()); + } + capacityResponse.setCapacityType(Capacity.CAPACITY_TYPE_GPU); + capacityResponse.setCapacityUsed((long)Math.ceil(capacityUsed)); + capacityResponse.setCapacityTotal(capacityMax); + capacityResponse.setPercentUsed(format.format(capacityUsed / capacityMax * 100f)); + capacityResponse.setObjectName("capacity"); + capacityResponses.add(capacityResponse); + } return capacityResponses; } diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index 2f7ef0aa85..9cb48a20a7 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -1104,6 +1104,8 @@ cloudStack.converters = { return "VLAN"; case 18: return "Secondary Storage VM"; + case 19: + return "GPU"; } }, diff --git a/ui/scripts/ui-custom/zoneChart.js b/ui/scripts/ui-custom/zoneChart.js index 877567e4a6..ac3c0e475a 100644 --- a/ui/scripts/ui-custom/zoneChart.js +++ b/ui/scripts/ui-custom/zoneChart.js @@ -383,6 +383,9 @@ }, 7: { name: _l('label.vlan') + }, + 19: { + name: _l('GPU') } }; From 4c01d81d80ef8541ba0976c3beee9d7180da883b Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Wed, 14 May 2014 16:38:17 +0530 Subject: [PATCH 442/683] CLOUDSTACK-6668: OVS distributed routing: ensure bridge is deleted when last VM from the VPC is deleted on a host OVS distributed routing: ensure bridge is deleted when last VM from the VPC is deleted on a host. This fix ensures that bridge is destroyed. --- .../xen/resource/CitrixResourceBase.java | 36 +++---- .../agent/api/OvsDestroyBridgeCommand.java | 8 +- .../network/ovs/OvsNetworkTopologyGuru.java | 2 +- .../ovs/OvsNetworkTopologyGuruImpl.java | 10 +- .../network/ovs/OvsTunnelManagerImpl.java | 96 ++++++++++--------- .../xenserver/cloudstack_pluginlib.py | 12 ++- scripts/vm/hypervisor/xenserver/ovstunnel | 27 ++++-- 7 files changed, 111 insertions(+), 80 deletions(-) diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 2b6fb11344..93feb07318 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -990,6 +990,7 @@ private synchronized Network findOrCreateTunnelNetwork(Connection conn, String n Network.Record rec = new Network.Record(); Set networks = Network.getByNameLabel(conn, nwName); + if (networks.size() == 0) { rec.nameDescription = "tunnel network id# " + nwName; rec.nameLabel = nwName; @@ -1064,11 +1065,11 @@ private synchronized Network configureTunnelNetwork(Connection conn, Long networ } } - private synchronized void destroyTunnelNetwork(Connection conn, String bridgeName) { + private synchronized void destroyTunnelNetwork(Connection conn, Network nw, long hostId) { try { - Network nw = findOrCreateTunnelNetwork(conn, bridgeName); String bridge = nw.getBridge(conn); - String result = callHostPlugin(conn, "ovstunnel", "destroy_ovs_bridge", "bridge", bridge); + String result = callHostPlugin(conn, "ovstunnel", "destroy_ovs_bridge", "bridge", bridge, + "cs_host_id", ((Long)hostId).toString()); String[] res = result.split(":"); if (res.length != 2 || !res[0].equalsIgnoreCase("SUCCESS")) { //TODO: Should make this error not fatal? @@ -1677,14 +1678,12 @@ private HashMap parseDefaultOvsRuleComamnd(String str) { return cmd; } - private void cleanUpTmpDomVif(Connection conn, Network nw) { - List vifs; - synchronized (_tmpDom0Vif) { - vifs = _tmpDom0Vif; - _tmpDom0Vif = new ArrayList(); - } + private void cleanUpTmpDomVif(Connection conn, Network nw) throws XenAPIException, XmlRpcException { - for (VIF v : vifs) { + Pair vm = getControlDomain(conn); + VM dom0 = vm.first(); + Set dom0Vifs = dom0.getVIFs(conn); + for (VIF v : dom0Vifs) { String vifName = "unknown"; try { VIF.Record vifr = v.getRecord(conn); @@ -5273,12 +5272,17 @@ private Answer execute(OvsSetupBridgeCommand cmd) { } private Answer execute(OvsDestroyBridgeCommand cmd) { - Connection conn = getConnection(); - Network nw = findOrCreateTunnelNetwork(conn, cmd.getBridgeName()); - cleanUpTmpDomVif(conn, nw); - destroyTunnelNetwork(conn, cmd.getBridgeName()); - s_logger.debug("OVS Bridge destroyed"); - return new Answer(cmd, true, null); + try { + Connection conn = getConnection(); + Network nw = findOrCreateTunnelNetwork(conn, cmd.getBridgeName()); + cleanUpTmpDomVif(conn, nw); + destroyTunnelNetwork(conn, nw, cmd.getHostId()); + s_logger.debug("OVS Bridge destroyed"); + return new Answer(cmd, true, null); + } catch (Exception e) { + s_logger.warn("caught execption when destroying ovs bridge", e); + return new Answer(cmd, false, e.getMessage()); + } } private Answer execute(OvsDestroyTunnelCommand cmd) { diff --git a/plugins/network-elements/ovs/src/com/cloud/agent/api/OvsDestroyBridgeCommand.java b/plugins/network-elements/ovs/src/com/cloud/agent/api/OvsDestroyBridgeCommand.java index f9205c5e9c..2e0e0b52a9 100644 --- a/plugins/network-elements/ovs/src/com/cloud/agent/api/OvsDestroyBridgeCommand.java +++ b/plugins/network-elements/ovs/src/com/cloud/agent/api/OvsDestroyBridgeCommand.java @@ -22,10 +22,12 @@ public class OvsDestroyBridgeCommand extends Command { Long networkId; String name; + Long hostId; - public OvsDestroyBridgeCommand(Long networkId, String name) { + public OvsDestroyBridgeCommand(Long networkId, String name, Long hostId) { this.networkId = networkId; this.name = name; + this.hostId = hostId; } public Long getNetworkId() { @@ -36,6 +38,10 @@ public String getBridgeName() { return name; } + public Long getHostId() { + return hostId; + } + @Override public boolean executeInSequence() { return true; diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsNetworkTopologyGuru.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsNetworkTopologyGuru.java index a9b62bff4f..4f26f45ba6 100644 --- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsNetworkTopologyGuru.java +++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsNetworkTopologyGuru.java @@ -55,7 +55,7 @@ public interface OvsNetworkTopologyGuru extends Manager { /** * get the list of all Vm id's in the network that are running on the host */ - public List getActiveVmsInNetworkOnHost(long vpcId, long hostId); + public List getActiveVmsInNetworkOnHost(long vpcId, long hostId, boolean includeVr); /** * get the list of all Vpc id's in which, a VM has a nic in the network that is part of VPC diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsNetworkTopologyGuruImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsNetworkTopologyGuruImpl.java index 402a9c8f52..820cd559b7 100644 --- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsNetworkTopologyGuruImpl.java +++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsNetworkTopologyGuruImpl.java @@ -181,7 +181,7 @@ public List getActiveVmsInVpcOnHost(long vpcId, long hostId) { Set vmIdsSet = new HashSet<>(); List vpcNetworks = _vpcMgr.getVpcNetworks(vpcId); for (Network network : vpcNetworks) { - List networkVmIds = getActiveVmsInNetworkOnHost(network.getId(), hostId); + List networkVmIds = getActiveVmsInNetworkOnHost(network.getId(), hostId, false); if (networkVmIds != null && !networkVmIds.isEmpty()) { vmIdsSet.addAll(networkVmIds); } @@ -195,21 +195,19 @@ public List getActiveVmsInVpcOnHost(long vpcId, long hostId) { * get the list of all Vm id's in the network that are running on the host */ @Override - public List getActiveVmsInNetworkOnHost(long networkId, long hostId) { + public List getActiveVmsInNetworkOnHost(long networkId, long hostId, boolean includeVr) { List vmIds = new ArrayList<>(); List vms = _userVmDao.listByNetworkIdAndStates(networkId, - VirtualMachine.State.Running, VirtualMachine.State.Starting, VirtualMachine.State.Stopping, VirtualMachine.State.Unknown, - VirtualMachine.State.Migrating); + VirtualMachine.State.Running, VirtualMachine.State.Migrating); // Find routers for the network List routers = _routerDao.findByNetwork(networkId); - if (vms != null) { for (UserVmVO vm : vms) { if (vm.getHostId() == hostId) vmIds.add(vm.getId()); } } - if (routers.size() != 0) { + if (routers.size() != 0 && includeVr) { for (DomainRouterVO router: routers) { if (router.getHostId() == hostId) vmIds.add(router.getId()); diff --git a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java index 2405f87632..c998e3be38 100644 --- a/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java +++ b/plugins/network-elements/ovs/src/com/cloud/network/ovs/OvsTunnelManagerImpl.java @@ -209,8 +209,8 @@ protected OvsTunnelNetworkVO createTunnelRecord(long from, long to, long network private void handleCreateTunnelAnswer(Answer[] answers) { OvsCreateTunnelAnswer r = (OvsCreateTunnelAnswer)answers[0]; String s = - String.format("(hostIP:%1$s, remoteIP:%2$s, bridge:%3$s," + "greKey:%4$s, portName:%5$s)", r.getFromIp(), r.getToIp(), r.getBridge(), r.getKey(), - r.getInPortName()); + String.format("(hostIP:%1$s, remoteIP:%2$s, bridge:%3$s," + "greKey:%4$s, portName:%5$s)", + r.getFromIp(), r.getToIp(), r.getBridge(), r.getKey(), r.getInPortName()); Long from = r.getFrom(); Long to = r.getTo(); long networkId = r.getNetworkId(); @@ -476,9 +476,13 @@ public void checkAndRemoveHostFromTunnelNetwork(Network nw, Host host) { if (nw.getVpcId() != null && isVpcEnabledForDistributedRouter(nw.getVpcId())) { List vmIds = _ovsNetworkToplogyGuru.getActiveVmsInVpcOnHost(nw.getVpcId(), host.getId()); + if (vmIds != null && !vmIds.isEmpty()) { return; } + + // there are not active VM's on this host belonging to any of the tiers in the VPC, so remove + // the host from the tunnel mesh network and destroy the bridge List vpcNetworks = _vpcMgr.getVpcNetworks(nw.getVpcId()); try { for (Network network: vpcNetworks) { @@ -499,7 +503,8 @@ public void checkAndRemoveHostFromTunnelNetwork(Network nw, Host host) { } } - Command cmd = new OvsDestroyBridgeCommand(nw.getId(), generateBridgeNameForVpc(nw.getVpcId())); + Command cmd = new OvsDestroyBridgeCommand(nw.getId(), generateBridgeNameForVpc(nw.getVpcId()), + host.getId()); s_logger.debug("Destroying bridge for network " + nw.getId() + " on host:" + host.getId()); Answer ans = _agentMgr.send(host.getId(), cmd); handleDestroyBridgeAnswer(ans, host.getId(), nw.getId()); @@ -507,7 +512,7 @@ public void checkAndRemoveHostFromTunnelNetwork(Network nw, Host host) { } } else { - List vmIds = _ovsNetworkToplogyGuru.getActiveVmsInNetworkOnHost(nw.getId(), host.getId()); + List vmIds = _ovsNetworkToplogyGuru.getActiveVmsInNetworkOnHost(nw.getId(), host.getId(), true); if (vmIds != null && !vmIds.isEmpty()) { return; } @@ -516,7 +521,7 @@ public void checkAndRemoveHostFromTunnelNetwork(Network nw, Host host) { * the tunnels for this network */ int key = getGreKey(nw); String bridgeName = generateBridgeName(nw, key); - Command cmd = new OvsDestroyBridgeCommand(nw.getId(), bridgeName); + Command cmd = new OvsDestroyBridgeCommand(nw.getId(), bridgeName, host.getId()); s_logger.debug("Destroying bridge for network " + nw.getId() + " on host:" + host.getId()); Answer ans = _agentMgr.send(host.getId(), cmd); handleDestroyBridgeAnswer(ans, host.getId(), nw.getId()); @@ -558,44 +563,66 @@ private String generateBridgeNameForVpc(long vpcId) { protected void checkAndCreateVpcTunnelNetworks(Host host, long vpcId) { long hostId = host.getId(); - List vpcNetworks = _vpcMgr.getVpcNetworks(vpcId); - List vpcSpannedHostIds = _ovsNetworkToplogyGuru.getVpcSpannedHosts(vpcId); String bridgeName=generateBridgeNameForVpc(vpcId); - boolean bridgeNotSetup = true; + List vmIds = _ovsNetworkToplogyGuru.getActiveVmsInVpcOnHost(vpcId, hostId); + + if (vmIds == null || vmIds.isEmpty()) { + + // since this is the first VM from the VPC being launched on the host, first setup the bridge + try { + Commands cmds = new Commands(new OvsSetupBridgeCommand(bridgeName, hostId, null)); + s_logger.debug("Ask host " + hostId + " to create bridge for vpc " + vpcId + " and configure the " + + " bridge for distributed routing."); + Answer[] answers = _agentMgr.send(hostId, cmds); + handleSetupBridgeAnswer(answers); + } catch (OperationTimedoutException | AgentUnavailableException e) { + s_logger.warn("Ovs Tunnel network created tunnel failed", e); + } + + // now that bridge is setup, populate network acl's before the VM gets created + OvsVpcRoutingPolicyConfigCommand cmd = prepareVpcRoutingPolicyUpdate(vpcId); + cmd.setSequenceNumber(getNextRoutingPolicyUpdateSequenceNumber(vpcId)); + + if (!sendVpcRoutingPolicyChangeUpdate(cmd, hostId, bridgeName)) { + s_logger.debug("Failed to send VPC routing policy change update to host : " + hostId + + ". But moving on with sending the updates to the rest of the hosts."); + } + } + + List vpcNetworks = _vpcMgr.getVpcNetworks(vpcId); + List vpcSpannedHostIds = _ovsNetworkToplogyGuru.getVpcSpannedHosts(vpcId); for (Network vpcNetwork: vpcNetworks) { if (vpcNetwork.getState() != Network.State.Implemented && vpcNetwork.getState() != Network.State.Implementing && vpcNetwork.getState() != Network.State.Setup) continue; + int key = getGreKey(vpcNetwork); List toHostIds = new ArrayList(); List fromHostIds = new ArrayList(); + OvsTunnelNetworkVO tunnelRecord = null; for (Long rh : vpcSpannedHostIds) { if (rh == hostId) { continue; } - OvsTunnelNetworkVO ta = _tunnelNetworkDao.getByFromToNetwork(hostId, rh.longValue(), vpcNetwork.getId()); - // Try and create the tunnel even if a previous attempt failed - if (ta == null || ta.getState().equals(OvsTunnel.State.Failed.name())) { + tunnelRecord = _tunnelNetworkDao.getByFromToNetwork(hostId, rh.longValue(), vpcNetwork.getId()); + // Try and create the tunnel if does not exit or previous attempt failed + if (tunnelRecord == null || tunnelRecord.getState().equals(OvsTunnel.State.Failed.name())) { s_logger.debug("Attempting to create tunnel from:" + hostId + " to:" + rh.longValue()); - if (ta == null) { + if (tunnelRecord == null) { createTunnelRecord(hostId, rh.longValue(), vpcNetwork.getId(), key); } if (!toHostIds.contains(rh)) { toHostIds.add(rh); } } - - ta = _tunnelNetworkDao.getByFromToNetwork(rh.longValue(), - hostId, vpcNetwork.getId()); - // Try and create the tunnel even if a previous attempt failed - if (ta == null || ta.getState().equals(OvsTunnel.State.Failed.name())) { - s_logger.debug("Attempting to create tunnel from:" + - rh.longValue() + " to:" + hostId); - if (ta == null) { - createTunnelRecord(rh.longValue(), hostId, - vpcNetwork.getId(), key); + tunnelRecord = _tunnelNetworkDao.getByFromToNetwork(rh.longValue(), hostId, vpcNetwork.getId()); + // Try and create the tunnel if does not exit or previous attempt failed + if (tunnelRecord == null || tunnelRecord.getState().equals(OvsTunnel.State.Failed.name())) { + s_logger.debug("Attempting to create tunnel from:" + rh.longValue() + " to:" + hostId); + if (tunnelRecord == null) { + createTunnelRecord(rh.longValue(), hostId, vpcNetwork.getId(), key); } if (!fromHostIds.contains(rh)) { fromHostIds.add(rh); @@ -615,20 +642,16 @@ protected void checkAndCreateVpcTunnelNetworks(Host host, long vpcId) { String otherIp = getGreEndpointIP(rHost, vpcNetwork); if (otherIp == null) throw new GreTunnelException( - "Unable to retrieve the remote " - + "endpoint for the GRE tunnel." + "Unable to retrieve the remote endpoint for the GRE tunnel." + "Failure is on host:" + rHost.getId()); - Commands cmds = new Commands( - new OvsCreateTunnelCommand(otherIp, key, - Long.valueOf(hostId), i, vpcNetwork.getId(), myIp, bridgeName, - vpcNetwork.getUuid())); + Commands cmds = new Commands( new OvsCreateTunnelCommand(otherIp, key, Long.valueOf(hostId), + i, vpcNetwork.getId(), myIp, bridgeName, vpcNetwork.getUuid())); s_logger.debug("Attempting to create tunnel from:" + hostId + " to:" + i + " for the network " + vpcNetwork.getId()); s_logger.debug("Ask host " + hostId + " to create gre tunnel to " + i); Answer[] answers = _agentMgr.send(hostId, cmds); handleCreateTunnelAnswer(answers); - bridgeNotSetup = false; } for (Long i : fromHostIds) { @@ -641,27 +664,12 @@ protected void checkAndCreateVpcTunnelNetworks(Host host, long vpcId) { + hostId); Answer[] answers = _agentMgr.send(i, cmds); handleCreateTunnelAnswer(answers); - bridgeNotSetup = false; } } catch (GreTunnelException | OperationTimedoutException | AgentUnavailableException e) { // I really thing we should do a better handling of these exceptions s_logger.warn("Ovs Tunnel network created tunnel failed", e); } } - - // If no tunnels have been configured, perform the bridge setup - // anyway. This will ensure VIF rules will be triggered - if (bridgeNotSetup) { - try { - Commands cmds = new Commands(new OvsSetupBridgeCommand(bridgeName, hostId, null)); - s_logger.debug("Ask host " + hostId + " to configure bridge for vpc"); - Answer[] answers = _agentMgr.send(hostId, cmds); - handleSetupBridgeAnswer(answers); - } catch (OperationTimedoutException | AgentUnavailableException e) { - // I really thing we should do a better handling of these exceptions - s_logger.warn("Ovs Tunnel network created tunnel failed", e); - } - } } @Override diff --git a/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py b/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py index b93f87b170..215d5562bc 100644 --- a/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py +++ b/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py @@ -345,8 +345,11 @@ def get_acl(vpcconfig, required_acl_id): return None def check_tunnel_exists(bridge, tunnel_name): - res = do_cmd([VSCTL_PATH, "port-to-br", tunnel_name]) - return res == bridge + try: + res = do_cmd([VSCTL_PATH, "port-to-br", tunnel_name]) + return res == bridge + except: + return False def create_tunnel(bridge, remote_ip, gre_key, src_host, dst_host, network_uuid): @@ -460,7 +463,7 @@ def create_tunnel(bridge, remote_ip, gre_key, src_host, dst_host, network_uuid): logging.debug("Successfully created tunnel from host %s" %src_host + " to host %s" %dst_host + " with GRE key %s" %gre_key) - return "SUCCESS:%s creation succeeded" % name + return "SUCCESS:%s" % name except: logging.debug("An unexpected error occured. Rolling back") if tunnel_setup: @@ -548,7 +551,8 @@ def configure_vpc_bridge_for_network_topology(bridge, this_host_id, json_config, # check if tunnel exists already, if not create a tunnel from this host to remote host if not check_tunnel_exists(bridge, tunnel_name): - create_tunnel(bridge, host.ipaddress, gre_key, this_host_id, host.hostid, network.networkuuid) + create_tunnel(bridge, str(host.ipaddress), str(gre_key), this_host_id, + host.hostid, network.networkuuid) of_port = get_ofport_for_vif(tunnel_name) diff --git a/scripts/vm/hypervisor/xenserver/ovstunnel b/scripts/vm/hypervisor/xenserver/ovstunnel index c95fc20721..0ae99f595b 100755 --- a/scripts/vm/hypervisor/xenserver/ovstunnel +++ b/scripts/vm/hypervisor/xenserver/ovstunnel @@ -96,16 +96,16 @@ def setup_ovs_bridge(session, args): result = "SUCCESS:%s" % bridge else: result = "FAILURE:%s" % res + lib.do_cmd([lib.XE_PATH, "network-param-set", "uuid=%s" % xs_nw_uuid, + "other-config:is-ovs-tun-network=True"]) # Finally note in the xenapi network object that the network has # been configured xs_nw_uuid = lib.do_cmd([lib.XE_PATH, "network-list", "bridge=%s" % bridge, "--minimal"]) - lib.do_cmd([lib.XE_PATH, "network-param-set", "uuid=%s" % xs_nw_uuid, - "other-config:is-ovs-tun-network=True"]) conf_hosts = lib.do_cmd([lib.XE_PATH, "network-param-get", "uuid=%s" % xs_nw_uuid, "param-name=other-config", - "param-key=ovs-host-setup", "--minimal"]) + "param-key=ovs-host-setup"]) conf_hosts = cs_host_id + (conf_hosts and ',%s' % conf_hosts or '') lib.do_cmd([lib.XE_PATH, "network-param-set", "uuid=%s" % xs_nw_uuid, "other-config:ovs-host-setup=%s" % conf_hosts]) @@ -160,7 +160,7 @@ def setup_ovs_bridge_for_distributed_routing(session, args): conf_hosts = lib.do_cmd([lib.XE_PATH, "network-param-get", "uuid=%s" % xs_nw_uuid, "param-name=other-config", - "param-key=ovs-host-setup", "--minimal"]) + "param-key=ovs-host-setup"]) conf_hosts = cs_host_id + (conf_hosts and ',%s' % conf_hosts or '') lib.do_cmd([lib.XE_PATH, "network-param-set", "uuid=%s" % xs_nw_uuid, "other-config:ovs-host-setup=%s" % conf_hosts]) @@ -204,6 +204,7 @@ def setup_ovs_bridge_for_distributed_routing(session, args): @echo def destroy_ovs_bridge(session, args): bridge = args.pop("bridge") + this_host_id = args.pop("cs_host_id") res = lib.check_switch() if res != "SUCCESS": return res @@ -213,11 +214,21 @@ def destroy_ovs_bridge(session, args): result = "FAILURE:%s" % res else: # Note that the bridge has been removed on xapi network object - xs_nw_uuid = lib.do_cmd([xePath, "network-list", + xs_nw_uuid = lib.do_cmd([lib.XE_PATH, "network-list", "bridge=%s" % bridge, "--minimal"]) - #FIXME: WOW, this an error - #lib.do_cmd([xePath,"network-param-set", "uuid=%s" % xs_nw_uuid, - # "other-config:ovs-setup=False"]) + conf_hosts = lib.do_cmd([lib.XE_PATH, "network-param-get", + "uuid=%s" % xs_nw_uuid, + "param-name=other-config", + "param-key=ovs-host-setup"]) + new_conf_hosts = "" + hosts = conf_hosts.split(',') + for host in hosts: + if str(host) == str(this_host_id): + continue + new_conf_hosts = host + "," + new_conf_hosts + new_conf_hosts = new_conf_hosts[:-1] + lib.do_cmd([lib.XE_PATH, "network-param-set", "uuid=%s" % xs_nw_uuid, + "other-config:ovs-host-setup=%s" % new_conf_hosts]) result = "SUCCESS:%s" % bridge logging.debug("Destroy_ovs_bridge completed with result:%s" % result) From 9106cfb4be7d157cc4574e4dcfeb61d3792cc673 Mon Sep 17 00:00:00 2001 From: SrikanteswaraRao Talluri Date: Wed, 14 May 2014 18:45:01 +0530 Subject: [PATCH 443/683] Revert "CLOUDSTACK-5674: Fixed cloudstackConnection.py to return FAILED in case of well handled exceptions returning from server having jobresultcode as 530" This reverts commit aaa2f5932ba8f7d3ef08ad5176744811589176f5. --- tools/marvin/marvin/cloudstackConnection.py | 24 ++++++++++++--------- tools/marvin/marvin/codes.py | 2 -- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/tools/marvin/marvin/cloudstackConnection.py b/tools/marvin/marvin/cloudstackConnection.py index 1ff8381a43..8044da7ec6 100644 --- a/tools/marvin/marvin/cloudstackConnection.py +++ b/tools/marvin/marvin/cloudstackConnection.py @@ -21,18 +21,26 @@ import hmac import hashlib import time -from cloudstackAPI import queryAsyncJobResult +from cloudstackAPI import * import jsonHelper from marvin.codes import ( FAILED, + INVALID_RESPONSE, + INVALID_INPUT, JOB_FAILED, + JOB_INPROGRESS, JOB_CANCELLED, - JOB_SUCCEEDED, - JOB_NO_EXCEPTION, - JOB_EXCEPTION_OCCURED + JOB_SUCCEEDED ) -from marvin.cloudstackException import (GetDetailExceptionInfo, - InvalidParameterException) +from requests import ( + ConnectionError, + HTTPError, + Timeout, + RequestException +) +from marvin.cloudstackException import ( + InvalidParameterException, + GetDetailExceptionInfo) class CSConnection(object): @@ -92,7 +100,6 @@ def __poll(self, jobid, response_cmd): start_time = time.time() end_time = time.time() async_response = FAILED - jobresultcode = JOB_NO_EXCEPTION self.logger.debug("=== Jobid: %s Started ===" % (str(jobid))) while timeout > 0: async_response = self.\ @@ -102,7 +109,6 @@ def __poll(self, jobid, response_cmd): if job_status in [JOB_FAILED, JOB_CANCELLED, JOB_SUCCEEDED]: - jobresultcode = async_response.jobresultcode break time.sleep(5) timeout -= 5 @@ -116,8 +122,6 @@ def __poll(self, jobid, response_cmd): "TotalTime:%s===" % (str(jobid), str(time.ctime(start_time)), str(time.ctime(end_time)), str(tot_time))) - if jobresultcode == JOB_EXCEPTION_OCCURED: - async_response = FAILED return async_response except Exception as e: self.__lastError = e diff --git a/tools/marvin/marvin/codes.py b/tools/marvin/marvin/codes.py index 0619374bf7..ef49c0c3c8 100644 --- a/tools/marvin/marvin/codes.py +++ b/tools/marvin/marvin/codes.py @@ -60,8 +60,6 @@ JOB_SUCCEEDED = 1 JOB_FAILED = 2 JOB_CANCELLED = 3 -JOB_EXCEPTION_OCCURED = 530 -JOB_NO_EXCEPTION = 0 ''' User Related Codes ''' From 9e21b8b04e6affa254bf88d1fdaa9c4da7f9bf05 Mon Sep 17 00:00:00 2001 From: Joris van Lieshout Date: Wed, 14 May 2014 12:05:36 +0200 Subject: [PATCH 444/683] releasing dhcp leases on vpcs failes because the network tier of the tennant aren't behinbd eth0. Here we make interface selection dynamic. Signed-off-by: Daan Hoogland --- systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh b/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh index 70c95a88ad..c1046c6dda 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh +++ b/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh @@ -99,7 +99,7 @@ if [ $dnsmasq_managed_lease ] then #release previous dhcp lease if present logger -t cloud "edithosts: releasing $ipv4" - dhcp_release eth0 $ipv4 $(grep "$ipv4 " $DHCP_LEASES | awk '{print $2}') > /dev/null 2>&1 + dhcp_release $(ip route get "$ipv4/32" | tr " " "\n" | grep eth) $ipv4 $(grep "$ipv4 " $DHCP_LEASES | awk '{print $2}') > /dev/null 2>&1 logger -t cloud "edithosts: released $ipv4" fi From 3b5f95c5473165356702d16873ac3d7cd8c514e8 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Wed, 14 May 2014 12:26:25 -0700 Subject: [PATCH 445/683] CLOUDSTACK-6675: updatePFRule - retrieve network sync object based on the PF rule id that is passed in to the call; not the public ip address --- .../firewall/UpdatePortForwardingRuleCmd.java | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java index 78525ba0d8..eb4d468886 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdatePortForwardingRuleCmd.java @@ -16,8 +16,6 @@ // under the License. package org.apache.cloudstack.api.command.user.firewall; -import org.apache.log4j.Logger; - import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -27,10 +25,10 @@ import org.apache.cloudstack.api.response.FirewallRuleResponse; import org.apache.cloudstack.api.response.IPAddressResponse; import org.apache.cloudstack.api.response.UserVmResponse; +import org.apache.log4j.Logger; import com.cloud.event.EventTypes; import com.cloud.exception.InvalidParameterValueException; -import com.cloud.network.IpAddress; import com.cloud.network.rules.FirewallRule; import com.cloud.network.rules.PortForwardingRule; import com.cloud.user.Account; @@ -94,10 +92,6 @@ public String getProtocol() { return protocol; } - public Long getPublicIpId() { - return publicIpId; - } - public String getPublicPort() { return publicPort; } @@ -109,11 +103,16 @@ public Long getVirtualMachineId() { public Boolean getDisplay() { return display; } + public Long getId() { + return id; + } ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// + + @Override public String getCommandName() { return s_name; @@ -121,9 +120,9 @@ public String getCommandName() { @Override public long getEntityOwnerId() { - IpAddress addr = _entityMgr.findById(IpAddress.class, getPublicIpId()); - if (addr != null) { - return addr.getAccountId(); + PortForwardingRule rule = _entityMgr.findById(PortForwardingRule.class, getId()); + if (rule != null) { + return rule.getAccountId(); } // bad address given, parent this command to SYSTEM so ERROR events are tracked @@ -173,14 +172,11 @@ public String getSyncObjType() { @Override public Long getSyncObjId() { - return getIp().getAssociatedWithNetworkId(); - } - - private IpAddress getIp() { - IpAddress ip = _networkService.getIp(publicIpId); - if (ip == null) { - throw new InvalidParameterValueException("Unable to find ip address by id " + publicIpId); + PortForwardingRule rule = _entityMgr.findById(PortForwardingRule.class, getId()); + if (rule != null) { + return rule.getNetworkId(); + } else { + throw new InvalidParameterValueException("Unable to find the rule by id"); } - return ip; } } From 076bbdcfe86d6886ab1ecfc513b02a323a995307 Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Wed, 14 May 2014 14:59:54 -0700 Subject: [PATCH 446/683] CLOUDSTACK-6660: Dont assume every vm will have a root volume now. --- server/src/com/cloud/vm/UserVmManagerImpl.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 9fa435303b..e7db877fdd 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -1854,7 +1854,16 @@ public UserVm updateVirtualMachine(UpdateVMCmd cmd) throws ResourceUnavailableEx saveUsageEvent(vmInstance); // take care of the root volume as well. - _volumeService.updateDisplay(_volsDao.findByInstanceAndType(id, Volume.Type.ROOT).get(0), isDisplayVm); + List rootVols = _volsDao.findByInstanceAndType(id, Volume.Type.ROOT); + if(!rootVols.isEmpty()){ + _volumeService.updateDisplay(rootVols.get(0), isDisplayVm); + } + + // take care of the data volumes as well. + List dataVols = _volsDao.findByInstanceAndType(id, Volume.Type.DATADISK); + for(Volume dataVol : dataVols){ + _volumeService.updateDisplay(dataVol, isDisplayVm); + } } From 1561138157f66485b4e3c762c4166a1c2cacd3d2 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Mon, 28 Apr 2014 02:32:31 -0400 Subject: [PATCH 447/683] CLOUDSTACK-5887: Resolved issue in test_base_image_updation.py --- .../component/test_base_image_updation.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/test/integration/component/test_base_image_updation.py b/test/integration/component/test_base_image_updation.py index d1cc7d463b..081d855fca 100644 --- a/test/integration/component/test_base_image_updation.py +++ b/test/integration/component/test_base_image_updation.py @@ -26,6 +26,7 @@ #Import Local Modules from marvin.codes import (PASS, + FAIL, RECURRING) from nose.plugins.attrib import attr from marvin.cloudstackTestCase import cloudstackTestCase @@ -649,9 +650,13 @@ def test_04_reoccuring_snapshot_rules(self): Here we are passing root disk id of vm before reboot which does not exist hence\ listing should fail") - with self.assertRaises(Exception): - list_snapshots_policy = SnapshotPolicy.list( - self.apiclient, - volumeid=vm_with_reset_root_disk_id - ) + try: + listSnapshotPolicies = SnapshotPolicy.list( + self.apiclient, + volumeid=vm_with_reset_root_disk_id) + except Exception as e: + self.fail("Failed to list snapshot policies: %s" % e) + + self.assertEqual(validateList(listSnapshotPolicies)[0], FAIL,\ + "Snapshot policies list should be empty") return From 149cd4b5646b37d1649c86a3428d4c89d03003a8 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Wed, 14 May 2014 20:17:01 -0400 Subject: [PATCH 448/683] Fixed config issue related to Persistent Networks --- tools/marvin/marvin/config/test_data.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py index 7001c423d2..026f5ff559 100644 --- a/tools/marvin/marvin/config/test_data.py +++ b/tools/marvin/marvin/config/test_data.py @@ -185,7 +185,7 @@ "guestiptype": 'Isolated', "supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding', "traffictype": 'GUEST', - "isPersistent": 'True', + "ispersistent": 'True', "availability": 'Optional', "serviceProviderList": { "Dhcp": 'VirtualRouter', @@ -438,7 +438,7 @@ "supportedservices": 'Vpn,Dhcp,Dns,SourceNat,PortForwarding,Firewall,Lb,UserData,StaticNat', "traffictype": 'GUEST', - "isPersistent": 'True', + "ispersistent": 'True', "availability": 'Optional', "serviceProviderList": { "Vpn": 'VirtualRouter', @@ -555,7 +555,7 @@ "supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding,Vpn,Firewall,Lb,UserData,StaticNat', "traffictype": 'GUEST', - "isPersistent": 'True', + "ispersistent": 'True', "availability": 'Optional', "serviceProviderList": { "Dhcp": 'VirtualRouter', @@ -578,7 +578,7 @@ 'Vpn,Dhcp,Dns,SourceNat,PortForwarding,UserData,StaticNat,NetworkACL', "traffictype": 'GUEST', "availability": 'Optional', - "isPersistent": 'True', + "ispersistent": 'True', "useVpc": 'on', "serviceProviderList": { "Vpn": 'VpcVirtualRouter', From 4e44ac56c92221c5b9509dca18e14befd7e297fe Mon Sep 17 00:00:00 2001 From: Sanjay Tripathi Date: Thu, 15 May 2014 14:07:10 +0530 Subject: [PATCH 449/683] CLOUDSTACK-6678: API:MS: listCapacity returns; errorcode":530,"cserrorcode":9999,"errortext":"Index: 0, Size: 0"}. --- server/src/com/cloud/api/ApiResponseHelper.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 4ce9fa6be6..ce685c6dff 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -1738,7 +1738,7 @@ public List createCapacityResponse(List re } List gpuCapacities; - if ((gpuCapacities = ApiDBUtils.getGpuCapacites(result.get(0).getDataCenterId(), result.get(0).getPodId(), result.get(0).getClusterId())) != null) { + if (!result.isEmpty() && (gpuCapacities = ApiDBUtils.getGpuCapacites(result.get(0).getDataCenterId(), result.get(0).getPodId(), result.get(0).getClusterId())) != null) { HashMap vgpuVMs = ApiDBUtils.getVgpuVmsCount(result.get(0).getDataCenterId(), result.get(0).getPodId(), result.get(0).getClusterId()); float capacityUsed = 0; @@ -1771,7 +1771,11 @@ public List createCapacityResponse(List re capacityResponse.setCapacityType(Capacity.CAPACITY_TYPE_GPU); capacityResponse.setCapacityUsed((long)Math.ceil(capacityUsed)); capacityResponse.setCapacityTotal(capacityMax); - capacityResponse.setPercentUsed(format.format(capacityUsed / capacityMax * 100f)); + if (capacityMax > 0) { + capacityResponse.setPercentUsed(format.format(capacityUsed / capacityMax * 100f)); + } else { + capacityResponse.setPercentUsed(format.format(0)); + } capacityResponse.setObjectName("capacity"); capacityResponses.add(capacityResponse); } From 5dcc34cb655ebfff996c629dc0eeeb3d54657480 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Thu, 15 May 2014 16:37:40 +0530 Subject: [PATCH 450/683] CLOUDSTACK-6685: OVS distributed firewall: source CIDR mismatch while populating ingress & egress network ACL fix ensures propoer values for nw_src and nw_dst are popoluated depending on the ingress or egress acl --- .../xenserver/cloudstack_pluginlib.py | 112 +++++++++++++----- 1 file changed, 82 insertions(+), 30 deletions(-) diff --git a/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py b/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py index 215d5562bc..d3d234fdf5 100644 --- a/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py +++ b/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py @@ -634,6 +634,12 @@ def configure_vpc_bridge_for_routing_policies(bridge, json_config, sequence_no): protocol = acl_item.protocol if protocol == "all": protocol = "*" + elif protocol == "tcp": + protocol = "6" + elif protocol == "udp": + protocol == "17" + elif protocol == "icmp": + protocol == "1" source_cidrs = acl_item.sourcecidrs acl_priority = 1000 + number if direction == "ingress": @@ -647,50 +653,96 @@ def configure_vpc_bridge_for_routing_policies(bridge, json_config, sequence_no): if source_port_start is None and source_port_end is None: if source_cidr.startswith('0.0.0.0'): if action == "deny": - ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + - " nw_dst=%s " %tier_cidr + " nw_proto=%s " %protocol + - " actions=drop" + "\n") + if direction == "ingress": + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " nw_dst=%s " %tier_cidr + " nw_proto=%s " %protocol + + " actions=drop" + "\n") + else: + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " nw_src=%s " %tier_cidr + " nw_proto=%s " %protocol + + " actions=drop" + "\n") if action == "allow": - ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + - " nw_dst=%s " %tier_cidr + " nw_proto=%s " %protocol + - " actions=resubmit(,%s)"%resubmit_table + "\n") - + if direction == "ingress": + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " nw_dst=%s " %tier_cidr + " nw_proto=%s " %protocol + + " actions=resubmit(,%s)"%resubmit_table + "\n") + else: + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " nw_src=%s " %tier_cidr + " nw_proto=%s " %protocol + + " actions=resubmit(,%s)"%resubmit_table + "\n") else: if action == "deny": - ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + - " nw_src=%s " %source_cidr + " nw_dst=%s " %tier_cidr + - " nw_proto=%s " %protocol + " actions=drop" + "\n") + if direction == "ingress": + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " nw_src=%s " %source_cidr + " nw_dst=%s " %tier_cidr + + " nw_proto=%s " %protocol + " actions=drop" + "\n") + else: + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " nw_src=%s " %tier_cidr + " nw_dst=%s " %source_cidr + + " nw_proto=%s " %protocol + " actions=drop" + "\n") if action == "allow": - ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + - " nw_src=%s "%source_cidr + " nw_dst=%s " %tier_cidr + - " nw_proto=%s " %protocol + - " actions=resubmit(,%s)"%resubmit_table + "\n") + if direction == "ingress": + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " nw_src=%s "%source_cidr + " nw_dst=%s " %tier_cidr + + " nw_proto=%s " %protocol + + " actions=resubmit(,%s)"%resubmit_table + "\n") + else: + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " nw_src=%s "%tier_cidr + " nw_dst=%s " %source_cidr + + " nw_proto=%s " %protocol + + " actions=resubmit(,%s)"%resubmit_table + "\n") continue # add flow rule to do action (allow/deny) for flows where source IP of the packet is in # source_cidr and destination ip is in tier_cidr - port = source_port_start - while (port < source_port_end): + port = int(source_port_start) + while (port <= int(source_port_end)): if source_cidr.startswith('0.0.0.0'): if action == "deny": - ofspec.write("table=%s " %matching_table + " priority=%s " %acl_priority + " ip " + - " tp_dst=%s " %port + " nw_dst=%s " %tier_cidr + - " nw_proto=%s " %protocol + " actions=drop" + "\n") + if direction == "ingress": + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " tp_dst=%s " %port + " nw_dst=%s " %tier_cidr + + " nw_proto=%s " %protocol + " actions=drop" + "\n") + else: + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " tp_dst=%s " %port + " nw_src=%s " %tier_cidr + + " nw_proto=%s " %protocol + " actions=drop" + "\n") if action == "allow": - ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + - " tp_dst=%s " %port + " nw_dst=%s " %tier_cidr + - " nw_proto=%s " %protocol + - " actions=resubmit(,%s)"%resubmit_table + "\n") + if direction == "ingress": + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " tp_dst=%s " %port + " nw_dst=%s " %tier_cidr + + " nw_proto=%s " %protocol + + " actions=resubmit(,%s)"%resubmit_table + "\n") + else: + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " tp_dst=%s " %port + " nw_src=%s " %tier_cidr + + " nw_proto=%s " %protocol + + " actions=resubmit(,%s)"%resubmit_table + "\n") else: if action == "deny": - ofspec.write("table=%s " %matching_table + " priority=%s " %acl_priority + " ip " + - " tp_dst=%s " %port + " nw_src=%s "%source_cidr + " nw_dst=%s "%tier_cidr + - " nw_proto=%s " %protocol + " actions=drop" + "\n") + if direction == "ingress": + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " tp_dst=%s " %port + " nw_src=%s " %source_cidr + + " nw_dst=%s " %tier_cidr + + " nw_proto=%s " %protocol + " actions=drop" + "\n") + else: + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " tp_dst=%s " %port + " nw_src=%s " %tier_cidr + + " nw_dst=%s " %source_cidr + + " nw_proto=%s " %protocol + " actions=drop" + "\n") if action == "allow": - ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + - " tp_dst=%s " %port + " nw_src=%s "%source_cidr + " nw_dst=%s "%tier_cidr + - " nw_proto=%s " %protocol + - " actions=resubmit(,%s)"%resubmit_table + "\n") + if direction == "ingress": + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " tp_dst=%s " %port + " nw_src=%s "%source_cidr + + " nw_dst=%s " %tier_cidr + + " nw_proto=%s " %protocol + + " actions=resubmit(,%s)"%resubmit_table + "\n") + else: + ofspec.write("table=%s "%matching_table + " priority=%s " %acl_priority + " ip " + + " tp_dst=%s " %port + " nw_src=%s "%tier_cidr + + " nw_dst=%s " %source_cidr + + " nw_proto=%s " %protocol + + " actions=resubmit(,%s)"%resubmit_table + "\n") port = port + 1 # add a default rule in egress table to allow packets (so forward packet to L3 lookup table) From 4e72ec99838685a60cee792ce94d206105331942 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Thu, 15 May 2014 16:41:34 +0530 Subject: [PATCH 451/683] CLOUDSTACK-6686:NetworkACLItemCidrsDaoImpl uses firewallRuleId instead of networkAclItemId fix uses networkAclItemId instead of firewallRuleId --- .../com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java b/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java index 23c1fa782e..7c02f8b554 100644 --- a/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java +++ b/engine/schema/src/com/cloud/network/vpc/dao/NetworkACLItemCidrsDaoImpl.java @@ -70,7 +70,7 @@ public void persist(long networkACLItemId, List cidrs) { @Override public List getCidrs(long networkACLItemId) { SearchCriteria sc = cidrsSearch.create(); - sc.setParameters("firewallRuleId", networkACLItemId); + sc.setParameters("networkAclItemId", networkACLItemId); List results = search(sc, null); List cidrs = new ArrayList(results.size()); @@ -84,7 +84,7 @@ public List getCidrs(long networkACLItemId) { @Override public List listByNetworkACLItemId(long networkACLItemId) { SearchCriteria sc = cidrsSearch.create(); - sc.setParameters("firewallRuleId", networkACLItemId); + sc.setParameters("networkAclItemId", networkACLItemId); List results = search(sc, null); From 14968daeaa454f872a6271172041596c208ce3f1 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Wed, 14 May 2014 23:47:21 -0400 Subject: [PATCH 452/683] CLOUDSTACK-6612: Resolved DB connection issue related to passing correct password --- tools/marvin/marvin/cloudstackTestClient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py index 72ce7d34d1..86b0a4bbd5 100644 --- a/tools/marvin/marvin/cloudstackTestClient.py +++ b/tools/marvin/marvin/cloudstackTestClient.py @@ -192,7 +192,7 @@ def __createDbConnection(self): user = "cloud" if self.__dbSvrDetails.user is None \ else self.__dbSvrDetails.user passwd = 'cloud' if self.__dbSvrDetails.passwd is None \ - else self.__dbSvrDetails.passd + else self.__dbSvrDetails.passwd db = 'cloud' if self.__dbSvrDetails.db is None \ else self.__dbSvrDetails.db self.__dbConnection = DbConnection(host, port, user, passwd, db) From 77460e9556f7d1b9d6cac6c8ece199bf3b83cd9c Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Thu, 15 May 2014 03:45:22 -0400 Subject: [PATCH 453/683] CLOUDSTACK-6687: Fixed IP reservation test case failures with code re-factoring --- .../component/test_ip_reservation.py | 121 +++++++++++++----- tools/marvin/marvin/codes.py | 1 + tools/marvin/marvin/lib/common.py | 28 ++-- 3 files changed, 106 insertions(+), 44 deletions(-) diff --git a/test/integration/component/test_ip_reservation.py b/test/integration/component/test_ip_reservation.py index 390a959249..c84f63c87a 100644 --- a/test/integration/component/test_ip_reservation.py +++ b/test/integration/component/test_ip_reservation.py @@ -35,9 +35,10 @@ get_domain, wait_for_cleanup, createEnabledNetworkOffering, - createNetworkRulesForVM) + createNetworkRulesForVM, + verifyNetworkState) from marvin.codes import (PASS, FAIL, FAILED, UNKNOWN, FAULT, MASTER, - NAT_RULE, STATIC_NAT_RULE) + NAT_RULE, STATIC_NAT_RULE, ERROR_CODE_530) import netaddr import random @@ -1067,19 +1068,6 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - def create_virtual_machine(self, network_id=None, ip_address=None): - virtual_machine = VirtualMachine.create(self.apiclient, - self.services["virtual_machine"], - networkids=network_id, - serviceofferingid=self.service_offering.id, - accountid=self.account.name, - domainid=self.domain.id, - ipaddress=ip_address - ) - self.debug("Virtual Machine is created: " + virtual_machine.id) - self.cleanup.append(virtual_machine) - return virtual_machine - @attr(tags=["advanced", "selfservice"]) def test_network_not_implemented(self): # steps @@ -1087,8 +1075,18 @@ def test_network_not_implemented(self): # # validation # should throw exception as network is not in implemented state as no vm is created - with self.assertRaises(Exception): - self.isolated_network.update(self.apiclient, guestvmcidr="10.1.1.0/26") + + networkOffering = self.isolated_network_offering + resultSet = createIsolatedNetwork(self, networkOffering.id) + if resultSet[0] == FAIL: + self.fail("Failed to create isolated network") + else: + isolated_network = resultSet[1] + + response = isolated_network.update(self.apiclient, guestvmcidr="10.1.1.0/26") + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, response)) return @attr(tags=["advanced", "selfservice"]) @@ -1102,14 +1100,31 @@ def test_vm_create_after_reservation(self): # 1. guest vm cidr should be successfully updated with correct value # 2. existing guest vm ip should not be changed after reservation # 3. newly created VM should get ip in guestvmcidr - guest_vm_cidr = u"10.1.1.0/29" + + networkOffering = self.isolated_persistent_network_offering + subnet = "10.1."+str(random.randrange(1,254)) + gateway = subnet + ".1" + isolated_persistent_network = None + resultSet = createIsolatedNetwork(self, networkOffering.id, gateway=gateway) + if resultSet[0] == FAIL: + self.fail("Failed to create isolated network") + else: + isolated_persistent_network = resultSet[1] + guest_vm_cidr = subnet +".0/29" virtual_machine_1 = None try: - virtual_machine_1 = self.create_virtual_machine(network_id=self.isolated_persistent_network.id, ip_address=u"10.1.1.3") + virtual_machine_1 = VirtualMachine.create(self.apiclient, + self.testData["virtual_machine"], + networkids=isolated_persistent_network.id, + serviceofferingid=self.service_offering.id, + accountid=self.account.name, + domainid=self.domain.id, + ipaddress=subnet+".3" + ) except Exception as e: - self.skipTest("VM creation fails in network ") + self.fail("VM creation fails in network: %s" % e) - update_response = Network.update(self.isolated_persistent_network, self.apiclient, id=self.isolated_persistent_network.id, guestvmcidr=guest_vm_cidr) + update_response = Network.update(isolated_persistent_network, self.apiclient, id=isolated_persistent_network.id, guestvmcidr=guest_vm_cidr) self.assertEqual(guest_vm_cidr, update_response.cidr, "cidr in response is not as expected") vm_list = VirtualMachine.list(self.apiclient, id=virtual_machine_1.id) @@ -1120,11 +1135,18 @@ def test_vm_create_after_reservation(self): virtual_machine_1.ipaddress, "VM IP should not change after reservation") try: - virtual_machine_2 = self.create_virtual_machine(network_id=self.isolated_persistent_network.id) + virtual_machine_2 = VirtualMachine.create(self.apiclient, + self.testData["virtual_machine"], + networkids=isolated_persistent_network.id, + serviceofferingid=self.service_offering.id, + accountid=self.account.name, + domainid=self.domain.id + ) if netaddr.IPAddress(virtual_machine_2.ipaddress) not in netaddr.IPNetwork(guest_vm_cidr): self.fail("Newly created VM doesn't get IP from reserverd CIDR") except Exception as e: self.skipTest("VM creation fails, cannot validate the condition: %s" % e) + return @attr(tags=["advanced", "selfservice"]) def test_reservation_after_router_restart(self): @@ -1135,24 +1157,43 @@ def test_reservation_after_router_restart(self): # validation # 1. guest vm cidr should be successfully updated with correct value # 2. network cidr should remain same after router restart - guest_vm_cidr = u"10.1.1.0/29" + networkOffering = self.isolated_persistent_network_offering + subnet = "10.1."+str(random.randrange(1,254)) + gateway = subnet + ".1" + isolated_persistent_network = None + resultSet = createIsolatedNetwork(self, networkOffering.id, gateway=gateway) + if resultSet[0] == FAIL: + self.fail("Failed to create isolated network") + else: + isolated_persistent_network = resultSet[1] + + response = verifyNetworkState(self.apiclient, isolated_persistent_network.id,\ + "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] - update_response = Network.update(self.isolated_persistent_network, self.apiclient, id=self.isolated_persistent_network.id, guestvmcidr=guest_vm_cidr) + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) + guest_vm_cidr = subnet +".0/29" + + update_response = Network.update(isolated_persistent_network, self.apiclient, id=isolated_persistent_network.id, guestvmcidr=guest_vm_cidr) self.assertEqual(guest_vm_cidr, update_response.cidr, "cidr in response is not as expected") routers = Router.list(self.apiclient, - networkid=self.isolated_persistent_network.id, + networkid=isolated_persistent_network.id, listall=True) self.assertEqual(validateList(routers)[0], PASS, "routers list validation failed") Router.reboot(self.apiclient, routers[0].id) - networks = Network.list(self.apiclient, id=self.isolated_persistent_network.id) + networks = Network.list(self.apiclient, id=isolated_persistent_network.id) self.assertEqual( validateList(networks)[0], PASS, "list Networks should return valid response" ) self.assertEqual(networks[0].cidr, guest_vm_cidr, "guestvmcidr should match after router reboot") + return @attr(tags=["advanced", "selfservice"]) def test_vm_create_outside_cidr_after_reservation(self): @@ -1163,11 +1204,25 @@ def test_vm_create_outside_cidr_after_reservation(self): # validation # 1. guest vm cidr should be successfully updated with correct value # 2 newly created VM should not be created and result in exception - guest_vm_cidr = u"10.1.1.0/29" - update_response = Network.update(self.isolated_persistent_network, self.apiclient, id=self.isolated_persistent_network.id, guestvmcidr=guest_vm_cidr) + networkOffering = self.isolated_persistent_network_offering + subnet = "10.1."+str(random.randrange(1,254)) + gateway = subnet + ".1" + isolated_persistent_network = None + resultSet = createIsolatedNetwork(self, networkOffering.id, gateway=gateway) + if resultSet[0] == FAIL: + self.fail("Failed to create isolated network") + else: + isolated_persistent_network = resultSet[1] + guest_vm_cidr = subnet +".0/29" + update_response = Network.update(isolated_persistent_network, self.apiclient, id=isolated_persistent_network.id, guestvmcidr=guest_vm_cidr) self.assertEqual(guest_vm_cidr, update_response.cidr, "cidr in response is not as expected") - try: - self.create_virtual_machine(network_id=self.isolated_persistent_network.id, ip_address=u"10.1.1.9") - self.fail("vm should not be created ") - except Exception as e: - self.debug("exception as IP is outside of guestvmcidr: %s" % e) + with self.assertRaises(Exception): + VirtualMachine.create(self.apiclient, + self.testData["virtual_machine"], + networkids=isolated_persistent_network.id, + serviceofferingid=self.service_offering.id, + accountid=self.account.name, + domainid=self.domain.id, + ipaddress="10.1.1.9" + ) + return diff --git a/tools/marvin/marvin/codes.py b/tools/marvin/marvin/codes.py index ef49c0c3c8..c72a6bde8f 100644 --- a/tools/marvin/marvin/codes.py +++ b/tools/marvin/marvin/codes.py @@ -60,6 +60,7 @@ JOB_SUCCEEDED = 1 JOB_FAILED = 2 JOB_CANCELLED = 3 +ERROR_CODE_530 = 530 ''' User Related Codes ''' diff --git a/tools/marvin/marvin/lib/common.py b/tools/marvin/marvin/lib/common.py index ad795883ea..b946b92f1e 100644 --- a/tools/marvin/marvin/lib/common.py +++ b/tools/marvin/marvin/lib/common.py @@ -1112,19 +1112,25 @@ def shouldTestBeSkipped(networkType, zoneType): def verifyNetworkState(apiclient, networkid, state): """List networks and check if the network state matches the given state""" + retriesCount = 10 + isNetworkInDesiredState = False + exceptionOccured = False + exceptionMessage = "" try: - networks = Network.list(apiclient, id=networkid) + while retriesCount >= 0: + networks = Network.list(apiclient, id=networkid) + assert validateList( + networks)[0] == PASS, "Networks list validation failed" + if str(networks[0].state).lower() == state: + isNetworkInDesiredState = True + break + retriesCount -= 1 + time.sleep(60) except Exception as e: - raise Exception( - "Failed while fetching network list with error: %s" % - e) - assert validateList( - networks)[0] == PASS, "Networks list validation failed, list is %s"\ - % networks - assert str(networks[0].state).lower( - ) == state, "network state should be %s, it is %s" \ - % (state, networks[0].state) - return + exceptionOccured = True + exceptionMessage = e + return [exceptionOccured, isNetworkInDesiredState, exceptionMessage] + return [exceptionOccured, isNetworkInDesiredState, exceptionMessage] def verifyComputeOfferingCreation(apiclient, computeofferingid): From 3c43401449595174b177bfeb8346232293ac233e Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Thu, 15 May 2014 03:58:13 -0400 Subject: [PATCH 454/683] Code improvement: Persistent Network Test cases, Adding check to verify network state and fail test case in case network state is not as desired --- .../component/test_persistent_networks.py | 212 +++++++++++++++--- 1 file changed, 187 insertions(+), 25 deletions(-) diff --git a/test/integration/component/test_persistent_networks.py b/test/integration/component/test_persistent_networks.py index 0350a05b11..d42ffcd4bc 100644 --- a/test/integration/component/test_persistent_networks.py +++ b/test/integration/component/test_persistent_networks.py @@ -219,7 +219,13 @@ def test_network_state_after_destroying_vms(self): accountid=self.account.name,domainid=self.domain.id, zoneid=self.zone.id) self.cleanup.append(network) - verifyNetworkState(self.apiclient, network.id, "implemented") + response = verifyNetworkState(self.apiclient, network.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(network.vlan, "vlan must not be null for persistent network") try: @@ -238,6 +244,12 @@ def test_network_state_after_destroying_vms(self): wait_for_cleanup(self.api_client, ["network.gc.interval", "network.gc.wait"]) verifyNetworkState(self.api_client, network.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) return @attr(tags=["advanced", "selfservice"]) @@ -325,7 +337,13 @@ def test_upgrade_to_persistent_services_VR(self, value): networkofferingid=networkOffering.id, accountid=account.name,domainid=self.domain.id, zoneid=self.zone.id) - verifyNetworkState(self.api_client, isolated_network.id, "allocated") + response = verifyNetworkState(self.api_client, isolated_network.id, "allocated") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) # Update the network with persistent network offering isolated_network.update(self.apiclient, networkofferingid=self.isolated_persistent_network_offering.id, changecidr=changecidr) @@ -369,7 +387,13 @@ def test_upgrade_to_persistent_services_VR(self, value): wait_for_cleanup(self.api_client, ["network.gc.interval", "network.gc.wait"]) # Check network state now, this will bolster that network updation has taken effect - verifyNetworkState(self.api_client, isolated_network.id, "implemented") + response = verifyNetworkState(self.api_client, isolated_network.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) return @attr(tags=["advanced"]) @@ -394,7 +418,13 @@ def test_upgrade_network_VR_to_PersistentRVR(self): networkofferingid=self.isolated_network_offering.id, accountid=account.name,domainid=self.domain.id, zoneid=self.zone.id) - verifyNetworkState(self.api_client, isolated_network.id, "allocated") + response = verifyNetworkState(self.api_client, isolated_network.id, "allocated") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) # Update network with network offering which has RVR isolated_network.update(self.apiclient, networkofferingid=self.isolated_persistent_network_offering_RVR.id) @@ -436,7 +466,13 @@ def test_upgrade_network_VR_to_PersistentRVR(self): wait_for_cleanup(self.api_client, ["network.gc.interval", "network.gc.wait"]) # Check network state now, this will bolster that network updation has taken effect - verifyNetworkState(self.api_client, isolated_network.id, "implemented") + response = verifyNetworkState(self.api_client, isolated_network.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) return @attr(tags=["advanced", "advancedns"]) @@ -467,7 +503,13 @@ def test_upgrade_network_NS_to_persistent_NS(self): networkofferingid=self.isolated_network_offering_netscaler.id, accountid=account.name,domainid=self.domain.id, zoneid=self.zone.id) - verifyNetworkState(self.api_client, isolated_network.id, "allocated") + response = verifyNetworkState(self.api_client, isolated_network.id, "allocated") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) isolated_network.update(self.apiclient, networkofferingid=self.isolated_persistent_network_offering_netscaler.id, changecidr=True) @@ -507,7 +549,13 @@ def test_upgrade_network_NS_to_persistent_NS(self): wait_for_cleanup(self.api_client, ["network.gc.interval", "network.gc.wait"]) # Check network state now, this will bolster that network updation has taken effect - verifyNetworkState(self.api_client, isolated_network.id, "implemented") + response = verifyNetworkState(self.api_client, isolated_network.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) return @data("LB-VR","LB-Netscaler") @@ -880,7 +928,13 @@ def test_change_persistent_network_to_non_persistent(self): wait_for_cleanup(self.api_client, ["network.gc.interval", "network.gc.wait"]) # Check network state now, this will bolster that network updation has taken effect - verifyNetworkState(self.api_client, network.id, "allocated") + response = verifyNetworkState(self.api_client, network.id, "allocated") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) return @attr(tags=["advanced"]) @@ -1064,7 +1118,13 @@ def test_assign_vm_different_account_VR(self, value): networkofferingid=network_offering.id, accountid=account_1.name,domainid=self.domain.id, zoneid=self.zone.id) - verifyNetworkState(self.api_client, network.id, "implemented") + response = verifyNetworkState(self.api_client, network.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(network.vlan, "vlan must not be null for persistent network") try: @@ -1173,7 +1233,13 @@ def test_account_operations(self, value): networkofferingid=self.isolated_persistent_network_offering.id, accountid=account.name,domainid=self.domain.id, zoneid=self.zone.id) - verifyNetworkState(self.api_client, network.id, "implemented") + response = verifyNetworkState(self.api_client, network.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(network.vlan, "vlan must not be null for persistent network") if value == "disabled": @@ -1191,7 +1257,13 @@ def test_account_operations(self, value): networks = Network.list(self.apiclient, account=account.name, domainid = account.domainid) self.assertEqual(validateList(networks)[0], PASS, "networks list validation failed, list is %s" % networks) - verifyNetworkState(self.api_client, networks[0].id, "implemented") + response = verifyNetworkState(self.api_client, networks[0].id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(networks[0].vlan, "vlan must not be null for persistent network") return @@ -1242,7 +1314,13 @@ def test_project_operations(self): # Wait for network cleanup interval wait_for_cleanup(self.api_client, ["network.gc.interval", "network.gc.wait"]) - verifyNetworkState(self.apiclient, network.id, "implemented") + response = verifyNetworkState(self.apiclient, network.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) return @ddt @@ -1378,7 +1456,13 @@ def test_cleanup_persistent_network(self, value): networkofferingid=self.isolated_persistent_network_offering.id, accountid=account.name,domainid=self.domain.id, zoneid=self.zone.id) - verifyNetworkState(self.apiclient, isolated_persistent_network.id, "implemented") + response = verifyNetworkState(self.apiclient, isolated_persistent_network.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(isolated_persistent_network.vlan, "vlan must not be null for persistent network") self.debug("Listing routers for network: %s" % isolated_persistent_network.name) @@ -1413,6 +1497,12 @@ def test_cleanup_persistent_network(self, value): self.assertEqual(validateList(networks)[0], PASS, "networks list validation failed, list is %s" % networks) verifyNetworkState(self.apiclient, networks[0].id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(networks[0].vlan, "vlan must not be null for persistent network") # Deploy VM @@ -1453,7 +1543,13 @@ def test_cleanup_persistent_network_lb_netscaler(self, value): networkofferingid=self.isolated_persistent_network_offering_netscaler.id, accountid=account.name,domainid=self.domain.id, zoneid=self.zone.id) - verifyNetworkState(self.apiclient, isolated_persistent_network.id, "implemented") + response = verifyNetworkState(self.apiclient, isolated_persistent_network.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(isolated_persistent_network.vlan, "vlan must not be null for persistent network") self.debug("Listing routers for network: %s" % isolated_persistent_network.name) @@ -1483,7 +1579,13 @@ def test_cleanup_persistent_network_lb_netscaler(self, value): networks = Network.list(self.apiclient, account=account.name, domainid = account.domainid) self.assertEqual(validateList(networks)[0], PASS, "networks list validation failed, list is %s" % networks) - verifyNetworkState(self.apiclient, networks[0].id, "implemented") + response = verifyNetworkState(self.apiclient, networks[0].id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(networks[0].vlan, "vlan must not be null for persistent network") # Deploy VM @@ -1685,21 +1787,45 @@ def test_vpc_network_life_cycle(self, value): networkofferingid=self.persistent_network_offering_NoLB.id, accountid=account.name,domainid=self.domain.id, zoneid=self.zone.id, vpcid=vpc.id, gateway="10.1.1.1", netmask="255.255.255.0") - verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented") + response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(persistent_network_1.vlan, "vlan must not be null for persistent network %s" % persistent_network_1.id) persistent_network_2 = Network.create(self.api_client,self.services["isolated_network"], networkofferingid=self.persistent_network_offering_NoLB.id, accountid=account.name,domainid=self.domain.id, zoneid=self.zone.id, vpcid=vpc.id, gateway="10.1.2.1", netmask="255.255.255.0") - verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented") + response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(persistent_network_2.vlan, "vlan must not be null for persistent network: %s" % persistent_network_2.id) if value == "restart": # Restart VPC vpc.restart(self.apiclient) - verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented") - verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented") + response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) + response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) elif value == "delete": vpc.delete(self.apiclient) @@ -1749,14 +1875,26 @@ def test_vpc_force_delete_domain(self): networkofferingid=self.persistent_network_offering_NoLB.id, accountid=account_1.name,domainid=account_1.domainid, zoneid=self.zone.id, vpcid=vpc_1.id, gateway="10.1.1.1", netmask="255.255.255.0") - verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented") + response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(persistent_network_1.vlan, "vlan must not be null for persistent network %s" % persistent_network_1.id) persistent_network_2 = Network.create(self.api_client,self.services["isolated_network"], networkofferingid=self.persistent_network_offering_NoLB.id, accountid=account_2.name,domainid=account_2.domainid, zoneid=self.zone.id, vpcid=vpc_2.id, gateway="10.1.1.1", netmask="255.255.255.0") - verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented") + response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(persistent_network_2.vlan, "vlan must not be null for persistent network: %s" % persistent_network_2.id) # Force delete domain @@ -1810,14 +1948,26 @@ def test_vpc_delete_account(self): networkofferingid=self.persistent_network_offering_NoLB.id, accountid=account.name,domainid=account.domainid, zoneid=self.zone.id, vpcid=vpc.id, gateway="10.1.1.1", netmask="255.255.255.0") - verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented") + response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(persistent_network_1.vlan, "vlan must not be null for persistent network %s" % persistent_network_1.id) persistent_network_2 = Network.create(self.api_client,self.services["isolated_network"], networkofferingid=self.persistent_network_offering_LB.id, accountid=account.name,domainid=account.domainid, zoneid=self.zone.id, vpcid=vpc.id, gateway="10.1.2.1", netmask="255.255.255.0") - verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented") + response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(persistent_network_2.vlan, "vlan must not be null for persistent network: %s" % persistent_network_2.id) # Deploy VMs in above networks (VM1, VM2 in network1 and VM3, VM4 in network2) @@ -1921,14 +2071,26 @@ def test_vpc_private_gateway_static_route(self): networkofferingid=self.persistent_network_offering_NoLB.id, accountid=account.name,domainid=account.domainid, zoneid=self.zone.id, vpcid=vpc.id, gateway="10.1.1.1", netmask="255.255.255.0") - verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented") + response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(persistent_network_1.vlan, "vlan must not be null for persistent network %s" % persistent_network_1.id) persistent_network_2 = Network.create(self.api_client,self.services["isolated_network"], networkofferingid=self.persistent_network_offering_LB.id, accountid=account.name,domainid=account.domainid, zoneid=self.zone.id, vpcid=vpc.id, gateway="10.1.2.1", netmask="255.255.255.0") - verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented") + response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] + + if (exceptionOccured or (not isNetworkInDesiredState)): + self.fail(exceptionMessage) self.assertIsNotNone(persistent_network_2.vlan, "vlan must not be null for persistent network: %s" % persistent_network_2.id) # Deploy VMs in above networks (VM1, VM2 in network1 and VM3, VM4 in network2) From a418ee443d6837b4360f91141f73b2d2bbdb73f0 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Thu, 15 May 2014 23:59:00 -0400 Subject: [PATCH 455/683] CLOUDSTACK-6689: Fixed indentation issue in persistent network test cases --- test/integration/component/test_persistent_networks.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/component/test_persistent_networks.py b/test/integration/component/test_persistent_networks.py index d42ffcd4bc..ab1e2c2ab4 100644 --- a/test/integration/component/test_persistent_networks.py +++ b/test/integration/component/test_persistent_networks.py @@ -182,8 +182,8 @@ def verifyVmExpungement(self, virtual_machine): retriesCount -= 1 # end while - if not isVmExpunged: - self.fail("Failed to expunge vm even after 20 minutes") + if not isVmExpunged: + self.fail("Failed to expunge vm even after 20 minutes") return def setUp(self): From 8eca37056f5bb1eee10f0bedee785142d7c3437a Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Thu, 15 May 2014 23:19:06 -0400 Subject: [PATCH 456/683] CLOUDSTACK-6657: Adding condition for checking error code 530 across test cases Signed-off-by: SrikanteswaraRao Talluri --- test/integration/component/test_accounts.py | 21 ++++++++----- .../component/test_add_remove_network.py | 15 +++++---- .../component/test_affinity_groups.py | 8 +++-- test/integration/component/test_assign_vm.py | 19 ++++++++++-- .../component/test_ip_reservation.py | 14 ++++++--- .../component/test_non_contiguous_vlan.py | 12 +++---- test/integration/component/test_projects.py | 21 ++++++------- test/integration/component/test_volumes.py | 10 +++--- test/integration/component/test_vpc.py | 7 +++-- .../integration/component/test_vpc_network.py | 8 +++-- .../component/test_vpc_network_lbrules.py | 7 +++-- .../component/test_vpc_vms_deployment.py | 15 ++++++--- test/integration/smoke/test_network.py | 13 +++++--- test/integration/smoke/test_nic.py | 31 ++++++++++--------- .../integration/smoke/test_primary_storage.py | 16 +++++----- test/integration/smoke/test_volumes.py | 25 +++++++-------- 16 files changed, 144 insertions(+), 98 deletions(-) diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index cf5f2b6e47..98a1aa10c3 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -18,7 +18,6 @@ """ #Import Local Modules from marvin.cloudstackTestCase import cloudstackTestCase -#from marvin.cloudstackAPI import * from marvin.lib.utils import (random_gen, cleanup_resources) from marvin.lib.base import (Domain, @@ -41,7 +40,7 @@ get_builtin_template_info, wait_for_cleanup) from nose.plugins.attrib import attr -from marvin.cloudstackException import CloudstackAPIException +from marvin.codes import ERROR_CODE_530 import time class Services: @@ -1672,21 +1671,25 @@ def test_forceDeleteDomain(self): " to cleanup any remaining resouces") # Sleep 3*account.gc to ensure that all resources are deleted wait_for_cleanup(self.apiclient, ["account.cleanup.interval"]*3) - with self.assertRaises(CloudstackAPIException): - Domain.list( + response = Domain.list( self.apiclient, id=domain.id, listall=True ) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) self.debug("Checking if the resources in domain are deleted") - with self.assertRaises(CloudstackAPIException): - Account.list( + response = Account.list( self.apiclient, name=self.account_1.name, domainid=self.account_1.domainid, listall=True ) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) return @attr(tags=["domains", "advanced", "advancedns", "simulator", "selfservice"]) @@ -1831,6 +1834,8 @@ def test_DeleteDomain(self): ) self.debug("Deleting domain without force option") - with self.assertRaises(Exception): - domain.delete(self.apiclient, cleanup=False) + response = domain.delete(self.apiclient, cleanup=False) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) return diff --git a/test/integration/component/test_add_remove_network.py b/test/integration/component/test_add_remove_network.py index c17293d17a..969d94ca10 100644 --- a/test/integration/component/test_add_remove_network.py +++ b/test/integration/component/test_add_remove_network.py @@ -58,7 +58,7 @@ removeNicFromVirtualMachine, updateDefaultNicForVirtualMachine) -from marvin.codes import PASS +from marvin.codes import PASS, ERROR_CODE_530 import random import time @@ -466,8 +466,10 @@ def test_05_add_vpc_nw_stopped_vm(self, value): self.cleanup.append(vpc) self.cleanup.append(vpc_off) self.debug("Trying to add VPC to vm belonging to isolated network, this should fail") - with self.assertRaises(Exception): - self.virtual_machine.add_nic(self.apiclient, vpc.id) + response = self.virtual_machine.add_nic(self.apiclient, vpc.id) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) self.debug("Starting virtual machine") self.virtual_machine.start(self.apiclient) self.debug("Disabling vpc offering: %s" % vpc_off.id) @@ -825,9 +827,10 @@ def test_08_remove_default_nic(self): self.assertEqual(len(vm_list[0].nic), 1, "There should only be default nic present in the vm") self.debug("Trying to remove the default nic of vm : %s, this should fail" % self.virtual_machine.id) - with self.assertRaises(Exception): - self.virtual_machine.remove_nic(self.apiclient, vm_list[0].nic[0].id) - self.debug("Removing default nic of vm failed") + response = self.virtual_machine.remove_nic(self.apiclient, vm_list[0].nic[0].id) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) return @attr(tags = ["advanced"]) diff --git a/test/integration/component/test_affinity_groups.py b/test/integration/component/test_affinity_groups.py index d0fa2f7a3d..d31746afe5 100644 --- a/test/integration/component/test_affinity_groups.py +++ b/test/integration/component/test_affinity_groups.py @@ -29,6 +29,7 @@ get_template, list_virtual_machines, wait_for_cleanup) +from marvin.codes import ERROR_CODE_530 from nose.plugins.attrib import attr class Services: @@ -1086,9 +1087,10 @@ def test_05_update_aff_grp_on_running_vm(self): vm1, hostid1 = self.create_vm_in_aff_grps([self.aff_grp[0].name], account_name=self.account.name, domain_id=self.domain.id) aff_grps = [self.aff_grp[0], self.aff_grp[1]] - with self.assertRaises(Exception): - vm1.update_affinity_group(self.api_client, affinitygroupnames=[]) - + response = vm1.update_affinity_group(self.api_client, affinitygroupnames=[]) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) vm1.delete(self.api_client) #Wait for expunge interval to cleanup VM wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"]) diff --git a/test/integration/component/test_assign_vm.py b/test/integration/component/test_assign_vm.py index 24b63a62f1..0b07e9f877 100644 --- a/test/integration/component/test_assign_vm.py +++ b/test/integration/component/test_assign_vm.py @@ -38,6 +38,7 @@ list_snapshots, list_virtual_machines) from marvin.lib.utils import cleanup_resources +from marvin.codes import ERROR_CODE_530 def log_test_exceptions(func): def test_wrap_exception_log(self, *args, **kwargs): @@ -369,7 +370,14 @@ def test_10_move_across_subdomain_vm_running(self): # 1. deploy VM in sub subdomain1 # 3. assignVirtualMachine to subdomain2 self.create_vm(self.sdomain_account_user1['account'], self.sdomain_account_user1['domain'],isRunning=True) - self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, self.apiclient, self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id) + response = self.virtual_machine.assign_virtual_machine( + self.apiclient, + self.sdomain_account_user2['account'].name, + self.sdomain_account_user2['domain'].id) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) + return @attr(tags = ["advanced"]) @log_test_exceptions @@ -380,7 +388,14 @@ def test_11_move_across_subdomain_vm_pfrule(self): # 1. deploy VM in sub subdomain1 with PF rule set. # 3. assignVirtualMachine to subdomain2 self.create_vm(self.sdomain_account_user1['account'], self.sdomain_account_user1['domain'],pfrule=True) - self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, self.apiclient, self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id) + response = self.virtual_machine.assign_virtual_machine( + self.apiclient, + self.sdomain_account_user2['account'].name, + self.sdomain_account_user2['domain'].id) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) + return @attr(tags = ["advanced"]) @log_test_exceptions diff --git a/test/integration/component/test_ip_reservation.py b/test/integration/component/test_ip_reservation.py index c84f63c87a..eb193d1494 100644 --- a/test/integration/component/test_ip_reservation.py +++ b/test/integration/component/test_ip_reservation.py @@ -270,8 +270,10 @@ def test_update_cidr_multiple_vms_not_all_inclusive(self): except Exception as e: self.fail("VM creation failed: %s" % e) - with self.assertRaises(Exception): - isolated_network.update(self.apiclient, guestvmcidr=guest_vm_cidr) + response = isolated_network.update(self.apiclient, guestvmcidr=guest_vm_cidr) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) return @attr(tags=["advanced"]) @@ -300,8 +302,10 @@ def test_update_cidr_single_vm_not_inclusive(self): except Exception as e: self.fail("VM creation failed: %s" % e) - with self.assertRaises(Exception): - isolated_network.update(self.apiclient, guestvmcidr=guest_vm_cidr) + response = isolated_network.update(self.apiclient, guestvmcidr=guest_vm_cidr) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) return @data(NAT_RULE, STATIC_NAT_RULE) @@ -1086,7 +1090,7 @@ def test_network_not_implemented(self): response = isolated_network.update(self.apiclient, guestvmcidr="10.1.1.0/26") self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, response)) + %s" % (ERROR_CODE_530, str(response))) return @attr(tags=["advanced", "selfservice"]) diff --git a/test/integration/component/test_non_contiguous_vlan.py b/test/integration/component/test_non_contiguous_vlan.py index 4609af95f1..1f74252a02 100644 --- a/test/integration/component/test_non_contiguous_vlan.py +++ b/test/integration/component/test_non_contiguous_vlan.py @@ -27,7 +27,7 @@ #Import local modules -from marvin.cloudstackTestCase import (cloudstackTestCase,unittest) +from marvin.cloudstackTestCase import (cloudstackTestCase) from marvin.lib.base import (Account, ServiceOffering, PhysicalNetwork, @@ -40,6 +40,7 @@ setNonContiguousVlanIds) from marvin.lib.utils import (cleanup_resources, xsplit) +from marvin.codes import ERROR_CODE_530 from nose.plugins.attrib import attr @@ -317,12 +318,11 @@ def test_05_remove_used_range(self): self.debug("Deployed instance in account: %s" % account.name) self.debug("Trying to remove vlan range : %s , This should fail" % self.vlan["partial_range"][0]) - with self.assertRaises(Exception) as e: - self.physicalnetwork.update(self.apiClient, id = self.physicalnetworkid, vlan = self.vlan["partial_range"][0]) - - self.debug("operation failed with exception: %s" % e.exception) + response = self.physicalnetwork.update(self.apiClient, id = self.physicalnetworkid, vlan = self.vlan["partial_range"][0]) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) account.delete(self.apiclient) - except Exception as e: self.fail("Exception in test case: %s" % e) diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py index c593fb6d9e..cf6cec8c42 100644 --- a/test/integration/component/test_projects.py +++ b/test/integration/component/test_projects.py @@ -17,15 +17,13 @@ """ P1 tests for Project """ #Import Local Modules -import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.lib.utils import * from marvin.lib.base import * from marvin.lib.common import * -from marvin.sshClient import SshClient -import datetime +from marvin.codes import ERROR_CODE_530 class Services: @@ -430,13 +428,14 @@ def test_02_cross_domain_account_add(self): self.user.domainid, project.id )) - with self.assertRaises(Exception): - # Add user to the project from different domain - project.addAccount( + # Add user to the project from different domain + response = project.addAccount( self.apiclient, self.user.name ) - self.debug("User add to project failed!") + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) return @@ -542,10 +541,10 @@ def test_03_delete_account_with_project(self): "Check project name from list response" ) # Deleting account who is owner of the project - with self.assertRaises(Exception): - self.account.delete(self.apiclient) - self.debug("Deleting account %s failed!" % - self.account.name) + response = self.account.delete(self.apiclient) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) return diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py index b5b08e2d5c..4a91e5dff1 100644 --- a/test/integration/component/test_volumes.py +++ b/test/integration/component/test_volumes.py @@ -36,6 +36,7 @@ get_zone, get_template, get_pod) +from marvin.codes import ERROR_CODE_530 #Import System modules import time @@ -341,16 +342,17 @@ def test_02_volume_attach_max(self): True, "Check list volumes response for valid list" ) - # Attach volume to VM - with self.assertRaises(Exception): - self.debug("Trying to Attach volume: %s to VM: %s" % ( + self.debug("Trying to Attach volume: %s to VM: %s" % ( volume.id, self.virtual_machine.id )) - self.virtual_machine.attach_volume( + response = self.virtual_machine.attach_volume( self.apiclient, volume ) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) return class TestAttachDetachVolume(cloudstackTestCase): diff --git a/test/integration/component/test_vpc.py b/test/integration/component/test_vpc.py index e9d396e8b8..31b421c0fd 100644 --- a/test/integration/component/test_vpc.py +++ b/test/integration/component/test_vpc.py @@ -25,6 +25,7 @@ from marvin.lib.utils import * from marvin.lib.base import * from marvin.lib.common import * +from marvin.codes import ERROR_CODE_530 class Services: @@ -699,8 +700,10 @@ def test_05_delete_vpc_with_networks(self): self.debug("Created network with ID: %s" % network_2.id) self.debug("Deleting the VPC with no network") - with self.assertRaises(Exception): - vpc.delete(self.apiclient) + response = vpc.delete(self.apiclient) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) self.debug("Delete VPC failed as there are still networks in VPC") self.debug("Deleting the networks in the VPC") diff --git a/test/integration/component/test_vpc_network.py b/test/integration/component/test_vpc_network.py index a449948c91..8d12ec6498 100644 --- a/test/integration/component/test_vpc_network.py +++ b/test/integration/component/test_vpc_network.py @@ -44,7 +44,7 @@ # For more info on ddt refer to http://ddt.readthedocs.org/en/latest/api.html#module-ddt from ddt import ddt, data import time -from marvin.codes import PASS +from marvin.codes import PASS, ERROR_CODE_530 class Services: """Test VPC network services @@ -2107,12 +2107,14 @@ def test_02_network_vpcvr2vr_upgrade(self): self.fail("Failed to stop VMs, %s" % e) self.debug("Upgrading network offering to support PF services") - with self.assertRaises(Exception): - network_1.update( + response = network_1.update( self.apiclient, networkofferingid=nw_off_vr.id, changecidr=True ) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) return class TestVPCNetworkGc(cloudstackTestCase): diff --git a/test/integration/component/test_vpc_network_lbrules.py b/test/integration/component/test_vpc_network_lbrules.py index a5625e7216..47bdce53a9 100644 --- a/test/integration/component/test_vpc_network_lbrules.py +++ b/test/integration/component/test_vpc_network_lbrules.py @@ -39,6 +39,7 @@ get_template, list_routers) from marvin.lib.utils import cleanup_resources +from marvin.codes import ERROR_CODE_530 import socket import time @@ -640,8 +641,10 @@ def test_04_VPC_CreateLBRuleInMultipleNetworksVRStoppedState(self): lb_rule = self.create_LB_Rule(public_ip_1, network_1, [vm_1, vm_2], self.services["lbrule_http"]) # In a VPC, the load balancing service is supported only on a single tier. # http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.0.2/html/Installation_Guide/configure-vpc.html - with self.assertRaises(Exception): - lb_rule.assign(self.apiclient, [vm_3]) + response = lb_rule.assign(self.apiclient, [vm_3]) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) self.check_wget_from_vm(vm_1, public_ip_1, testnegative=False) return diff --git a/test/integration/component/test_vpc_vms_deployment.py b/test/integration/component/test_vpc_vms_deployment.py index 1c1f93d37e..19aa448792 100644 --- a/test/integration/component/test_vpc_vms_deployment.py +++ b/test/integration/component/test_vpc_vms_deployment.py @@ -19,7 +19,7 @@ """ #Import Local Modules from nose.plugins.attrib import attr -from marvin.cloudstackTestCase import cloudstackTestCase, unittest +from marvin.cloudstackTestCase import cloudstackTestCase from marvin.lib.base import (VirtualMachine, NetworkOffering, VpcOffering, @@ -43,6 +43,7 @@ get_free_vlan) from marvin.lib.utils import cleanup_resources +from marvin.codes import ERROR_CODE_530 from marvin.cloudstackAPI import rebootRouter @@ -1622,8 +1623,10 @@ def test_06_delete_network_vm_running(self): "Vm state should be running for each VM deployed" ) self.debug("Trying to delete network: %s" % network_1.name) - with self.assertRaises(Exception): - network_1.delete(self.apiclient) + response = network_1.delete(self.apiclient) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) self.debug("Delete netwpork failed as there are running instances") self.debug("Destroying all the instances in network1: %s" % @@ -2161,8 +2164,10 @@ def test_07_delete_network_with_rules(self): ) self.debug("Trying to delete network: %s" % network_1.name) - with self.assertRaises(Exception): - network_1.delete(self.apiclient) + response = network_1.delete(self.apiclient) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) self.debug("Delete network failed as there are running instances") self.debug("Destroying all the instances in network1: %s" % diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index 6beb0710a8..b82501c695 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -27,6 +27,7 @@ from marvin.lib.base import * from marvin.lib.common import * from nose.plugins.attrib import attr +from marvin.codes import ERROR_CODE_530 #Import System modules import time @@ -389,12 +390,14 @@ def test_01_port_fwd_on_src_nat(self): try: nat_rule.delete(self.apiclient) - list_nat_rule_response = list_nat_rules( - self.apiclient, - id=nat_rule.id - ) except CloudstackAPIException: - self.fail("Nat Rule Deletion or Listing Failed") + self.fail("Nat Rule deletion failed: %s" % e) + + response = list_nat_rules(self.apiclient, + id=nat_rule.id) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) # Check if the Public SSH port is inaccessible with self.assertRaises(Exception): diff --git a/test/integration/smoke/test_nic.py b/test/integration/smoke/test_nic.py index 592a8391a0..a76e858226 100644 --- a/test/integration/smoke/test_nic.py +++ b/test/integration/smoke/test_nic.py @@ -15,14 +15,17 @@ # specific language governing permissions and limitations # under the License. """ NIC tests for VM """ -import marvin -from marvin.codes import FAILED -from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient -from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * +from marvin.codes import ERROR_CODE_530 +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.lib.base import(Account, + ServiceOffering, + Network, + VirtualMachine, + NetworkOffering) +from marvin.lib.common import (get_zone, + get_domain, + get_template, + list_virtual_machines) from nose.plugins.attrib import attr import signal @@ -186,7 +189,7 @@ def test_01_nic(self): existing_nic_id = vm_response.nic[0].id # 1. add a nic - add_response = self.virtual_machine.add_nic(self.apiclient, self.test_network2.id) + self.virtual_machine.add_nic(self.apiclient, self.test_network2.id) time.sleep(5) # now go get the vm list? @@ -231,13 +234,11 @@ def test_01_nic(self): "Verify second adapter is set to default" ) - sawException = False - try: - self.virtual_machine.remove_nic(self.apiclient, new_nic_id) - except Exception as ex: - sawException = True + response = self.virtual_machine.remove_nic(self.apiclient, new_nic_id) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) - self.assertEqual(sawException, True, "Make sure we cannot delete the default NIC") self.virtual_machine.update_default_nic(self.apiclient, existing_nic_id) time.sleep(5) self.virtual_machine.remove_nic(self.apiclient, new_nic_id) diff --git a/test/integration/smoke/test_primary_storage.py b/test/integration/smoke/test_primary_storage.py index 3147d86645..5b24b6490f 100644 --- a/test/integration/smoke/test_primary_storage.py +++ b/test/integration/smoke/test_primary_storage.py @@ -17,16 +17,18 @@ """ BVT tests for Primary Storage """ #Import Local Modules -import marvin -from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * -from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * +from marvin.cloudstackTestCase import cloudstackTestCase +#from marvin.cloudstackAPI import * +from marvin.lib.utils import cleanup_resources +from marvin.lib.base import StoragePool +from marvin.lib.common import (get_zone, + get_pod, + list_clusters, + list_hosts, + list_storage_pools) from nose.plugins.attrib import attr #Import System modules -import time _multiprocess_shared_ = True class TestPrimaryStorageServices(cloudstackTestCase): diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index 5908e2b5a5..a151df9435 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -18,11 +18,9 @@ """ #Import Local Modules from marvin.cloudstackTestCase import cloudstackTestCase -#from marvin.cloudstackException import * from marvin.cloudstackAPI import (deleteVolume, extractVolume, resizeVolume) -#from marvin.sshClient import SshClient from marvin.lib.utils import (cleanup_resources, format_volume_to_ext3) from marvin.lib.base import (ServiceOffering, @@ -35,7 +33,7 @@ get_zone, get_template) from marvin.lib.utils import checkVolumeSize -from marvin.codes import SUCCESS, FAILED +from marvin.codes import SUCCESS, FAILED, ERROR_CODE_530 from nose.plugins.attrib import attr #Import System modules import os @@ -395,8 +393,11 @@ def test_03_download_attached_volume(self): cmd.zoneid = self.services["zoneid"] # A proper exception should be raised; # downloading attach VM is not allowed - with self.assertRaises(Exception): - self.apiClient.extractVolume(cmd) + response = self.apiClient.extractVolume(cmd) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) + return @attr(tags = ["advanced", "advancedns", "smoke", "basic", "selfservice"]) def test_04_delete_attached_volume(self): @@ -548,15 +549,11 @@ def test_07_resize_fail(self): cmd.id = rootvolume.id cmd.diskofferingid = self.services['diskofferingid'] success = False - try: - self.apiClient.resizeVolume(cmd) - except Exception as ex: - if "Can only resize Data volumes" in str(ex): - success = True - self.assertEqual( - success, - True, - "ResizeVolume - verify root disks cannot be resized by disk offering id") + + response = self.apiClient.resizeVolume(cmd) + self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ + have failed with error code %s, instead got response \ + %s" % (ERROR_CODE_530, str(response))) # Ok, now let's try and resize a volume that is not custom. cmd.id = self.volume.id From 4e10b80293493d7bc78d75a43a00b6646acb52de Mon Sep 17 00:00:00 2001 From: Girish Shilamkar Date: Tue, 13 May 2014 03:00:29 -0400 Subject: [PATCH 457/683] CLOUDSTACK-6655: Fixing cleanup issues with portable IP test cases --- .../integration/component/test_portable_ip.py | 348 +++++++----------- tools/marvin/marvin/lib/common.py | 33 +- 2 files changed, 156 insertions(+), 225 deletions(-) diff --git a/test/integration/component/test_portable_ip.py b/test/integration/component/test_portable_ip.py index 61268ebc7c..847bb4a822 100644 --- a/test/integration/component/test_portable_ip.py +++ b/test/integration/component/test_portable_ip.py @@ -21,11 +21,24 @@ Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/portable+public+IP """ from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.cloudstackException import CloudstackAPIException -from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -from netaddr import * +from marvin.lib.utils import cleanup_resources +from marvin.lib.base import (VirtualMachine, + PublicIPAddress, + Network, + NetworkOffering, + ServiceOffering, + NATRule, + Account, + PortablePublicIpRange, + StaticNATRule, + FireWallRule) +from marvin.lib.common import (get_zone, + get_template, + get_domain, + get_region, + get_pod, + isIpInDesiredState) +from netaddr import IPAddress from marvin.sshClient import SshClient from nose.plugins.attrib import attr @@ -196,29 +209,19 @@ def test_create_portable_ip_range(self): # 2. Portable ip range should be created successfully portable_ip_range_services = self.services["portableIpRange"] - - self.debug(portable_ip_range_services) - if portable_ip_range_services is None: self.skipTest('Failed to read config values related to portable ip range') portable_ip_range_services["regionid"] = self.region.id - self.debug("Creating new portable IP range with startip:%s and endip:%s" % - (str(portable_ip_range_services["startip"]), - str(portable_ip_range_services["endip"]))) - - #create new portable ip range - new_portable_ip_range = PortablePublicIpRange.create(self.apiclient, + try: + #create new portable ip range + new_portable_ip_range = PortablePublicIpRange.create(self.apiclient, portable_ip_range_services) - self.debug("Created new portable IP range with startip:%s and endip:%s and id:%s" % - (new_portable_ip_range.startip, - new_portable_ip_range.endip, - new_portable_ip_range.id)) - - self.cleanup.append(new_portable_ip_range) - + self.cleanup.append(new_portable_ip_range) + except Exception as e: + self.fail("Failed to create portable IP range: %s" % e) return @attr(tags=["advanced", "selfservice"]) @@ -228,29 +231,32 @@ def test_create_portable_ip_range_non_root_admin(self): # 1. Create new portable ip range with non root admin api client # 2. Portable ip range should not be created - self.account = Account.create( + portable_ip_range_services = self.services["portableIpRange"] + + if portable_ip_range_services is None: + self.skipTest('Failed to read config values related to portable ip range') + + try: + self.account = Account.create( self.apiclient, self.services["account"], domainid=self.domain.id ) - self.api_client_user = self.testClient.getUserApiClient( + self.api_client_user = self.testClient.getUserApiClient( UserName=self.account.name, DomainName=self.account.domain ) - portable_ip_range_services = self.services["portableIpRange"] + portable_ip_range_services["regionid"] = self.region.id - if portable_ip_range_services is None: - self.skipTest('Failed to read config values related to portable ip range') - - portable_ip_range_services["regionid"] = self.region.id - - self.debug("Trying to create portable ip range with non root-admin api client, should raise exception") - with self.assertRaises(Exception): - portable_ip_range = PortablePublicIpRange.create(self.api_client_user, + self.debug("Trying to create portable ip range with non root-admin api client, should raise exception") + with self.assertRaises(Exception): + portable_ip_range = PortablePublicIpRange.create(self.api_client_user, portable_ip_range_services) - self.cleanup.append(portable_ip_range) + self.cleanup.append(portable_ip_range) + except Exception as e: + self.fail(e) return @@ -322,19 +328,10 @@ def setUp(self): portable_ip_range_services["regionid"] = self.region.id - self.debug("Creating new portable IP range with startip:%s and endip:%s" % - (str(portable_ip_range_services["startip"]), - str(portable_ip_range_services["endip"]))) - #create new portable ip range self.portable_ip_range = PortablePublicIpRange.create(self.apiclient, portable_ip_range_services) - self.debug("Created new portable IP range with startip:%s and endip:%s and id:%s" % - (self.portable_ip_range.startip, - self.portable_ip_range.endip, - self.portable_ip_range.id)) - self.cleanup = [] return @@ -353,12 +350,7 @@ def test_delete_portable_ip_range(self): # 1. Try to delete the created range with root admin api client # 2. Portable range should be deleted successfully - self.debug("Deleting portable ip range with root-admin api") - self.portable_ip_range.delete(self.apiclient) - - self.debug("Deleted portable ip range") - return @attr(tags=["advanced", "selfservice"]) @@ -368,23 +360,29 @@ def test_delete_portable_ip_range_non_root_admin(self): # 1. Try to delete the created range with non root admin api client # 2. Portable range deletion should fail - self.account = Account.create( + try: + self.account = Account.create( self.apiclient, self.services["account"], domainid=self.domain.id ) - self.cleanup.append(self.account) + self.cleanup.append(self.account) - self.api_client_user = self.testClient.getUserApiClient( + self.api_client_user = self.testClient.getUserApiClient( UserName=self.account.name, DomainName=self.account.domain ) + except Exception as e: + self.fail(e) - with self.assertRaises(Exception): - self.portable_ip_range.delete(self.api_client_user) - - self.portable_ip_range.delete(self.apiclient) + try: + with self.assertRaises(Exception): + self.portable_ip_range.delete(self.api_client_user) + except Exception as e: + self.fail(e) + finally: + self.portable_ip_range.delete(self.apiclient) return @attr(tags=["advanced", "selfservice"]) @@ -395,30 +393,23 @@ def test_delete_portable_ip_range_in_use(self): # 2. Try to delete the portable ip range with root admin api client # 3. Portable ip range should not be deleted unless currently used ip is disassociated - self.account = Account.create( + try: + self.account = Account.create( self.apiclient, self.services["account"], domainid=self.domain.id ) - self.cleanup.append(self.account) - - self.debug( - "Creating n/w offering" - ) - self.network_offering = NetworkOffering.create( + self.cleanup.append(self.account) + self.network_offering = NetworkOffering.create( self.apiclient, self.services["network_offering"], conservemode=False ) + # Enable Network offering + self.network_offering.update(self.apiclient, state='Enabled') - self.debug("Created n/w offering with ID: %s" % - self.network_offering.id) - # Enable Network offering - self.network_offering.update(self.apiclient, state='Enabled') - self.debug("Creating network") - - self.network = Network.create( + self.network = Network.create( self.apiclient, self.services["network"], accountid=self.account.name, @@ -426,10 +417,7 @@ def test_delete_portable_ip_range_in_use(self): networkofferingid=self.network_offering.id, zoneid=self.zone.id ) - - self.debug("Created network with id: %s" % self.network.id) - self.debug("Associating public ip address with network: %s with isportable=True" % self.network.id) - portableip = PublicIPAddress.create( + portableip = PublicIPAddress.create( self.apiclient, accountid=self.account.name, zoneid=self.zone.id, @@ -437,19 +425,21 @@ def test_delete_portable_ip_range_in_use(self): networkid=self.network.id, isportable=True ) - self.debug("Associated public ip address (portable): %s" % portableip.ipaddress.ipaddress) - - with self.assertRaises(Exception): - self.debug("Trying to Delete portable ip range with root-admin api, this should fail") - self.portable_ip_range.delete(self.apiclient) - self.debug("Deleting portable ip range failed") - self.debug("Disassociating portable ip") - portableip.delete(self.apiclient) - - self.debug("Deleting portable ip range") - self.portable_ip_range.delete(self.apiclient) + except Exception as e: + self.fail(e) + try: + with self.assertRaises(Exception): + self.debug("Trying to Delete portable ip range with root-admin api, this should fail") + self.portable_ip_range.delete(self.apiclient) + except Exception as e: + self.fail(e) + finally: + self.debug("Disassociating portable ip") + portableip.delete(self.apiclient) + self.debug("Deleting portable ip range") + self.portable_ip_range.delete(self.apiclient) return class TestListPortablePublicIpRanges(cloudstackTestCase): @@ -660,21 +650,10 @@ def setUp(self): portable_ip_range_services["regionid"] = self.region.id - self.debug("Creating new portable IP range with startip:%s and endip:%s" % - (str(portable_ip_range_services["startip"]), - str(portable_ip_range_services["endip"]))) - #create new portable ip range self.portable_ip_range = PortablePublicIpRange.create(self.apiclient, portable_ip_range_services) - - self.debug("Created new portable IP range with startip:%s and endip:%s and id:%s" % - (self.portable_ip_range.startip, - self.portable_ip_range.endip, - self.portable_ip_range.id)) - self.cleanup.append(self.portable_ip_range) - return def tearDown(self): @@ -755,7 +734,6 @@ def test_associate_ip_address_invalid_zone(self): isportable=True ) publicipaddress.delete(self.apiclient) - self.debug("Associating ip address failed") return @attr(tags=["advanced", "provisioning"]) @@ -803,10 +781,13 @@ def test_associate_ip_address_services_enable_disable(self): ) self.debug("created public ip address (portable): %s" % portableip.ipaddress.ipaddress) - ipInCorrectState = is_public_ip_in_correct_state(self.apiclient, portableip.ipaddress.id, state="allocated") - if not ipInCorrectState: + response = isIpInDesiredState(self.apiclient, portableip.ipaddress.id, state="allocated") + exceptionOccured = response[0] + ipInDesiredState = response[1] + exceptionMessage = response[2] + if (exceptionOccured or (not ipInDesiredState)): portableip.delete(self.apiclient) - self.fail("Portable IP not in allocated state even after 10 mins") + self.fail(exceptionMessage) try: # Open up firewall port for SSH @@ -1004,21 +985,10 @@ def setUp(self): portable_ip_range_services["regionid"] = self.region.id - self.debug("Creating new portable IP range with startip:%s and endip:%s" % - (str(portable_ip_range_services["startip"]), - str(portable_ip_range_services["endip"]))) - #create new portable ip range new_portable_ip_range = PortablePublicIpRange.create(self.apiclient, portable_ip_range_services) - - self.debug("Created new portable IP range with startip:%s and endip:%s and id:%s" % - (new_portable_ip_range.startip, - new_portable_ip_range.endip, - new_portable_ip_range.id)) - self.cleanup.append(new_portable_ip_range) - return def tearDown(self): @@ -1039,7 +1009,8 @@ def test_disassociate_ip_address_no_services(self): # 3. Disassociate the portable ip with root admin api client # 4. Disassociating should be successful - portableip = PublicIPAddress.create( + try: + portableip = PublicIPAddress.create( self.apiclient, accountid=self.account.name, zoneid=self.zone.id, @@ -1047,18 +1018,9 @@ def test_disassociate_ip_address_no_services(self): networkid=self.network.id, isportable=True ) - self.debug("created public ip address (portable): %s" % portableip.ipaddress.ipaddress) - - try: - self.debug("Disassociating portable ip: %s with id: %s" % - (portableip.ipaddress.ipaddress, portableip.ipaddress.id) - ) - portableip.delete(self.apiclient) - except Exception as e: - raise Exception("Exception while disassociating portable ip: %s" % e) - + raise Exception("Exception occured: %s" % e) return @attr(tags=["advanced", "selfservice"]) @@ -1079,12 +1041,14 @@ def test_disassociate_ip_address_services_enabled(self): networkid=self.network.id, isportable=True ) - self.debug("created public ip address (portable): %s" % portableip.ipaddress.ipaddress) - ipInCorrectState = is_public_ip_in_correct_state(self.apiclient, portableip.ipaddress.id, state="allocated") - if not ipInCorrectState: + response = isIpInDesiredState(self.apiclient, portableip.ipaddress.id, state="allocated") + exceptionOccured = response[0] + ipInDesiredState = response[1] + exceptionMessage = response[2] + if (exceptionOccured or (not ipInDesiredState)): portableip.delete(self.apiclient) - self.fail("Portable IP not in allocated state even after 10 mins") + self.fail(exceptionMessage) try: # Open up firewall port for SSH @@ -1111,15 +1075,9 @@ def test_disassociate_ip_address_services_enabled(self): self.fail("Error: %s" % e) try: - self.debug("Disassociating portable ip: %s with id: %s" % - (portableip.ipaddress.ipaddress, portableip.ipaddress.id) - ) - portableip.delete(self.apiclient) - except Exception as e: raise Exception("Exception while disassociating portable ip: %s" % e) - return @attr(tags=["advanced", "selfservice"]) @@ -1132,7 +1090,8 @@ def test_disassociate_ip_address_other_account(self): # 3. Try to Disassociate the portable ip with an account which is not owner of portable ip # 4. Disassociating should fail - portableip = PublicIPAddress.create( + try: + portableip = PublicIPAddress.create( self.apiclient, accountid=self.account.name, zoneid=self.zone.id, @@ -1140,30 +1099,26 @@ def test_disassociate_ip_address_other_account(self): networkid=self.network.id, isportable=True ) - self.debug("created public ip address (portable): %s" % portableip.ipaddress.ipaddress) + except Exception as e: + self.fail("Failed to create portable ip: %s" % e) - self.user_account = Account.create( + try: + self.user_account = Account.create( self.apiclient, self.services["account"], domainid=self.domain.id ) - self.api_client_user = self.testClient.getUserApiClient( + self.api_client_user = self.testClient.getUserApiClient( UserName=self.user_account.name, DomainName=self.user_account.domain ) - try: - self.debug("Disassociating portable ip: %s with id: %s with other account :%s" % - (portableip.ipaddress.ipaddress, portableip.ipaddress.id, self.user_account.name) - ) with self.assertRaises(Exception): portableip.delete(self.api_client_user) - except Exception as e: - raise Exception("Exception while disassociating portable ip: %s" % e) - - portableip.delete(self.apiclient) + portableip.delete(self.apiclient) + self.fail("Exception while disassociating portable ip: %s" % e) return class TestDeleteAccount(cloudstackTestCase): @@ -1194,7 +1149,7 @@ def setUpClass(cls): # Set Zones and disk offerings cls.services["small"]["zoneid"] = cls.zone.id cls.services["small"]["template"] = template.id - + cls._cleanup = [] return @@ -1211,52 +1166,32 @@ def setUp(self): self.apiclient = self.testClient.getApiClient() self.dbclient = self.testClient.getDbConnection() - self.account = Account.create( + portable_ip_range_services = self.services["portableIpRange"] + if portable_ip_range_services is None: + self.skipTest('Failed to read config values related to portable ip range') + + self.cleanup = [] + try: + self.account = Account.create( self.apiclient, self.services["account"], domainid=self.domain.id, admin=True ) - self.cleanup = [] - - portable_ip_range_services = self.services["portableIpRange"] - - if portable_ip_range_services is None: - self.skipTest('Failed to read config values related to portable ip range') - - portable_ip_range_services["regionid"] = self.region.id - - self.debug("Creating new portable IP range with startip:%s and endip:%s" % - (str(portable_ip_range_services["startip"]), - str(portable_ip_range_services["endip"]))) - - #create new portable ip range - new_portable_ip_range = PortablePublicIpRange.create(self.apiclient, + portable_ip_range_services["regionid"] = self.region.id + #create new portable ip range + new_portable_ip_range = PortablePublicIpRange.create(self.apiclient, portable_ip_range_services) - - self.debug("Created new portable IP range with startip:%s and endip:%s and id:%s" % - (new_portable_ip_range.startip, - new_portable_ip_range.endip, - new_portable_ip_range.id)) - - self.cleanup.append(new_portable_ip_range) - - self.debug( - "Creating n/w offering" - ) - self.network_offering = NetworkOffering.create( + self.cleanup.append(new_portable_ip_range) + self.network_offering = NetworkOffering.create( self.apiclient, self.services["network_offering"], conservemode=False ) + # Enable Network offering + self.network_offering.update(self.apiclient, state='Enabled') - self.debug("Created n/w offering with ID: %s" % - self.network_offering.id) - # Enable Network offering - self.network_offering.update(self.apiclient, state='Enabled') - self.debug("Creating network") - - self.network = Network.create( + self.network = Network.create( self.apiclient, self.services["network"], accountid=self.account.name, @@ -1264,17 +1199,14 @@ def setUp(self): networkofferingid=self.network_offering.id, zoneid=self.zone.id ) - - self.cleanup.append(self.network_offering) - - self.debug("Created network with id: %s" % self.network.id) + self.cleanup.append(self.network_offering) + except Exception as e: + self.cleanup.append(self.account) + self.fail("Exception in setupClass: %s" % e) return def tearDown(self): try: - # Disable Network offering - self.network_offering.update(self.apiclient, state='Enabled') - #Clean up, terminate the resources created cleanup_resources(self.apiclient, self.cleanup) except Exception as e: @@ -1289,7 +1221,8 @@ def test_delete_account_services_disabled(self): # 2. Delete account # 3. Account should get deleted successfully - portableip = PublicIPAddress.create( + try: + portableip = PublicIPAddress.create( self.apiclient, accountid=self.account.name, zoneid=self.zone.id, @@ -1297,18 +1230,12 @@ def test_delete_account_services_disabled(self): networkid=self.network.id, isportable=True ) - self.debug("created public ip address (portable): %s" % portableip.ipaddress.ipaddress) - - self.debug("Deleting account: %s :" % self.account.name) - - self.account.delete(self.apiclient) - - self.debug("Account deleted successfully") - - with self.assertRaises(Exception): - PublicIPAddress.list(self.apiclient, + self.account.delete(self.apiclient) + with self.assertRaises(Exception): + PublicIPAddress.list(self.apiclient, id=portableip.ipaddress.id) - + except Exception as e: + self.fail(e) return @attr(tags=["advanced", "selfservice"]) @@ -1348,11 +1275,14 @@ def test_delete_account_services_enabled(self): ) self.debug("created public ip address (portable): %s" % portableip.ipaddress.ipaddress) - ipInCorrectState = is_public_ip_in_correct_state(self.apiclient, portableip.ipaddress.id, state="allocated") - if not ipInCorrectState: + response = isIpInDesiredState(self.apiclient, portableip.ipaddress.id, state="allocated") + exceptionOccured = response[0] + ipInDesiredState = response[1] + exceptionMessage = response[2] + if (exceptionOccured or (not ipInDesiredState)): portableip.delete(self.apiclient) self.account.delete(self.apiclient) - self.fail("Portable IP not in allocated state even after 10 mins") + self.fail(exceptionMessage) try: # Open up firewall port for SSH @@ -1503,19 +1433,10 @@ def setUp(self): self.portable_ip_range_services["regionid"] = self.region.id - self.debug("Creating new portable IP range with startip:%s and endip:%s" % - (str(self.portable_ip_range_services["startip"]), - str(self.portable_ip_range_services["endip"]))) - #create new portable ip range self.portable_ip_range = PortablePublicIpRange.create(self.apiclient, self.portable_ip_range_services) - self.debug("Created new portable IP range with startip:%s and endip:%s and id:%s" % - (self.portable_ip_range.startip, - self.portable_ip_range.endip, - self.portable_ip_range.id)) - self.cleanup = [self.portable_ip_range, ] return @@ -1546,10 +1467,13 @@ def test_list_portable_ip_range_non_root_admin(self): isportable=True ) - ipInCorrectState = is_public_ip_in_correct_state(self.apiclient, portableip.ipaddress.id, state="allocated") - if not ipInCorrectState: + response = isIpInDesiredState(self.apiclient, portableip.ipaddress.id, state="allocated") + exceptionOccured = response[0] + ipInDesiredState = response[1] + exceptionMessage = response[2] + if (exceptionOccured or (not ipInDesiredState)): portableip.delete(self.apiclient) - self.fail("Portable IP not in allocated state even after 10 mins") + self.fail(exceptionMessage) self.debug("created public ip address (portable): %s" % portableip.ipaddress.ipaddress) #Create NAT rule diff --git a/tools/marvin/marvin/lib/common.py b/tools/marvin/marvin/lib/common.py index b946b92f1e..91fe0537e7 100644 --- a/tools/marvin/marvin/lib/common.py +++ b/tools/marvin/marvin/lib/common.py @@ -1022,24 +1022,31 @@ def setNonContiguousVlanIds(apiclient, zoneid): return physical_network, vlan - -def is_public_ip_in_correct_state(apiclient, ipaddressid, state): +def isIpInDesiredState(apiclient, ipaddressid, state): """ Check if the given IP is in the correct state (given) and return True/False accordingly""" retriesCount = 10 - while True: - portableips = PublicIPAddress.list(apiclient, id=ipaddressid) - assert validateList( - portableips)[0] == PASS, "IPs list validation failed" - if str(portableips[0].state).lower() == state: - break - elif retriesCount == 0: - return False - else: + ipInDesiredState = False + exceptionOccured = False + exceptionMessage = "" + try: + while retriesCount >= 0: + portableips = PublicIPAddress.list(apiclient, id=ipaddressid) + assert validateList( + portableips)[0] == PASS, "IPs list validation failed" + if str(portableips[0].state).lower() == state: + ipInDesiredState = True + break retriesCount -= 1 time.sleep(60) - continue - return True + except Exception as e: + exceptionOccured = True + exceptionMessage = e + return [exceptionOccured, ipInDesiredState, e] + if not ipInDesiredState: + exceptionMessage = "Ip should be in %s state, it is in %s" %\ + (state, portableips[0].state) + return [False, ipInDesiredState, exceptionMessage] def setSharedNetworkParams(networkServices, range=20): From 3448ab7f1c5c15949855788b029028ddac01327b Mon Sep 17 00:00:00 2001 From: Prachi Damle Date: Fri, 16 May 2014 16:48:53 -0700 Subject: [PATCH 458/683] CLOUDSTACK-6476: Basic Zone with Multiple Pods Setup: DHCP server doesnt get deployed in the pod where the VM gets deployed Changes: PodId in which the router should get started was not being saved to the DB due to the VO's setter method not following the setXXX format. So when planner loaded the router from DB, it always got podId as null and that would allow planner to deploy the router in any pod. If the router happens to start in a different pod than the user VM, the Vm fails to start since the Dhcp service check fails. Fixed the VO's setPodId method, that was causing the DB save operation fail. --- .../src/com/cloud/vm/VirtualMachineManagerImpl.java | 6 +++--- engine/schema/src/com/cloud/vm/VMInstanceVO.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index d8abdfb4d7..9b63043b90 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -389,7 +389,7 @@ public void allocate(String vmInstanceName, final VirtualMachineTemplate templat vm.setDataCenterId(plan.getDataCenterId()); if (plan.getPodId() != null) { - vm.setPodId(plan.getPodId()); + vm.setPodIdToDeployIn(plan.getPodId()); } assert (plan.getClusterId() == null && plan.getPoolId() == null) : "We currently don't support cluster and pool preset yet"; final VMInstanceVO vmFinal = _vmDao.persist(vm); @@ -951,7 +951,7 @@ public void orchestrateStart(String vmUuid, Map Date: Mon, 19 May 2014 10:30:21 +0530 Subject: [PATCH 459/683] CLOUDSTACK-6672: [Automation] NPE observed while listing system vms fixing NPE --- server/src/com/cloud/api/ApiResponseHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index ce685c6dff..6746c130d3 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -1209,8 +1209,8 @@ public SystemVmResponse createSystemVmResponse(VirtualMachine vm) { NetworkOffering networkOffering = ApiDBUtils.findNetworkOfferingById(network.getNetworkOfferingId()); if (networkOffering.getElasticIp()) { IpAddress ip = ApiDBUtils.findIpByAssociatedVmId(vm.getId()); - Vlan vlan = ApiDBUtils.findVlanById(ip.getVlanId()); if (ip != null) { + Vlan vlan = ApiDBUtils.findVlanById(ip.getVlanId()); vmResponse.setPublicIp(ip.getAddress().addr()); vmResponse.setPublicNetmask(vlan.getVlanNetmask()); vmResponse.setGateway(vlan.getVlanGateway()); From d5425e1a4a8ed4cadc2f9b97f82f6f608e9a51de Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Sun, 18 May 2014 23:20:12 -0700 Subject: [PATCH 460/683] CLOUDSTACK-6699: listResouceDetails - enhance it to list by (key,value) pair - allowed to Admin only. --- .../cloud/server/ResourceMetaDataService.java | 10 ++++++++ .../user/volume/ListResourceDetailsCmd.java | 8 ++++++ .../resourcedetail/ResourceDetailsDao.java | 9 +++++++ .../ResourceDetailsDaoBase.java | 20 +++++++++++++++ .../com/cloud/api/query/QueryManagerImpl.java | 25 ++++++++++++++++--- .../metadata/ResourceMetaDataManagerImpl.java | 10 ++++++++ 6 files changed, 78 insertions(+), 4 deletions(-) diff --git a/api/src/com/cloud/server/ResourceMetaDataService.java b/api/src/com/cloud/server/ResourceMetaDataService.java index 56fe1045ab..113dc0703b 100644 --- a/api/src/com/cloud/server/ResourceMetaDataService.java +++ b/api/src/com/cloud/server/ResourceMetaDataService.java @@ -46,6 +46,16 @@ public interface ResourceMetaDataService { ResourceDetail getDetail(long resourceId, ResourceObjectType resourceType, String key); + /** + * List by key, value pair + * @param resourceType + * @param key + * @param value + * @param forDisplay + * @return + */ + List getDetails(ResourceObjectType resourceType, String key, String value, Boolean forDisplay); + Map getDetailsMap(long resourceId, ResourceObjectType resourceType, Boolean forDisplay); List getDetailsList(long resourceId, ResourceObjectType resourceType, Boolean forDisplay); diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java index 93dc29db79..47f80a034f 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/ListResourceDetailsCmd.java @@ -44,6 +44,10 @@ public class ListResourceDetailsCmd extends BaseListProjectAndAccountResourcesCm @Parameter(name = ApiConstants.KEY, type = CommandType.STRING, description = "list by key") private String key; + @Parameter(name = ApiConstants.VALUE, type = CommandType.STRING, description = "list by key, value. Needs to be passed only along with key" , + since = "4.4", authorized = { RoleType.Admin }) + private String value; + @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "if set to true, only details marked with display=true, are returned." + " False by default", since = "4.3", authorized = { RoleType.Admin }) private Boolean forDisplay; @@ -56,6 +60,10 @@ public String getKey() { return key; } + public String getValue() { + return value; + } + @Override public String getCommandName() { return s_name; diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDao.java b/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDao.java index 5002683791..5d2d919a68 100644 --- a/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDao.java +++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDao.java @@ -32,6 +32,15 @@ public interface ResourceDetailsDao extends GenericDao */ public R findDetail(long resourceId, String name); + /** + * Find details by key,value pair + * @param key + * @param value + * @param display + * @return + */ + public List findDetails(String key, String value, Boolean display); + /** * Removes all details for the resource specified * @param resourceId diff --git a/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDaoBase.java b/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDaoBase.java index 60d7f162f2..b3e7ea2758 100644 --- a/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDaoBase.java +++ b/engine/schema/src/org/apache/cloudstack/resourcedetail/ResourceDetailsDaoBase.java @@ -34,6 +34,7 @@ public ResourceDetailsDaoBase() { AllFieldsSearch = createSearchBuilder(); AllFieldsSearch.and("resourceId", AllFieldsSearch.entity().getResourceId(), SearchCriteria.Op.EQ); AllFieldsSearch.and("name", AllFieldsSearch.entity().getName(), SearchCriteria.Op.EQ); + AllFieldsSearch.and("value", AllFieldsSearch.entity().getValue(), SearchCriteria.Op.EQ); // FIXME SnapshotDetailsVO doesn't have a display field if (_allAttributes.containsKey("display")) { AllFieldsSearch.and("display", AllFieldsSearch.entity().isDisplay(), SearchCriteria.Op.EQ); @@ -49,6 +50,25 @@ public R findDetail(long resourceId, String name) { return findOneBy(sc); } + public List findDetails(String name, String value, Boolean display) { + SearchCriteria sc = AllFieldsSearch.create(); + + if(display != null){ + sc.setParameters("display", display); + } + + if(name != null){ + sc.setParameters("name", name); + } + + if(value != null){ + sc.setParameters("value", value); + } + + List results = search(sc, null); + return results; + } + public Map listDetailsKeyPairs(long resourceId) { SearchCriteria sc = AllFieldsSearch.create(); sc.setParameters("resourceId", resourceId); diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java index 6848ba03fe..a2437b8900 100644 --- a/server/src/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/com/cloud/api/query/QueryManagerImpl.java @@ -3895,23 +3895,40 @@ public List listResourceDetails(ListResourceDetailsCmd c Boolean forDisplay = cmd.getDisplay(); ResourceTag.ResourceObjectType resourceType = cmd.getResourceType(); String resourceIdStr = cmd.getResourceId(); + String value = cmd.getValue(); Long resourceId = null; + + //Validation - 1.1 - resourceId and value cant be null. + if(resourceIdStr == null && value == null){ + throw new InvalidParameterValueException("Insufficient parameters passed for listing by resourceId OR key,value pair. Please check your params and try again."); + } + + //Validation - 1.2 - Value has to be passed along with key. + if(value != null && key == null){ + throw new InvalidParameterValueException("Listing by (key, value) but key is null. Please check the params and try again"); + } + + //Validation - 1.3 if (resourceIdStr != null) { resourceId = _taggedResourceMgr.getResourceId(resourceIdStr, resourceType); + if (resourceId == null) { + throw new InvalidParameterValueException("Cannot find resource with resourceId " + resourceIdStr + " and of resource type " + resourceType); + } } - if (resourceId == null) { - throw new InvalidParameterValueException("Cannot find resource with resourceId " + resourceIdStr + " and of resource type " + resourceType); - } + + List detailList = new ArrayList(); ResourceDetail requestedDetail = null; if (key == null) { detailList = _resourceMetaDataMgr.getDetailsList(resourceId, resourceType, forDisplay); - } else { + } else if (value == null){ requestedDetail = _resourceMetaDataMgr.getDetail(resourceId, resourceType, key); if (requestedDetail != null && forDisplay != null && requestedDetail.isDisplay() != forDisplay) { requestedDetail = null; } + }else { + detailList = _resourceMetaDataMgr.getDetails(resourceType, key, value, forDisplay); } List responseList = new ArrayList(); diff --git a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java index f7b092c5bd..6f1f40d648 100644 --- a/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java +++ b/server/src/com/cloud/metadata/ResourceMetaDataManagerImpl.java @@ -224,6 +224,10 @@ private ResourceDetail getDetail(long resourceId, String key) { return dao.findDetail(resourceId, key); } + private List getDetails(String key, String value, Boolean forDisplay) { + return dao.findDetails(key, value, forDisplay); + } + private void addDetail(long resourceId, String key, String value, boolean forDisplay) { dao.addDetail(resourceId, key, value, forDisplay); } @@ -257,6 +261,12 @@ public ResourceDetail getDetail(long resourceId, ResourceObjectType resourceType return newDetailDaoHelper.getDetail(resourceId, key); } + @Override + public List getDetails(ResourceObjectType resourceType, String key, String value, Boolean forDisplay){ + DetailDaoHelper newDetailDaoHelper = new DetailDaoHelper(resourceType); + return newDetailDaoHelper.getDetails(key, value, forDisplay); + } + @Override public Map getDetailsMap(long resourceId, ResourceObjectType resourceType, Boolean forDisplay) { DetailDaoHelper newDetailDaoHelper = new DetailDaoHelper(resourceType); From f2ebfe019e1ead6172712ec804b241cf0dc5a800 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Sun, 18 May 2014 21:25:29 -0400 Subject: [PATCH 461/683] CLOUDSTACK-6612: Resolved issue with sshClient.py --- tools/marvin/marvin/config/test_data.py | 2 +- tools/marvin/marvin/sshClient.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py index 026f5ff559..9df3f2f060 100644 --- a/tools/marvin/marvin/config/test_data.py +++ b/tools/marvin/marvin/config/test_data.py @@ -617,7 +617,7 @@ }, "natrule": { "privateport": 22, - "publicport": 2222, + "publicport": 22, "protocol": "TCP" }, "lbrule": { diff --git a/tools/marvin/marvin/sshClient.py b/tools/marvin/marvin/sshClient.py index 76f3b6dd59..df2eeee1d4 100644 --- a/tools/marvin/marvin/sshClient.py +++ b/tools/marvin/marvin/sshClient.py @@ -15,7 +15,6 @@ # specific language governing permissions and limitations # under the License. -import paramiko from paramiko import (BadHostKeyException, AuthenticationException, SSHException, @@ -32,9 +31,8 @@ import contextlib import logging from marvin.codes import ( - SUCCESS, FAILED, INVALID_INPUT, EXCEPTION_OCCURRED + SUCCESS, FAILED, INVALID_INPUT ) -from contextlib import closing class SshClient(object): @@ -152,9 +150,9 @@ def createConnection(self): self.logger.\ exception("SshClient: Exception under " "createConnection: %s" % except_msg) - self.retryCnt = self.retryCnt - 1 + self.retryCnt -= 1 time.sleep(self.delay) - return ret + return ret def runCommand(self, command): ''' From c5634570e25900f2e83a77a2ad20ad267bba8202 Mon Sep 17 00:00:00 2001 From: vinayvarmav Date: Mon, 19 May 2014 16:46:06 +0530 Subject: [PATCH 462/683] CLOUDSTACK-6282 - Divided test_escalations.py into individual files based on functionality and added automed tests for Public IP Addresses --- .../component/test_escalations_instances.py | 3448 ++++++++++++++ .../component/test_escalations_ipaddresses.py | 4192 +++++++++++++++++ .../component/test_escalations_isos.py | 783 +++ .../test_escalations_securitygroups.py | 588 +++ .../component/test_escalations_snapshots.py | 647 +++ .../component/test_escalations_templates.py | 944 ++++ .../component/test_escalations_volumes.py | 1703 +++++++ .../test_escalations_vpncustomergateways.py | 382 ++ tools/marvin/marvin/lib/base.py | 191 +- 9 files changed, 12877 insertions(+), 1 deletion(-) create mode 100644 test/integration/component/test_escalations_instances.py create mode 100644 test/integration/component/test_escalations_ipaddresses.py create mode 100644 test/integration/component/test_escalations_isos.py create mode 100644 test/integration/component/test_escalations_securitygroups.py create mode 100644 test/integration/component/test_escalations_snapshots.py create mode 100644 test/integration/component/test_escalations_templates.py create mode 100644 test/integration/component/test_escalations_volumes.py create mode 100644 test/integration/component/test_escalations_vpncustomergateways.py diff --git a/test/integration/component/test_escalations_instances.py b/test/integration/component/test_escalations_instances.py new file mode 100644 index 0000000000..9e040db9f7 --- /dev/null +++ b/test/integration/component/test_escalations_instances.py @@ -0,0 +1,3448 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackAPI import (createVolume, + createTemplate) +from marvin.lib.base import (Volume, + Iso, + VirtualMachine, + Template, + Snapshot, + SecurityGroup, + Account, + Zone, + Network, + NetworkOffering, + DiskOffering, + ServiceOffering, + VmSnapshot, + SnapshotPolicy, + SSHKeyPair, + Resources, + Configurations, + VpnCustomerGateway, + Hypervisor, + VpcOffering, + VPC, + NetworkACL) +from marvin.lib.common import (get_zone, + get_domain, + get_template, + list_os_types) +from marvin.lib.utils import (validateList, + cleanup_resources, + random_gen) +from marvin.codes import (PASS, FAIL, EMPTY_LIST) +from nose.plugins.attrib import attr +import time + +class TestListInstances(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestListInstances, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + if cls.zone.localstorageenabled: + cls.storagetype = 'local' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' + cls.services["disk_offering"]["storagetype"] = 'local' + else: + cls.storagetype = 'shared' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' + cls.services["disk_offering"]["storagetype"] = 'shared' + + cls.services['mode'] = cls.zone.networktype + cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.services["custom_volume"]["zoneid"] = cls.zone.id + # Creating Disk offering, Service Offering and Account + cls.disk_offering = DiskOffering.create( + cls.api_client, + cls.services["disk_offering"] + ) + cls.service_offering = ServiceOffering.create( + cls.api_client, + cls.services["service_offerings"]["tiny"] + ) + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + # Updating resource Limits + for i in range(0,12): + Resources.updateLimit( + cls.api_client, + account=cls.account.name, + domainid=cls.domain.id, + max=-1, + resourcetype=i + ) + + cls._cleanup.append(cls.account) + cls._cleanup.append(cls.service_offering) + cls._cleanup.append(cls.disk_offering) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_01_list_instances_pagination(self): + """ + @Desc: Test List Instances pagination + @Steps: + Step1: Listing all the Instances for a user + Step2: Verifying listed Instances for account created at class level + Step3: If number of volumes is less than (page size + 1), then creating them + Step4: Listing all the volumes again after creation of volumes + Step5: Verifying the length of the volumes is (page size + 1) + Step6: Listing all the volumes in page1 + Step7: Verifying that the length of the volumes in page 1 is (page size) + Step8: Listing all the volumes in page2 + Step9: Verifying that the length of the volumes in page 2 is 1 + Step10: Deleting the volume present in page 2 + Step11: Listing for the volumes on page 2 + Step12: Verifying that there are no volumes present in page 2 + """ + # Listing all the instances for a user + list_instances_before = VirtualMachine.list(self.userapiclient, listall=self.services["listall"]) + + # Verifying listed instances for account created at class level + self.assertIsNone( + list_instances_before, + "Virtual Machine already exists for newly created user" + ) + # If number of instances are less than (pagesize + 1), then creating them + for i in range(0, (self.services["pagesize"] + 1)): + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + if(i < (self.services["pagesize"])): + self.cleanup.append(vm_created) + + self.assertEqual( + self.services["virtual_machine"]["displayname"], + vm_created.displayname, + "Newly created VM name and the test data VM name are not matching" + ) + + # Listing all the instances again after creating VM's + list_instances_after = VirtualMachine.list(self.userapiclient, listall=self.services["listall"]) + status = validateList(list_instances_after) + self.assertEquals( + PASS, + status[0], + "Listing of instances after creation failed" + ) + # Verifying the length of the instances is (page size + 1) + self.assertEqual( + len(list_instances_after), + (self.services["pagesize"] + 1), + "Number of instances created is not matching as expected" + ) + + # Listing all the volumes in page1 + list_instances_page1 = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid + ) + status = validateList(list_instances_page1) + self.assertEquals( + PASS, + status[0], + "Listing of instances in page1 failed" + ) + # Verifying that the length of the instances in page 1 is (page size) + self.assertEqual( + self.services["pagesize"], + len(list_instances_page1), + "List VM response is not matching with the page size length for page 1" + ) + + # Listing all the VM's in page2 + list_instances_page2 = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"], + domainid=self.account.domainid + ) + status = validateList(list_instances_page2) + self.assertEquals( + PASS, + status[0], + "Listing of instances in page2 failed" + ) + # Verifying that the length of the VM's in page 2 is 1 + self.assertEqual( + 1, + len(list_instances_page2), + "List VM response is not matching with the page size length for page 2" + ) + instance_page2 = list_instances_page2[0] + + # Verifying that the VM on page 2 is not present in page1 + for i in range(0, len(list_instances_page1)): + instance_page1 = list_instances_page1[i] + self.assertNotEquals( + instance_page2.id, + instance_page1.id, + "VM listed in page 2 is also listed in page 1" + ) + + # Deleting a single VM + VirtualMachine.delete(vm_created, self.userapiclient) + + # Listing the VM's in page 2 + list_instance_response = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"], + domainid=self.account.domainid + ) + # verifying that VM does not exists on page 2 + self.assertEqual( + list_instance_response, + None, + "VM was not deleted" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_02_list_Running_vm(self): + """ + @Desc: Test List Running VM's + @Steps: + Step1: Listing all the Running VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Listing all the Running VMs for a user again + Step5: Verifying that the size of the list is increased by 1 + Step6: Verifying that the details of the Running VM listed are same as the VM deployed in Step3 + """ + # Listing all the Running VM's for a User + list_running_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Running" + ) + self.assertIsNone( + list_running_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the Running VM's for a User + list_running_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Running" + ) + status = validateList(list_running_vms_after) + self.assertEquals( + PASS, + status[0], + "Newly created VM is not in Running state" + ) + # Verifying list size is 1 + self.assertEquals( + 1, + len(list_running_vms_after), + "Running VM list count is not matching" + ) + running_vm = list_running_vms_after[0] + + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":"Running", + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":running_vm.id, + "name":running_vm.name, + "displayname":running_vm.displayname, + "state":running_vm.state, + "zoneid":running_vm.zoneid, + "account":running_vm.account, + "template":running_vm.templateid + } + running_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + running_vm_status, + "Listed Running VM details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_03_list_Stopped_vm(self): + """ + @Desc: Test List Stopped VM's + @Steps: + Step1: Listing all the Stopped VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Stopping the VM deployed in step3 + Step5: Listing all the Stopped VMs for a user again + Step6: Verifying that the size of the list is increased by 1 + Step7: Verifying that the details of the Stopped VM listed are same as the VM stopped in Step4 + """ + # Listing all the Stopped VM's for a User + list_stopped_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Stopped" + ) + self.assertIsNone( + list_stopped_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Stopping the VM + VirtualMachine.stop(vm_created, self.userapiclient) + # Listing all the Stopped VM's for a User + list_stopped_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Stopped" + ) + status = validateList(list_stopped_vms_after) + self.assertEquals( + PASS, + status[0], + "Stopped VM is not in Stopped state" + ) + # Verifying list size is 1 + self.assertEquals( + 1, + len(list_stopped_vms_after), + "Stopped VM list count is not matching" + ) + stopped_vm = list_stopped_vms_after[0] + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":"Stopped", + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":stopped_vm.id, + "name":stopped_vm.name, + "displayname":stopped_vm.displayname, + "state":stopped_vm.state, + "zoneid":stopped_vm.zoneid, + "account":stopped_vm.account, + "template":stopped_vm.templateid + } + stopped_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + stopped_vm_status, + "Listed Stopped VM details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_04_list_Destroyed_vm(self): + """ + @Desc: Test List Destroyed VM's + @Steps: + Step1: Listing all the Destroyed VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Destroyed the VM deployed in step3 + Step5: Listing all the Destroyed VMs for a user again + Step6: Verifying that destroyed VM is not listed for User + Step7: Listing all the destroyed VMs as admin + Step8: Verifying that the size of the list is 1 + Step9: Verifying that the details of the Destroyed VM listed are same as the VM destroyed in Step4 + """ + # Listing all the Destroyed VM's for a User + list_destroyed_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Destroyed" + ) + self.assertIsNone( + list_destroyed_vms_before, + "Virtual Machine in Destroyed state already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + # Destroying the VM + VirtualMachine.delete(vm_created, self.userapiclient) + # Listing all the Destroyed VM's for a User + list_destroyed_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Destroyed" + ) + self.assertIsNone( + list_destroyed_vms_after, + "Destroyed VM is not in destroyed state" + ) + # Listing destroyed VMs as admin user + list_destroyed_vms_admin = VirtualMachine.list( + self.apiClient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Destroyed", + id=vm_created.id + ) + status = validateList(list_destroyed_vms_admin) + self.assertEquals( + PASS, + status[0], + "Destroyed VM is not in Destroyed state" + ) + # Verifying that the length of the destroyed VMs list should be 1 + self.assertEquals( + 1, + len(list_destroyed_vms_admin), + "Destroyed VM list count is not matching" + ) + destroyed_vm = list_destroyed_vms_admin[0] + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":"Destroyed", + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":destroyed_vm.id, + "name":destroyed_vm.name, + "displayname":destroyed_vm.displayname, + "state":destroyed_vm.state, + "zoneid":destroyed_vm.zoneid, + "account":destroyed_vm.account, + "template":destroyed_vm.templateid + } + destroyed_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + destroyed_vm_status, + "Listed Destroyed VM details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_05_list_vm_by_id(self): + """ + @Desc: Test List VM by Id + @Steps: + Step1: Listing all the VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Listing all the VMs for a user again + Step5: Verifying that the size of the list is increased by 1 + Step6: List a VM by specifying the Id if the VM deployed in Step3 + Step7: Verifying that the details of the Listed VM are same as the VM deployed in Step3 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + account=self.account.name + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VM's for a User + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + account=self.account.name + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "Listing of VM after creation failed" + ) + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing a VM by Id + list_vm_byid = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + id=vm_created.id + ) + status = validateList(list_vm_byid) + self.assertEquals( + PASS, + status[0], + "Listing of VM by Id failed" + ) + listed_vm = list_vm_byid[0] + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":vm_created.state, + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":listed_vm.id, + "name":listed_vm.name, + "displayname":listed_vm.displayname, + "state":listed_vm.state, + "zoneid":listed_vm.zoneid, + "account":listed_vm.account, + "template":listed_vm.templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM by Id details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_06_list_vm_by_name(self): + """ + @Desc: Test List VM's by Name + @Steps: + Step1: Listing all the VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a 2 VM's + Step4: Listing all the VMs for a user again + Step5: Verifying that list size is increased by 2 + Step6: Listing the VM by specifying complete name of VM-1 created in step3 + Step7: Verifying that the size of the list is 1 + Step8: Verifying that the details of the listed VM are same as the VM-1 created in step3 + Step9: Listing the VM by specifying the partial name of VM + Step10: Verifying that the size of the list is 2 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + vms = {} + for i in range(0, 2): + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + vms.update({i: vm_created}) + + # Listing all the VM's for a User + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM's creation failed" + ) + self.assertEquals( + 2, + len(list_vms_after), + "VM's list count is not matching" + ) + # Listing the VM by complete name + list_vm_byfullname = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + name=vms[0].name + ) + status = validateList(list_vm_byfullname) + self.assertEquals( + PASS, + status[0], + "Failed to list VM by Name" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vm_byfullname), + "VM list by full name count is not matching" + ) + # Verifying that the details of the listed VM are same as the VM created above + #Creating expected and actual values dictionaries + expected_dict = { + "id":vms[0].id, + "name":vms[0].name, + "displayname":vms[0].displayname, + "state":vms[0].state, + "zoneid":vms[0].zoneid, + "account":vms[0].account, + "template":vms[0].templateid + } + actual_dict = { + "id":list_vm_byfullname[0].id, + "name":list_vm_byfullname[0].name, + "displayname":list_vm_byfullname[0].displayname, + "state":list_vm_byfullname[0].state, + "zoneid":list_vm_byfullname[0].zoneid, + "account":list_vm_byfullname[0].account, + "template":list_vm_byfullname[0].templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM details are not as expected" + ) + # Listing the VM by partial name + list_vm_bypartialname = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + domainid=self.account.domainid, + name=vms[0].name[:1] + ) + status = validateList(list_vm_bypartialname) + self.assertEquals( + PASS, + status[0], + "Failed to list VM by Name" + ) + # Verifying that the size of the list is 2 + self.assertEquals( + 2, + len(list_vm_bypartialname), + "VM list by full name count is not matching" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_07_list_vm_by_name_state(self): + """ + @Desc: Test List VM's by Name and State + @Steps: + Step1: Listing all the VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Listing all the VMs for a user again + Step5: Verifying that list size is increased by 1 + Step6: Listing the VM by specifying name of VM created in step3 and state as Running (matching name and state) + Step7: Verifying that the size of the list is 1 + Step8: Verifying that the details of the listed VM are same as the VM created in step3 + Step9: Listing the VM by specifying name of VM created in step3 and state as Stopped (non matching state) + Step10: Verifying that the size of the list is 0 + Step11: Listing the VM by specifying non matching name and state as Running (non matching name) + Step12: Verifying that the size of the list is 0 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VM's for a User + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM's creation failed" + ) + self.assertEquals( + 1, + len(list_vms_after), + "VM's list count is not matching" + ) + # Listing the VM by matching Name and State + list_running_vm = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + name=vm_created.name, + state="Running" + ) + status = validateList(list_running_vm) + self.assertEquals( + PASS, + status[0], + "List VM by name and state failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_running_vm), + "Count of VM list by name and state is not matching" + ) + # Verifying that the details of the listed VM are same as the VM created above + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":"Running", + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":list_running_vm[0].id, + "name":list_running_vm[0].name, + "displayname":list_running_vm[0].displayname, + "state":list_running_vm[0].state, + "zoneid":list_running_vm[0].zoneid, + "account":list_running_vm[0].account, + "template":list_running_vm[0].templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM details are not as expected" + ) + # Listing the VM by matching name and non matching state + list_running_vm = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + name=vm_created.name, + state="Stopped" + ) + self.assertIsNone( + list_running_vm, + "Listed VM with non matching state" + ) + # Listing the VM by non matching name and matching state + list_running_vm = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + name="name", + state="Running" + ) + self.assertIsNone( + list_running_vm, + "Listed VM with non matching name" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_08_list_vm_by_zone(self): + """ + @Desc: Test List VM by Zone. + This test case is applicable for a setup having multiple zones. + @Steps: + Step1: Listing all the zones + Step2: Checking if there are multiple zones in the setup. + Continuing below steps only if there are multiple zones + Step3: Listing template for zone + Step4: Listing all the VMs for a user + Step5: Verifying that the size of the list is 0 + Step6: Deploying a VM + Step7: Listing all the VMs for a user again for matching zone + Step8: Verifying that the size of the list is 1 + Step9: Verifying that the details of the Listed VM are same as the VM deployed in Step6 + Step10: Listing all the VMs for a user again for non-matching zone + Step11: Verifying that the size of the list is 0 + """ + # Listing all the zones available + zones_list = Zone.list(self.apiClient) + status = validateList(zones_list) + self.assertEquals( + PASS, + status[0], + "zones not available in the given setup" + ) + current_zone = self.services["virtual_machine"]["zoneid"] + current_template = self.services["virtual_machine"]["template"] + # Checking if there are multiple zones in the setup. + if not len(zones_list) > 1: + self.debug("Setup is not having multiple zones") + else: + # Getting the template available under the zone + template = get_template( + self.apiClient, + zones_list[0].id, + self.services["ostype"] + ) + self.assertIsNotNone( + template, + "Template not found for zone" + ) + self.services["virtual_machine"]["zoneid"] = zones_list[0].id + self.services["virtual_machine"]["template"] = template.id + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[0].id + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again for matching zone + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[0].id + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + listed_vm = list_vms_after[0] + # Verifying that the details of the Listed VM are same as the VM deployed above + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":vm_created.state, + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":listed_vm.id, + "name":listed_vm.name, + "displayname":listed_vm.displayname, + "state":listed_vm.state, + "zoneid":listed_vm.zoneid, + "account":listed_vm.account, + "template":listed_vm.templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM by Id details are not as expected" + ) + # Listing all the VMs for a user again for non-matching zone + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[1].id + ) + self.assertIsNone( + list_vms, + "VM's listed for non matching zone" + ) + self.services["virtual_machine"]["zoneid"] = current_zone + self.services["virtual_machine"]["template"] = current_template + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_09_list_vm_by_zone_name(self): + """ + @Desc: Test List VM by Zone. + This test case is applicable for a setup having multiple zones. + @Steps: + Step1: Listing all the zones + Step2: Checking if there are multiple zones in the setup. + Continuing below steps only if there are multiple zones + Step3: Listing template for zone + Step4: Listing all the VMs for a user + Step5: Verifying that the size of the list is 0 + Step6: Deploying a VM + Step7: Listing all the VMs for a user again + Step8: Verifying that list size is increased by 1 + Step9: Listing the VM by specifying name of VM created in step6 and matching zone (matching name and zone) + Step10: Verifying that the size of the list is 1 + Step11: Verifying that the details of the listed VM are same as the VM created in step3 + Step12: Listing the VM by specifying name of VM created in step6 and non matching zone (non matching zone) + Step13: Verifying that the size of the list is 0 + Step14: Listing the VM by specifying non matching name and matching zone (non matching name) + Step15: Verifying that the size of the list is 0 + """ + # Listing all the zones available + zones_list = Zone.list(self.apiClient) + status = validateList(zones_list) + self.assertEquals( + PASS, + status[0], + "zones not available in the given setup" + ) + current_zone = self.services["virtual_machine"]["zoneid"] + current_template = self.services["virtual_machine"]["template"] + # Checking if there are multiple zones in the setup. + if not len(zones_list) > 1: + self.debug("Setup is not having multiple Zones") + else: + # Getting the template available under the zone + template = get_template( + self.apiClient, + zones_list[0].id, + self.services["ostype"] + ) + self.assertIsNotNone( + template, + "Template not found for zone" + ) + self.services["virtual_machine"]["zoneid"] = zones_list[0].id + self.services["virtual_machine"]["template"] = template.id + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[0].id, + account=self.account.name + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again for matching zone + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[0].id, + account=self.account.name + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing the VM by specifying name of VM created in above and matching zone + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[0].id, + name=vm_created.name + ) + status = validateList(list_vms) + self.assertEquals( + PASS, + status[0], + "Listing VM's by name and zone failed" + ) + # Verifying Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms), + "Count of listed VM's by name and zone is not as expected" + ) + listed_vm = list_vms[0] + # Verifying that the details of the Listed VM are same as the VM deployed above + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":vm_created.state, + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":listed_vm.id, + "name":listed_vm.name, + "displayname":listed_vm.displayname, + "state":listed_vm.state, + "zoneid":listed_vm.zoneid, + "account":listed_vm.account, + "template":listed_vm.templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM by Id details are not as expected" + ) + # Listing the VM by specifying name of VM created in step3 and non matching zone + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[1].id, + name=vm_created.name + ) + self.assertIsNone( + list_vms, + "VM's listed for non matching zone" + ) + # Listing the VM by specifying non matching name of VM and matching zone + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[0].id, + name="name" + ) + self.assertIsNone( + list_vms, + "VM's listed for non matching zone" + ) + self.services["virtual_machine"]["zoneid"] = current_zone + self.services["virtual_machine"]["template"] = current_template + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_10_list_vm_by_zone_name_state(self): + """ + @Desc: Test List VM by Zone. + @Steps: + Step1: Listing all the VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Listing all the VMs for a user again + Step5: Verifying that list size is increased by 1 + Step6: Listing the VM by specifying name of VM created in step3 and matching zone and state as Running + Step7: Verifying that the size of the list is 1 + Step8: Verifying that the details of the listed VM are same as the VM created in step3 + Step9: Listing the VM by specifying name of VM created in step3 and matching zone and state as Stopped + Step10: Verifying that the size of the list is 0 + Step11: Listing the VM by name, Zone and account + Step12: Verifying that the size of the list is 1 + Step13: Verifying that the details of the listed VM are same as the VM created in step3 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + account=self.account.name + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again for matching zone + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + account=self.account.name + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing the VM by specifying name of VM created in step3 and matching zone and state as Running + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + name=vm_created.name, + state="Running" + ) + status = validateList(list_vms) + self.assertEquals( + PASS, + status[0], + "Listing VM's by name and zone failed" + ) + # Verifying Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms), + "Count of listed VM's by name, zone and state is not as expected" + ) + listed_vm = list_vms[0] + # Verifying that the details of the Listed VM are same as the VM deployed above + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":vm_created.state, + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":listed_vm.id, + "name":listed_vm.name, + "displayname":listed_vm.displayname, + "state":listed_vm.state, + "zoneid":listed_vm.zoneid, + "account":listed_vm.account, + "template":listed_vm.templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM by Id details are not as expected" + ) + # Listing the VM by specifying name of VM created in step3, zone and State as Stopped + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + name=vm_created.name, + state="Stopped" + ) + self.assertIsNone( + list_vms, + "VM's listed for non matching zone" + ) + # Listing the VM by name, zone and account + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + name=vm_created.name, + account=self.account.name + ) + status = validateList(list_vms) + self.assertEquals( + PASS, + status[0], + "Listing VM's by name, account and zone failed" + ) + # Verifying Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms), + "Count of listed VM's by name, zone and account is not as expected" + ) + listed_vm = list_vms[0] + # Verifying that the details of the Listed VM are same as the VM deployed above + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":vm_created.state, + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":listed_vm.id, + "name":listed_vm.name, + "displayname":listed_vm.displayname, + "state":listed_vm.state, + "zoneid":listed_vm.zoneid, + "account":listed_vm.account, + "template":listed_vm.templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM by Id details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_11_register_reset_vm_sshkey(self): + """ + @Desc: Test to verify registering and reset of SSH Key for VM + @Steps: + Step1: Deploying a VM + Step2: Stopping the VM deployed in step1 + Step3: Listing all the SSH Key pairs + Step4: Registering a SSH Key pair + Step5: Listing all the SSh Key pairs again + Step6: Verifying that the key pairs list is increased by 1 + Step7: Resetting the VM SSH Key to the key pair registered in step4 + Step8: Verifying that the registered SSH Key pair is set to the VM + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Stopping the VM deployed above + vm_created.stop( + self.userapiclient, + forced=True + ) + # Listing all the SSH Key pairs + list_keypairs_before = SSHKeyPair.list( + self.userapiclient + ) + list_keypairs_before_size = 0 + if list_keypairs_before is not None: + list_keypairs_before_size = len(list_keypairs_before) + + # Registering new Key pair + new_keypair = SSHKeyPair.register( + self.userapiclient, + name="keypair1", + publickey="ssh-rsa: e6:9a:1e:b5:98:75:88:5d:56:bc:92:7b:43:48:05:b2" + ) + self.assertIsNotNone( + new_keypair, + "New Key pair generation failed" + ) + self.assertEquals( + "keypair1", + new_keypair.name, + "Key Pair not created with given name" + ) + # Listing all the SSH Key pairs again + list_keypairs_after = SSHKeyPair.list( + self.userapiclient + ) + status = validateList(list_keypairs_after) + self.assertEquals( + PASS, + status[0], + "Listing of Key pairs failed" + ) + # Verifying that list size is increased by 1 + self.assertEquals( + list_keypairs_before_size + 1, + len(list_keypairs_after), + "List count is not matching" + ) + # Resetting the VM SSH key to the Key pair created above + vm_created.resetSshKey( + self.userapiclient, + keypair=new_keypair.name + ) + # Listing VM details again + list_vm = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vm) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + self.assertEquals( + 1, + len(list_vm), + "VMs list is not as expected" + ) + # Verifying that VM's SSH keypair is set to newly created keypair + self.assertEquals( + new_keypair.name, + list_vm[0].keypair, + "VM is not set to newly created SSH Key pair" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_12_vm_nics(self): + """ + @Desc: Test to verify Nics for a VM + @Steps: + Step1: Deploying a VM + Step2: Listing all the Networks + Step3: Verifying that the list size is 1 + Step4: Creating 1 network + Step5: Listing all the networks again + Step6: Verifying that the list size is 2 + Step7: Verifying that VM deployed in step1 has only 1 nic + and it is same as network listed in step3 + Step8: Adding the networks created in step4 to VM deployed in step1 + Step9: Verifying that VM deployed in step1 has 2 nics + Step10: Verifying that isdefault is set to true for only 1 nic + Step11: Verifying that isdefault is set to true for the Network created when deployed a VM + Step12: Making the nic created in step4 as default nic + Step13: Verifying that isdefault is set to true for only 1 nic + Step14: Verifying that the isdefault is set to true for the nic created in step4 + Step15: Removing the non-default nic from VM + Step16: Verifying that VM deployed in step1 has only 1 nic + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing all the networks before + list_network_before = Network.list( + self.userapiclient, + isdefault="true", + zoneid=self.zone.id, + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_network_before) + self.assertEquals( + PASS, + status[0], + "Default Network not created when deploying a VM" + ) + # Verifying that only 1 network is created while deploying a VM + self.assertEquals( + 1, + len(list_network_before), + "More than 1 default network exists" + ) + network1 = list_network_before[0] + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat", + zoneid=self.zone.id + ) + self.assertIsNotNone( + network_offerings_list, + "Isolated Network Offerings with sourceNat enabled are not found" + ) + # Creating one more network + network2 = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network2, + "Network creation failed" + ) + self.cleanup.append(network2) + # Listing all the networks again + list_network_after = Network.list( + self.userapiclient, + zoneid=self.zone.id, + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_network_after) + self.assertEquals( + PASS, + status[0], + "List of Networks failed" + ) + # Verifying that list size is 2 + self.assertEquals( + 2, + len(list_network_after), + "More than 1 default network exists" + ) + # Verifying that VM created is having only 1 nic + vm_nics_before = vm_created.nic + self.assertIsNotNone( + vm_nics_before, + "Nic not found for the VM deployed" + ) + self.assertEquals( + 1, + len(vm_nics_before), + "VM Nic count is not matching" + ) + # Verifying that the nic is same as the default network listed above + self.assertEquals( + network1.id, + vm_nics_before[0].networkid, + "Default NIC for VM is not as expected" + ) + # Adding network2 created above to VM + VirtualMachine.add_nic( + vm_created, + self.userapiclient, + network2.id + ) + # Listing the Vm details again + list_vms_after = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + vm = list_vms_after[0] + # Verifying that VM nics size is 2 now + vm_nics_after = vm.nic + self.assertIsNotNone( + vm_nics_after, + "Nic not found for the deployed VM" + ) + self.assertEquals( + 2, + len(vm_nics_after), + "VM NIC's count is not matching" + ) + # Verifying that isdefault is set to true for only 1 nic + default_count = 0 + for i in range(0, len(vm_nics_after)): + if vm_nics_after[i].isdefault is True: + default_count = default_count + 1 + default_nic = vm_nics_after[i] + else: + non_default_nic = vm_nics_after[i] + self.assertEquals( + 1, + default_count, + "Default NIC count is not matching" + ) + # Verifying that default NIC is same the network created when VM is deployed + self.assertEquals( + network1.id, + default_nic.networkid, + "Default NIC is not matching for VM" + ) + # Updating network 2 as default NIC + vm_created.update_default_nic( + self.userapiclient, + non_default_nic.id + ) + # Listing the Vm details again + list_vms_after = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + vm = list_vms_after[0] + # Verifying that VM nics size is 2 now + vm_nics_after = vm.nic + self.assertIsNotNone( + vm_nics_after, + "Nic not found for the deployed VM" + ) + self.assertEquals( + 2, + len(vm_nics_after), + "VM NIC's count is not matching" + ) + # Verifying that isdefault is set to true for only 1 nic + default_count = 0 + for i in range(0, len(vm_nics_after)): + if vm_nics_after[i].isdefault is True: + default_count = default_count + 1 + default_nic = vm_nics_after[i] + else: + non_default_nic = vm_nics_after[i] + + self.assertEquals( + 1, + default_count, + "Default NIC count is not matching" + ) + # Verifying that default NIC is same the newly updated network (network 2) + self.assertEquals( + network2.id, + default_nic.networkid, + "Default NIC is not matching for VM" + ) + # Deleting non default NIC + vm_created.remove_nic( + self.userapiclient, + non_default_nic.id + ) + # Listing the Vm details again + list_vms_after = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + vm = list_vms_after[0] + # Verifying that VM nics size is 1 now + vm_nics_after = vm.nic + self.assertIsNotNone( + vm_nics_after, + "Nic not found for the deployed VM" + ) + self.assertEquals( + 1, + len(vm_nics_after), + "VM NIC's count is not matching" + ) + # Verifying the nic network is same as the default nic network + self.assertEquals( + network2.id, + vm_nics_after[0].networkid, + "VM NIC is not same as expected" + ) + return + +class TestInstances(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestInstances, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + if cls.zone.localstorageenabled: + cls.storagetype = 'local' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' + cls.services["disk_offering"]["storagetype"] = 'local' + else: + cls.storagetype = 'shared' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' + cls.services["disk_offering"]["storagetype"] = 'shared' + + cls.services['mode'] = cls.zone.networktype + cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.services["custom_volume"]["zoneid"] = cls.zone.id + + # Creating Disk offering, Service Offering and Account + cls.disk_offering = DiskOffering.create( + cls.api_client, + cls.services["disk_offering"] + ) + cls.service_offering = ServiceOffering.create( + cls.api_client, + cls.services["service_offerings"]["tiny"] + ) + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + # Updating resource Limits + for i in range(0,12): + Resources.updateLimit( + cls.api_client, + account=cls.account.name, + domainid=cls.domain.id, + max=-1, + resourcetype=i + ) + cls._cleanup.append(cls.account) + cls._cleanup.append(cls.service_offering) + cls._cleanup.append(cls.disk_offering) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_13_attach_detach_iso(self): + """ + @Desc: Test Attach ISO to VM and Detach ISO from VM. + @Steps: + Step1: Listing all the VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Listing all the VMs for a user again + Step5: Verifying that list size is increased by 1 + Step6: Listing all the ready ISO's + Step7: If size of the list is >= 1 continuing to next steps + Step8: Attaching the ISO listed to VM deployed in Step3 + Step9: Verifying that the attached ISO details are associated with VM + Step10: Detaching the ISO attached in step8 + Step11: Verifying that detached ISO details are not associated with VM + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + account=self.account.name + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again for matching zone + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + account=self.account.name + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing the ISO's in ready state + isos_list = Iso.list( + self.userapiclient, + isready="true", + isofilter="executable", + zoneid=self.zone.id + ) + # Verifying if size of the list is >= 1 + if isos_list is not None: + iso_toattach = isos_list[0] + # Attaching ISO listed to VM deployed + VirtualMachine.attach_iso( + vm_created, + self.userapiclient, + iso_toattach + ) + list_vm = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vm) + self.assertEquals( + PASS, + status[0], + "VM listing by Id failed" + ) + # Verifying that attached ISO details are present in VM + self.assertEquals( + iso_toattach.name, + list_vm[0].isoname, + "Attached ISO name is not matching" + ) + self.assertEquals( + iso_toattach.displaytext, + list_vm[0].isodisplaytext, + "Attached ISO display is not matching" + ) + # Detaching ISO from VM + VirtualMachine.detach_iso( + vm_created, + self.userapiclient + ) + list_vm = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vm) + self.assertEquals( + PASS, + status[0], + "VM listing by Id failed" + ) + # Verifying that ISO details are NOT present in VM + self.assertIsNone( + list_vm[0].isoname, + "ISO not detached from VM" + ) + else: + self.fail("Executable ISO in Ready is not found in the given setup") + + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_14_vm_snapshot_pagination(self): + """ + @Desc: Test VM Snapshots pagination. + @Steps: + Step1: Deploying a VM + Step2: Listing all the Snapshots of the VM deployed in Step 1 + Step3: Verifying that the list size is 0 + Step4: Creating (pagesize + 1) number of Snapshots for the VM + Step5: Listing all the Snapshots of the VM deployed in Step 1 + Step6: Verifying that the list size is (pagesize + 1) + Step7: Listing all the VM snapshots in Page 1 with page size + Step8: Verifying that size of the list is same as page size + Step9: Listing all the VM snapshots in Page 2 with page size + Step10: Verifying that size of the list is 1 + Step11: Deleting VM snapshot in page 2 + Step12: Listing all the VM snapshots in Page 2 with page size + Step13: Verifying that size of the list is 0 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing all the VM snapshots for VM deployed above + list_snapshots_before = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + # Verifying that the VM snapshot list is None + self.assertIsNone( + list_snapshots_before, + "Snapshots already exists for newly created VM" + ) + # Creating pagesize + 1 number of VM snapshots + for i in range(0, (self.services["pagesize"] + 1)): + snapshot_created = VmSnapshot.create( + self.userapiclient, + vm_created.id, + ) + self.assertIsNotNone( + snapshot_created, + "Snapshot creation failed" + ) + + # Listing all the VM snapshots for VM again + list_snapshots_after = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + status = validateList(list_snapshots_after) + self.assertEquals( + PASS, + status[0], + "VM Snapshots creation failed" + ) + self.assertEquals( + self.services["pagesize"] + 1, + len(list_snapshots_after), + "Count of VM Snapshots is not matching" + ) + # Listing all the VM snapshots in Page 1 with page size + list_snapshots_page1 = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id, + page=1, + pagesize=self.services["pagesize"], + ) + status = validateList(list_snapshots_page1) + self.assertEquals( + PASS, + status[0], + "Listing of VM Snapshots failed in page 1" + ) + # Verifying the list size is equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_snapshots_page1), + "List VM Snapshot count is not matching in page 1" + ) + # Listing all the VM Snapshots in page 2 + list_snapshots_page2 = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id, + page=2, + pagesize=self.services["pagesize"], + ) + status = validateList(list_snapshots_page2) + self.assertEquals( + PASS, + status[0], + "Listing of VM Snapshots failed in page 2" + ) + # Verifying the list size is equal to 1 + self.assertEquals( + 1, + len(list_snapshots_page2), + "List VM Snapshot count is not matching in page 2" + ) + # Deleting VM Snapshot in page 2 + VmSnapshot.deleteVMSnapshot( + self.userapiclient, + snapshot_created.id + ) + # Listing all the VM Snapshots in page 2 again + list_snapshots_page2 = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id, + page=2, + pagesize=self.services["pagesize"], + ) + # Verifying the list size is equal to 0 + self.assertIsNone( + list_snapshots_page2, + "VM Snapshots exists in page 2" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_15_revert_vm_to_snapshot(self): + """ + @Desc: Test Revert VM to Snapshot functionality. + @Steps: + Step1: Deploying a VM + Step2: Listing all the Snapshots of the VM deployed in Step 1 + Step3: Verifying that the list size is 0 + Step4: Creating 2 Snapshots for the VM + Step5: Listing all the Snapshots of the VM deployed in Step 1 + Step6: Verifying that the list size is 2 + Step7: Verifying that only 1 snapshot is have current flag set to True + Step8: Verifying that the VM snapshot with current flag set as true is the latest snapshot created + Step9: Reverting VM to snapshot having current flag as false (non current snapshot) + Step10: Verifying that only 1 VM snapshot is having current flag set as true. + Step11: Verifying that the VM Snapshot with current flag set to true is the reverted snapshot in Step 8 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing all the VM snapshots for VM deployed above + list_snapshots_before = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + # Verifying that the VM snapshot list is None + self.assertIsNone( + list_snapshots_before, + "Snapshots already exists for newly created VM" + ) + # Creating 2 of VM snapshots + snapshot1 = VmSnapshot.create( + self.userapiclient, + vm_created.id, + ) + self.assertIsNotNone( + snapshot1, + "Snapshot creation failed" + ) + snapshot2 = VmSnapshot.create( + self.userapiclient, + vm_created.id, + ) + self.assertIsNotNone( + snapshot2, + "Snapshot creation failed" + ) + # Listing all the VM snapshots for VM again + list_snapshots_after = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + status = validateList(list_snapshots_after) + self.assertEquals( + PASS, + status[0], + "VM Snapshots creation failed" + ) + self.assertEquals( + 2, + len(list_snapshots_after), + "Count of VM Snapshots is not matching" + ) + # Verifying that only 1 snapshot is having current flag set to true + # and that snapshot is the latest snapshot created (snapshot2) + current_count = 0 + for i in range(0, len(list_snapshots_after)): + if(list_snapshots_after[i].current is True): + current_count = current_count + 1 + current_snapshot = list_snapshots_after[i] + + self.assertEquals( + 1, + current_count, + "count of VM Snapshot with current flag as true is not matching" + ) + self.assertEquals( + snapshot2.id, + current_snapshot.id, + "Latest snapshot taken is not marked as current" + ) + # Reverting the VM to Snapshot 1 + VmSnapshot.revertToSnapshot( + self.userapiclient, + snapshot1.id + ) + # Listing the VM snapshots again + list_snapshots_after = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + status = validateList(list_snapshots_after) + self.assertEquals( + PASS, + status[0], + "VM Snapshots creation failed" + ) + self.assertEquals( + 2, + len(list_snapshots_after), + "Count of VM Snapshots is not matching" + ) + # Verifying that only 1 snapshot is having current flag set to true + # and that snapshot is snapshot1 + current_count = 0 + for i in range(0, len(list_snapshots_after)): + if(list_snapshots_after[i].current is True): + current_count = current_count + 1 + current_snapshot = list_snapshots_after[i] + self.assertEquals( + 1, + current_count, + "count of VM Snapshot with current flag as true is not matching" + ) + self.assertEquals( + snapshot1.id, + current_snapshot.id, + "Current flag was set properly after reverting the VM to snapshot" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_16_list_vm_volumes_pagination(self): + """ + @Desc: Test to verify pagination of Volumes for a VM + @Steps: + Step1: Deploying a VM + Step2: Listing all the Volumes of the VM deployed in Step 1 + Step3: Verifying that the list size is 1 + Step4: Creating page size number of volumes + Step5: Attaching all the volumes created in step4 to VM deployed in Step1 + Step6: Listing all the Volumes for the VM in step1 + Step7: Verifying that the list size is equal to page size + 1 + Step8: Listing all the volumes of VM in page 1 + Step9: Verifying that the list size is equal to page size + Step10: Listing all the Volumes in Page 2 + Step11: Verifying that the list size is 1 + Step12: Detaching the volume from the VM + Step13: Listing all the Volumes in Page 2 + Step14: Verifying that list size is 0 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing all the Volumes for the VM deployed + list_volumes_before = Volume.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + status = validateList(list_volumes_before) + self.assertEquals( + PASS, + status[0], + "Root volume is not created for VM deployed" + ) + # Verifying the size of the list is 1 + self.assertEquals( + 1, + len(list_volumes_before), + "Volumes count is not matching" + ) + # Creating Page size number of volumes + for i in range(0, self.services["pagesize"]): + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + self.assertIsNotNone( + volume_created, + "Volume is not created" + ) + self.cleanup.append(volume_created) + # Attaching all the volumes created to VM + vm_created.attach_volume( + self.userapiclient, + volume_created + ) + + # List all the volumes for the VM again + list_volumes_after = Volume.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + status = validateList(list_volumes_after) + self.assertEquals( + PASS, + status[0], + "Volumes are not listed" + ) + # Verifying that size of the list is equal to page size + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_volumes_after), + "VM's volume count is not matching" + ) + # Listing all the volumes for a VM in page 1 + list_volumes_page1 = Volume.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id, + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_volumes_page1) + self.assertEquals( + PASS, + status[0], + "Volumes not listed in page1" + ) + # Verifying that list size is equal to page size + self.assertEquals( + self.services["pagesize"], + len(list_volumes_page1), + "VM's volume count is not matching in page 1" + ) + # Listing all the volumes for a VM in page 2 + list_volumes_page2 = Volume.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id, + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_volumes_page2) + self.assertEquals( + PASS, + status[0], + "Volumes not listed in page2" + ) + # Verifying that list size is equal to 1 + self.assertEquals( + 1, + len(list_volumes_page2), + "VM's volume count is not matching in page 1" + ) + # Detaching 1 volume from VM + vm_created.detach_volume( + self.userapiclient, + volume_created + ) + # Listing all the volumes for a VM in page 2 again + list_volumes_page2 = Volume.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id, + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that there are no volumes present in page 2 + self.assertIsNone( + list_volumes_page2, + "Volumes listed in page 2" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_17_running_vm_scaleup(self): + """ + @Desc: Test to verify change service for Running VM + @Steps: + Step1: Checking if dynamic scaling of virtual machines is enabled in zone and template. + If yes then continuing. + If not then printing message that scale up is not possible for Running VM + Step2: Deploying a VM + Step3: Listing all the existing service offerings + Step4: If there is a matching Service Offering for scale-up of running VM + use that service offering. If not create one service offering for scale up. + Step5: Perform change service (scale up) the Running VM deployed in step1 + Step6: Verifying that VM's service offerings is changed + """ + # Checking if Dynamic scaling of VM is supported or not + list_config = Configurations.list( + self.apiClient, + zoneid=self.zone.id, + name="enable.dynamic.scale.vm" + ) + status = validateList(list_config) + self.assertEquals( + PASS, + status[0], + "Listing of configuration failed" + ) + # Checking if dynamic scaling is allowed in Zone and Template + if not ((list_config[0].value is True) and (self.template.isdynamicallyscalable)): + self.debug("Scale up of Running VM is not possible as Zone/Template does not support") + else: + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing details of current Service Offering + vm_so_list = ServiceOffering.list( + self.userapiclient, + id=vm_created.serviceofferingid + ) + status = validateList(vm_so_list) + self.assertEquals( + PASS, + status[0], + "Listing of VM Service offering failed" + ) + current_so = vm_so_list[0] + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing all the existing service offerings + service_offerings_list = ServiceOffering.list( + self.userapiclient, + virtualmachineid=vm_created.id + ) + # Verifying if any Service offering available for scale up of VM + so_exists = False + if service_offerings_list is not None: + for i in range(0, len(service_offerings_list)): + if not ((current_so.cpunumber > service_offerings_list[i].cpunumber or\ + current_so.cpuspeed > service_offerings_list[i].cpuspeed or\ + current_so.memory > service_offerings_list[i].memory) or\ + (current_so.cpunumber == service_offerings_list[i].cpunumber and\ + current_so.cpuspeed == service_offerings_list[i].cpuspeed and\ + current_so.memory == service_offerings_list[i].memory)): + if(current_so.storagetype == service_offerings_list[i].storagetype): + so_exists = True + new_so = service_offerings_list[i] + break + # If service offering does not exists, then creating one service offering for scale up + if not so_exists: + self.services["service_offerings"]["small"]["storagetype"] = current_so.storagetype + new_so = ServiceOffering.create( + self.apiClient, + self.services["service_offerings"]["small"] + ) + self.cleanup.append(new_so) + # Scaling up the VM + vm_created.scale_virtualmachine( + self.userapiclient, + new_so.id + ) + # Listing VM details again + list_vms_after = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + self.assertEquals( + 1, + len(list_vms_after), + "VMs list is not as expected" + ) + # Verifying that VM's service offerings is changed + self.assertEquals( + new_so.id, + list_vms_after[0].serviceofferingid, + "VM is not containing New Service Offering" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_18_stopped_vm_change_service(self): + """ + @Desc: Test to verify change service for Stopped VM + @Steps: + Step1: Deploying a VM + Step2: Stopping the VM deployed in step1 + Step3: Listing all the existing service offerings + Step4: If there is a matching Service Offering for change service of stopped VM + use that service offering. If not create one service offering for change service. + Step5: Perform change service for the Stopped VM + Step6: Verifying that VM's service offerings is changed + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing details of current Service Offering + vm_so_list = ServiceOffering.list( + self.userapiclient, + id=vm_created.serviceofferingid + ) + status = validateList(vm_so_list) + self.assertEquals( + PASS, + status[0], + "Listing of VM Service offering failed" + ) + current_so = vm_so_list[0] + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Stopping the VM deployed above + vm_created.stop( + self.userapiclient, + forced=True + ) + # Listing all the service offerings + service_offerings_list = ServiceOffering.list( + self.userapiclient, + virtualmachineid=vm_created.id + ) + # Verifying if any Service offering available for change service of VM + so_exists = False + if service_offerings_list is not None: + for i in range(0, len(service_offerings_list)): + if ((current_so.id != service_offerings_list[i].id) and\ + (current_so.storagetype == service_offerings_list[i].storagetype)): + so_exists = True + new_so = service_offerings_list[i] + break + # If service offering does not exists, then creating one service offering for scale up + if not so_exists: + self.services["service_offerings"]["small"]["storagetype"] = current_so.storagetype + new_so = ServiceOffering.create( + self.apiClient, + self.services["service_offerings"]["small"] + ) + self.cleanup.append(new_so) + # Changing service for the VM + vm_created.scale_virtualmachine( + self.userapiclient, + new_so.id + ) + # Listing VM details again + list_vm = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vm) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + self.assertEquals( + 1, + len(list_vm), + "VMs list is not as expected" + ) + # Verifying that VM's service offerings is changed + self.assertEquals( + new_so.id, + list_vm[0].serviceofferingid, + "VM is not containing New Service Offering" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_19_create_reset_vm_sshkey(self): + """ + @Desc: Test to verify creation and reset of SSH Key for VM + @Steps: + Step1: Deploying a VM + Step2: Stopping the VM deployed in step1 + Step3: Listing all the SSH Key pairs + Step4: Creating a new SSH Key pair + Step5: Listing all the SSh Key pairs again + Step6: Verifying that the key pairs list is increased by 1 + Step7: Resetting the VM SSH Key to the key pair created in step4 + Step8: Verifying that the new SSH Key pair is set to the VM + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Stopping the VM deployed above + vm_created.stop( + self.userapiclient, + forced=True + ) + # Listing all the SSH Key pairs + list_keypairs_before = SSHKeyPair.list( + self.userapiclient + ) + list_keypairs_before_size = 0 + if list_keypairs_before is not None: + list_keypairs_before_size = len(list_keypairs_before) + + # Creating a new Key pair + new_keypair = SSHKeyPair.create( + self.userapiclient, + name="keypair1", + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNotNone( + new_keypair, + "New Key pair generation failed" + ) + self.assertEquals( + "keypair1", + new_keypair.name, + "Key Pair not created with given name" + ) + # Listing all the SSH Key pairs again + list_keypairs_after = SSHKeyPair.list( + self.userapiclient + ) + status = validateList(list_keypairs_after) + self.assertEquals( + PASS, + status[0], + "Listing of Key pairs failed" + ) + # Verifying that list size is increased by 1 + self.assertEquals( + list_keypairs_before_size + 1, + len(list_keypairs_after), + "List count is not matching" + ) + # Resetting the VM SSH key to the Key pair created above + vm_created.resetSshKey( + self.userapiclient, + keypair=new_keypair.name + ) + # Listing VM details again + list_vm = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vm) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + self.assertEquals( + 1, + len(list_vm), + "VMs list is not as expected" + ) + # Verifying that VM's SSH keypair is set to newly created keypair + self.assertEquals( + new_keypair.name, + list_vm[0].keypair, + "VM is not set to newly created SSH Key pair" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_20_update_vm_displayname_group(self): + """ + @Desc: Test to verify Update VM details + @Steps: + Step1: List all the VM's for a user + Step2: Deploy a VM with all parameters + Step3: Listing all the VM's again for the user + Step4: Verifying that list size is increased by 1 + Step5: Updating VM details - displayname, group + Step6: Listing the VM deployed in step 2 by ID + Step7: Verifying that displayname, group details of the VM are updated + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + self.services["virtual_machine"]["keyboard"] = "us" + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + group="groupName" + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Verifying the displayname and group details for deployed VM + self.assertEquals( + self.services["virtual_machine"]["displayname"], + vm_created.displayname, + "Display name of VM is not as expected" + ) + self.assertEquals( + "groupName", + vm_created.group, + "Group of VM is not as expected" + ) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Updating the VM details - displayname and group + vm_created.update( + self.userapiclient, + displayname="DisplayName", + group="Group", + haenable=False + ) + # Listing VM details again + list_vm = VirtualMachine.list( + self.userapiclient, + id=vm_created.id, + ) + status = validateList(list_vm) + self.assertEquals( + PASS, + status[0], + "Listing of VM by Id failed" + ) + self.assertEquals( + 1, + len(list_vm), + "Count of List VM by Id is not matching" + ) + # Verifying that displayname and group details are updated + self.assertEquals( + "DisplayName", + list_vm[0].displayname, + "Displayname of VM is not updated" + ) + self.assertEquals( + "Group", + list_vm[0].group, + "Group of VM is not updated" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_21_restore_vm(self): + """ + @Desc: Test to verify Restore VM + @Steps: + Step1: List all the VM's for a user + Step2: Deploy a VM with all parameters + Step3: Listing all the VM's again for the user + Step4: Verifying that list size is increased by 1 + Step5: Restoring the VM deployed in step2 + Step6: Verifying that restored VM details are same as the VM deployed in step2 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Restoring the VM + restored_vm = vm_created.restore(self.userapiclient) + self.assertIsNotNone( + restored_vm, + "VM restore failed" + ) + # Verifying the restored VM details + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":vm_created.state, + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":restored_vm.id, + "name":restored_vm.name, + "displayname":restored_vm.displayname, + "state":restored_vm.state, + "zoneid":restored_vm.zoneid, + "account":restored_vm.account, + "template":restored_vm.templateid + } + restored_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + restored_vm_status, + "Restored VM details are not as expected" + ) + return + + @attr(tags=["advanced", "selfservice"]) + def test_22_deploy_vm_multiple_networks(self): + """ + @Desc: Test to verify deploy VM with multiple networks + @Steps: + Step1: List all the networks for user + Step2: If size of list networks is greater than 2 then get all the networks id's + Else create 2 networks and get network id's + Step3: List all the VM's for a user + Step4: Deploy a VM with multiple network id's + Step5: Listing all the VM's again for the user + Step6: Verifying that list size is increased by 1 + Step7: Verify that VM is associated with multiple networks + """ + # Listing all the networks available + networks_list_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + networks_list_size = 0 + if networks_list_before is not None: + networks_list_size = len(networks_list_before) + + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat enabled are not found" + ) + while networks_list_size < 2: + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + networks_list_size = networks_list_size + 1 + + # Listing the networks again + networks_list_after = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Listing networks failed" + ) + # populating network id's + networkids = networks_list_after[0].id + "," + networks_list_after[1].id + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=networkids, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Verifying that the NIC's in VM created are same as provided + vm_nics = vm_created.nic + # Verifying that the size of nics is 2 + self.assertEquals( + 2, + len(vm_nics), + "NIC's count in VM created is not matching" + ) + # Verifying that NIC network ID's are as expected + for i in range(0, len(vm_nics)): + if vm_nics[i].isdefault is True: + self.assertEquals( + networks_list_after[0].id, + vm_nics[i].networkid, + "Default NIC is not as expected" + ) + else: + self.assertEquals( + networks_list_after[1].id, + vm_nics[i].networkid, + "Non Default NIC is not as expected" + ) + return + + @attr(tags=["basic", "provisioning"]) + def test_23_deploy_vm_multiple_securitygroups(self): + """ + @Desc: Test to verify deploy VM with multiple Security Groups + @Steps: + Step1: List all the security groups for user + Step2: If size of list security groups is greater than 2 then get all the security groups id's + Else creating 2 security groups and get security groups id's + Step3: List all the VM's for a user + Step4: Deploy a VM with multiple security groups id's + Step5: Listing all the VM's again for the user + Step6: Verifying that list size is increased by 1 + Step7: Verify that VM is associated with multiple security groups + """ + # Listing all the security groups available + security_groups_list = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + domainid=self.domain.id + ) + security_groups_list_size = 0 + if security_groups_list is not None: + security_groups_list_size = len(security_groups_list) + + while security_groups_list_size < 2: + # Creating a security group + security_group = SecurityGroup.create( + self.userapiclient, + self.services["security_group"], + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNotNone( + security_group, + "Security Group creation failed" + ) + self.cleanup.append(security_group) + security_groups_list_size = security_groups_list_size + 1 + + # Listing the networks again + security_groups_list = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + domainid=self.domain.id + ) + status = validateList(security_groups_list) + self.assertEquals( + PASS, + status[0], + "Listing Security Groups failed" + ) + # populating Security Groups id's + securitygroupids = {security_groups_list[0].id , security_groups_list[1].id} + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + securitygroupids=securitygroupids, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Verifying that the Security Groups's in VM created are same as provided + vm_securitygroups = vm_created.securitygroup + # Verifying that the size of security groups is 2 + self.assertEquals( + 2, + len(vm_securitygroups), + "Security Groups count in VM created is not matching" + ) + # Verifying that Security Group network ID's are as expected + vm_securitygroups_flag = True + for i in range(0, len(vm_securitygroups)): + if ((vm_securitygroups[i].id != security_groups_list[0].id) and\ + (vm_securitygroups[i].id != security_groups_list[1].id)): + vm_securitygroups_flag = False + break + + self.assertEquals( + True, + vm_securitygroups_flag, + "Security Groups in VM are not same as created" + ) + return \ No newline at end of file diff --git a/test/integration/component/test_escalations_ipaddresses.py b/test/integration/component/test_escalations_ipaddresses.py new file mode 100644 index 0000000000..23dd76b9cf --- /dev/null +++ b/test/integration/component/test_escalations_ipaddresses.py @@ -0,0 +1,4192 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import * +from marvin.cloudstackException import * +from marvin.cloudstackAPI import * +from marvin.sshClient import SshClient +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * +from marvin.lib.utils import checkVolumeSize +from marvin.codes import SUCCESS +from nose.plugins.attrib import attr +from time import sleep + +class TestIpAddresses(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestIpAddresses, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + if cls.zone.localstorageenabled: + cls.storagetype = 'local' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' + else: + cls.storagetype = 'shared' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' + + cls.services['mode'] = cls.zone.networktype + cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.service_offering = ServiceOffering.create( + cls.api_client, + cls.services["service_offerings"]["tiny"] + ) + cls._cleanup.append(cls.service_offering) + cls.services['mode'] = cls.zone.networktype + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls._cleanup.append(cls.account) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created volumes + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + def __verify_values(self, expected_vals, actual_vals): + """ + @summary: Function to verify expected and actual values + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "provisioning"]) + def test_01_list_ipaddresses_pagination(self): + """ + @summary: Test List IP Addresses pagination + @Steps: + Step1: Creating a network for the user + Step2: Listing all the IP Addresses for a user + Step3: Verifying that no IP Addresses are listed + Step4: Associating (pagesize + 1) number of IP Addresses + Step5: Listing all the IP Addresses again + Step6: Verifying the length of the IP Addresses is (page size + 1) + Step7: Listing all the IP Addresses in page1 + Step8: Verifying that the length of the IP Addresses in page 1 is (page size) + Step9: Listing all the IP Addresses in page2 + Step10: Verifying that the length of the IP Addresses in page 2 is 1 + Step11: Dis-Associating the IP Addresses present in page 2 + Step12: Listing for the IP Addresses on page 2 + Step13: Verifying that no IP Addresses are listed + """ + # Listing all the networks available + networks_list_before = Network.list( + self.userapiclient, + forvpc="false", + domainid=self.domain.id, + account=self.account.name, + ) + self.assertIsNone( + networks_list_before, + "Networks listed for newly created user" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the networks available + networks_list_after = Network.list( + self.userapiclient, + forvpc="false", + domainid=self.domain.id, + account=self.account.name, + ) + status = validateList(networks_list_after) + self.assertEquals( + PASS, + status[0], + "Network Creation Failed" + ) + self.assertEquals( + 1, + len(networks_list_after), + "Network creation failed" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created user" + ) + # Associating (pagesize + 1) number of IP Addresses + for i in range(0, (self.services["pagesize"] + 1)): + ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + ipaddress, + "Failed to Associate IP Address" + ) + + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the volumes is (page size + 1) + self.assertEqual( + (self.services["pagesize"] + 1), + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing IP Address in page 1 + list_ipaddress_page1 = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_ipaddress_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list IP Addresses in page1" + ) + # Verifying that list size is equals to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_ipaddress_page1), + "Failed to list pagesize number of IP Addresses in page1" + ) + # Listing IP Address in page 2 + list_ipaddress_page2 = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_ipaddress_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list IP Addresses in page2" + ) + # Verifying that List size is equal to 1 + self.assertEquals( + 1, + len(list_ipaddress_page2), + "Failed to list IP Addresses in page2" + ) + # Dis-associating an IP Address + ipaddress.delete(self.userapiclient) + # Listing IP Address in page 2 + list_ipaddress_page2 = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that no IP Addresses are listed + self.assertIsNone( + list_ipaddress_page2, + "Disassociation of IP Address Failed" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_02_list_ipaddresses_byid(self): + """ + @summary: Test List IP Addresses details by ID + @Steps: + Step1: Creating a network for the user + Step2: Listing all the IP Addresses for a user + Step3: Verifying that no IP Addresses are listed + Step4: Associating an IP Addresses for Network + Step5: Listing all the IP Addresses again + Step6: Verifying the length of the IP Addresses is 1 + Step7: Listing the IP Addresses by Id + Step8: Verifying that the length of the IP Addresses list is 1 + Step9: Verifying the details of the Listed IP Address + """ + # Listing all the networks available + networks_list_before = Network.list( + self.userapiclient, + forvpc="false", + domainid=self.domain.id, + account=self.account.name, + ) + self.assertIsNone( + networks_list_before, + "Networks listed for newly created user" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the networks available + networks_list_after = Network.list( + self.userapiclient, + forvpc="false", + domainid=self.domain.id, + account=self.account.name, + ) + status = validateList(networks_list_after) + self.assertEquals( + PASS, + status[0], + "Network Creation Failed" + ) + self.assertEquals( + 1, + len(networks_list_after), + "Network creation failed" + ) + # Listing the Network By ID + network_list_byid = Network.list( + self.userapiclient, + listall=self.services["listall"], + id=network.id + ) + status = validateList(network_list_byid) + self.assertEquals( + PASS, + status[0], + "Failed to list Network by Id" + ) + self.assertEquals( + 1, + len(network_list_byid), + "Failed to list Network by Id" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created user" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network_list_byid[0].id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing IP Address by id + list_ipaddress_byid = PublicIPAddress.list( + self.userapiclient, + id=associated_ipaddress.ipaddress.id + ) + status = validateList(list_ipaddress_byid) + self.assertEquals( + PASS, + status[0], + "Failed to list IP Addresses by ID" + ) + # Verifying that list size is equals to 1 + self.assertEquals( + 1, + len(list_ipaddress_byid), + "Failed to list IP Addresses by ID" + ) + # Verifying details of the listed IP Address to be same as IP Address created above + # Creating expected and actual values dictionaries + expected_dict = { + "id":associated_ipaddress.ipaddress.id, + "associatednetworkid":associated_ipaddress.ipaddress.associatednetworkid, + "associatednetworkname":associated_ipaddress.ipaddress.associatednetworkname, + "ipaddress":associated_ipaddress.ipaddress.ipaddress, + "issourcenat":associated_ipaddress.ipaddress.issourcenat, + "isstaticnat":associated_ipaddress.ipaddress.isstaticnat, + "networkid":associated_ipaddress.ipaddress.networkid + } + actual_dict = { + "id":list_ipaddress_byid[0].id, + "associatednetworkid":list_ipaddress_byid[0].associatednetworkid, + "associatednetworkname":list_ipaddress_byid[0].associatednetworkname, + "ipaddress":list_ipaddress_byid[0].ipaddress, + "issourcenat":list_ipaddress_byid[0].issourcenat, + "isstaticnat":list_ipaddress_byid[0].isstaticnat, + "networkid":list_ipaddress_byid[0].networkid + } + ipaddress_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + ipaddress_status, + "Listed IP Address details are not as expected" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_03_associate_ipaddress_for_vpc(self): + """ + @summary: Test to Associate IP Address for VPC + @Steps: + Step1: Creating a VPC for the user + Step2: Listing all the IP Addresses for a user + Step3: Verifying that 1 IP Addresses is listed + Step4: Associating an IP Addresses for VPC + Step5: Listing all the IP Addresses again + Step6: Verifying the length of the IP Addresses list is 2 + Step7: Listing the IP Addresses by Id + Step8: Verifying that the length of the IP Addresses list is 1 + Step9: Verifying the details of the Listed IP Address + """ + # Listing all the vpc's for a user + list_vpc_before = VPC.list(self.userapiclient) + # Verifying No VPCs are listed + self.assertIsNone( + list_vpc_before, + "VPC's Listed for newly Created User" + ) + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals( + PASS, + status[0], + "list vpc offering is none") + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone( + vpc_created, + "VPC Creation Failed" + ) + self.cleanup.append(vpc_created) + # Listing the vpc for a user after creating a vpc + list_vpc_after = VPC.list(self.userapiclient) + status = validateList(list_vpc_after) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_vpc_after), + "list VPC not equal as expected" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "Failed to List VPC IP Address" + ) + self.assertEquals( + 1, + len(list_ipaddresses_before), + "Failed to List VPC IP Address" + ) + # Associating an IP Addresses to VPC created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + vpcid=vpc_created.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + len(list_ipaddresses_before) + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing IP Address by id + list_ipaddress_byid = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + id=associated_ipaddress.ipaddress.id + ) + status = validateList(list_ipaddress_byid) + self.assertEquals( + PASS, + status[0], + "Failed to list IP Addresses by ID" + ) + # Verifying that list size is equals to 1 + self.assertEquals( + 1, + len(list_ipaddress_byid), + "Failed to list IP Addresses by ID" + ) + # Verifying details of the listed IP Address to be same as IP Address created above + # Creating expected and actual values dictionaries + expected_dict = { + "id":associated_ipaddress.ipaddress.id, + "associatednetworkid":associated_ipaddress.ipaddress.associatednetworkid, + "associatednetworkname":associated_ipaddress.ipaddress.associatednetworkname, + "ipaddress":associated_ipaddress.ipaddress.ipaddress, + "issourcenat":associated_ipaddress.ipaddress.issourcenat, + "isstaticnat":associated_ipaddress.ipaddress.isstaticnat, + "networkid":associated_ipaddress.ipaddress.networkid, + "vpcid":associated_ipaddress.ipaddress.vpcid + } + actual_dict = { + "id":list_ipaddress_byid[0].id, + "associatednetworkid":list_ipaddress_byid[0].associatednetworkid, + "associatednetworkname":list_ipaddress_byid[0].associatednetworkname, + "ipaddress":list_ipaddress_byid[0].ipaddress, + "issourcenat":list_ipaddress_byid[0].issourcenat, + "isstaticnat":list_ipaddress_byid[0].isstaticnat, + "networkid":list_ipaddress_byid[0].networkid, + "vpcid":list_ipaddress_byid[0].vpcid + } + ipaddress_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + ipaddress_status, + "Listed IP Address details are not as expected" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_04_create_delete_lbrule_fornonvpc(self): + """ + @summary: Test to list, create and delete Load Balancer Rule for IP Address associated to Non VPC network + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Listing Load Balancer Rules for the IP Address associated in Step2 + Step4: Verifying that no Load Balancer Rules are listed + Step5: Creating a Load Balancer Rule for IP Address associated in Step2 + Step6: Listing Load Balancer Rules for the IP Address associated in Step2 + Step7: Verifying 1 Load Balancer Rule is listed + Step8: Deleting the Load Balancer Rule created in Step5 + Step9: Listing Load Balancer Rules for the IP Address associated in Step2 + Step10: Verifying that no Load Balancer Rules are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Lb enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_before = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are listed + self.assertIsNone( + list_lbrules_before, + "Load Balancer Rules listed for newly Acquired Ip Address" + ) + self.services["lbrule"]["openfirewall"] = 'false' + # Creating a Load Balancer Rule for Ip Address + lb_rule = LoadBalancerRule.create( + self.userapiclient, + self.services["lbrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + ) + self.assertIsNotNone( + lb_rule, + "Failed to create Load Balancer Rule" + ) + # Verifying details of created Load Balancer Rule + # Creating expected and actual values dictionaries + expected_dict = { + "algorithm":self.services["lbrule"]["alg"], + "privateport":str(self.services["lbrule"]["privateport"]), + "publicport":str(self.services["lbrule"]["publicport"]), + "name":self.services["lbrule"]["name"], + } + actual_dict = { + "algorithm":str(lb_rule.algorithm), + "privateport":str(lb_rule.privateport), + "publicport":str(lb_rule.publicport), + "name":str(lb_rule.name), + } + lbrule_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + lbrule_status, + "Created Load Balancer Rule details are not as expected" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_lbrules_after) + self.assertEquals( + PASS, + status[0], + "Load Balancer Rule creation Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbrules_after), + "Load Balancer Rule creation Failed" + ) + # Deleting Load Balancer Rule + lb_rule.delete(self.userapiclient) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are Listed + self.assertIsNone( + list_lbrules_after, + "Failed to delete Load Balancer Rule" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_05_create_delete_lbrule_forvpc(self): + """ + @summary: Test to list, create and delete Load Balancer Rule for IP Address associated to VPC + @Steps: + Step1: Creating a VPC for the user + Step2: Creating Network inside VPC + Step3: Associating an IP Addresses for VPC + Step4: Listing Load Balancer Rules for the IP Address associated in Step2 + Step5: Verifying that no Load Balancer Rules are listed + Step6: Creating a Load Balancer Rule for IP Address associated in Step2 + Step7: Listing Load Balancer Rules for the IP Address associated in Step2 + Step8: Verifying 1 Load Balancer Rule is listed + Step9: Deleting the Load Balancer Rule created in Step5 + Step10: Listing Load Balancer Rules for the IP Address associated in Step2 + Step11: Verifying that no Load Balancer Rules are listed + """ + # Listing all the vpc's for a user + list_vpc_before = VPC.list(self.userapiclient) + # Verifying No VPCs are listed + self.assertIsNone( + list_vpc_before, + "VPC's Listed for newly Created User" + ) + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals( + PASS, + status[0], + "list vpc offering is none") + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone( + vpc_created, + "VPC Creation Failed" + ) + # Listing the vpc for a user after creating a vpc + list_vpc_after = VPC.list(self.userapiclient) + status = validateList(list_vpc_after) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_vpc_after), + "list VPC not equal as expected" + ) + #List network offering for vpc = true + network_offering_vpc_true_list = NetworkOffering.list( + self.userapiclient, + forvpc = "true", + zoneid = self.zone.id, + supportedServices = "Lb", + state = "Enabled" + ) + status = validateList(network_offering_vpc_true_list) + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with Lb") + # Creating network under VPC + network_created = Network.create( + self.userapiclient, + self.services["ntwk"], + networkofferingid = network_offering_vpc_true_list[0].id, + vpcid = vpc_created.id, + zoneid=self.zone.id, + gateway= self.services["ntwk"]["gateway"], + netmask = self.services["ntwk"]["netmask"] + ) + self.cleanup.append(network_created) + self.assertIsNotNone( + network_created, + "Network is not created" + ) + self.cleanup.append(vpc_created) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "list IP Addresses not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_ipaddresses_before), + "list IP Addresses not equal as expected" + ) + # Associating an IP Addresses to VPC created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + vpcid=vpc_created.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + len(list_ipaddresses_before) + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_before = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are listed + self.assertIsNone( + list_lbrules_before, + "Load Balancer Rules listed for newly Acquired Ip Address" + ) + self.services["lbrule"]["openfirewall"] = 'false' + # Creating a Load Balancer Rule for Ip Address + lb_rule = LoadBalancerRule.create( + self.userapiclient, + self.services["lbrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + networkid=network_created.id + ) + self.assertIsNotNone( + lb_rule, + "Failed to create Load Balancer Rule" + ) + # Verifying details of created Load Balancer Rule + # Creating expected and actual values dictionaries + expected_dict = { + "algorithm":self.services["lbrule"]["alg"], + "privateport":str(self.services["lbrule"]["privateport"]), + "publicport":str(self.services["lbrule"]["publicport"]), + "name":self.services["lbrule"]["name"], + } + actual_dict = { + "algorithm":str(lb_rule.algorithm), + "privateport":str(lb_rule.privateport), + "publicport":str(lb_rule.publicport), + "name":str(lb_rule.name), + } + lbrule_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + lbrule_status, + "Created Load Balancer Rule details are not as expected" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id, + ) + status = validateList(list_lbrules_after) + self.assertEquals( + PASS, + status[0], + "Load Balancer Rule creation Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbrules_after), + "Load Balancer Rule creation Failed" + ) + # Deleting Load Balancer Rule + lb_rule.delete(self.userapiclient) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are Listed + self.assertIsNone( + list_lbrules_after, + "Failed to delete Load Balancer Rule" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_06_update_lbrule_name(self): + """ + @summary: Test to Update Load Balancer Rule Name for IP Address associated to Non VPC network + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Listing Load Balancer Rules for the IP Address associated in Step2 + Step4: Verifying that no Load Balancer Rules are listed + Step5: Creating a Load Balancer Rule for IP Address associated in Step2 + Step6: Listing Load Balancer Rules for the IP Address associated in Step2 + Step7: Verifying 1 Load Balancer Rule is listed + Step8: Updating the Load Balancer Rule created in Step5 + Step9: Verifying that Load Balancer Rule details are updated + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Lb enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing Networks again + list_networks_after = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_networks_after) + self.assertEquals( + PASS, + status[0], + "Network Creation Failed" + ) + # Verifying network list count is increased by 1 + self.assertEquals( + 1, + len(list_networks_after), + "Network Creation Failed" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_before = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are listed + self.assertIsNone( + list_lbrules_before, + "Load Balancer Rules listed for newly Acquired Ip Address" + ) + self.services["lbrule"]["openfirewall"] = 'false' + # Creating a Load Balancer Rule for Ip Address + lb_rule = LoadBalancerRule.create( + self.userapiclient, + self.services["lbrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + ) + self.assertIsNotNone( + lb_rule, + "Failed to create Load Balancer Rule" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_lbrules_after) + self.assertEquals( + PASS, + status[0], + "Load Balancer Rule creation Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbrules_after), + "Load Balancer Rule creation Failed" + ) + # Updating Load Balancer Rule Name + updated_lb_rule = LoadBalancerRule.update( + lb_rule, + self.userapiclient, + algorithm="source", + name="NewLBRuleName" + ) + self.assertIsNotNone( + updated_lb_rule, + "Failed to update Load Balancer Rule details" + ) + # Verifying details of the updated Load Balancer Rule + # Creating expected and actual values dictionaries + expected_dict = { + "id":lb_rule.id, + "account":lb_rule.account, + "algorithm":"source", + "domainid":lb_rule.domainid, + "name":"NewLBRuleName", + "networkid":lb_rule.networkid, + "zoneid":lb_rule.zoneid, + "privateport":lb_rule.privateport, + "publicip":lb_rule.publicip, + "publicport":lb_rule.publicport, + } + actual_dict = { + "id":updated_lb_rule.id, + "account":updated_lb_rule.account, + "algorithm":updated_lb_rule.algorithm, + "domainid":updated_lb_rule.domainid, + "name":updated_lb_rule.name, + "networkid":updated_lb_rule.networkid, + "zoneid":updated_lb_rule.zoneid, + "privateport":updated_lb_rule.privateport, + "publicip":updated_lb_rule.publicip, + "publicport":updated_lb_rule.publicport, + } + lbrule_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + lbrule_status, + "Updated Load Balancer Rule details are not as expected" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_07_assign_remove_lbrule_toinstance(self): + """ + @summary: Test to Assign and Remove Load Balancer Rule to an Instance + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Launching a VM using the network created in Step 1 + Step4: Creating a Load Balancer Rule for IP Address associated in Step2 + Step5: Listing Load Balancer Rule Instances for applied as true + Step6: Verifying no Load balancer rule instances are listed + Step7: Listing Load Balancer Rule Instances for applied as false + Step8: Verifying that list size is 1 + Step9: Assigning the Instance to Load Balancer Rule + Step10: Listing Load Balancer Rule Instances for applied as true + Step11: Verifying list size is 1 + Step12: Listing Load Balancer Rule Instances for applied as false + Step13: Verifying no Load balancer rule instances are listed + Step14: Removing the Load Balancer Rule assigned form Instance + Step15: Listing Load Balancer Rule Instances for applied as true + Step16: Verifying no Load balancer rule instances are listed + Step17: Listing Load Balancer Rule Instances for applied as false + Step18: Verifying that list size is 1 + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Lb enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching a Virtual Machine with above created Network + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + self.cleanup.append(network) + # Listing Virtual Machines in Running state in the network created above + list_vms_running = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id, + state="Running", + networkid=network.id + ) + status = validateList(list_vms_running) + self.assertEquals( + PASS, + status[0], + "VM Created is not in Running state" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_vms_running), + "VM Created is not in Running state" + ) + self.assertEquals( + vm_created.id, + list_vms_running[0].id, + "VM Created is not in Running state" + ) + # Listing Virtual Machines in Stopped state in the network created above + list_vms_stopped = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id, + state="Stopped", + networkid=network.id + ) + # Verifying that no vms are listed + self.assertIsNone( + list_vms_stopped, + "Created VM is in Stopped state" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_before = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are listed + self.assertIsNone( + list_lbrules_before, + "Load Balancer Rules listed for newly Acquired Ip Address" + ) + self.services["lbrule"]["openfirewall"] = 'false' + # Creating a Load Balancer Rule for Ip Address + lb_rule = LoadBalancerRule.create( + self.userapiclient, + self.services["lbrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + ) + self.assertIsNotNone( + lb_rule, + "Failed to create Load Balancer Rule" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_lbrules_after) + self.assertEquals( + PASS, + status[0], + "Load Balancer Rule creation Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbrules_after), + "Load Balancer Rule creation Failed" + ) + # Listing Load Balancer Rule Instances for applied as true + list_lbruleinstance_applied_true = LoadBalancerRule.listLoadBalancerRuleInstances( + self.userapiclient, + id=lb_rule.id, + applied="true" + ) + # Verifying No Instances are assigned to the Load Balancer Rule + self.assertIsNone( + list_lbruleinstance_applied_true, + "Instances are assigned to Newly created Load Balancer Rule" + ) + # Listing Load Balancer Rule Instances for applied as false + list_lbruleinstance_applied_false = LoadBalancerRule.listLoadBalancerRuleInstances( + self.userapiclient, + id=lb_rule.id, + applied="false" + ) + status = validateList(list_lbruleinstance_applied_false) + self.assertEquals( + PASS, + status[0], + "No Instances are available to assign to Load Balancer Rule" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbruleinstance_applied_false), + "No Instances are available to assign to Load Balancer Rule" + ) + # Verifying that Instance created above is listed + self.assertEquals( + vm_created.id, + list_lbruleinstance_applied_false[0].id, + "Failed to list Instance available to asign a Load Balancer Rule" + ) + # Assigning Instance created to Load Balancer Rule + LoadBalancerRule.assign( + lb_rule, + self.userapiclient, + vms=[vm_created] + ) + # Listing Load Balancer Rule Instances for applied as true + list_lbruleinstance_applied_true = LoadBalancerRule.listLoadBalancerRuleInstances( + self.userapiclient, + id=lb_rule.id, + applied="true" + ) + status = validateList(list_lbruleinstance_applied_false) + self.assertEquals( + PASS, + status[0], + "No Instances are available to assign to Load Balancer Rule" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbruleinstance_applied_false), + "No Instances are available to assign to Load Balancer Rule" + ) + # Verifying Instances is assigned to the Load Balancer Rule + self.assertEquals( + vm_created.id, + list_lbruleinstance_applied_true[0].id, + "Failed to assign Load Balancer Rule to given Instance" + ) + # Listing Load Balancer Rule Instances for applied as false + list_lbruleinstance_applied_false = LoadBalancerRule.listLoadBalancerRuleInstances( + self.userapiclient, + id=lb_rule.id, + applied="false" + ) + # Verifying No Load Balancer Rules Instances are available to assign + self.assertIsNone( + list_lbruleinstance_applied_false, + "Instances are available for assigning a Load Balancer Rule" + ) + # Removing Load balancer Rule from Instance + LoadBalancerRule.remove( + lb_rule, + self.userapiclient, + vms=[vm_created] + ) + # Listing Load Balancer Rule Instances for applied as true + list_lbruleinstance_applied_true = LoadBalancerRule.listLoadBalancerRuleInstances( + self.userapiclient, + id=lb_rule.id, + applied="true" + ) + # Verifying that there are no Instances assigned to the Load Balancer Rule + self.assertIsNone( + list_lbruleinstance_applied_true, + "Instances is assigned to Load balancer Rule" + ) + # Listing Load Balancer Rule Instances for applied as false + list_lbruleinstance_applied_false = LoadBalancerRule.listLoadBalancerRuleInstances( + self.userapiclient, + id=lb_rule.id, + applied="false" + ) + status = validateList(list_lbruleinstance_applied_false) + self.assertEquals( + PASS, + status[0], + "No Instances are available to assign to Load Balancer Rule" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbruleinstance_applied_false), + "No Instances are available to assign to Load Balancer Rule" + ) + # Verifying that Instance created above is listed + self.assertEquals( + vm_created.id, + list_lbruleinstance_applied_false[0].id, + "Failed to list Instance available to asign a Load Balancer Rule" + ) + # Destroying the VM Launched + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_08_list_create_delete_lbsticky_policy(self): + """ + @summary: Test to List, Create, Delete Load Balancer Stickyness Policy + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Creating a Load Balancer Rule for IP Address associated in Step2 + Step4: Listing Load Balancer Sticky Policies for LB Rule created in Step3 + Step5: Verifying that no Load Balancer Sticky Policies are listed + Step6: Creating a Load Balancer Sticky Policies for LB Rule created in Step3 + Step7: Listing Load Balancer Sticky Policies for LB Rule created in Step3 + Step8: Verifying 1 Load Balancer Sticky Policy is listed + Step9: Deleting the Load Balancer Sticky Policies + Step10: Listing Load Balancer Sticky Policies for LB Rule created in Step3 + Step11: Verifying that no Load Balancer Sticky Policies are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Lb enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing Networks again + list_networks_after = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_networks_after) + self.assertEquals( + PASS, + status[0], + "Network Creation Failed" + ) + # Verifying network list count is increased by 1 + self.assertEquals( + 1, + len(list_networks_after), + "Network Creation Failed" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_before = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are listed + self.assertIsNone( + list_lbrules_before, + "Load Balancer Rules listed for newly Acquired Ip Address" + ) + self.services["lbrule"]["openfirewall"] = 'false' + # Creating a Load Balancer Rule for Ip Address + lb_rule = LoadBalancerRule.create( + self.userapiclient, + self.services["lbrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + ) + self.assertIsNotNone( + lb_rule, + "Failed to create Load Balancer Rule" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_lbrules_after) + self.assertEquals( + PASS, + status[0], + "Load Balancer Rule creation Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbrules_after), + "Load Balancer Rule creation Failed" + ) + # Listing Load Balancer Stickyness Policies for LB Rule + list_lbstickypolicy_before = LoadBalancerRule.listStickyPolicies( + self.userapiclient, + lbruleid=lb_rule.id, + listall=self.services["listall"] + ) + # Verifying no Sticky Policies are listed + self.assertEquals( + 0, + len(list_lbstickypolicy_before[0].stickinesspolicy), + "Sticky Policy listed for newly created Load Balancer Rule" + ) + # Creating a Sticy Policy for Load Balancer Rule + sticky_policy = LoadBalancerRule.createSticky( + lb_rule, + self.userapiclient, + methodname='LbCookie', + name='LbCookieSticky' + ) + self.assertIsNotNone( + sticky_policy, + "Failed to create Sticky Policy for Load Balancer Rule" + ) + # Verifying details of Sticky Policy created + # Creating expected and actual values dictionaries + expected_dict = { + "account":self.account.name, + "domainid":self.domain.id, + "lbruleid":lb_rule.id, + "methodname":"LbCookie", + "name":"LbCookieSticky", + } + actual_dict = { + "account":sticky_policy.account, + "domainid":sticky_policy.domainid, + "lbruleid":sticky_policy.lbruleid, + "methodname":sticky_policy.stickinesspolicy[0].methodname, + "name":sticky_policy.stickinesspolicy[0].name, + } + lbstickypolicy_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + lbstickypolicy_status, + "Created Load Balancer Sticky Policy details are not as expected" + ) + # Listing Load Balancer Stickyness Policies for LB Rule + list_lbstickypolicy_after = LoadBalancerRule.listStickyPolicies( + self.userapiclient, + lbruleid=lb_rule.id, + listall=self.services["listall"] + ) + status = validateList(list_lbstickypolicy_after[0].stickinesspolicy) + self.assertEquals( + PASS, + status[0], + "Load Balancer Sticky Policy creation Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbstickypolicy_after[0].stickinesspolicy), + "Load Balancer Sticky Policy creation Failed" + ) + # Deleting the Sticky Policy + deleted = LoadBalancerRule.deleteSticky( + lb_rule, + self.userapiclient, + id=sticky_policy.stickinesspolicy[0].id + ) + # Listing Load Balancer Stickyness Policies for LB Rule + list_lbstickypolicy_after = LoadBalancerRule.listStickyPolicies( + self.userapiclient, + lbruleid=lb_rule.id, + listall=self.services["listall"] + ) + # Verifying no Sticky Policies are listed + self.assertEquals( + 0, + len(list_lbstickypolicy_after[0].stickinesspolicy), + "Sticky Policy listed for newly created Load Balancer Rule" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_09_create_delete_portforwarding_fornonvpc(self): + """ + @summary: Test to list, create and delete Port Forwarding for IP Address associated to Non VPC network + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Launching Virtual Machine in network created in step 2 + Step4: Listing Port Forwarding Rules for the IP Address associated in Step2 + Step5: Verifying that no Port Forwarding Rules are listed + Step6: Creating a Port Forwarding Rule for IP Address associated in Step2 + Step7: Listing Port Forwarding Rules for the IP Address associated in Step2 + Step8: Verifying 1 Port Forwarding Rule is listed + Step9: Deleting the Port Forwarding Rule created in Step6 + Step10: Listing Port Forwarding Rules for the IP Address associated in Step2 + Step11: Verifying that no Port Forwarding Rules are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,PortForwarding", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, PortForwarding enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching a Virtual Machine with above created Network + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + self.cleanup.append(network) + # Listing Virtual Machines in running state in above created network + list_vms_running = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + state="Running", + networkid=network.id + ) + status = validateList(list_vms_running) + self.assertEquals( + PASS, + status[0], + "VM Created is not in Running state" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "VM Created is not in Runnning state" + ) + self.assertEquals( + vm_created.id, + list_vms_running[0].id, + "VM Created is not in Runnning state" + ) + # Listing Virtual Machines in stopped state in above created network + list_vms_stopped = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + state="Stopped", + networkid=network.id + ) + # Verifying no VMs are in stopped state + self.assertIsNone( + list_vms_stopped, + "VM Created is in stopped state" + ) + # Listing Port Forwarding Rules for the IP Address associated + list_prtfwdrule_before = NATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no port forwarding rules are listed + self.assertIsNone( + list_prtfwdrule_before, + "Port Forwarding Rules listed for newly associated IP Address" + ) + # Creating a Port Forwarding rule + portfwd_rule = NATRule.create( + self.userapiclient, + virtual_machine=vm_created, + services=self.services["natrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + ) + self.assertIsNotNone( + portfwd_rule, + "Failed to create Port Forwarding Rule" + ) + # Verifying details of Sticky Policy created + # Creating expected and actual values dictionaries + expected_dict = { + "ipaddressid":associated_ipaddress.ipaddress.id, + "privateport":str(self.services["natrule"]["privateport"]), + "publicport":str(self.services["natrule"]["publicport"]), + "protocol":str(self.services["natrule"]["protocol"]).lower(), + } + actual_dict = { + "ipaddressid":portfwd_rule.ipaddressid, + "privateport":str(portfwd_rule.privateport), + "publicport":str(portfwd_rule.publicport), + "protocol":portfwd_rule.protocol, + } + portfwd_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + portfwd_status, + "Created Port Forward Rule details are not as expected" + ) + # Listing Port Forwarding Rules for the IP Address associated + list_prtfwdrule_after = NATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_prtfwdrule_after) + self.assertEquals( + PASS, + status[0], + "Failed to create Port Forwarding Rule" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_prtfwdrule_after), + "Failed to create Port Forwarding Rule" + ) + # Deleting Port Forwarding Rule + portfwd_rule.delete(self.userapiclient) + # # Listing Port Forwarding Rules for the IP Address associated + list_prtfwdrule_after = NATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no port forwarding rules are listed + self.assertIsNone( + list_prtfwdrule_after, + "Port Forwarding Rules listed after deletion" + ) + # Destroying the VM Launched + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_10_create_delete_portforwarding_forvpc(self): + """ + @summary: Test to list, create and delete Port Forwarding Rule for IP Address associated to VPC + @Steps: + Step1: Creating a VPC for the user + Step2: Creating Network inside VPC + Step3: Associating an IP Addresses for VPC + Step4: Launching a VM in the Network created in Step 2 + Step5: Listing Port Forwarding Rules for the IP Address associated in Step3 + Step6: Verifying that no Port Forwarding Rules are listed + Step7: Creating a Port Forwarding Rule for IP Address associated in Step3 + Step8: Listing Port Forwarding Rules for the IP Address associated in Step3 + Step9: Verifying 1 Port Forwarding Rule is listed + Step10: Deleting the Port Forwarding Rule created in Step7 + Step11: Listing Port Forwarding Rules for the IP Address associated in Step3 + Step12: Verifying that no Port Forwarding Rules are listed + """ + # Listing all the vpc's for a user + list_vpc_before = VPC.list(self.userapiclient) + # Verifying No VPCs are listed + self.assertIsNone( + list_vpc_before, + "VPC's Listed for newly Created User" + ) + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals( + PASS, + status[0], + "list vpc offering is none" + ) + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone( + vpc_created, + "VPC Creation Failed" + ) + # Listing the vpc for a user after creating a vpc + list_vpc_after = VPC.list(self.userapiclient) + status = validateList(list_vpc_after) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_vpc_after), + "list VPC not equal as expected" + ) + #List network offering for vpc = true + network_offering_vpc_true_list = NetworkOffering.list( + self.userapiclient, + forvpc = "true", + zoneid = self.zone.id, + supportedServices = "SourceNat,PortForwarding", + state = "Enabled" + ) + status = validateList(network_offering_vpc_true_list) + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with PortForwarding") + # Creating network under VPC + network_created = Network.create( + self.userapiclient, + self.services["ntwk"], + networkofferingid = network_offering_vpc_true_list[0].id, + vpcid = vpc_created.id, + zoneid=self.zone.id, + gateway= self.services["ntwk"]["gateway"], + netmask = self.services["ntwk"]["netmask"] + ) + self.assertIsNotNone( + network_created, + "Network is not created" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "list IP Addresses not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_ipaddresses_before), + "list IP Addresses not equal as expected" + ) + # Associating an IP Addresses to VPC created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + vpcid=vpc_created.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + len(list_ipaddresses_before) + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching a Virtual Machine with above created Network + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network_created.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + self.cleanup.append(network_created) + self.cleanup.append(vpc_created) + # Listing Port Forwarding Rules for the IP Address associated + list_prtfwdrule_before = NATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no port forwarding rules are listed + self.assertIsNone( + list_prtfwdrule_before, + "Port Forwarding Rules listed for newly associated IP Address" + ) + # Creating a Port Forwarding rule + portfwd_rule = NATRule.create( + self.userapiclient, + virtual_machine=vm_created, + services=self.services["natrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + networkid=network_created.id + ) + self.assertIsNotNone( + portfwd_rule, + "Failed to create Port Forwarding Rule" + ) + # Verifying details of Sticky Policy created + # Creating expected and actual values dictionaries + expected_dict = { + "ipaddressid":associated_ipaddress.ipaddress.id, + "privateport":str(self.services["natrule"]["privateport"]), + "publicport":str(self.services["natrule"]["publicport"]), + "protocol":str(self.services["natrule"]["protocol"]).lower(), + } + actual_dict = { + "ipaddressid":portfwd_rule.ipaddressid, + "privateport":str(portfwd_rule.privateport), + "publicport":str(portfwd_rule.publicport), + "protocol":portfwd_rule.protocol, + } + portfwd_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + portfwd_status, + "Created Port Forward Rule details are not as expected" + ) + # Listing Port Forwarding Rules for the IP Address associated + list_prtfwdrule_after = NATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_prtfwdrule_after) + self.assertEquals( + PASS, + status[0], + "Failed to create Port Forwarding Rule" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_prtfwdrule_after), + "Failed to create Port Forwarding Rule" + ) + # Deleting Port Forwarding Rule + portfwd_rule.delete(self.userapiclient) + # # Listing Port Forwarding Rules for the IP Address associated + list_prtfwdrule_after = NATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no port forwarding rules are listed + self.assertIsNone( + list_prtfwdrule_after, + "Port Forwarding Rules listed after deletion" + ) + # Destroying the VM Launched + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_11_create_delete_firewallrule(self): + """ + @summary: Test to list, create and delete Firewall Rule for IP Address associated to Non VPC network + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Listing Firewall Rules for the IP Address associated in Step2 + Step4: Verifying that no Rules are listed + Step5: Creating a Firewall Rule for IP Address associated in Step2 + Step6: Listing Firewall Rules for the IP Address associated in Step2 + Step7: Verifying 1 Firewall Rule is listed + Step8: Deleting the Firewall Rule created in Step5 + Step9: Listing Firewall Rules for the IP Address associated in Step2 + Step10: Verifying that no Firewall Rules are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Firewall", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Firewall enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Firewall rules for the IP Associated + list_firewalls_before = FireWallRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no firewall rules are listed + self.assertIsNone( + list_firewalls_before, + "Firewall Rules listed for newly associated IP Address" + ) + # Creating a Firewall Rule + firewall_rule = FireWallRule.create( + self.userapiclient, + ipaddressid=associated_ipaddress.ipaddress.id, + protocol='tcp', + cidrlist='10.1.1.1/16', + startport='22', + endport='2222' + ) + self.assertIsNotNone( + firewall_rule, + "Failed to create Firewall Rule" + ) + # Verifying details of the created Firewall Rule + # Creating expected and actual values dictionaries + expected_dict = { + "ipaddressid":associated_ipaddress.ipaddress.id, + "startport":"22", + "endport":"2222", + "protocol":"tcp", + "cidrlist":"10.1.1.1/16" + } + actual_dict = { + "ipaddressid":firewall_rule.ipaddressid, + "startport":firewall_rule.startport, + "endport":firewall_rule.endport, + "protocol":firewall_rule.protocol, + "cidrlist":firewall_rule.cidrlist + } + firewall_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + firewall_status, + "Created Firewall Rule details are not as expected" + ) + # Listing Firewall rules for the IP Associated + list_firewalls_after = FireWallRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_firewalls_after) + self.assertEquals( + PASS, + status[0], + "Failed to create Firewall Rule" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_firewalls_after), + "Failed to create Firewall Rule" + ) + # Deleting the Firewall Rule + firewall_rule.delete(self.userapiclient) + # Listing Firewall rules for the IP Associated + list_firewalls_after = FireWallRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no firewall rules are listed + self.assertIsNone( + list_firewalls_after, + "Failed to create Firewall Rule" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_12_create_delete_remoteaccessvpn(self): + """ + @summary: Test to list, create and delete Remote Access VPNs + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Listing Remore Access VPNs for the IP Address associated in Step2 + Step4: Verifying that no Remore Access VPNs are listed + Step5: Creating a Remore Access VPN for IP Address associated in Step2 + Step6: Listing Remore Access VPNs for the IP Address associated in Step2 + Step7: Verifying 1 Remore Access VPN is listed + Step8: Deleting the Remore Access VPNs created in Step5 + Step9: Listing Remore Access VPNs for the IP Address associated in Step2 + Step10: Verifying that no Remore Access VPNs are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Vpn", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Vpn enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Remote access VPNs for the IP Associated + list_vpns_before = Vpn.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no Remote Access VPNs are listed + self.assertIsNone( + list_vpns_before, + "Remote Access VPNs listed for newly associated IP Address" + ) + # Creating a Remote Access VPN + vpn_created = Vpn.create( + self.userapiclient, + publicipid=associated_ipaddress.ipaddress.id, + account=self.account.name, + domainid=self.domain.id, + openfirewall='false' + ) + self.assertIsNotNone( + vpn_created, + "Failed to create Remote Access VPN" + ) + # Verifying details of the created Remote Access VPN + # Creating expected and actual values dictionaries + expected_dict = { + "ipaddressid":associated_ipaddress.ipaddress.id, + "account":self.account.name, + "domainid":self.domain.id, + "state":"Running", + } + actual_dict = { + "ipaddressid":vpn_created.publicipid, + "account":vpn_created.account, + "domainid":vpn_created.domainid, + "state":vpn_created.state, + } + vpn_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + vpn_status, + "Created Remote Access VPN details are not as expected" + ) + # Listing Remote Access VPNs for the IP Associated + list_vpns_after = Vpn.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_vpns_after) + self.assertEquals( + PASS, + status[0], + "Failed to create Remote Access VPN" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_vpns_after), + "Failed to create Remote Access VPN" + ) + # Deleting the Remote Access VPN + vpn_created.delete(self.userapiclient) + # Listing Remote Access VPNs for the IP Associated + list_vpns_after = Vpn.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no Remote Access VPNs are listed + self.assertIsNone( + list_vpns_after, + "Failed to create Remote Access VPN" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_13_add_remove_vpnusers(self): + """ + @summary: Test to list, add and remove VPN Users + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Launching a VM under network created in Step1 + Step4: Creating Remote Access VPN + Step5: Listing VPN Users + Step6: Verifying that no VPN Users are listed + Step7: Adding a VPN user + Step8: Listing VPN Users + Step9: Verifying 1 VPN is listed + Step10: Deleting VPN user + Step11: Listing VPN Users + Step12: Verifying that no VPN Users are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Vpn", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Vpn enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Listing Remote access VPNs for the IP Associated + list_vpns_before = Vpn.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no Remote Access VPNs are listed + self.assertIsNone( + list_vpns_before, + "Remote Access VPNs listed for newly associated IP Address" + ) + # Creating a Remote Access VPN + vpn_created = Vpn.create( + self.userapiclient, + publicipid=associated_ipaddress.ipaddress.id, + account=self.account.name, + domainid=self.domain.id, + openfirewall='false' + ) + self.assertIsNotNone( + vpn_created, + "Failed to create Remote Access VPN" + ) + # Listing Remote Access VPNs for the IP Associated + list_vpns_after = Vpn.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_vpns_after) + self.assertEquals( + PASS, + status[0], + "Failed to create Remote Access VPN" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_vpns_after), + "Failed to create Remote Access VPN" + ) + # Listing VPN Users + list_vpnusers_beore = VpnUser.list( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + # Verifying no VPN Users listed + self.assertIsNone( + list_vpnusers_beore, + "VPN Users listed for newly created VPN" + ) + # Creating a VPN User + vpnuser_created = VpnUser.create( + self.userapiclient, + username=self.services["vpn_user"]["username"], + password=self.services["vpn_user"]["password"], + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNotNone( + vpnuser_created, + "Failed to create VPN User" + ) + # Listing VPN Users + list_vpnusers_after = VpnUser.list( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_vpnusers_after) + self.assertEquals( + PASS, + status[0], + "Failed to list VPN user after creation" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_vpnusers_after), + "Failed to list VPN user after creation" + ) + # Deleting the VPN User + vpnuser_created.delete(self.userapiclient) + # Listing VPN Users + list_vpnusers_after = VpnUser.list( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + # Verifying no VPN Users are listed + self.assertIsNone( + list_vpnusers_after, + "VPN User listed after deletion" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_14_enable_disable_staticnat_fornonvpc(self): + """ + @summary: Test to Enable and Disable StaticNat for IP Address associated to Non VPC Network + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network created in step1 + Step3: Associating one more Ip Address to Network created in step1 + Step4: Launching the VM in network created in step1 + Step5: Enabling the staticNat to IP Associated in Step3 + Step6: Verifying that StaticNat is enabled + Step7: Disabling the staticNat to IP Associated in Step3 + Step8: Verifying that StaticNat is disabled + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,StaticNat", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Vpn enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress1 = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress1, + "Failed to Associate IP Address" + ) + # Associating another IP Addresses to Network created + associated_ipaddress2 = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress2, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 2, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching a Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Enabling static Nat for Ip Address associated + StaticNATRule.enable( + self.userapiclient, + ipaddressid=associated_ipaddress2.ipaddress.id, + virtualmachineid=vm_created.id, + ) + # Listing Ip Address by id + list_ipaddress = PublicIPAddress.list( + self.userapiclient, + id=associated_ipaddress2.ipaddress.id, + listall=self.services["listall"] + ) + status = validateList(list_ipaddress) + self.assertEquals( + PASS, + status[0], + "Failed to List IP Address" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddress), + "Failed to List IP Address" + ) + self.assertEquals( + True, + list_ipaddress[0].isstaticnat, + "Failed to Enable Static Nat" + ) + # Disabling static Nat + StaticNATRule.disable( + self.userapiclient, + ipaddressid=associated_ipaddress2.ipaddress.id + ) + # Listing Ip Address by id + list_ipaddress = PublicIPAddress.list( + self.userapiclient, + id=associated_ipaddress2.ipaddress.id, + listall=self.services["listall"] + ) + status = validateList(list_ipaddress) + self.assertEquals( + PASS, + status[0], + "Failed to List IP Address" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddress), + "Failed to List IP Address" + ) + self.assertEquals( + False, + list_ipaddress[0].isstaticnat, + "Failed to Disable Static Nat" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_15_enable_disable_staticnat_forvpc(self): + """ + @summary: Test to Enable and Disable StaticNat for IP Address associated to VPC Network + @Steps: + Step1: Creating a VPC + Step2: Creating a Network under VPC for the user + Step3: Associating an IP Addresses for Network created in step1 + Step4: Launching the VM in network created in step2 + Step5: Enabling the staticNat to IP Associated in Step3 + Step6: Verifying that StaticNat is enabled + Step7: Disabling the staticNat to IP Associated in Step3 + Step8: Verifying that StaticNat is disabled + """ + # Listing all the vpc's for a user + list_vpc_before = VPC.list(self.userapiclient) + # Verifying No VPCs are listed + self.assertIsNone( + list_vpc_before, + "VPC's Listed for newly Created User" + ) + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals( + PASS, + status[0], + "list vpc offering is none" + ) + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone( + vpc_created, + "VPC Creation Failed" + ) + # Listing the vpc for a user after creating a vpc + list_vpc_after = VPC.list(self.userapiclient) + status = validateList(list_vpc_after) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_vpc_after), + "list VPC not equal as expected" + ) + #List network offering for vpc = true + network_offering_vpc_true_list = NetworkOffering.list( + self.userapiclient, + forvpc = "true", + zoneid = self.zone.id, + supportedServices = "SourceNat,PortForwarding,StaticNat", + state = "Enabled" + ) + status = validateList(network_offering_vpc_true_list) + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with PortForwarding") + # Creating network under VPC + network_created = Network.create( + self.userapiclient, + self.services["ntwk"], + networkofferingid = network_offering_vpc_true_list[0].id, + vpcid = vpc_created.id, + zoneid=self.zone.id, + gateway= self.services["ntwk"]["gateway"], + netmask = self.services["ntwk"]["netmask"] + ) + self.assertIsNotNone( + network_created, + "Network is not created" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "list IP Addresses not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_ipaddresses_before), + "list IP Addresses not equal as expected" + ) + # Associating an IP Addresses to VPC created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + vpcid=vpc_created.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + len(list_ipaddresses_before) + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching a Virtual Machine with above created Network + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network_created.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + self.cleanup.append(network_created) + self.cleanup.append(vpc_created) + # Enabling static Nat for Ip Address associated + StaticNATRule.enable( + self.userapiclient, + ipaddressid=associated_ipaddress.ipaddress.id, + virtualmachineid=vm_created.id, + networkid=network_created.id + ) + # Listing Ip Address by id + list_ipaddress = PublicIPAddress.list( + self.userapiclient, + id=associated_ipaddress.ipaddress.id, + listall=self.services["listall"] + ) + status = validateList(list_ipaddress) + self.assertEquals( + PASS, + status[0], + "Failed to List IP Address" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddress), + "Failed to List IP Address" + ) + self.assertEquals( + True, + list_ipaddress[0].isstaticnat, + "Failed to Enable Static Nat" + ) + # Disabling static Nat + StaticNATRule.disable( + self.userapiclient, + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Listing Ip Address by id + list_ipaddress = PublicIPAddress.list( + self.userapiclient, + id=associated_ipaddress.ipaddress.id, + listall=self.services["listall"] + ) + status = validateList(list_ipaddress) + self.assertEquals( + PASS, + status[0], + "Failed to List IP Address" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddress), + "Failed to List IP Address" + ) + self.assertEquals( + False, + list_ipaddress[0].isstaticnat, + "Failed to Disable Static Nat" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_16_create_delete_ipforwardingrule(self): + """ + @summary: Test to list, create and delete IP Forwarding Rules for IP Address + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network created in step1 + Step3: Associating one more Ip Address to Network created in step1 + Step4: Launching the VM in network created in step1 + Step5: Enabling the staticNat to IP Associated in Step3 + Step6: Listing IP Forwarding rules + Step7: Verifying no IP Forwarding rules are listed + Step8: Creating a IP Forwarding Rule + Step9: Listing IP Forwarding rules + Step10: Verifying 1 IP Forwarding rule is listed + Step11: Deleting the IP Forwarding rule + Step12: Listing IP Forwarding rules + Step13: Verifying no IP Forwarding rules are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Vpn", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Vpn enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress1 = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress1, + "Failed to Associate IP Address" + ) + # Associating another IP Addresses to Network created + associated_ipaddress2 = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress2, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 2, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching a Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Enabling static Nat for Ip Address associated + StaticNATRule.enable( + self.userapiclient, + ipaddressid=associated_ipaddress2.ipaddress.id, + virtualmachineid=vm_created.id, + ) + # Listing Ip Address by id + list_ipaddress = PublicIPAddress.list( + self.userapiclient, + id=associated_ipaddress2.ipaddress.id, + listall=self.services["listall"] + ) + status = validateList(list_ipaddress) + self.assertEquals( + PASS, + status[0], + "Failed to List IP Address" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddress), + "Failed to List IP Address" + ) + self.assertEquals( + True, + list_ipaddress[0].isstaticnat, + "Failed to Enable Static Nat" + ) + # Listing IP Forwarding Rules + list_ipfwdrule_before = StaticNATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress2.ipaddress.id + ) + # Verifying no IP Forwarding Rules are listed + self.assertIsNone( + list_ipfwdrule_before, + "IP Forwardign Rule listed for newly enabled StaticNat IP" + ) + # Creating IP Forwardign Rule + ipfwd_rule = StaticNATRule.createIpForwardingRule( + self.userapiclient, + startport='80', + endport='89', + protocol='tcp', + ipaddressid=associated_ipaddress2.ipaddress.id, + openfirewall=False + ) + self.assertIsNotNone( + ipfwd_rule, + "Failed to create IP Forwarding Rule" + ) + # Listing IP Forwarding Rules + list_ipfwdrule_after = StaticNATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress2.ipaddress.id + ) + status = validateList(list_ipfwdrule_after) + self.assertEquals( + PASS, + status[0], + "Failed to List IP Forwarding Rule after Creation" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipfwdrule_after), + "Failed to List IP Forwarding Rule after Creation" + ) + # Deleting IP Forwarding Rule + ipfwd_rule.delete(self.userapiclient) + # Listing IP Forwarding Rules + list_ipfwdrule_after = StaticNATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress2.ipaddress.id + ) + # Verifying no IP Forwarding Rules are listed + self.assertIsNone( + list_ipfwdrule_after, + "IP Forwardign Rule listed after deletion" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_17_create_update_autoscalepolicy(self): + """ + @summary: Test to list, create and update Autoscale Policy + @Steps: + Step1: Creating a Network Offering for Supported Service LB with Netscaler + Step2: Create a Network using Network Offering created in Step1 + Step3: Launching a VM using Network created in Step2 + Step4: Associating IP Address for Network created in Step2 + Step5: Listing Counters + Step6: Listing Conditions for the user + Step7: Verifying no Conditions are listed + Step8: Creating a 2 conditions + Step9: Listing conditions again + Step10: Verifying 2 conditions are listed + Step11: Listing Autoscale Policies for User + Step12: Verifying No Autoscale policy is listed + Step13: Creating Autoscale Policy using Condition1 + Step14: Verifying that Autoscale Policy is created with Condition1 + Step15: Listing Autoscale Policies + Step16: Verifying 1 Autoscale Policy is listed + Step17: Updating Autoscale Policy created in step13 with condition2 + Step18: Verifying Autoscale policy is updated with condition2 + """ + # Listing Network Offerings + list_nwoff_before = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + # Creating Network Offerign with LB as Netscalar + nwoff_created = NetworkOffering.create( + self.apiClient, + self.services["nw_off_isolated_netscaler"] + ) + self.assertIsNotNone( + nwoff_created, + "Failed to Create Network Offering with LB sercvice for Netscaler" + ) + # Enable Network offering + nwoff_created.update(self.apiClient, state='Enabled') + # Listing Network Offerings again + list_nwoff_after = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + self.assertEquals( + len(list_nwoff_before)+1, + len(list_nwoff_after), + "Failed to create Network Offering" + ) + # Creating a Network Using the Network Offering + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=nwoff_created.id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + self.cleanup.append(nwoff_created) + # Launching a Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed while launching a VM" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_before), + "IP Addresses Association Failed while launching a VM" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 2, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Counters + list_counters = Autoscale.listCounters( + self.userapiclient, + ) + status = validateList(list_counters) + self.assertEquals( + PASS, + status[0], + "Failed to list counters" + ) + # Listing Conditions + list_conditions_before = Autoscale.listConditions( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNone( + list_conditions_before, + "Listed Conditions for newly created user" + ) + # Creating first Condition + condition_created1 = Autoscale.createCondition( + self.userapiclient, + counterid=list_counters[0].id, + relationaloperator='GT', + threshold='1000' + ) + self.assertIsNotNone( + condition_created1, + "Failed to create Condition" + ) + # Creating second Condition + condition_created2 = Autoscale.createCondition( + self.userapiclient, + counterid=list_counters[0].id, + relationaloperator='GT', + threshold='1500' + ) + self.assertIsNotNone( + condition_created2, + "Failed to create Condition" + ) + # Listing Conditions again + list_conditions_after = Autoscale.listConditions( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_conditions_after) + self.assertEquals( + PASS, + status[0], + "Failed to list Conditions after creation" + ) + # Listing Autoscale policies + list_autoscalepolicies_before = Autoscale.listAutoscalePolicies( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no Autoscale policies are listed + self.assertIsNone( + list_autoscalepolicies_before, + "Autoscale policies listed" + ) + # Creating Autoscale Policy + autoscalepolicy_created = Autoscale.createAutoscalePolicy( + self.userapiclient, + action='scaleup', + conditionids=condition_created1.id, + duration='100', + quiettime='100' + ) + self.assertIsNotNone( + autoscalepolicy_created, + "Failed to create Autoscale VM Policy" + ) + # Verifying autoscalepolicy is created using condition1 + self.assertEquals( + condition_created1.id, + autoscalepolicy_created.conditions[0].id, + "Autoscale Policy not created by given condition" + ) + # Listing Autoscale policies + list_autoscalepolicies_after = Autoscale.listAutoscalePolicies( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_autoscalepolicies_after) + self.assertEquals( + PASS, + status[0], + "Failed to list Autoscale Policy after creation" + ) + self.assertEquals( + 1, + len(list_autoscalepolicies_after), + "Autoscale Policies count is not matching" + ) + # Updating Autoscale Policy + autoscalepolicy_updated = Autoscale.updateAutoscalePolicy( + self.userapiclient, + id=autoscalepolicy_created.id, + conditionids=condition_created2.id, + duration='100', + quiettime='100' + ) + self.assertIsNotNone( + autoscalepolicy_updated, + "Failed to update Autoscale Policy" + ) + # Verifying the Autoscale Policy is updated + self.assertEquals( + condition_created2.id, + autoscalepolicy_updated.conditions[0].id, + "Autoscale Policy not updated to given condition" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_18_create_update_autoscaleprofiles(self): + """ + @summary: Test to list, create and update Autoscale VM Profiles + @Steps: + Step1: Creating a Network Offering for Supported Service LB with Netscaler + Step2: Create a Network using Network Offering created in Step1 + Step3: Launching a VM using Network created in Step2 + Step4: Associating IP Address for Network created in Step2 + Step5: Listing Available Service Offerings + Step6: Listing all types of templates + Step7: Verifying only featured templates are listed for newly created user + Step8: Listing autoscale vm profiles + Step9: Verifying no Autoscale VM Profiles are listed + Step10: Creating a Autoscale VM Profile + Step11: Listing Autoscale VM Profile + Step12: Verifying 1 Autoscale VM Profile is listed + Step13: Listing Autoscale VM Profile by id + Step14: Verifying details of the created autoscale vm profile are matching with listed autoscal vm profile + Step15: Updating Autoscale VM profile with destroy vm grace period + Step16: Verifying that Autoscale VM is updated + """ + # Listing Network Offerings + list_nwoff_before = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + # Creating Network Offerign with LB as Netscalar + nwoff_created = NetworkOffering.create( + self.apiClient, + self.services["nw_off_isolated_netscaler"] + ) + self.assertIsNotNone( + nwoff_created, + "Failed to Create Network Offering with LB sercvice for Netscaler" + ) + # Enable Network offering + nwoff_created.update(self.apiClient, state='Enabled') + # Listing Network Offerings again + list_nwoff_after = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + self.assertEquals( + len(list_nwoff_before)+1, + len(list_nwoff_after), + "Failed to create Network Offering" + ) + # Creating a Network Using the Network Offering + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=nwoff_created.id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + self.cleanup.append(nwoff_created) + # Launching a Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed while launching a VM" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_before), + "IP Addresses Association Failed while launching a VM" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 2, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Service Offerings + list_service_offerings = ServiceOffering.list( + self.userapiclient, + listall=self.services["listall"], + issystem='false' + ) + status = validateList(list_service_offerings) + self.assertEquals( + PASS, + status[0], + "Failed to list Service Offerings" + ) + # Listing Users + list_users = User.list( + self.apiClient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_users) + self.assertEquals( + PASS, + status[0], + "Failed to list Users" + ) + # Listing Featured Templates + list_templates_featured = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter="featured", + zoneid=self.zone.id + ) + status = validateList(list_templates_featured) + self.assertEquals( + PASS, + status[0], + "Failed to list Featured Templates" + ) + # Listing Community Templates + list_templates_community = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter="community", + zoneid=self.zone.id + ) + self.assertIsNone( + list_templates_community, + "Community Templates listed for newly created User" + ) + # Listing selfexecutable Templates + list_templates_selfexecutable = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter="selfexecutable", + zoneid=self.zone.id + ) + self.assertIsNone( + list_templates_selfexecutable, + "Self Executable Templates listed for newly created User" + ) + # Listing Autoscale VM Profiles + list_autoscalevm_profiles_before = Autoscale.listAutoscaleVmPofiles( + self.userapiclient, + listall=self.services["listall"] + ) + self.assertIsNone( + list_autoscalevm_profiles_before, + "Autoscale VM Profiles listed" + ) + # Creating Autoscale VM Profile + counterparam = { "snmpcommunity": "public", "snmpport": "161"} + autoscalevm_profile = Autoscale.createAutoscaleVmProfile( + self.userapiclient, + serviceofferingid=list_service_offerings[0].id, + zoneid=self.zone.id, + templateid=list_templates_featured[0].id, + autoscaleuserid=list_users[0].id, + destroyvmgraceperiod='100', + counterparam=counterparam + ) + self.assertIsNotNone( + autoscalevm_profile, + "Failed to create Autoscale VM Profile" + ) + # Listing Autoscale VM Profiles + list_autoscalevm_profiles_after = Autoscale.listAutoscaleVmPofiles( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_autoscalevm_profiles_after) + self.assertEquals( + PASS, + status[0], + "Failed to list Autoscale VM Profile after creation" + ) + # Verifying only 1 autoscale vm profile is created + self.assertEquals( + 1, + len(list_autoscalevm_profiles_after), + "Count of Autoscale VM profiles listed is not matching" + ) + # Listing the Autoscale VM Profile by id + list_autoscalvmprofile = Autoscale.listAutoscaleVmPofiles( + self.userapiclient, + listall=self.services["listall"], + id=autoscalevm_profile.id + ) + status = validateList(list_autoscalvmprofile) + self.assertEquals( + PASS, + status[0], + "Failed to list Autoscale VM Profile by Id after creation" + ) + # Verifying details of the listed Autoscale VM Profile + # Creating expected and actual values dictionaries + expected_dict = { + "id":autoscalevm_profile.id, + "account":self.account.name, + "domainid":self.domain.id, + "autoscaleuserid":list_users[0].id, + "serviceofferingid":list_service_offerings[0].id, + "zoneid":self.zone.id, + "templateid":list_templates_featured[0].id, + "destroyvmgraceperiod":autoscalevm_profile.destroyvmgraceperiod + } + actual_dict = { + "id":list_autoscalvmprofile[0].id, + "account":list_autoscalvmprofile[0].account, + "domainid":list_autoscalvmprofile[0].domainid, + "autoscaleuserid":list_autoscalvmprofile[0].autoscaleuserid, + "serviceofferingid":list_autoscalvmprofile[0].serviceofferingid, + "zoneid":list_autoscalvmprofile[0].zoneid, + "templateid":list_autoscalvmprofile[0].templateid, + "destroyvmgraceperiod":list_autoscalvmprofile[0].destroyvmgraceperiod + } + autoscalevm_profile_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + autoscalevm_profile_status, + "Created Autoscale VM Profile details are not as expected" + ) + # Updating destroyvmgrageperiod for created Autoscale VM Profile + autoscalevm_profile_updated = Autoscale.updateAutoscaleVMProfile( + self.userapiclient, + id=autoscalevm_profile.id, + autoscaleuserid=list_users[0].id, + destroyvmgraceperiod='200', + templateid=list_templates_featured[0].id, + ) + self.assertIsNotNone( + autoscalevm_profile_updated, + "Failed to update Autoscale VM Profile" + ) + # Verifyign that Destroy VM Graceperiod is updated in autoscale VM Profile + self.assertEquals( + 200, + autoscalevm_profile_updated.destroyvmgraceperiod, + "Failed to update destroy vm grace period" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_19_create_update_autoscalevmgroup(self): + """ + @summary: Test to list, create, update, enable, disable Autoscale VM Profiles + @Steps: + Step1: Creating a Network Offering for Supported Service LB with Netscaler + Step2: Create a Network using Network Offering created in Step1 + Step3: Launching a VM using Network created in Step2 + Step4: Associating IP Address for Network created in Step2 + Step5: Creating Scaleup condition and scaleup policy + Step6: Creating Scaledown condition and scaledown policy + Step7: Creating Autoscale VM profile + Step8: Creating Load Balancer Rule + Step9: Listing Autoscale Vm groups and verifying no Autoscale VM groups are listed + Step10: Creating Autoscale VM Group and verifying it was created + Step11: Listing Autoscale Vm groups and verifying 1 Autoscale VM groups is listed + Step12: Disabling Autoscale VM group and verifying it was disabled + Step13: Updating Autoscale VM group and verifying it was updated + Step14: Enabling Autoscale VM group and verifying it was enabled + """ + # Listing Network Offerings + list_nwoff_before = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + # Creating Network Offerign with LB as Netscalar + nwoff_created = NetworkOffering.create( + self.apiClient, + self.services["nw_off_isolated_netscaler"] + ) + self.assertIsNotNone( + nwoff_created, + "Failed to Create Network Offering with LB sercvice for Netscaler" + ) + # Enable Network offering + nwoff_created.update(self.apiClient, state='Enabled') + # Listing Network Offerings again + list_nwoff_after = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + self.assertEquals( + len(list_nwoff_before)+1, + len(list_nwoff_after), + "Failed to create Network Offering" + ) + # Creating a Network Using the Network Offering + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=nwoff_created.id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + self.cleanup.append(nwoff_created) + # Launching a Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed while launching a VM" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_before), + "IP Addresses Association Failed while launching a VM" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 2, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Users + list_users = User.list( + self.apiClient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_users) + self.assertEquals( + PASS, + status[0], + "Failed to list Users" + ) + # Listing counters + list_counters = Autoscale.listCounters(self.userapiclient) + status = validateList(list_counters) + self.assertEquals( + PASS, + status[0], + "Failed to list Counters" + ) + # Create Condition for scaleup Vm Policy + condition_scaleup = Autoscale.createCondition( + self.userapiclient, + counterid=list_counters[0].id, + relationaloperator='GT', + threshold='40' + ) + self.assertIsNotNone( + condition_scaleup, + "Failed to create Scaleup Condition" + ) + # Creating scaleup Vm Policy + scaleup_policy = Autoscale.createAutoscalePolicy( + self.userapiclient, + action='scaleup', + conditionids=condition_scaleup.id, + duration='40', + quiettime='300' + ) + self.assertIsNotNone( + scaleup_policy, + "Failed to create Scaleup VM Policy" + ) + # Create Condition for scaledown Vm Policy + condition_scaledown = Autoscale.createCondition( + self.userapiclient, + counterid=list_counters[0].id, + relationaloperator='GT', + threshold='10' + ) + self.assertIsNotNone( + condition_scaledown, + "Failed to create Scaledown Condition" + ) + # Creating scaledown Vm Policy + scaledown_policy = Autoscale.createAutoscalePolicy( + self.userapiclient, + action='scaledown', + conditionids=condition_scaledown.id, + duration='40', + quiettime='300' + ) + self.assertIsNotNone( + scaledown_policy, + "Failed to create Scaledown VM Policy" + ) + counterparam = { "snmpcommunity": "public", "snmpport": "161"} + # Create Autoscale VM Profile + vmprofile = Autoscale.createAutoscaleVmProfile( + self.userapiclient, + serviceofferingid=self.service_offering.id, + zoneid=self.zone.id, + templateid=self.template.id, + autoscaleuserid=list_users[0].id, + destroyvmgraceperiod='30', + counterparam=counterparam + ) + self.assertIsNotNone( + vmprofile, + "Failed to create Autoscale Vm Profile" + ) + self.services["lbrule"]["openfirewall"] = False + # Creating Load Balancer Rule + lbrule = LoadBalancerRule.create( + self.userapiclient, + self.services["lbrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + accountid=self.account.name, + networkid=network.id, + domainid=self.domain.id + ) + self.assertIsNotNone( + lbrule, + "Failed to create Load Balancer Rule" + ) + # Listing Autoscale VM Groups + list_vmgroup_before = Autoscale.listAutoscaleVmGroup( + self.userapiclient, + listall=self.services["listall"], + lbruleid=lbrule.id + ) + # Verifying No Autoscale VM Groups are listed + self.assertIsNone( + list_vmgroup_before, + "Listed Autoscale VM Groups for newly created LB Rule" + ) + # Creating Autoscale VM Group + vmgroup = Autoscale.createAutoscaleVmGroup( + self.userapiclient, + lbruleid=lbrule.id, + minmembers='3', + maxmembers='10', + scaledownpolicyids=scaledown_policy.id, + scaleuppolicyids=scaleup_policy.id, + vmprofileid=vmprofile.id, + interval='30' + ) + self.assertIsNotNone( + vmgroup, + "Failed to create Autoscale VM Group" + ) + # Listing Autoscale VM Groups + list_vmgroup_after = Autoscale.listAutoscaleVmGroup( + self.userapiclient, + listall=self.services["listall"], + lbruleid=lbrule.id + ) + status = validateList(list_vmgroup_after) + self.assertEquals( + PASS, + status[0], + "Failed to list Autoscale VM group after creation" + ) + # Verifying only 1 Autoscale VM group is listed + self.assertEquals( + 1, + len(list_vmgroup_after), + "Autoscale VM group list count is not matching" + ) + # Disabling Autoscale VM group + vmgroup_disabled = Autoscale.disableAutoscaleVmGroup( + self.userapiclient, + id=vmgroup.id + ) + self.assertIsNotNone( + vmgroup_disabled, + "Failed to disable Autoscale VM group" + ) + # Verifyign the state of the VM Group afte renabling + self.assertEquals( + "disabled", + vmgroup_disabled.state, + "Disabled VM Group state is not matching" + ) + # Updating Autoscale VM Group + vmgroup_updated = Autoscale.updateAutoscaleVMGroup( + self.userapiclient, + id=vmgroup.id, + minmembers='3', + maxmembers='10', + scaledownpolicyids=scaledown_policy.id, + scaleuppolicyids=scaleup_policy.id, + interval='40' + ) + self.assertIsNotNone( + vmgroup_updated, + "Failed to update Autoscale VM group" + ) + self.assertEquals( + 40, + vmgroup_updated.interval, + "Updated Autoscale VM group interval value is not matching" + ) + # Enabling Autoscale VM group + vmgroup_enabled = Autoscale.enableAutoscaleVmGroup( + self.userapiclient, + id=vmgroup.id + ) + self.assertIsNotNone( + vmgroup_enabled, + "Failed to enable Autoscale VM group" + ) + # Verifyign the state of the VM Group afte renabling + self.assertEquals( + "enabled", + vmgroup_enabled.state, + "Enabled VM Group state is not matching" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + \ No newline at end of file diff --git a/test/integration/component/test_escalations_isos.py b/test/integration/component/test_escalations_isos.py new file mode 100644 index 0000000000..387a681a03 --- /dev/null +++ b/test/integration/component/test_escalations_isos.py @@ -0,0 +1,783 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackAPI import (createVolume, + createTemplate) +from marvin.lib.base import (Volume, + Iso, + VirtualMachine, + Template, + Snapshot, + SecurityGroup, + Account, + Zone, + Network, + NetworkOffering, + DiskOffering, + ServiceOffering, + VmSnapshot, + SnapshotPolicy, + SSHKeyPair, + Resources, + Configurations, + VpnCustomerGateway, + Hypervisor, + VpcOffering, + VPC, + NetworkACL) +from marvin.lib.common import (get_zone, + get_domain, + get_template, + list_os_types) +from marvin.lib.utils import (validateList, + cleanup_resources, + random_gen) +from marvin.codes import (PASS, FAIL, EMPTY_LIST) +from nose.plugins.attrib import attr +import time + +class TestIsos(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestIsos, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + cls.hypervisor = cls.testClient.getHypervisorInfo() + cls.services['mode'] = cls.zone.networktype + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls._cleanup.append(cls.account) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_01_list_isos_pagination(self): + """ + @Desc: Test to List ISO's pagination + @steps: + Step1: Listing all the ISO's for a user + Step2: Verifying that no ISO's are listed + Step3: Creating (page size + 1) number of ISO's + Step4: Listing all the ISO's again for a user + Step5: Verifying that list size is (page size + 1) + Step6: Listing all the ISO's in page1 + Step7: Verifying that list size is (page size) + Step8: Listing all the ISO's in page2 + Step9: Verifying that list size is 1 + Step10: Listing the ISO's by Id + Step11: Verifying if the ISO is downloaded and ready. + If yes the continuing + If not waiting and checking for iso to be ready till timeout + Step12: Deleting the ISO present in page 2 + Step13: Listing all the ISO's in page2 + Step14: Verifying that no ISO's are listed + """ + # Listing all the ISO's for a User + list_iso_before = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"] + ) + # Verifying that no ISOs are listed + self.assertIsNone( + list_iso_before, + "ISOs listed for newly created User" + ) + self.services["iso"]["zoneid"] = self.zone.id + # Creating pagesize + 1 number of ISO's + for i in range(0, (self.services["pagesize"] + 1)): + iso_created = Iso.create( + self.userapiclient, + self.services["iso"] + ) + self.assertIsNotNone( + iso_created, + "ISO creation failed" + ) + if(i < self.services["pagesize"]): + self.cleanup.append(iso_created) + + # Listing all the ISO's for a User + list_iso_after = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"] + ) + status = validateList(list_iso_after) + self.assertEquals( + PASS, + status[0], + "ISO's creation failed" + ) + # Verifying that list size is pagesize + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_iso_after), + "Failed to create pagesize + 1 number of ISO's" + ) + # Listing all the ISO's in page 1 + list_iso_page1 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_iso_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list ISO's in page 1" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_iso_page1), + "Size of ISO's in page 1 is not matching" + ) + # Listing all the Templates in page 2 + list_iso_page2 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_iso_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list ISo's in page 2" + ) + # Verifying the list size to be equal to 1 + self.assertEquals( + 1, + len(list_iso_page2), + "Size of ISO's in page 2 is not matching" + ) + # Verifying the state of the ISO to be ready. If not waiting for state to become ready + iso_ready = False + count = 0 + while iso_ready is False: + list_iso = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + id=iso_created.id + ) + status = validateList(list_iso) + self.assertEquals( + PASS, + status[0], + "Failed to list ISO by Id" + ) + if list_iso[0].isready is True: + iso_ready = True + elif (str(list_iso[0].status) == "Error"): + self.fail("Created ISO is in Errored state") + break + elif count > 10: + self.fail("Timed out before ISO came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Deleting the ISO present in page 2 + Iso.delete( + iso_created, + self.userapiclient + ) + # Listing all the ISO's in page 2 again + list_iso_page2 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that there are no ISO's listed + self.assertIsNone( + list_iso_page2, + "ISO's not deleted from page 2" + ) + del self.services["iso"]["zoneid"] + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_02_download_iso(self): + """ + @Desc: Test to Download ISO + @steps: + Step1: Listing all the ISO's for a user + Step2: Verifying that no ISO's are listed + Step3: Creating an ISO + Step4: Listing all the ISO's again for a user + Step5: Verifying that list size is 1 + Step6: Verifying if the ISO is in ready state. + If yes the continuing + If not waiting and checking for template to be ready till timeout + Step7: Downloading the ISO (Extract) + Step8: Verifying the details of downloaded ISO + """ + # Listing all the ISO's for a User + list_iso_before = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"] + ) + # Verifying that no ISOs are listed + self.assertIsNone( + list_iso_before, + "ISOs listed for newly created User" + ) + self.services["iso"]["zoneid"] = self.zone.id + self.services["iso"]["isextractable"] = True + # Creating an ISO's + iso_created = Iso.create( + self.userapiclient, + self.services["iso"] + ) + self.assertIsNotNone( + iso_created, + "ISO creation failed" + ) + self.cleanup.append(iso_created) + # Listing all the ISO's for a User + list_iso_after = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"] + ) + status = validateList(list_iso_after) + self.assertEquals( + PASS, + status[0], + "ISO's creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_iso_after), + "Failed to create an ISO's" + ) + # Verifying the state of the ISO to be ready. If not waiting for state to become ready + iso_ready = False + count = 0 + while iso_ready is False: + list_iso = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + id=iso_created.id + ) + status = validateList(list_iso) + self.assertEquals( + PASS, + status[0], + "Failed to list ISO by Id" + ) + if list_iso[0].isready is True: + iso_ready = True + elif (str(list_iso[0].status) == "Error"): + self.fail("Created ISO is in Errored state") + break + elif count > 10: + self.fail("Timed out before ISO came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Downloading the ISO + download_iso = Iso.extract( + self.userapiclient, + iso_created.id, + mode="HTTP_DOWNLOAD", + zoneid=self.zone.id + ) + self.assertIsNotNone( + download_iso, + "Download ISO failed" + ) + # Verifying the details of downloaded ISO + self.assertEquals( + "DOWNLOAD_URL_CREATED", + download_iso.state, + "Download URL not created for ISO" + ) + self.assertIsNotNone( + download_iso.url, + "Download URL not created for ISO" + ) + self.assertEquals( + iso_created.id, + download_iso.id, + "Download ISO details are not same as ISO created" + ) + del self.services["iso"]["zoneid"] + del self.services["iso"]["isextractable"] + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_03_edit_iso_details(self): + """ + @Desc: Test to Edit ISO name, displaytext, OSType + @steps: + Step1: Listing all the ISO's for a user + Step2: Verifying that no ISO's are listed + Step3: Creating an ISO + Step4: Listing all the ISO's again for a user + Step5: Verifying that list size is 1 + Step6: Verifying if the ISO is in ready state. + If yes the continuing + If not waiting and checking for template to be ready till timeout + Step7: Editing the ISO's name, displaytext + Step8: Verifying that ISO name and displaytext are edited + Step9: Editing the ISO name, displaytext, ostypeid + Step10: Verifying that ISO name, displaytext and ostypeid are edited + """ + # Listing all the ISO's for a User + list_iso_before = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"] + ) + # Verifying that no ISOs are listed + self.assertIsNone( + list_iso_before, + "ISOs listed for newly created User" + ) + self.services["iso"]["zoneid"] = self.zone.id + # Creating an ISO's + iso_created = Iso.create( + self.userapiclient, + self.services["iso"] + ) + self.assertIsNotNone( + iso_created, + "ISO creation failed" + ) + self.cleanup.append(iso_created) + # Listing all the ISO's for a User + list_iso_after = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"] + ) + status = validateList(list_iso_after) + self.assertEquals( + PASS, + status[0], + "ISO's creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_iso_after), + "Failed to create an ISO's" + ) + # Verifying the state of the ISO to be ready. If not waiting for state to become ready + iso_ready = False + count = 0 + while iso_ready is False: + list_iso = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + id=iso_created.id + ) + status = validateList(list_iso) + self.assertEquals( + PASS, + status[0], + "Failed to list ISO by Id" + ) + if list_iso[0].isready is True: + iso_ready = True + elif (str(list_iso[0].status) == "Error"): + self.fail("Created ISO is in Errored state") + break + elif count > 10: + self.fail("Timed out before ISO came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Editing the ISO name, displaytext + edited_iso = Iso.update( + iso_created, + self.userapiclient, + name="NewISOName", + displaytext="NewISODisplayText" + ) + self.assertIsNotNone( + edited_iso, + "Editing ISO failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":iso_created.id, + "name":"NewISOName", + "displaytest":"NewISODisplayText", + "account":iso_created.account, + "domainid":iso_created.domainid, + "isfeatured":iso_created.isfeatured, + "ostypeid":iso_created.ostypeid, + "ispublic":iso_created.ispublic, + } + actual_dict = { + "id":edited_iso.id, + "name":edited_iso.name, + "displaytest":edited_iso.displaytext, + "account":edited_iso.account, + "domainid":edited_iso.domainid, + "isfeatured":edited_iso.isfeatured, + "ostypeid":edited_iso.ostypeid, + "ispublic":edited_iso.ispublic, + } + edit_iso_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_iso_status, + "Edited ISO details are not as expected" + ) + # Editing the ISO name, displaytext, ostypeid + ostype_list = list_os_types(self.userapiclient) + status = validateList(ostype_list) + self.assertEquals( + PASS, + status[0], + "Failed to list OS Types" + ) + for i in range(0, len(ostype_list)): + if ostype_list[i].id != iso_created.ostypeid: + newostypeid = ostype_list[i].id + break + + edited_iso = Iso.update( + iso_created, + self.userapiclient, + name=iso_created.name, + displaytext=iso_created.displaytext, + ostypeid=newostypeid + ) + self.assertIsNotNone( + edited_iso, + "Editing ISO failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":iso_created.id, + "name":iso_created.name, + "displaytest":iso_created.displaytext, + "account":iso_created.account, + "domainid":iso_created.domainid, + "isfeatured":iso_created.isfeatured, + "ostypeid":newostypeid, + "ispublic":iso_created.ispublic, + } + actual_dict = { + "id":edited_iso.id, + "name":edited_iso.name, + "displaytest":edited_iso.displaytext, + "account":edited_iso.account, + "domainid":edited_iso.domainid, + "isfeatured":edited_iso.isfeatured, + "ostypeid":edited_iso.ostypeid, + "ispublic":edited_iso.ispublic, + } + edit_iso_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_iso_status, + "Edited ISO details are not as expected" + ) + del self.services["iso"]["zoneid"] + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_04_copy_iso(self): + """ + @Desc: Test to copy ISO from one zone to another + @steps: + Step1: Listing Zones available for a user + Step2: Verifying if the zones listed are greater than 1. + If Yes continuing. + If not halting the test. + Step3: Listing all the ISO's for a user in zone1 + Step4: Verifying that no ISO's are listed + Step5: Listing all the ISO's for a user in zone2 + Step6: Verifying that no ISO's are listed + Step7: Creating an ISO in zone 1 + Step8: Listing all the ISO's again for a user in zone1 + Step9: Verifying that list size is 1 + Step10: Listing all the ISO's for a user in zone2 + Step11: Verifying that no ISO's are listed + Step12: Copying the ISO created in step7 from zone1 to zone2 + Step13: Listing all the ISO's for a user in zone2 + Step14: Verifying that list size is 1 + Step15: Listing all the ISO's for a user in zone1 + Step16: Verifying that list size is 1 + """ + # Listing Zones available for a user + zones_list = Zone.list( + self.userapiclient, + available=True + ) + status = validateList(zones_list) + self.assertEquals( + PASS, + status[0], + "Failed to list Zones" + ) + if not len(zones_list) > 1: + self.fail("Enough zones doesnot exists to copy iso") + else: + # Listing all the ISO's for a User in Zone 1 + list_isos_zone1 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + zoneid=zones_list[0].id + ) + # Verifying that no ISO's are listed + self.assertIsNone( + list_isos_zone1, + "ISO's listed for newly created User in Zone1" + ) + # Listing all the ISO's for a User in Zone 2 + list_isos_zone2 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + zoneid=zones_list[1].id + ) + # Verifying that no ISO's are listed + self.assertIsNone( + list_isos_zone2, + "ISO's listed for newly created User in Zone2" + ) + self.services["iso"]["zoneid"] = zones_list[0].id + # Creating an ISO in Zone 1 + iso_created = Iso.create( + self.userapiclient, + self.services["iso"] + ) + self.assertIsNotNone( + iso_created, + "ISO creation failed" + ) + self.cleanup.append(iso_created) + # Listing all the ISO's for a User in Zone 1 + list_isos_zone1 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + zoneid=zones_list[0].id + ) + status = validateList(list_isos_zone1) + self.assertEquals( + PASS, + status[0], + "ISO creation failed in Zone1" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_isos_zone1), + "Failed to create a Template" + ) + # Listing all the ISO's for a User in Zone 2 + list_isos_zone2 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + zoneid=zones_list[1].id + ) + # Verifying that no ISO's are listed + self.assertIsNone( + list_isos_zone2, + "ISO's listed for newly created User in Zone2" + ) + # Verifying the state of the ISO to be ready. If not waiting for state to become ready + iso_ready = False + count = 0 + while iso_ready is False: + list_iso = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + id=iso_created.id + ) + status = validateList(list_iso) + self.assertEquals( + PASS, + status[0], + "Failed to list ISO by Id" + ) + if list_iso[0].isready is True: + iso_ready = True + elif (str(list_iso[0].status) == "Error"): + self.fail("Created ISO is in Errored state") + break + elif count > 10: + self.fail("Timed out before ISO came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Copying the ISO from Zone1 to Zone2 + copied_iso = Iso.copy( + self.userapiclient, + iso_created.id, + sourcezoneid=iso_created.zoneid, + destzoneid=zones_list[1].id + ) + self.assertIsNotNone( + copied_iso, + "Copying ISO from Zone1 to Zone2 failed" + ) + # Listing all the ISO's for a User in Zone 1 + list_isos_zone1 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + zoneid=zones_list[0].id + ) + status = validateList(list_isos_zone1) + self.assertEquals( + PASS, + status[0], + "ISO creation failed in Zone1" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_isos_zone1), + "Failed to create a Template" + ) + # Listing all the ISO's for a User in Zone 2 + list_isos_zone2 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + zoneid=zones_list[1].id + ) + status = validateList(list_isos_zone2) + self.assertEquals( + PASS, + status[0], + "ISO failed to copy into Zone2" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_isos_zone2), + "ISO failed to copy into Zone2" + ) + self.assertNotEquals( + "Connection refused", + list_isos_zone2[0].status, + "Failed to copy ISO" + ) + self.assertEquals( + True, + list_isos_zone2[0].isready, + "Failed to copy ISO" + ) + del self.services["iso"]["zoneid"] + return \ No newline at end of file diff --git a/test/integration/component/test_escalations_securitygroups.py b/test/integration/component/test_escalations_securitygroups.py new file mode 100644 index 0000000000..8934088774 --- /dev/null +++ b/test/integration/component/test_escalations_securitygroups.py @@ -0,0 +1,588 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackAPI import (createVolume, + createTemplate) +from marvin.lib.base import (Volume, + Iso, + VirtualMachine, + Template, + Snapshot, + SecurityGroup, + Account, + Zone, + Network, + NetworkOffering, + DiskOffering, + ServiceOffering, + VmSnapshot, + SnapshotPolicy, + SSHKeyPair, + Resources, + Configurations, + VpnCustomerGateway, + Hypervisor, + VpcOffering, + VPC, + NetworkACL) +from marvin.lib.common import (get_zone, + get_domain, + get_template, + list_os_types) +from marvin.lib.utils import (validateList, + cleanup_resources, + random_gen) +from marvin.codes import (PASS, FAIL, EMPTY_LIST) +from nose.plugins.attrib import attr +import time + +class TestSecurityGroups(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestSecurityGroups, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + cls.services['mode'] = cls.zone.networktype + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls._cleanup.append(cls.account) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["basic", "provisioning"]) + def test_01_list_securitygroups_pagination(self): + """ + @Desc: Test to List Security Groups pagination + @steps: + Step1: Listing all the Security Groups for a user + Step2: Verifying that list size is 1 + Step3: Creating (page size) number of Security Groups + Step4: Listing all the Security Groups again for a user + Step5: Verifying that list size is (page size + 1) + Step6: Listing all the Security Groups in page1 + Step7: Verifying that list size is (page size) + Step8: Listing all the Security Groups in page2 + Step9: Verifying that list size is 1 + Step10: Deleting the Security Group present in page 2 + Step11: Listing all the Security Groups in page2 + Step12: Verifying that no security groups are listed + """ + # Listing all the Security Groups for a User + list_securitygroups_before = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying that default security group is created + status = validateList(list_securitygroups_before) + self.assertEquals( + PASS, + status[0], + "Default Security Groups creation failed" + ) + # Verifying the size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_before), + "Count of Security Groups list is not matching" + ) + # Creating pagesize number of security groups + for i in range(0, (self.services["pagesize"])): + securitygroup_created = SecurityGroup.create( + self.userapiclient, + self.services["security_group"], + account=self.account.name, + domainid=self.domain.id, + description=self.services["security_group"]["name"] + ) + self.assertIsNotNone( + securitygroup_created, + "Security Group creation failed" + ) + if (i < self.services["pagesize"]): + self.cleanup.append(securitygroup_created) + + # Listing all the security groups for user again + list_securitygroups_after = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_securitygroups_after) + self.assertEquals( + PASS, + status[0], + "Security Groups creation failed" + ) + # Verifying that list size is pagesize + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_securitygroups_after), + "Failed to create pagesize + 1 number of Security Groups" + ) + # Listing all the security groups in page 1 + list_securitygroups_page1 = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_securitygroups_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list security groups in page 1" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_securitygroups_page1), + "Size of security groups in page 1 is not matching" + ) + # Listing all the security groups in page 2 + list_securitygroups_page2 = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_securitygroups_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list security groups in page 2" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + 1, + len(list_securitygroups_page2), + "Size of security groups in page 2 is not matching" + ) + # Deleting the security group present in page 2 + SecurityGroup.delete( + securitygroup_created, + self.userapiclient) + # Listing all the security groups in page 2 again + list_securitygroups_page2 = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that there are no security groups listed + self.assertIsNone( + list_securitygroups_page2, + "Security Groups not deleted from page 2" + ) + return + + @attr(tags=["basic", "provisioning"]) + def test_02_securitygroups_authorize_revoke_ingress(self): + """ + @Desc: Test to Authorize and Revoke Ingress for Security Group + @steps: + Step1: Listing all the Security Groups for a user + Step2: Verifying that list size is 1 + Step3: Creating a Security Groups + Step4: Listing all the Security Groups again for a user + Step5: Verifying that list size is 2 + Step6: Authorizing Ingress for the security group created in step3 + Step7: Listing the security groups by passing id of security group created in step3 + Step8: Verifying that list size is 1 + Step9: Verifying that Ingress is authorized to the security group + Step10: Verifying the details of the Ingress rule are as expected + Step11: Revoking Ingress for the security group created in step3 + Step12: Listing the security groups by passing id of security group created in step3 + Step13: Verifying that list size is 1 + Step14: Verifying that Ingress is revoked from the security group + """ + # Listing all the Security Groups for a User + list_securitygroups_before = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying that default security group is created + status = validateList(list_securitygroups_before) + self.assertEquals( + PASS, + status[0], + "Default Security Groups creation failed" + ) + # Verifying the size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_before), + "Count of Security Groups list is not matching" + ) + # Creating a security group + securitygroup_created = SecurityGroup.create( + self.userapiclient, + self.services["security_group"], + account=self.account.name, + domainid=self.domain.id, + description=self.services["security_group"]["name"] + ) + self.assertIsNotNone( + securitygroup_created, + "Security Group creation failed" + ) + self.cleanup.append(securitygroup_created) + + # Listing all the security groups for user again + list_securitygroups_after = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_securitygroups_after) + self.assertEquals( + PASS, + status[0], + "Security Groups creation failed" + ) + # Verifying that list size is 2 + self.assertEquals( + 2, + len(list_securitygroups_after), + "Failed to create Security Group" + ) + # Authorizing Ingress for the security group created in step3 + securitygroup_created.authorize( + self.userapiclient, + self.services["ingress_rule"], + self.account.name, + self.domain.id, + ) + # Listing the security group by Id + list_securitygroups_byid = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + id=securitygroup_created.id, + domainid=self.domain.id + ) + # Verifying that security group is listed + status = validateList(list_securitygroups_byid) + self.assertEquals( + PASS, + status[0], + "Listing of Security Groups by id failed" + ) + # Verifying size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_byid), + "Count of the listing security group by id is not matching" + ) + securitygroup_ingress = list_securitygroups_byid[0].ingressrule + # Validating the Ingress rule + status = validateList(securitygroup_ingress) + self.assertEquals( + PASS, + status[0], + "Security Groups Ingress rule authorization failed" + ) + self.assertEquals( + 1, + len(securitygroup_ingress), + "Security Group Ingress rules count is not matching" + ) + # Verifying the details of the Ingress rule are as expected + #Creating expected and actual values dictionaries + expected_dict = { + "cidr":self.services["ingress_rule"]["cidrlist"], + "protocol":self.services["ingress_rule"]["protocol"], + "startport":self.services["ingress_rule"]["startport"], + "endport":self.services["ingress_rule"]["endport"], + } + actual_dict = { + "cidr":str(securitygroup_ingress[0].cidr), + "protocol":str(securitygroup_ingress[0].protocol.upper()), + "startport":str(securitygroup_ingress[0].startport), + "endport":str(securitygroup_ingress[0].endport), + } + ingress_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + ingress_status, + "Listed Security group Ingress rule details are not as expected" + ) + # Revoking the Ingress rule from Security Group + securitygroup_created.revoke(self.userapiclient, securitygroup_ingress[0].ruleid) + # Listing the security group by Id + list_securitygroups_byid = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + id=securitygroup_created.id, + domainid=self.domain.id + ) + # Verifying that security group is listed + status = validateList(list_securitygroups_byid) + self.assertEquals( + PASS, + status[0], + "Listing of Security Groups by id failed" + ) + # Verifying size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_byid), + "Count of the listing security group by id is not matching" + ) + securitygroup_ingress = list_securitygroups_byid[0].ingressrule + # Verifying that Ingress rule is empty(revoked) + status = validateList(securitygroup_ingress) + self.assertEquals( + EMPTY_LIST, + status[2], + "Security Groups Ingress rule is not revoked" + ) + return + + @attr(tags=["basic", "provisioning"]) + def test_03_securitygroups_authorize_revoke_egress(self): + """ + @Desc: Test to Authorize and Revoke Egress for Security Group + @steps: + Step1: Listing all the Security Groups for a user + Step2: Verifying that list size is 1 + Step3: Creating a Security Groups + Step4: Listing all the Security Groups again for a user + Step5: Verifying that list size is 2 + Step6: Authorizing Egress for the security group created in step3 + Step7: Listing the security groups by passing id of security group created in step3 + Step8: Verifying that list size is 1 + Step9: Verifying that Egress is authorized to the security group + Step10: Verifying the details of the Egress rule are as expected + Step11: Revoking Egress for the security group created in step3 + Step12: Listing the security groups by passing id of security group created in step3 + Step13: Verifying that list size is 1 + Step14: Verifying that Egress is revoked from the security group + """ + # Listing all the Security Groups for a User + list_securitygroups_before = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying that default security group is created + status = validateList(list_securitygroups_before) + self.assertEquals( + PASS, + status[0], + "Default Security Groups creation failed" + ) + # Verifying the size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_before), + "Count of Security Groups list is not matching" + ) + # Creating a security group + securitygroup_created = SecurityGroup.create( + self.userapiclient, + self.services["security_group"], + account=self.account.name, + domainid=self.domain.id, + description=self.services["security_group"]["name"] + ) + self.assertIsNotNone( + securitygroup_created, + "Security Group creation failed" + ) + self.cleanup.append(securitygroup_created) + + # Listing all the security groups for user again + list_securitygroups_after = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_securitygroups_after) + self.assertEquals( + PASS, + status[0], + "Security Groups creation failed" + ) + # Verifying that list size is 2 + self.assertEquals( + 2, + len(list_securitygroups_after), + "Failed to create Security Group" + ) + # Authorizing Egress for the security group created in step3 + securitygroup_created.authorizeEgress( + self.userapiclient, + self.services["ingress_rule"], + self.account.name, + self.domain.id, + ) + # Listing the security group by Id + list_securitygroups_byid = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + id=securitygroup_created.id, + domainid=self.domain.id + ) + # Verifying that security group is listed + status = validateList(list_securitygroups_byid) + self.assertEquals( + PASS, + status[0], + "Listing of Security Groups by id failed" + ) + # Verifying size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_byid), + "Count of the listing security group by id is not matching" + ) + securitygroup_egress = list_securitygroups_byid[0].egressrule + # Validating the Ingress rule + status = validateList(securitygroup_egress) + self.assertEquals( + PASS, + status[0], + "Security Groups Egress rule authorization failed" + ) + self.assertEquals( + 1, + len(securitygroup_egress), + "Security Group Egress rules count is not matching" + ) + # Verifying the details of the Egress rule are as expected + #Creating expected and actual values dictionaries + expected_dict = { + "cidr":self.services["ingress_rule"]["cidrlist"], + "protocol":self.services["ingress_rule"]["protocol"], + "startport":self.services["ingress_rule"]["startport"], + "endport":self.services["ingress_rule"]["endport"], + } + actual_dict = { + "cidr":str(securitygroup_egress[0].cidr), + "protocol":str(securitygroup_egress[0].protocol.upper()), + "startport":str(securitygroup_egress[0].startport), + "endport":str(securitygroup_egress[0].endport), + } + ingress_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + ingress_status, + "Listed Security group Egress rule details are not as expected" + ) + # Revoking the Egress rule from Security Group + securitygroup_created.revokeEgress(self.userapiclient, securitygroup_egress[0].ruleid) + # Listing the security group by Id + list_securitygroups_byid = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + id=securitygroup_created.id, + domainid=self.domain.id + ) + # Verifying that security group is listed + status = validateList(list_securitygroups_byid) + self.assertEquals( + PASS, + status[0], + "Listing of Security Groups by id failed" + ) + # Verifying size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_byid), + "Count of the listing security group by id is not matching" + ) + securitygroup_egress = list_securitygroups_byid[0].egressrule + # Verifying that Ingress rule is empty(revoked) + status = validateList(securitygroup_egress) + self.assertEquals( + EMPTY_LIST, + status[2], + "Security Groups Egress rule is not revoked" + ) + return \ No newline at end of file diff --git a/test/integration/component/test_escalations_snapshots.py b/test/integration/component/test_escalations_snapshots.py new file mode 100644 index 0000000000..2367253b58 --- /dev/null +++ b/test/integration/component/test_escalations_snapshots.py @@ -0,0 +1,647 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackAPI import (createVolume, + createTemplate) +from marvin.lib.base import (Volume, + Iso, + VirtualMachine, + Template, + Snapshot, + SecurityGroup, + Account, + Zone, + Network, + NetworkOffering, + DiskOffering, + ServiceOffering, + VmSnapshot, + SnapshotPolicy, + SSHKeyPair, + Resources, + Configurations, + VpnCustomerGateway, + Hypervisor, + VpcOffering, + VPC, + NetworkACL) +from marvin.lib.common import (get_zone, + get_domain, + get_template, + list_os_types) +from marvin.lib.utils import (validateList, + cleanup_resources, + random_gen) +from marvin.codes import (PASS, FAIL, EMPTY_LIST) +from nose.plugins.attrib import attr +import time + +class TestSnapshots(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestSnapshots, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + if cls.zone.localstorageenabled: + cls.storagetype = 'local' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' + cls.services["disk_offering"]["storagetype"] = 'local' + else: + cls.storagetype = 'shared' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' + cls.services["disk_offering"]["storagetype"] = 'shared' + + cls.services['mode'] = cls.zone.networktype + cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.services["custom_volume"]["zoneid"] = cls.zone.id + # Creating Disk offering, Service Offering and Account + cls.disk_offering = DiskOffering.create( + cls.api_client, + cls.services["disk_offering"] + ) + cls._cleanup.append(cls.disk_offering) + cls.service_offering = ServiceOffering.create( + cls.api_client, + cls.services["service_offerings"]["tiny"] + ) + cls._cleanup.append(cls.service_offering) + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls._cleanup.append(cls.account) + # Creating Virtual Machine + cls.virtual_machine = VirtualMachine.create( + cls.userapiclient, + cls.services["virtual_machine"], + accountid=cls.account.name, + domainid=cls.account.domainid, + serviceofferingid=cls.service_offering.id, + ) + cls._cleanup.append(cls.virtual_machine) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_01_list_volume_snapshots_pagination(self): + """ + @Desc: Test to List Volume Snapshots pagination + @steps: + Step1: Listing all the volume snapshots for a user + Step2: Verifying that list size is 0 + Step3: Creating (page size + 1) number of volume snapshots + Step4: Listing all the volume snapshots again for a user + Step5: Verifying that list size is (page size + 1) + Step6: Listing all the volume snapshots in page1 + Step7: Verifying that list size is (page size) + Step8: Listing all the volume snapshots in page2 + Step9: Verifying that list size is 1 + Step10: Deleting the volume snapshot present in page 2 + Step11: Listing all the volume snapshots in page2 + Step12: Verifying that list size is 0 + """ + # Listing all the volume snapshots for a User + list_vol_snaps_before = Snapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying list size is 0 + self.assertIsNone( + list_vol_snaps_before, + "Volume snapshots exists for newly created user" + ) + # Listing the root volumes available for the user + volumes_list = Volume.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(volumes_list) + self.assertEquals( + PASS, + status[0], + "Root volume did not get created while deploying a VM" + ) + # Verifying list size to be 1 + self.assertEquals( + 1, + len(volumes_list), + "More than 1 root volume created for deployed VM" + ) + root_volume = volumes_list[0] + # Creating pagesize + 1 number of volume snapshots + for i in range(0, (self.services["pagesize"] + 1)): + snapshot_created = Snapshot.create( + self.userapiclient, + root_volume.id, + ) + self.assertIsNotNone( + snapshot_created, + "Snapshot creation failed" + ) + self.cleanup.append(snapshot_created) + + # Listing all the volume snapshots for user again + list_vol_snaps_after = Snapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_vol_snaps_after) + self.assertEquals( + PASS, + status[0], + "Volume snapshot creation failed" + ) + # Verifying that list size is pagesize + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_vol_snaps_after), + "Failed to create pagesize + 1 number of Volume snapshots" + ) + # Listing all the volume snapshots in page 1 + list_vol_snaps_page1 = Snapshot.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vol_snaps_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list volume snapshots in page 1" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_vol_snaps_page1), + "Size of volume snapshots in page 1 is not matching" + ) + # Listing all the volume snapshots in page 2 + list_vol_snaps_page2 = Snapshot.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vol_snaps_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list volume snapshots in page 2" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + 1, + len(list_vol_snaps_page2), + "Size of volume snapshots in page 2 is not matching" + ) + # Deleting the volume snapshot present in page 2 + Snapshot.delete( + snapshot_created, + self.userapiclient + ) + # Listing all the snapshots in page 2 again + list_vol_snaps_page2 = Snapshot.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that list size is 0 + self.assertIsNone( + list_vol_snaps_page2, + "Volume snapshot not deleted from page 2" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_02_list_volume_snapshots_byid(self): + """ + @Desc: Test to List Volume Snapshots by Id + @Steps: + Step1: Listing all the volume snapshots for a user + Step2: Verifying that list size is 0 + Step3: Creating a volume snapshot + Step4: Listing all the volume snapshots again for a user + Step5: Verifying that list size is 1 + Step6: Listing all the volume snapshots by specifying snapshot id + Step7: Verifying that list size is 1 + Step8: Verifying details of the listed volume snapshot + """ + # Listing all the volume snapshots for a User + list_vol_snaps_before = Snapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying list size is 0 + self.assertIsNone( + list_vol_snaps_before, + "Volume snapshots exists for newly created user" + ) + # Listing the root volumes available for the user + volumes_list = Volume.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(volumes_list) + self.assertEquals( + PASS, + status[0], + "Root volume did not get created while deploying a VM" + ) + # Verifying list size to be 1 + self.assertEquals( + 1, + len(volumes_list), + "More than 1 root volume created for deployed VM" + ) + root_volume = volumes_list[0] + # Creating a volume snapshot + snapshot_created = Snapshot.create( + self.userapiclient, + root_volume.id, + ) + self.assertIsNotNone( + snapshot_created, + "Snapshot creation failed" + ) + self.cleanup.append(snapshot_created) + # Listing all the volume snapshots for user again + list_vol_snaps_after = Snapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_vol_snaps_after) + self.assertEquals( + PASS, + status[0], + "Volume snapshot creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_vol_snaps_after), + "Failed to create Volume snapshot" + ) + # Listing volume snapshot by id + list_vol_snapshot = Snapshot.list( + self.userapiclient, + listall=self.services["listall"], + id=snapshot_created.id + ) + status = validateList(list_vol_snapshot) + self.assertEquals( + PASS, + status[0], + "Failed to list Volume snapshot by Id" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_vol_snapshot), + "Size of the list volume snapshot by Id is not matching" + ) + # Verifying details of the listed snapshot to be same as snapshot created above + #Creating expected and actual values dictionaries + expected_dict = { + "id":snapshot_created.id, + "name":snapshot_created.name, + "state":snapshot_created.state, + "intervaltype":snapshot_created.intervaltype, + "account":snapshot_created.account, + "domain":snapshot_created.domainid, + "volume":snapshot_created.volumeid + } + actual_dict = { + "id":list_vol_snapshot[0].id, + "name":list_vol_snapshot[0].name, + "state":list_vol_snapshot[0].state, + "intervaltype":list_vol_snapshot[0].intervaltype, + "account":list_vol_snapshot[0].account, + "domain":list_vol_snapshot[0].domainid, + "volume":list_vol_snapshot[0].volumeid + } + vol_snapshot_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + vol_snapshot_status, + "Listed Volume Snapshot details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_03_list_vm_snapshots_pagination(self): + """ + @Desc: Test to List VM Snapshots pagination + @Steps: + Step1: Listing all the VM snapshots for a user + Step2: Verifying that list size is 0 + Step3: Creating (page size + 1) number of VM snapshots + Step4: Listing all the VM snapshots again for a user + Step5: Verifying that list size is (page size + 1) + Step6: Listing all the VM snapshots in page1 + Step7: Verifying that list size is (page size) + Step8: Listing all the VM snapshots in page2 + Step9: Verifying that list size is 1 + Step10: Deleting the VM snapshot present in page 2 + Step11: Listing all the volume snapshots in page2 + Step12: Verifying that list size is 0 + """ + # Listing all the VM snapshots for a User + list_vm_snaps_before = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying list size is 0 + self.assertIsNone( + list_vm_snaps_before, + "VM snapshots exists for newly created user" + ) + # Creating pagesize + 1 number of VM snapshots + for i in range(0, (self.services["pagesize"] + 1)): + snapshot_created = VmSnapshot.create( + self.userapiclient, + self.virtual_machine.id, + ) + self.assertIsNotNone( + snapshot_created, + "Snapshot creation failed" + ) + + # Listing all the VM snapshots for user again + list_vm_snaps_after = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_vm_snaps_after) + self.assertEquals( + PASS, + status[0], + "VM snapshot creation failed" + ) + # Verifying that list size is pagesize + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_vm_snaps_after), + "Failed to create pagesize + 1 number of VM snapshots" + ) + # Listing all the VM snapshots in page 1 + list_vm_snaps_page1 = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vm_snaps_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list vm snapshots in page 1" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_vm_snaps_page1), + "Size of vm snapshots in page 1 is not matching" + ) + # Listing all the vm snapshots in page 2 + list_vm_snaps_page2 = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vm_snaps_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list vm snapshots in page 2" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + 1, + len(list_vm_snaps_page2), + "Size of vm snapshots in page 2 is not matching" + ) + # Deleting the vm snapshot present in page 2 + VmSnapshot.deleteVMSnapshot( + self.userapiclient, + snapshot_created.id + ) + # Listing all the snapshots in page 2 again + list_vm_snaps_page2 = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that list size is 0 + self.assertIsNone( + list_vm_snaps_page2, + "VM snapshot not deleted from page 2" + ) + # Deleting all the existing VM snapshots + list_vm_snaps = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vm_snaps) + self.assertEquals( + PASS, + status[0], + "All VM snapshots deleted" + ) + # Verifying that list size is equal to page size + self.assertEquals( + self.services["pagesize"], + len(list_vm_snaps), + "VM Snapshots count is not matching" + ) + # Deleting all the existing VM snapshots + for i in range(0, len(list_vm_snaps)): + VmSnapshot.deleteVMSnapshot( + self.userapiclient, + list_vm_snaps[i].id + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_04_list_vm_snapshots_byid(self): + """ + @summary: Test to List VM Snapshots by Id + + Step1: Listing all the VM snapshots for a user + Step2: Verifying that list size is 0 + Step3: Creating a VM snapshot + Step4: Listing all the VM snapshots again for a user + Step5: Verifying that list size is 1 + Step6: Listing all the VM snapshots by specifying snapshot id + Step7: Verifying that list size is 1 + Step8: Verifying details of the listed VM snapshot + """ + # Listing all the VM snapshots for a User + list_vm_snaps_before = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying list size is 0 + self.assertIsNone( + list_vm_snaps_before, + "VM snapshots exists for newly created user" + ) + # Creating a VM snapshot + snapshot_created = VmSnapshot.create( + self.userapiclient, + self.virtual_machine.id, + ) + self.assertIsNotNone( + snapshot_created, + "Snapshot creation failed" + ) + # Listing all the VM snapshots for user again + list_vm_snaps_after = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_vm_snaps_after) + self.assertEquals( + PASS, + status[0], + "VM snapshot creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_vm_snaps_after), + "Failed to create VM snapshot" + ) + # Listing vm snapshot by id + list_vm_snapshot = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + vmsnapshotid=snapshot_created.id + ) + status = validateList(list_vm_snapshot) + self.assertEquals( + PASS, + status[0], + "Failed to list VM snapshot by Id" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_vm_snapshot), + "Size of the list vm snapshot by Id is not matching" + ) + # Verifying details of the listed snapshot to be same as snapshot created above + #Creating expected and actual values dictionaries + expected_dict = { + "id":snapshot_created.id, + "name":snapshot_created.name, + "state":snapshot_created.state, + "vmid":snapshot_created.virtualmachineid, + } + actual_dict = { + "id":list_vm_snapshot[0].id, + "name":list_vm_snapshot[0].name, + "state":list_vm_snapshot[0].state, + "vmid":list_vm_snapshot[0].virtualmachineid, + } + vm_snapshot_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + vm_snapshot_status, + "Listed VM Snapshot details are not as expected" + ) + return \ No newline at end of file diff --git a/test/integration/component/test_escalations_templates.py b/test/integration/component/test_escalations_templates.py new file mode 100644 index 0000000000..083ba90e32 --- /dev/null +++ b/test/integration/component/test_escalations_templates.py @@ -0,0 +1,944 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackAPI import (createVolume, + createTemplate) +from marvin.lib.base import (Volume, + Iso, + VirtualMachine, + Template, + Snapshot, + SecurityGroup, + Account, + Zone, + Network, + NetworkOffering, + DiskOffering, + ServiceOffering, + VmSnapshot, + SnapshotPolicy, + SSHKeyPair, + Resources, + Configurations, + VpnCustomerGateway, + Hypervisor, + VpcOffering, + VPC, + NetworkACL) +from marvin.lib.common import (get_zone, + get_domain, + get_template, + list_os_types) +from marvin.lib.utils import (validateList, + cleanup_resources, + random_gen) +from marvin.codes import (PASS, FAIL, EMPTY_LIST) +from nose.plugins.attrib import attr +import time + +class TestTemplates(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestTemplates, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + cls.hypervisor = cls.testClient.getHypervisorInfo() + cls.services['mode'] = cls.zone.networktype + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls._cleanup.append(cls.account) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_01_list_templates_pagination(self): + """ + @Desc: Test to List Templates pagination + @steps: + Step1: Listing all the Templates for a user + Step2: Verifying that no Templates are listed + Step3: Creating (page size + 1) number of Templates + Step4: Listing all the Templates again for a user + Step5: Verifying that list size is (page size + 1) + Step6: Listing all the Templates in page1 + Step7: Verifying that list size is (page size) + Step8: Listing all the Templates in page2 + Step9: Verifying that list size is 1 + Step10: Listing the template by Id + Step11: Verifying if the template is downloaded and ready. + If yes the continuing + If not waiting and checking for template to be ready till timeout + Step12: Deleting the Template present in page 2 + Step13: Listing all the Templates in page2 + Step14: Verifying that no Templates are listed + """ + # Listing all the Templates for a User + list_templates_before = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"] + ) + # Verifying that no Templates are listed + self.assertIsNone( + list_templates_before, + "Templates listed for newly created User" + ) + self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" + self.services["template"]["format"] = "VHD" + self.services["template"]["ostype"] = self.services["ostype"] + # Creating pagesize + 1 number of Templates + for i in range(0, (self.services["pagesize"] + 1)): + template_created = Template.register( + self.userapiclient, + self.services["template"], + self.zone.id, + hypervisor=self.hypervisor + ) + self.assertIsNotNone( + template_created, + "Template creation failed" + ) + if(i < self.services["pagesize"]): + self.cleanup.append(template_created) + + # Listing all the Templates for a User + list_templates_after = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"] + ) + status = validateList(list_templates_after) + self.assertEquals( + PASS, + status[0], + "Templates creation failed" + ) + # Verifying that list size is pagesize + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_templates_after), + "Failed to create pagesize + 1 number of Templates" + ) + # Listing all the Templates in page 1 + list_templates_page1 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_templates_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list Templates in page 1" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_templates_page1), + "Size of Templates in page 1 is not matching" + ) + # Listing all the Templates in page 2 + list_templates_page2 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_templates_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list Templates in page 2" + ) + # Verifying the list size to be equal to 1 + self.assertEquals( + 1, + len(list_templates_page2), + "Size of Templates in page 2 is not matching" + ) + # Verifying the state of the template to be ready. If not waiting for state to become ready + template_ready = False + count = 0 + while template_ready is False: + list_template = Template.list( + self.userapiclient, + id=template_created.id, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + ) + status = validateList(list_template) + self.assertEquals( + PASS, + status[0], + "Failed to list Templates by Id" + ) + if list_template[0].isready is True: + template_ready = True + elif (str(list_template[0].status) == "Error"): + self.fail("Created Template is in Errored state") + break + elif count > 10: + self.fail("Timed out before Template came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Deleting the Template present in page 2 + Template.delete( + template_created, + self.userapiclient + ) + # Listing all the Templates in page 2 again + list_templates_page2 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that there are no Templates listed + self.assertIsNone( + list_templates_page2, + "Templates not deleted from page 2" + ) + del self.services["template"]["url"] + del self.services["template"]["format"] + del self.services["template"]["ostype"] + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_02_download_template(self): + """ + @Desc: Test to Download Template + @steps: + Step1: Listing all the Templates for a user + Step2: Verifying that no Templates are listed + Step3: Creating a Templates + Step4: Listing all the Templates again for a user + Step5: Verifying that list size is 1 + Step6: Verifying if the template is in ready state. + If yes the continuing + If not waiting and checking for template to be ready till timeout + Step7: Downloading the template (Extract) + Step8: Verifying that Template is downloaded + """ + # Listing all the Templates for a User + list_templates_before = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"] + ) + # Verifying that no Templates are listed + self.assertIsNone( + list_templates_before, + "Templates listed for newly created User" + ) + self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" + self.services["template"]["format"] = "VHD" + self.services["template"]["ostype"] = self.services["ostype"] + self.services["template"]["isextractable"] = True + # Creating aTemplate + template_created = Template.register( + self.userapiclient, + self.services["template"], + self.zone.id, + hypervisor=self.hypervisor + ) + self.assertIsNotNone( + template_created, + "Template creation failed" + ) + self.cleanup.append(template_created) + # Listing all the Templates for a User + list_templates_after = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"] + ) + status = validateList(list_templates_after) + self.assertEquals( + PASS, + status[0], + "Templates creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_templates_after), + "Failed to create a Template" + ) + # Verifying the state of the template to be ready. If not waiting for state to become ready till time out + template_ready = False + count = 0 + while template_ready is False: + list_template = Template.list( + self.userapiclient, + id=template_created.id, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + ) + status = validateList(list_template) + self.assertEquals( + PASS, + status[0], + "Failed to list Templates by Id" + ) + if list_template[0].isready is True: + template_ready = True + elif (str(list_template[0].status) == "Error"): + self.fail("Created Template is in Errored state") + break + elif count > 10: + self.fail("Timed out before Template came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Downloading the Template name + download_template = Template.extract( + self.userapiclient, + template_created.id, + mode="HTTP_DOWNLOAD", + zoneid=self.zone.id + ) + self.assertIsNotNone( + download_template, + "Download Template failed" + ) + # Verifying the details of downloaded template + self.assertEquals( + "DOWNLOAD_URL_CREATED", + download_template.state, + "Download URL not created for Template" + ) + self.assertIsNotNone( + download_template.url, + "Download URL not created for Template" + ) + self.assertEquals( + template_created.id, + download_template.id, + "Download Template details are not same as Template created" + ) + del self.services["template"]["url"] + del self.services["template"]["format"] + del self.services["template"]["ostype"] + del self.services["template"]["isextractable"] + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_03_edit_template_details(self): + """ + @Desc: Test to Edit Template name, displaytext, OSType + @steps: + Step1: Listing all the Templates for a user + Step2: Verifying that no Templates are listed + Step3: Creating a Templates + Step4: Listing all the Templates again for a user + Step5: Verifying that list size is 1 + Step6: Verifying if the template is in ready state. + If yes the continuing + If not waiting and checking for template to be ready till timeout + Step7: Editing the template name + Step8: Verifying that Template name is edited + Step9: Editing the template displaytext + Step10: Verifying that Template displaytext is edited + Step11: Editing the template ostypeid + Step12: Verifying that Template ostypeid is edited + Step13: Editing the template name, displaytext + Step14: Verifying that Template name, displaytext are edited + Step15: Editing the template name, displaytext, ostypeid + Step16: Verifying that Template name, displaytext and ostypeid are edited + """ + # Listing all the Templates for a User + list_templates_before = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"] + ) + # Verifying that no Templates are listed + self.assertIsNone( + list_templates_before, + "Templates listed for newly created User" + ) + self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" + self.services["template"]["format"] = "VHD" + self.services["template"]["ostype"] = self.services["ostype"] + # Creating aTemplate + template_created = Template.register( + self.userapiclient, + self.services["template"], + self.zone.id, + hypervisor=self.hypervisor + ) + self.assertIsNotNone( + template_created, + "Template creation failed" + ) + self.cleanup.append(template_created) + # Listing all the Templates for a User + list_templates_after = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"] + ) + status = validateList(list_templates_after) + self.assertEquals( + PASS, + status[0], + "Templates creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_templates_after), + "Failed to create a Template" + ) + # Verifying the state of the template to be ready. If not waiting for state to become ready till time out + template_ready = False + count = 0 + while template_ready is False: + list_template = Template.list( + self.userapiclient, + id=template_created.id, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + ) + status = validateList(list_template) + self.assertEquals( + PASS, + status[0], + "Failed to list Templates by Id" + ) + if list_template[0].isready is True: + template_ready = True + elif (str(list_template[0].status) == "Error"): + self.fail("Created Template is in Errored state") + break + elif count > 10: + self.fail("Timed out before Template came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Editing the Template name + edited_template = Template.update( + template_created, + self.userapiclient, + name="NewTemplateName" + ) + self.assertIsNotNone( + edited_template, + "Editing Template failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":template_created.id, + "name":"NewTemplateName", + "displaytest":template_created.displaytext, + "account":template_created.account, + "domainid":template_created.domainid, + "format":template_created.format, + "ostypeid":template_created.ostypeid, + "templatetype":template_created.templatetype, + } + actual_dict = { + "id":edited_template.id, + "name":edited_template.name, + "displaytest":edited_template.displaytext, + "account":edited_template.account, + "domainid":edited_template.domainid, + "format":edited_template.format, + "ostypeid":edited_template.ostypeid, + "templatetype":edited_template.templatetype, + } + edit_template_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_template_status, + "Edited Template details are not as expected" + ) + # Editing the Template displaytext + edited_template = Template.update( + template_created, + self.userapiclient, + displaytext="TemplateDisplaytext" + ) + self.assertIsNotNone( + edited_template, + "Editing Template failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":template_created.id, + "name":"NewTemplateName", + "displaytest":"TemplateDisplaytext", + "account":template_created.account, + "domainid":template_created.domainid, + "format":template_created.format, + "ostypeid":template_created.ostypeid, + "templatetype":template_created.templatetype, + } + actual_dict = { + "id":edited_template.id, + "name":edited_template.name, + "displaytest":edited_template.displaytext, + "account":edited_template.account, + "domainid":edited_template.domainid, + "format":edited_template.format, + "ostypeid":edited_template.ostypeid, + "templatetype":edited_template.templatetype, + } + edit_template_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_template_status, + "Edited Template details are not as expected" + ) + # Editing the Template ostypeid + ostype_list = list_os_types(self.userapiclient) + status = validateList(ostype_list) + self.assertEquals( + PASS, + status[0], + "Failed to list OS Types" + ) + for i in range(0, len(ostype_list)): + if ostype_list[i].id != template_created.ostypeid: + newostypeid = ostype_list[i].id + break + + edited_template = Template.update( + template_created, + self.userapiclient, + ostypeid=newostypeid + ) + self.assertIsNotNone( + edited_template, + "Editing Template failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":template_created.id, + "name":"NewTemplateName", + "displaytest":"TemplateDisplaytext", + "account":template_created.account, + "domainid":template_created.domainid, + "format":template_created.format, + "ostypeid":newostypeid, + "templatetype":template_created.templatetype, + } + actual_dict = { + "id":edited_template.id, + "name":edited_template.name, + "displaytest":edited_template.displaytext, + "account":edited_template.account, + "domainid":edited_template.domainid, + "format":edited_template.format, + "ostypeid":edited_template.ostypeid, + "templatetype":edited_template.templatetype, + } + edit_template_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_template_status, + "Edited Template details are not as expected" + ) + # Editing the Template name, displaytext + edited_template = Template.update( + template_created, + self.userapiclient, + name=template_created.name, + displaytext=template_created.displaytext + ) + self.assertIsNotNone( + edited_template, + "Editing Template failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":template_created.id, + "name":template_created.name, + "displaytest":template_created.displaytext, + "account":template_created.account, + "domainid":template_created.domainid, + "format":template_created.format, + "ostypeid":newostypeid, + "templatetype":template_created.templatetype, + } + actual_dict = { + "id":edited_template.id, + "name":edited_template.name, + "displaytest":edited_template.displaytext, + "account":edited_template.account, + "domainid":edited_template.domainid, + "format":edited_template.format, + "ostypeid":edited_template.ostypeid, + "templatetype":edited_template.templatetype, + } + edit_template_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_template_status, + "Edited Template details are not as expected" + ) + # Editing the Template name, displaytext, ostypeid + edited_template = Template.update( + template_created, + self.userapiclient, + name="NewTemplateName", + displaytext="TemplateDisplaytext", + ostypeid=template_created.ostypeid + ) + self.assertIsNotNone( + edited_template, + "Editing Template failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":template_created.id, + "name":"NewTemplateName", + "displaytest":"TemplateDisplaytext", + "account":template_created.account, + "domainid":template_created.domainid, + "format":template_created.format, + "ostypeid":template_created.ostypeid, + "templatetype":template_created.templatetype, + } + actual_dict = { + "id":edited_template.id, + "name":edited_template.name, + "displaytest":edited_template.displaytext, + "account":edited_template.account, + "domainid":edited_template.domainid, + "format":edited_template.format, + "ostypeid":edited_template.ostypeid, + "templatetype":edited_template.templatetype, + } + edit_template_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_template_status, + "Edited Template details are not as expected" + ) + del self.services["template"]["url"] + del self.services["template"]["format"] + del self.services["template"]["ostype"] + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_04_copy_template(self): + """ + @Desc: Test to copy Template from one zone to another + @steps: + Step1: Listing Zones available for a user + Step2: Verifying if the zones listed are greater than 1. + If Yes continuing. + If not halting the test. + Step3: Listing all the templates for a user in zone1 + Step4: Verifying that no templates are listed + Step5: Listing all the templates for a user in zone2 + Step6: Verifying that no templates are listed + Step7: Creating a Template in zone 1 + Step8: Listing all the Templates again for a user in zone1 + Step9: Verifying that list size is 1 + Step10: Listing all the templates for a user in zone2 + Step11: Verifying that no templates are listed + Step12: Copying the template created in step7 from zone1 to zone2 + Step13: Listing all the templates for a user in zone2 + Step14: Verifying that list size is 1 + Step15: Listing all the Templates for a user in zone1 + Step16: Verifying that list size is 1 + """ + # Listing Zones available for a user + zones_list = Zone.list( + self.userapiclient, + available=True + ) + status = validateList(zones_list) + self.assertEquals( + PASS, + status[0], + "Failed to list Zones" + ) + if not len(zones_list) > 1: + self.fail("Enough zones doesnot exists to copy template") + else: + # Listing all the Templates for a User in Zone 1 + list_templates_zone1 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + zoneid=zones_list[0].id + ) + # Verifying that no Templates are listed + self.assertIsNone( + list_templates_zone1, + "Templates listed for newly created User in Zone1" + ) + # Listing all the Templates for a User in Zone 2 + list_templates_zone2 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + zoneid=zones_list[1].id + ) + # Verifying that no Templates are listed + self.assertIsNone( + list_templates_zone2, + "Templates listed for newly created User in Zone2" + ) + self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" + self.services["template"]["format"] = "VHD" + self.services["template"]["ostype"] = self.services["ostype"] + #Listing Hypervisors in Zone 1 + hypervisor_list = Hypervisor.list( + self.apiClient, + zoneid=zones_list[0].id + ) + status = validateList(zones_list) + self.assertEquals( + PASS, + status[0], + "Failed to list Hypervisors in Zone 1" + ) + # Creating aTemplate in Zone 1 + template_created = Template.register( + self.userapiclient, + self.services["template"], + zones_list[0].id, + hypervisor=hypervisor_list[0].name + ) + self.assertIsNotNone( + template_created, + "Template creation failed" + ) + self.cleanup.append(template_created) + # Listing all the Templates for a User in Zone 1 + list_templates_zone1 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + zoneid=zones_list[0].id + ) + status = validateList(list_templates_zone1) + self.assertEquals( + PASS, + status[0], + "Templates creation failed in Zone1" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_templates_zone1), + "Failed to create a Template" + ) + # Listing all the Templates for a User in Zone 2 + list_templates_zone2 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + zoneid=zones_list[1].id + ) + # Verifying that no Templates are listed + self.assertIsNone( + list_templates_zone2, + "Templates listed for newly created User in Zone2" + ) + # Verifying the state of the template to be ready. If not waiting for state to become ready till time out + template_ready = False + count = 0 + while template_ready is False: + list_template = Template.list( + self.userapiclient, + id=template_created.id, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + ) + status = validateList(list_template) + self.assertEquals( + PASS, + status[0], + "Failed to list Templates by Id" + ) + if list_template[0].isready is True: + template_ready = True + elif (str(list_template[0].status) == "Error"): + self.fail("Created Template is in Errored state") + break + elif count > 10: + self.fail("Timed out before Template came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Copying the Template from Zone1 to Zone2 + copied_template = Template.copy( + self.userapiclient, + template_created.id, + sourcezoneid=template_created.zoneid, + destzoneid=zones_list[1].id + ) + self.assertIsNotNone( + copied_template, + "Copying Template from Zone1 to Zone2 failed" + ) + # Listing all the Templates for a User in Zone 1 + list_templates_zone1 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + zoneid=zones_list[0].id + ) + status = validateList(list_templates_zone1) + self.assertEquals( + PASS, + status[0], + "Templates creation failed in Zone1" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_templates_zone1), + "Failed to create a Template" + ) + # Listing all the Templates for a User in Zone 2 + list_templates_zone2 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + zoneid=zones_list[1].id + ) + status = validateList(list_templates_zone2) + self.assertEquals( + PASS, + status[0], + "Template failed to copy into Zone2" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_templates_zone2), + "Template failed to copy into Zone2" + ) + self.assertNotEquals( + "Connection refused", + list_templates_zone2[0].status, + "Failed to copy Template" + ) + self.assertEquals( + True, + list_templates_zone2[0].isready, + "Failed to copy Template" + ) + del self.services["template"]["url"] + del self.services["template"]["format"] + del self.services["template"]["ostype"] + return \ No newline at end of file diff --git a/test/integration/component/test_escalations_volumes.py b/test/integration/component/test_escalations_volumes.py new file mode 100644 index 0000000000..d1dae12681 --- /dev/null +++ b/test/integration/component/test_escalations_volumes.py @@ -0,0 +1,1703 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import * +from marvin.cloudstackException import * +from marvin.cloudstackAPI import * +from marvin.sshClient import SshClient +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * +from marvin.lib.utils import checkVolumeSize +from marvin.codes import SUCCESS +from nose.plugins.attrib import attr +from time import sleep + +class TestVolumes(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestVolumes, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + if cls.zone.localstorageenabled: + cls.storagetype = 'local' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' + cls.services["disk_offering"]["storagetype"] = 'local' + else: + cls.storagetype = 'shared' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' + cls.services["disk_offering"]["storagetype"] = 'shared' + + cls.services['mode'] = cls.zone.networktype + cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.services["custom_volume"]["zoneid"] = cls.zone.id + # Creating Disk offering, Service Offering and Account + cls.disk_offering = DiskOffering.create( + cls.api_client, + cls.services["disk_offering"] + ) + cls.service_offering = ServiceOffering.create( + cls.api_client, + cls.services["service_offerings"]["tiny"] + ) + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + # Creating Virtual Machine + cls.virtual_machine = VirtualMachine.create( + cls.userapiclient, + cls.services["virtual_machine"], + accountid=cls.account.name, + domainid=cls.account.domainid, + serviceofferingid=cls.service_offering.id, + ) + cls._cleanup.append(cls.virtual_machine) + cls._cleanup.append(cls.disk_offering) + cls._cleanup.append(cls.service_offering) + cls._cleanup.append(cls.account) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created volumes + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + + def __verify_values(self, expected_vals, actual_vals): + """ + @summary: Function to verify expected and actual values + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_01_list_volumes_pagination(self): + """ + @summary: Test List Volumes pagination + + Step1: Listing all the volumes for a user + Step2: Verifying listed volumes for account created at class level + Step3: If number of volumes is less than (page size + 1), then creating them + Step4: Listing all the volumes again after creation of volumes + Step5: Verifying the length of the volumes is (page size + 1) + Step6: Listing all the volumes in page1 + Step7: Verifying that the length of the volumes in page 1 is (page size) + Step8: Listing all the volumes in page2 + Step9: Verifying that the length of the volumes in page 2 is 1 + Step10: Deleting the volume present in page 2 + Step11: Listing for the volumes on page 2 + Step12: Verifying that there are no volumes present in page 2 + """ + # Listing all the volumes for a user + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + # Verifying listed volumes for account created at class level + self.assertIsNotNone( + list_volumes_before, + "create volume from VM failed at class setup method" + ) + self.assertEqual( + len(list_volumes_before), + 1, + "more than 1 volume created from VM at class level" + ) + + # If number of volumes is less than (pagesize + 1), then creating them + for i in range(0, (self.services["pagesize"])): + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + self.assertIsNotNone( + volume_created, + "Volume is not created" + ) + if(i < (self.services["pagesize"] - 1)): + self.cleanup.append(volume_created) + + self.assertEqual( + self.services["volume"]["diskname"], + volume_created.name, + "Newly created volume name and the test data volume name are not matching" + ) + + # Listing all the volumes again after creation of volumes + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + # Verifying the length of the volumes is (page size + 1) + self.assertEqual( + len(list_volumes_after), + (self.services["pagesize"] + 1), + "Number of volumes created is not matching expected" + ) + + # Listing all the volumes in page1 + list_volumes_page1 = Volume.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + self.assertIsNotNone( + list_volumes_page1, + "No volumes found in Page 1" + ) + # Verifying that the length of the volumes in page 1 is (page size) + self.assertEqual( + len(list_volumes_page1), + self.services["pagesize"], + "List Volume response is not matching with the page size length for page 1" + ) + + # Listing all the volumes in page2 + list_volumes_page2 = Volume.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + self.assertIsNotNone( + list_volumes_page2, + "No volumes found in Page 2" + ) + # Verifying that the length of the volumes in page 2 is 1 + self.assertEqual( + len(list_volumes_page2), + 1, + "List Volume response is not matching with the page size length for page 2" + ) + volume_page2 = list_volumes_page2[0] + + # Verifying that the volume on page 2 is not present in page1 + for i in range(0, len(list_volumes_page1)): + volume_page1 = list_volumes_page1[i] + self.assertNotEquals( + volume_page2.id, + volume_page1.id, + "Volume listed in page 2 is also listed in page 1" + ) + + # Deleting a single volume + Volume.delete(volume_created, self.userapiclient) + + # Listing the volumes in page 2 + list_volume_response = Volume.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + # verifying that volume does not exists on page 2 + self.assertEqual( + list_volume_response, + None, + "Volume was not deleted" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_02_list_volume_byid(self): + """ + @summary: Test List Volumes with Id + + Step1: Listing all the volumes for a user before creating a data volume + Step2: Verifying the length of the list as 1 + Step3: Creating a data volume + Step4: Listing all the volumes for a user after creating a data volume + Step5: Verifying the list volume size is increased by 1 + Step6: List the volumes by specifying root volume Id + Step7: Verifying the details of the root volume + Step8: List the volumes by specifying data volume Id + Step9: Verifying the details of the data volume + """ + # Listing all the volumes for a user before creating a data volume + list_volumes_before = Volume.list( + self.userapiclient, + listall=self.services["listall"] + ) + self.assertIsNotNone( + list_volumes_before, + "create volume from VM failed at class setup method") + # Verifying the length of the list as 1 + self.assertEqual( + len(list_volumes_before), + 1, + "more than 1 volume created at class level" + ) + root_volume = list_volumes_before[0] + + # Creating a data volume + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + self.assertIsNotNone( + volume_created, + "Volume is not created" + ) + self.cleanup.append(volume_created) + + self.assertEqual( + self.services["volume"]["diskname"], + volume_created.name, + "Newly created volume name and the test data volume name are not matching" + ) + # Listing all the volumes for a user after creating a data volume + list_volumes_after = Volume.list( + self.userapiclient, + listall=self.services["listall"] + ) + self.assertIsNotNone( + list_volumes_after, + "Volume creation failed" + ) + # Verifying the list volume size is increased by 1 + self.assertEqual( + len(list_volumes_before) + 1, + len(list_volumes_after), + "list volume is not matching with Number of volumes created" + ) + + # Listing a Root Volume by Id and verifying the volume details + list_volumes_by_id = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=root_volume.id + ) + self.assertIsNotNone( + list_volumes_by_id, + "Root volume is not listed" + ) + self.assertEqual( + 1, + len(list_volumes_by_id), + "list volume is not matching with Number of volumes created" + ) + obtained_volume = list_volumes_by_id[0] + + #Creating expected and actual values dictionaries + expected_dict = { + "id":root_volume.id, + "name":root_volume.name, + "vmname":self.virtual_machine.name, + "state":"Ready", + "type":"ROOT", + "zoneid":self.zone.id, + "account":self.account.name, + "storagetype":self.storagetype, + "size":self.template.size + } + actual_dict = { + "id":obtained_volume.id, + "name":obtained_volume.name, + "vmname":obtained_volume.vmname, + "state":obtained_volume.state, + "type":obtained_volume.type, + "zoneid":obtained_volume.zoneid, + "account":obtained_volume.account, + "storagetype":obtained_volume.storagetype, + "size":obtained_volume.size, + } + root_volume_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + root_volume_status, + "Listed Root Volume details are not as expected" + ) + # Listing a Data Volume by Id and verifying the volume details + list_volumes_by_id = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + self.assertIsNotNone( + list_volumes_by_id, + "Data volume is not listed" + ) + self.assertEqual( + len(list_volumes_by_id), + 1, + "list volume is not matching with Number of volumes created" + ) + obtained_volume = list_volumes_by_id[0] + + #Creating expected and actual values dictionaries + expected_dict = { + "id":volume_created.id, + "name":volume_created.name, + "state":"Allocated", + "type":"DATADISK", + "zoneid":self.zone.id, + "account":self.account.name, + "storagetype":self.storagetype, + "size":self.disk_offering.disksize + } + actual_dict = { + "id":obtained_volume.id, + "name":obtained_volume.name, + "state":obtained_volume.state, + "type":obtained_volume.type, + "zoneid":obtained_volume.zoneid, + "account":obtained_volume.account, + "storagetype":obtained_volume.storagetype, + "size":obtained_volume.size/(1024*1024*1024), + } + root_volume_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + root_volume_status, + "Listed Data Volume details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_03_data_volume_resize(self): + """ + @summary: Test to verify creation and resize of data volume + + Step1: Listing the volumes for a user before creating data volume + Step2: Creating a data volume + Step3: Listing the volumes for a user after creating data volume + Step4: Attaching and Detaching data volume created to Virtual Machine + Step5: Verifying if there exists a disk offering with higher size + If not present creating it + Step6: Resizing data volume + """ + # Listing volumes for a user before creating a volume + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + # Creating a data volume + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + self.assertIsNotNone(volume_created, "Data volume creation failed") + + self.cleanup.append(volume_created) + + # Listing volumes for a user after creating data volume + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Data volume creation failed" + ) + + # Attaching data volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + + # Detaching data volume from Virtual Machine + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + + # Verifying if there exists a disk offering with higher size. If not present creating it + list_disk_offerings = DiskOffering.list(self.apiClient) + + large_disk_offering_exists = False + # Converting disk_size in bytes to GB + current_disk_size = volume_created.size/(1024*1024*1024) + + for disk_offering in list_disk_offerings: + if ((disk_offering.disksize > current_disk_size) and (not disk_offering.iscustomized) and disk_offering.storagetype == self.storagetype): + new_disk_offering = disk_offering + large_disk_offering_exists = True + break + + if large_disk_offering_exists == False: + new_size = (volume_created.size/(1024*1024*1024)) + 1 + self.services["disk_offering"]["disksize"] = new_size + new_disk_offering = DiskOffering.create( + self.apiClient, + self.services["disk_offering"] + ) + if new_disk_offering is not None: + self.cleanup.append(new_disk_offering) + else: + new_size = new_disk_offering.disksize + + # Resizing data volume + resized_volume = volume_created.resize( + self.userapiclient, + diskofferingid=new_disk_offering.id, + shrinkok='false', + ) + self.assertIsNotNone(resized_volume, "Resize Volume failed") + # Verifying data volume size is increased + self.assertEquals( + new_size, + (resized_volume.size/(1024*1024*1024)), + "volume not resized to expected value" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_04_custom_volume_resize(self): + """ + @summary: Test to verify creation and resize of custom volume + + Step1: Checking if Custom disk offering already exists. + If not present then creating custom Disk Offering + Step2: Listing the volumes for a user before creating custom volume + Step3: Creating a custom volume + Step4: Listing the volumes for a user after creating custom volume + Step5: Attaching and Detaching custom volume created to Virtual Machine + Step6: Resizing custom volume + """ + # Listing all the disk offerings + list_disk_offerings = DiskOffering.list(self.apiClient) + + custom_disk_offering_exists = False + + # Verifying if a custom disk offering already exists + if list_disk_offerings is not None: + for disk_offering in list_disk_offerings: + if (disk_offering.iscustomized and disk_offering.storagetype == self.storagetype): + custom_disk_offering = disk_offering + custom_disk_offering_exists = True + break + + # If a custom disk offering does not exists, then creating a custom disk offering + if custom_disk_offering_exists == False: + custom_disk_offering = DiskOffering.create( + self.apiClient, + self.services["disk_offering"], + custom=True + ) + if custom_disk_offering is not None: + self.cleanup.append(custom_disk_offering) + + # Listing the volumes for a user before creating custom volume + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + # Creating a custom volume + volume_created = Volume.create_custom_disk( + self.userapiclient, + self.services["custom_volume"], + account=self.account.name, + domainid=self.account.domainid, + diskofferingid=custom_disk_offering.id + ) + self.assertIsNotNone( + volume_created, + "Custom volume did not get created" + ) + + self.cleanup.append(volume_created) + + # Listing the volumes for a user after creating custom volume + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + # Verifyign that volume list is increased by 1 after creation of custion volume + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Custom volume did not get created" + ) + + # Attaching custom volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + + # Detaching custom volume from Virtual Machine + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + + # Resizing custom volume + # Increasing custom disk size by 1 + new_size = self.services["custom_volume"]["customdisksize"] + 1 + resized_volume = volume_created.resize( + self.userapiclient, + diskofferingid=custom_disk_offering.id, + shrinkok='false', + size=new_size) + self.assertIsNotNone(resized_volume, "Resize Volume failed") + # Verifying that custom disk size is increased + self.assertEquals( + new_size, + (resized_volume.size/(1024*1024*1024)), + "volume not resized to expected value" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_05_volume_snapshot(self): + """ + @summary: Test to verify creation of snapshot from volume and creation of template, volume from snapshot + + Step1: Creating a volume + Step2: Attaching and Detaching custom volume created to Virtual Machine + Step3: Creating Snapshot from volume + Step4: Creating Volume from snapshot + Step5: Creating Template from Snapshot + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + + self.assertIsNotNone(volume_created, "Volume not created") + + if volume_created is not None: + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + # Attaching and Detaching custom volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + # Creating Snapshot from volume + snapshot_created = Snapshot.create( + self.userapiclient, + volume_created.id, + ) + + self.assertIsNotNone(snapshot_created, "Snapshot not created") + + self.cleanup.append(snapshot_created) + + #Creating expected and actual values dictionaries + expected_dict = { + "id":volume_created.id, + "intervaltype":"MANUAL", + "snapshottype":"MANUAL", + "volumetype":volume_created.type, + "domain":self.domain.id + } + actual_dict = { + "id":snapshot_created.volumeid, + "intervaltype":snapshot_created.intervaltype, + "snapshottype":snapshot_created.snapshottype, + "volumetype":snapshot_created.volumetype, + "domain":snapshot_created.domainid, + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Snapshot created from Volume details are not as expected" + ) + # Creating Volume from snapshot + cmd = createVolume.createVolumeCmd() + cmd.name = "-".join([self.services["volume"]["diskname"], random_gen()]) + cmd.snapshotid = snapshot_created.id + + volume_from_snapshot = Volume(self.userapiclient.createVolume(cmd).__dict__) + + self.assertIsNotNone( + volume_from_snapshot, + "Volume creation failed from snapshot" + ) + self.cleanup.append(volume_from_snapshot) + + #Creating expected and actual values dictionaries + expected_dict = { + "snapshotid":snapshot_created.id, + "volumetype":snapshot_created.volumetype, + "size":self.disk_offering.disksize, + "accounr":self.account.name, + "domain":self.domain.id, + "storagetype":self.storagetype, + "zone":self.zone.id + } + actual_dict = { + "snapshotid":volume_from_snapshot.snapshotid, + "volumetype":volume_from_snapshot.type, + "size":volume_from_snapshot.size/(1024*1024*1024), + "accounr":volume_from_snapshot.account, + "domain":volume_from_snapshot.domainid, + "storagetype":volume_from_snapshot.storagetype, + "zone":volume_from_snapshot.zoneid, + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Volume created from Snapshot details are not as expected" + ) + # Creating Template from Snapshot + list_templates_before = Template.list(self.userapiclient, templatefilter='self') + + if list_templates_before is None: + templates_before_size = 0 + else: + templates_before_size = len(list_templates_before) + + cmd = createTemplate.createTemplateCmd() + cmd.name = self.services["ostype"] + cmd.displaytext = self.services["ostype"] + cmd.ostypeid = self.template.ostypeid + cmd.snapshotid = snapshot_created.id + cmd.ispublic = False + cmd.passwordenabled = False + + template_from_snapshot = Template(self.userapiclient.createTemplate(cmd).__dict__) + + self.assertIsNotNone( + template_from_snapshot, + "Template creation failed from snapshot" + ) + + self.cleanup.append(template_from_snapshot) + + #Creating expected and actual values dictionaries + expected_dict = { + "name":self.services["ostype"], + "ostypeid":self.template.ostypeid, + "type":"USER", + "zone":self.zone.id, + "domain":self.domain.id, + "account":self.account.name, + "passwordenabled":False, + "ispublic":False, + "size":self.disk_offering.disksize + } + actual_dict = { + "name":template_from_snapshot.name, + "ostypeid":template_from_snapshot.ostypeid, + "type":template_from_snapshot.templatetype, + "zone":template_from_snapshot.zoneid, + "domain":template_from_snapshot.domainid, + "account":template_from_snapshot.account, + "passwordenabled":template_from_snapshot.passwordenabled, + "ispublic":template_from_snapshot.ispublic, + "size":template_from_snapshot.size/(1024*1024*1024) + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Template created from Snapshot details are not as expected" + ) + + list_templates_after = Template.list(self.userapiclient, templatefilter='self') + + self.assertEquals( + templates_before_size + 1, + len(list_templates_after), + "Template creation failed from snapshot" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_06_volume_snapshot_policy_hourly(self): + """ + @summary: Test to verify creation of Hourly Snapshot policies from volume + + Step1: Creating a Volume. + Step2: Attaching volume created in Step2 to virtual machine + Step3: Detaching the volume created in step2 from virtual machine + Step4: Listing snapshot policies for a volume created in step1 + Step5: Creating Hourly snapshot policy + Step6: Listing snapshot policies for a volume created in step1 again + Step7: Verifyign that the list snapshot policy length is increased by 1 + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + + self.assertIsNotNone(volume_created, "Volume not created") + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + + # Attaching volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + # Detaching volume created from Virtual Machine + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + # Creating Hourly Snapshot Policy from volume + self.services["recurring_snapshot"]["intervaltype"] = 'hourly' + self.services["recurring_snapshot"]["schedule"] = '1' + + list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + snapshot_policy_before_size = 0 + + if list_snapshot_policy_before is not None: + snapshot_policy_before_size = len(list_snapshot_policy_before) + + snapshot_policy_hourly = SnapshotPolicy.create( + self.userapiclient, + volume_created.id, + self.services["recurring_snapshot"] + ) + self.assertIsNotNone( + snapshot_policy_hourly, + "Hourly Snapshot policy creation failed" + ) + #Creating expected and actual values dictionaries + expected_dict = { + "schedule":self.services["recurring_snapshot"]["schedule"], + "intervaltype":0, + "volumeid":volume_created.id + } + actual_dict = { + "schedule":snapshot_policy_hourly.schedule, + "intervaltype":snapshot_policy_hourly.intervaltype, + "volumeid":snapshot_policy_hourly.volumeid + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Hourly Snapshot Policy details are not as expected" + ) + + list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + self.assertIsNotNone( + list_snapshot_policy_after, + "Hourly Snapshot policy creation failed" + ) + self.assertEquals( + snapshot_policy_before_size + 1, + len(list_snapshot_policy_after), + "Hourly Snapshot policy creation failed" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_07_volume_snapshot_policy_daily(self): + """ + @summary: Test to verify creation of Daily Snapshot policies from volume + + Step1: Creating a Volume. + Step2: Attaching volume created in Step2 to virtual machine + Step3: Detaching the volume created in step2 from virtual machine + Step4: Listing snapshot policies for a volume created in step1 + Step5: Creating Daily snapshot policy + Step6: Listing snapshot policies for a volume created in step1 again + Step7: Verifyign that the list snapshot policy length is increased by 1 + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + + self.assertIsNotNone(volume_created, "Volume not created") + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + # Attaching volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + # Detaching volume created from Virtual Machine + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + # Creating Daily Snapshot Policy from volume + self.services["recurring_snapshot"]["intervaltype"] = 'daily' + self.services["recurring_snapshot"]["schedule"] = '00:00' + + list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + snapshot_policy_before_size = 0 + + if list_snapshot_policy_before is not None: + snapshot_policy_before_size = len(list_snapshot_policy_before) + + snapshot_policy_daily = SnapshotPolicy.create( + self.userapiclient, + volume_created.id, + self.services["recurring_snapshot"] + ) + self.assertIsNotNone( + snapshot_policy_daily, + "Daily Snapshot policy creation failed" + ) + #Creating expected and actual values dictionaries + expected_dict = { + "schedule":self.services["recurring_snapshot"]["schedule"], + "intervaltype":1, + "volumeid":volume_created.id + } + actual_dict = { + "schedule":snapshot_policy_daily.schedule, + "intervaltype":snapshot_policy_daily.intervaltype, + "volumeid":snapshot_policy_daily.volumeid + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Daily Snapshot Policy details are not as expected" + ) + + list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + self.assertIsNotNone( + list_snapshot_policy_after, + "Daily Snapshot policy creation failed" + ) + self.assertEquals( + snapshot_policy_before_size + 1, + len(list_snapshot_policy_after), + "Daily Snapshot policy creation failed" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_08_volume_snapshot_policy_weekly(self): + """ + @summary: Test to verify creation of Weekly Snapshot policies from volume + + Step1: Creating a Volume. + Step2: Attaching volume created in Step2 to virtual machine + Step3: Detaching the volume created in step2 from virtual machine + Step4: Listing snapshot policies for a volume created in step1 + Step5: Creating Weekly snapshot policy + Step6: Listing snapshot policies for a volume created in step1 again + Step7: Verifyign that the list snapshot policy length is increased by 1 + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + + self.assertIsNotNone(volume_created, "Volume not created") + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + + # Attaching volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + # Detaching volume created to Virtual Machine + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + # Creating Weekly Snapshot Policy from volume + self.services["recurring_snapshot"]["intervaltype"] = 'weekly' + self.services["recurring_snapshot"]["schedule"] = '00:00:1' + + list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + snapshot_policy_before_size = 0 + + if list_snapshot_policy_before is not None: + snapshot_policy_before_size = len(list_snapshot_policy_before) + + snapshot_policy_weekly = SnapshotPolicy.create( + self.userapiclient, + volume_created.id, + self.services["recurring_snapshot"] + ) + self.assertIsNotNone( + snapshot_policy_weekly, + "Weekly Snapshot policy creation failed" + ) + #Creating expected and actual values dictionaries + expected_dict = { + "schedule":self.services["recurring_snapshot"]["schedule"], + "intervaltype":2, + "volumeid":volume_created.id + } + actual_dict = { + "schedule":snapshot_policy_weekly.schedule, + "intervaltype":snapshot_policy_weekly.intervaltype, + "volumeid":snapshot_policy_weekly.volumeid + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Weekly Snapshot Policy details are not as expected" + ) + + list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + self.assertIsNotNone( + list_snapshot_policy_after, + "Weekly Snapshot policy creation failed" + ) + self.assertEquals( + snapshot_policy_before_size + 1, + len(list_snapshot_policy_after), + "Weekly Snapshot policy creation failed" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_09_volume_snapshot_policy_monthly(self): + """ + @summary: Test to verify creation of Monthly Snapshot policies from volume + + Step1: Creating a Volume. + Step2: Attaching volume created in Step2 to virtual machine + Step3: Detaching the volume created in step2 from virtual machine + Step4: Listing snapshot policies for a volume created in step1 + Step5: Creating Monthly snapshot policy + Step6: Listing snapshot policies for a volume created in step1 again + Step7: Verifyign that the list snapshot policy length is increased by 1 + Step8: Deleting monthly snapshot policy created in step5 + Step9: List snapshot policies for a volume again + Step10: Verifying that the list snapshot policy length is decreased by 1 + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + self.assertIsNotNone(volume_created, "Volume not created") + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + # Attaching and Detaching custom volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + # Creating Monthly Snapshot Policy from volume + self.services["recurring_snapshot"]["intervaltype"] = 'monthly' + self.services["recurring_snapshot"]["schedule"] = '00:00:1' + + list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + snapshot_policy_before_size = 0 + + if list_snapshot_policy_before is not None: + snapshot_policy_before_size = len(list_snapshot_policy_before) + + snapshot_policy_monthly = SnapshotPolicy.create( + self.userapiclient, + volume_created.id, + self.services["recurring_snapshot"]) + self.assertIsNotNone( + snapshot_policy_monthly, + "Monthly Snapshot policy creation failed" + ) + #Creating expected and actual values dictionaries + expected_dict = { + "schedule":self.services["recurring_snapshot"]["schedule"], + "intervaltype":3, + "volumeid":volume_created.id + } + actual_dict = { + "schedule":snapshot_policy_monthly.schedule, + "intervaltype":snapshot_policy_monthly.intervaltype, + "volumeid":snapshot_policy_monthly.volumeid + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Monthly Snapshot Policy details are not as expected" + ) + + list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + self.assertIsNotNone( + list_snapshot_policy_after, + "Monthly Snapshot policy creation failed" + ) + self.assertEquals( + snapshot_policy_before_size + 1, + len(list_snapshot_policy_after), + "Monthly Snapshot policy creation failed" + ) + # Deleting monthly snapshot policy + SnapshotPolicy.delete(snapshot_policy_monthly, self.userapiclient) + + list_snapshot_policies = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + self.assertIsNone( + list_snapshot_policies, + "Deletion of Monthly Snapshot policy failed" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_10_volume_snapshots_pagination(self): + """ + @summary: Test to verify pagination of snapshots for Volume + + Step1: Creating a Volume. + Step2: Attaching volume created in Step2 to virtual machine + Step3: Detaching the volume created in step2 from virtual machine + Step4: Listing all the snapshots for a volume + Step5: Creating Pagesize + 1 number of snapshots for a volume + Step6: Listing all the snapshots for a volume + Step7: Verifying that there are pagesize + 1 number of snapshots listsed + Step8: Listing all the snapshots in page 1 + Step9: Listing all the snapshots in page 2 + Step10: Deleting the snapshot present in page 2 + Step11: Listign the snapshots from page 2 again and verifyign that list returns none + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + # Creating a Volume + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + self.assertIsNotNone(volume_created, "Volume not created") + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + #Attaching volume to virtual machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + #Detaching volume from virtual machine + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + + #Creating 3 Snapshots from volume + list_snapshot_before = Snapshot.list( + self.userapiclient, + volumeid=volume_created.id, + listall=self.services["listall"] + ) + self.assertIsNone( + list_snapshot_before, + "Newly created volume is already having snapshots" + ) + + list_snapshot_before_size = 0 + for i in range(0, 3): + snapshot_created = Snapshot.create( + self.userapiclient, + volume_created.id, + ) + self.assertIsNotNone(snapshot_created, "Snapshot not created") + self.cleanup.append(snapshot_created) + + self.assertEquals( + volume_created.id, + snapshot_created.volumeid, + "Snapshot not created for given volume" + ) + + list_snapshot_after = Snapshot.list( + self.userapiclient, + volumeid=volume_created.id, + listall=self.services["listall"] + ) + self.assertEqual( + list_snapshot_before_size+3, + len(list_snapshot_after), + "Number of snapshots created is not matching expected" + ) + #Listing all the snapshots in page1 + list_snapshots_page1 = Snapshot.list( + self.userapiclient, + volumeid=volume_created.id, + listall=self.services["listall"], + page=1, + pagesize=2 + ) + self.assertEqual( + 2, + len(list_snapshots_page1), + "List snapshots response is not matching with the page size length for page 1" + ) + + #Listing all the snapshots in page2 and ensuring only 1 snapshot is present + list_snapshots_page2 = Snapshot.list( + self.userapiclient, + volumeid=volume_created.id, + listall=self.services["listall"], + page=2, + pagesize=2 + ) + self.assertEqual( + len(list_snapshots_page2), + 1, + "List snapshots response is not matching with the page size length for page 2" + ) + snapshot_page2 = list_snapshots_page2[0] + + # Verifying that the snapshot on page 2 is not present in page1 + for i in range(0, len(list_snapshots_page1)): + snapshot_page1 = list_snapshots_page1[i] + self.assertNotEquals( + snapshot_page2.id, + snapshot_page1.id, + "Snapshot listed in page 2 is also listed in page 1" + ) + # Deleting a single snapshot and verifying that snapshot does not exists on page 2 + Snapshot.delete(snapshot_created, self.userapiclient) + + list_snapshot_page2 = Snapshot.list( + self.userapiclient, + volumeid=volume_created.id, + listall=self.services["listall"], + page=2, + pagesize=2 + ) + self.assertEqual( + None, + list_snapshot_page2, + "Snapshot was not deleted" + ) + list_snapshot_page1 = Snapshot.list( + self.userapiclient, + volumeid=volume_created.id, + listall=self.services["listall"], + page=1, + pagesize=2 + ) + self.assertEqual( + 2, + len(list_snapshot_page1), + "Snapshots on page 1 are not matching" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_11_volume_extract(self): + """ + @summary: Test to verify extract/download a Volume + + Step1: Listing Volumes before creating a Volume + Step2: Creating a Volume. + Step3: Verifying that created volume is not none and adding to clean up + Step4: Listing the volumes after creation + Step5: Verifying that the list volume size is increased by 1 + Step6: Attaching volume created in Step2 to virtual machine + Step7: Detaching the volume created in step2 from virtual machine + Step8: Extracting/Downloadign the volume + Step9: Verifyign that a download URL is created for volume download + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertIsNotNone( + list_volumes_before, + "volume not created for the vm launched at class level" + ) + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + + self.assertIsNotNone(volume_created, "Volume not created") + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertIsNotNone( + list_volumes_after, + "volume creation failed" + ) + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + #Attaching and Detaching volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + #Extract/Download the volume + self.services["mode"] = "HTTP_DOWNLOAD" + + extract_volume_response = Volume.extract( + self.userapiclient, + volume_created.id, + self.zone.id, + self.services["mode"] + ) + self.assertIsNotNone(extract_volume_response, "Extract/Download volume failed") + + self.assertEquals( + "DOWNLOAD_URL_CREATED", + extract_volume_response.state, + "Failed to create Download URL" + ) + self.assertIsNotNone( + extract_volume_response.url, + "Extract/Download volume URL is NULL" + ) + self.assertTrue( + (extract_volume_response.url.find("http")!=-1), + "Extract/Download volume URL doesnot contain http" + ) + self.assertEquals( + volume_created.id, + extract_volume_response.id, + "Extracted/Downloaded volume is not matching with original volume" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_12_volume_upload(self): + """ + @summary: Test to verify upload volume + + Step1: Listing the volumes for a user before uploading volume + Step2: Uploading a volume + Step3: Listing the volumes for a user after uploading data volume + Step4: Verifying that the list volume length after upload is increased by 1 + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertIsNotNone( + list_volumes_before, + "volume not created for the vm launched at class level" + ) + #Uploading a Volume + volume_uploaded = Volume.upload( + self.userapiclient, + self.services["upload_volume"], + self.zone.id + ) + self.assertIsNotNone(volume_uploaded, "volume uploading failed") + + self.assertEquals( + self.services["upload_volume"]["diskname"], + volume_uploaded.name, + "Uploaded volume name is not matching with name provided while uploading") + + #Listing the volumes for a user after uploading data volume + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertIsNotNone( + list_volumes_after, + "volume not created for the vm launched at class level" + ) + #Asserting that the list volume length after upload is increased by 1 + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "upload volume failed" + ) + return \ No newline at end of file diff --git a/test/integration/component/test_escalations_vpncustomergateways.py b/test/integration/component/test_escalations_vpncustomergateways.py new file mode 100644 index 0000000000..dc6576863d --- /dev/null +++ b/test/integration/component/test_escalations_vpncustomergateways.py @@ -0,0 +1,382 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackAPI import (createVolume, + createTemplate) +from marvin.lib.base import (Volume, + Iso, + VirtualMachine, + Template, + Snapshot, + SecurityGroup, + Account, + Zone, + Network, + NetworkOffering, + DiskOffering, + ServiceOffering, + VmSnapshot, + SnapshotPolicy, + SSHKeyPair, + Resources, + Configurations, + VpnCustomerGateway, + Hypervisor, + VpcOffering, + VPC, + NetworkACL) +from marvin.lib.common import (get_zone, + get_domain, + get_template, + list_os_types) +from marvin.lib.utils import (validateList, + cleanup_resources, + random_gen) +from marvin.codes import (PASS, FAIL, EMPTY_LIST) +from nose.plugins.attrib import attr +import time + +class TestVpnCustomerGateways(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestVpnCustomerGateways, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + cls.services['mode'] = cls.zone.networktype + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls._cleanup.append(cls.account) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_01_list_vpncustomergateways_pagination(self): + """ + @Desc: Test to List VPN Customer Gateways pagination + @steps: + Step1: Listing all the VPN Customer Gateways for a user + Step2: Verifying that no VPN Customer Gateways are listed + Step3: Creating (page size + 1) number of VPN Customer Gateways + Step4: Listing all the VPN Customer Gateways again for a user + Step5: Verifying that list size is (page size + 1) + Step6: Listing all the VPN Customer Gateways in page1 + Step7: Verifying that list size is (page size) + Step8: Listing all the VPN Customer Gateways in page2 + Step9: Verifying that list size is 1 + Step10: Deleting the VPN Customer Gateways present in page 2 + Step11: Listing all the VPN Customer Gateways in page2 + Step12: Verifying that no VPN Customer Gateways are listed + """ + # Listing all the VPN Customer Gateways for a User + list_vpncustomergateways_before = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying that no VPN Customer Gateways are listed + self.assertIsNone( + list_vpncustomergateways_before, + "VPN Customer Gateways listed for newly created User" + ) + # Creating pagesize + 1 number of VPN Customer Gateways + for i in range(0, (self.services["pagesize"] + 1)): + vpncustomergateway_created = VpnCustomerGateway.create( + self.userapiclient, + self.services["vpncustomergateway"], + name="VPNCustGateway"+str(i+1), + gateway="10.102.153." + str(i+1), + cidrlist="10.0.0.0/24", + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNotNone( + vpncustomergateway_created, + "VPN Customer Gateway creation failed" + ) + if (i < self.services["pagesize"] + 1): + self.cleanup.append(vpncustomergateway_created) + + # Listing all the VPN Customer Gateways for a User + list_vpncustomergateways_after = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_vpncustomergateways_after) + self.assertEquals( + PASS, + status[0], + "VPN Customer Gateway creation failed" + ) + # Verifying that list size is pagesize + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_vpncustomergateways_after), + "Failed to create pagesize + 1 number of VPN Customer Gateways" + ) + # Listing all the VPN Customer Gateways in page 1 + list_vpncustomergateways_page1 = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vpncustomergateways_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list VPN Customer Gateways in page 1" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_vpncustomergateways_page1), + "Size of VPN Customer Gateways in page 1 is not matching" + ) + # Listing all the VPN Customer Gateways in page 2 + list_vpncustomergateways_page2 = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vpncustomergateways_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list VPN Customer Gateways in page 2" + ) + # Verifying the list size to be equal to 1 + self.assertEquals( + 1, + len(list_vpncustomergateways_page2), + "Size of VPN Customer Gateways in page 2 is not matching" + ) + # Deleting the VPM Customer Gateway present in page 2 + VpnCustomerGateway.delete( + vpncustomergateway_created, + self.userapiclient + ) + # Listing all the VPN Customer Gateways in page 2 again + list_vpncustomergateways_page2 = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that there are no VPN Customer Gateways listed + self.assertIsNone( + list_vpncustomergateways_page2, + "VPN Customer Gateways not deleted from page 2" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_02_update_vpncustomergateways(self): + """ + @Desc: Test to update VPN Customer Gateways pagination + @steps: + Step1: Listing all the VPN Customer Gateways for a user + Step2: Verifying that no VPN Customer Gateways are listed + Step3: Creating a VPN Customer Gateways + Step4: Listing all the VPN Customer Gateways again for a user + Step5: Verifying that list size is 1 + Step6: Updating the VPN Customer Gateways created in step3 + Step7: Listing the VPN customer gateway by id + Step8: Verifying that list size is 1 + Step9: Verifying the details of the listed VPN customer gateway are same as updated in step6 + """ + # Listing all the VPN Customer Gateways for a User + list_vpncustomergateways_before = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying that no VPN Customer Gateways are listed + self.assertIsNone( + list_vpncustomergateways_before, + "VPN Customer Gateways listed for newly created User" + ) + # Creating A VPN Customer Gateways + vpncustomergateway_created = VpnCustomerGateway.create( + self.userapiclient, + self.services["vpncustomergateway"], + name="VPNCustGateway", + gateway="10.102.153.90", + cidrlist="10.0.0.0/24", + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNotNone( + vpncustomergateway_created, + "VPN Customer Gateway creation failed" + ) + self.cleanup.append(vpncustomergateway_created) + # Listing all the VPN Customer Gateways for a User + list_vpncustomergateways_after = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_vpncustomergateways_after) + self.assertEquals( + PASS, + status[0], + "VPN Customer Gateway creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_vpncustomergateways_after), + "Failed to create VPN Customer Gateways" + ) + # Updating the VPN Customer gateway + vpncustomergateway_updated = VpnCustomerGateway.update( + vpncustomergateway_created, + self.userapiclient, + self.services["vpncustomergateway"], + name="NewVPNCustGateway", + gateway="10.102.153.90", + cidrlist="10.0.0.0/24", + ) + self.assertIsNotNone( + vpncustomergateway_updated, + "Updation of VPN Customer Gateway failed" + ) + # Listing the VPN Customer Gateways by Id + list_vpncustomergateway = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"], + id=vpncustomergateway_created.id + ) + status = validateList(list_vpncustomergateway) + self.assertEquals( + PASS, + status[0], + "Failed to list VPN Customer Gateways by Id" + ) + # Verifying the list size to be equal to 1 + self.assertEquals( + 1, + len(list_vpncustomergateway), + "Size of VPN Customer Gateways by id is not matching" + ) + # Verifying the details of the listed VPN Customer Gateway are same as updated + #Creating expected and actual values dictionaries + expected_dict = { + "name":vpncustomergateway_updated.name, + "id":vpncustomergateway_updated.id, + "account":vpncustomergateway_updated.account, + "domainid":vpncustomergateway_updated.domainid, + "gateway":vpncustomergateway_updated.gateway, + "cidrlist":vpncustomergateway_updated.cidrlist, + "seckey":vpncustomergateway_updated.ipsecpsk, + "ikepolicy":vpncustomergateway_updated.ikepolicy, + "ikelifetime":vpncustomergateway_updated.ikelifetime, + "esppolicy":vpncustomergateway_updated.esppolicy, + "esplifetime":vpncustomergateway_updated.esplifetime, + } + actual_dict = { + "name":list_vpncustomergateway[0].name, + "id":list_vpncustomergateway[0].id, + "account":list_vpncustomergateway[0].account, + "domainid":list_vpncustomergateway[0].domainid, + "gateway":list_vpncustomergateway[0].gateway, + "cidrlist":list_vpncustomergateway[0].cidrlist, + "seckey":list_vpncustomergateway[0].ipsecpsk, + "ikepolicy":list_vpncustomergateway[0].ikepolicy, + "ikelifetime":list_vpncustomergateway[0].ikelifetime, + "esppolicy":list_vpncustomergateway[0].esppolicy, + "esplifetime":list_vpncustomergateway[0].esplifetime, + } + vpncustomergateway_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + vpncustomergateway_status, + "Listed VPN Customer Gateway details are not as Updated" + ) + return \ No newline at end of file diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py index 03b03b61e3..7d08e89eff 100644 --- a/tools/marvin/marvin/lib/base.py +++ b/tools/marvin/marvin/lib/base.py @@ -20,6 +20,7 @@ """ import marvin +from utils import is_server_ssh_ready, random_gen from marvin.cloudstackAPI import * from marvin.codes import (FAILED, FAIL, PASS, RUNNING, STOPPED, STARTING, DESTROYED, EXPUNGING, @@ -613,6 +614,12 @@ def delete(self, apiclient): cmd.id = self.id apiclient.destroyVirtualMachine(cmd) + def expung(self, apiclient): + """Expung an Instance""" + cmd = expungeVirtualMachine.expungeVirtualMachineCmd() + cmd.id = self.id + apiclient.expungeVirtualMachine(cmd) + def migrate(self, apiclient, hostid=None): """migrate an Instance""" cmd = migrateVirtualMachine.migrateVirtualMachineCmd() @@ -1498,6 +1505,18 @@ def create(cls, apiclient, services, ipaddressid=None, cmd.vpcid = vpcid return StaticNATRule(apiclient.createFirewallRule(cmd).__dict__) + @classmethod + def createIpForwardingRule(cls, apiclient, startport, endport, protocol, ipaddressid, openfirewall): + """Creates static ip forwarding rule""" + + cmd = createIpForwardingRule.createIpForwardingRuleCmd() + cmd.startport = startport + cmd.endport = endport + cmd.protocol = protocol + cmd.openfirewall = openfirewall + cmd.ipaddressid = ipaddressid + return StaticNATRule(apiclient.createIpForwardingRule(cmd).__dict__) + def delete(self, apiclient): """Delete IP forwarding rule""" cmd = deleteIpForwardingRule.deleteIpForwardingRuleCmd() @@ -1629,6 +1648,162 @@ def list(cls, apiclient, **kwargs): cmd.listall=True return(apiclient.listFirewallRules(cmd)) +class Autoscale: + + """Manage Auto scale""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def listCounters(cls, apiclient, **kwargs): + """Lists all available Counters.""" + + cmd = listCounters.listCountersCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listCounters(cmd)) + + @classmethod + def createCondition(cls, apiclient, counterid, relationaloperator, threshold): + """creates condition.""" + + cmd = createCondition.createConditionCmd() + cmd.counterid = counterid + cmd.relationaloperator = relationaloperator + cmd.threshold = threshold + return(apiclient.createCondition(cmd)) + + @classmethod + def listConditions(cls, apiclient, **kwargs): + """Lists all available Conditions.""" + + cmd = listConditions.listConditionsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listConditions(cmd)) + + @classmethod + def listAutoscalePolicies(cls, apiclient, **kwargs): + """Lists all available Autoscale Policies.""" + + cmd = listAutoScalePolicies.listAutoScalePoliciesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listAutoScalePolicies(cmd)) + + @classmethod + def createAutoscalePolicy(cls, apiclient, action, conditionids, duration, quiettime=None): + """creates condition.""" + + cmd = createAutoScalePolicy.createAutoScalePolicyCmd() + cmd.action = action + cmd.conditionids = conditionids + cmd.duration = duration + if quiettime: + cmd.quiettime = quiettime + + return(apiclient.createAutoScalePolicy(cmd)) + + @classmethod + def updateAutoscalePolicy(cls, apiclient, id, **kwargs): + """Updates Autoscale Policy.""" + + cmd = updateAutoScalePolicy.updateAutoScalePolicyCmd() + cmd.id = id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.updateAutoScalePolicy(cmd)) + + @classmethod + def listAutoscaleVmPofiles(cls, apiclient, **kwargs): + """Lists all available AutoscaleVM Profiles.""" + + cmd = listAutoScaleVmProfiles.listAutoScaleVmProfilesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listAutoScaleVmProfiles(cmd)) + + @classmethod + def createAutoscaleVmProfile(cls, apiclient, serviceofferingid, zoneid, templateid, + autoscaleuserid=None, destroyvmgraceperiod=None, counterparam=None): + """creates Autoscale VM Profile.""" + + cmd = createAutoScaleVmProfile.createAutoScaleVmProfileCmd() + cmd.serviceofferingid = serviceofferingid + cmd.zoneid = zoneid + cmd.templateid = templateid + if autoscaleuserid: + cmd.autoscaleuserid = autoscaleuserid + + if destroyvmgraceperiod: + cmd.destroyvmgraceperiod = destroyvmgraceperiod + + if counterparam: + for name, value in counterparam.items(): + cmd.counterparam.append({ + 'name': name, + 'value': value + }) + + return(apiclient.createAutoScaleVmProfile(cmd)) + + @classmethod + def updateAutoscaleVMProfile(cls, apiclient, id, **kwargs): + """Updates Autoscale Policy.""" + + cmd = updateAutoScaleVmProfile.updateAutoScaleVmProfileCmd() + cmd.id = id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.updateAutoScaleVmProfile(cmd)) + + @classmethod + def createAutoscaleVmGroup(cls, apiclient, lbruleid, minmembers, maxmembers, + scaledownpolicyids, scaleuppolicyids, vmprofileid, interval=None): + """creates Autoscale VM Group.""" + + cmd = createAutoScaleVmGroup.createAutoScaleVmGroupCmd() + cmd.lbruleid = lbruleid + cmd.minmembers = minmembers + cmd.maxmembers = maxmembers + cmd.scaledownpolicyids = scaledownpolicyids + cmd.scaleuppolicyids = scaleuppolicyids + cmd.vmprofileid = vmprofileid + if interval: + cmd.interval = interval + + return(apiclient.createAutoScaleVmGroup(cmd)) + + @classmethod + def listAutoscaleVmGroup(cls, apiclient, **kwargs): + """Lists all available AutoscaleVM Group.""" + + cmd = listAutoScaleVmGroups.listAutoScaleVmGroupsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listAutoScaleVmGroups(cmd)) + + @classmethod + def enableAutoscaleVmGroup(cls, apiclient, id, **kwargs): + """Enables AutoscaleVM Group.""" + + cmd = enableAutoScaleVmGroup.enableAutoScaleVmGroupCmd() + cmd.id = id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.enableAutoScaleVmGroup(cmd)) + + @classmethod + def disableAutoscaleVmGroup(cls, apiclient, id, **kwargs): + """Disables AutoscaleVM Group.""" + + cmd = disableAutoScaleVmGroup.disableAutoScaleVmGroupCmd() + cmd.id = id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.disableAutoScaleVmGroup(cmd)) + + @classmethod + def updateAutoscaleVMGroup(cls, apiclient, id, **kwargs): + """Updates Autoscale VM Group.""" + + cmd = updateAutoScaleVmGroup.updateAutoScaleVmGroupCmd() + cmd.id = id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.updateAutoScaleVmGroup(cmd)) + class ServiceOffering: @@ -2003,6 +2178,18 @@ def list(cls, apiclient, **kwargs): cmd.listall=True return(apiclient.listLoadBalancerRules(cmd)) + @classmethod + def listLoadBalancerRuleInstances(cls, apiclient, id, applied=None, **kwargs): + """Lists load balancing rule Instances""" + + cmd = listLoadBalancerRuleInstances.listLoadBalancerRuleInstancesCmd() + cmd.id = id + if applied: + cmd.applied = applied + + [setattr(cmd, k, v) for k, v in kwargs.items()] + return apiclient.listLoadBalancerRuleInstances(cmd) + class Cluster: @@ -2498,7 +2685,7 @@ def __init__(self, items): @classmethod def create(cls, apiclient, publicipid, account=None, domainid=None, - projectid=None, networkid=None, vpcid=None): + projectid=None, networkid=None, vpcid=None, openfirewall=None): """Create VPN for Public IP address""" cmd = createRemoteAccessVpn.createRemoteAccessVpnCmd() cmd.publicipid = publicipid @@ -2512,6 +2699,8 @@ def create(cls, apiclient, publicipid, account=None, domainid=None, cmd.networkid = networkid if vpcid: cmd.vpcid = vpcid + if openfirewall: + cmd.openfirewall = openfirewall return Vpn(apiclient.createRemoteAccessVpn(cmd).__dict__) def delete(self, apiclient): From d43d28ee84424359d5847fa6e53dabad176f037e Mon Sep 17 00:00:00 2001 From: Girish Shilamkar Date: Mon, 19 May 2014 01:56:58 -0400 Subject: [PATCH 463/683] Revert "CLOUDSTACK-6282 - Divided test_escalations.py into individual files based on functionality and added automed tests for Public IP Addresses" This reverts commit c5634570e25900f2e83a77a2ad20ad267bba8202. --- .../component/test_escalations_instances.py | 3448 -------------- .../component/test_escalations_ipaddresses.py | 4192 ----------------- .../component/test_escalations_isos.py | 783 --- .../test_escalations_securitygroups.py | 588 --- .../component/test_escalations_snapshots.py | 647 --- .../component/test_escalations_templates.py | 944 ---- .../component/test_escalations_volumes.py | 1703 ------- .../test_escalations_vpncustomergateways.py | 382 -- tools/marvin/marvin/lib/base.py | 191 +- 9 files changed, 1 insertion(+), 12877 deletions(-) delete mode 100644 test/integration/component/test_escalations_instances.py delete mode 100644 test/integration/component/test_escalations_ipaddresses.py delete mode 100644 test/integration/component/test_escalations_isos.py delete mode 100644 test/integration/component/test_escalations_securitygroups.py delete mode 100644 test/integration/component/test_escalations_snapshots.py delete mode 100644 test/integration/component/test_escalations_templates.py delete mode 100644 test/integration/component/test_escalations_volumes.py delete mode 100644 test/integration/component/test_escalations_vpncustomergateways.py diff --git a/test/integration/component/test_escalations_instances.py b/test/integration/component/test_escalations_instances.py deleted file mode 100644 index 9e040db9f7..0000000000 --- a/test/integration/component/test_escalations_instances.py +++ /dev/null @@ -1,3448 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -#Import Local Modules -from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.cloudstackAPI import (createVolume, - createTemplate) -from marvin.lib.base import (Volume, - Iso, - VirtualMachine, - Template, - Snapshot, - SecurityGroup, - Account, - Zone, - Network, - NetworkOffering, - DiskOffering, - ServiceOffering, - VmSnapshot, - SnapshotPolicy, - SSHKeyPair, - Resources, - Configurations, - VpnCustomerGateway, - Hypervisor, - VpcOffering, - VPC, - NetworkACL) -from marvin.lib.common import (get_zone, - get_domain, - get_template, - list_os_types) -from marvin.lib.utils import (validateList, - cleanup_resources, - random_gen) -from marvin.codes import (PASS, FAIL, EMPTY_LIST) -from nose.plugins.attrib import attr -import time - -class TestListInstances(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestListInstances, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - if cls.zone.localstorageenabled: - cls.storagetype = 'local' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' - cls.services["disk_offering"]["storagetype"] = 'local' - else: - cls.storagetype = 'shared' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' - cls.services["disk_offering"]["storagetype"] = 'shared' - - cls.services['mode'] = cls.zone.networktype - cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() - cls.services["virtual_machine"]["zoneid"] = cls.zone.id - cls.services["virtual_machine"]["template"] = cls.template.id - cls.services["custom_volume"]["zoneid"] = cls.zone.id - # Creating Disk offering, Service Offering and Account - cls.disk_offering = DiskOffering.create( - cls.api_client, - cls.services["disk_offering"] - ) - cls.service_offering = ServiceOffering.create( - cls.api_client, - cls.services["service_offerings"]["tiny"] - ) - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - # Updating resource Limits - for i in range(0,12): - Resources.updateLimit( - cls.api_client, - account=cls.account.name, - domainid=cls.domain.id, - max=-1, - resourcetype=i - ) - - cls._cleanup.append(cls.account) - cls._cleanup.append(cls.service_offering) - cls._cleanup.append(cls.disk_offering) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_01_list_instances_pagination(self): - """ - @Desc: Test List Instances pagination - @Steps: - Step1: Listing all the Instances for a user - Step2: Verifying listed Instances for account created at class level - Step3: If number of volumes is less than (page size + 1), then creating them - Step4: Listing all the volumes again after creation of volumes - Step5: Verifying the length of the volumes is (page size + 1) - Step6: Listing all the volumes in page1 - Step7: Verifying that the length of the volumes in page 1 is (page size) - Step8: Listing all the volumes in page2 - Step9: Verifying that the length of the volumes in page 2 is 1 - Step10: Deleting the volume present in page 2 - Step11: Listing for the volumes on page 2 - Step12: Verifying that there are no volumes present in page 2 - """ - # Listing all the instances for a user - list_instances_before = VirtualMachine.list(self.userapiclient, listall=self.services["listall"]) - - # Verifying listed instances for account created at class level - self.assertIsNone( - list_instances_before, - "Virtual Machine already exists for newly created user" - ) - # If number of instances are less than (pagesize + 1), then creating them - for i in range(0, (self.services["pagesize"] + 1)): - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - if(i < (self.services["pagesize"])): - self.cleanup.append(vm_created) - - self.assertEqual( - self.services["virtual_machine"]["displayname"], - vm_created.displayname, - "Newly created VM name and the test data VM name are not matching" - ) - - # Listing all the instances again after creating VM's - list_instances_after = VirtualMachine.list(self.userapiclient, listall=self.services["listall"]) - status = validateList(list_instances_after) - self.assertEquals( - PASS, - status[0], - "Listing of instances after creation failed" - ) - # Verifying the length of the instances is (page size + 1) - self.assertEqual( - len(list_instances_after), - (self.services["pagesize"] + 1), - "Number of instances created is not matching as expected" - ) - - # Listing all the volumes in page1 - list_instances_page1 = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid - ) - status = validateList(list_instances_page1) - self.assertEquals( - PASS, - status[0], - "Listing of instances in page1 failed" - ) - # Verifying that the length of the instances in page 1 is (page size) - self.assertEqual( - self.services["pagesize"], - len(list_instances_page1), - "List VM response is not matching with the page size length for page 1" - ) - - # Listing all the VM's in page2 - list_instances_page2 = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"], - domainid=self.account.domainid - ) - status = validateList(list_instances_page2) - self.assertEquals( - PASS, - status[0], - "Listing of instances in page2 failed" - ) - # Verifying that the length of the VM's in page 2 is 1 - self.assertEqual( - 1, - len(list_instances_page2), - "List VM response is not matching with the page size length for page 2" - ) - instance_page2 = list_instances_page2[0] - - # Verifying that the VM on page 2 is not present in page1 - for i in range(0, len(list_instances_page1)): - instance_page1 = list_instances_page1[i] - self.assertNotEquals( - instance_page2.id, - instance_page1.id, - "VM listed in page 2 is also listed in page 1" - ) - - # Deleting a single VM - VirtualMachine.delete(vm_created, self.userapiclient) - - # Listing the VM's in page 2 - list_instance_response = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"], - domainid=self.account.domainid - ) - # verifying that VM does not exists on page 2 - self.assertEqual( - list_instance_response, - None, - "VM was not deleted" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_02_list_Running_vm(self): - """ - @Desc: Test List Running VM's - @Steps: - Step1: Listing all the Running VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Listing all the Running VMs for a user again - Step5: Verifying that the size of the list is increased by 1 - Step6: Verifying that the details of the Running VM listed are same as the VM deployed in Step3 - """ - # Listing all the Running VM's for a User - list_running_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Running" - ) - self.assertIsNone( - list_running_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the Running VM's for a User - list_running_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Running" - ) - status = validateList(list_running_vms_after) - self.assertEquals( - PASS, - status[0], - "Newly created VM is not in Running state" - ) - # Verifying list size is 1 - self.assertEquals( - 1, - len(list_running_vms_after), - "Running VM list count is not matching" - ) - running_vm = list_running_vms_after[0] - - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":"Running", - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":running_vm.id, - "name":running_vm.name, - "displayname":running_vm.displayname, - "state":running_vm.state, - "zoneid":running_vm.zoneid, - "account":running_vm.account, - "template":running_vm.templateid - } - running_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - running_vm_status, - "Listed Running VM details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_03_list_Stopped_vm(self): - """ - @Desc: Test List Stopped VM's - @Steps: - Step1: Listing all the Stopped VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Stopping the VM deployed in step3 - Step5: Listing all the Stopped VMs for a user again - Step6: Verifying that the size of the list is increased by 1 - Step7: Verifying that the details of the Stopped VM listed are same as the VM stopped in Step4 - """ - # Listing all the Stopped VM's for a User - list_stopped_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Stopped" - ) - self.assertIsNone( - list_stopped_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Stopping the VM - VirtualMachine.stop(vm_created, self.userapiclient) - # Listing all the Stopped VM's for a User - list_stopped_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Stopped" - ) - status = validateList(list_stopped_vms_after) - self.assertEquals( - PASS, - status[0], - "Stopped VM is not in Stopped state" - ) - # Verifying list size is 1 - self.assertEquals( - 1, - len(list_stopped_vms_after), - "Stopped VM list count is not matching" - ) - stopped_vm = list_stopped_vms_after[0] - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":"Stopped", - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":stopped_vm.id, - "name":stopped_vm.name, - "displayname":stopped_vm.displayname, - "state":stopped_vm.state, - "zoneid":stopped_vm.zoneid, - "account":stopped_vm.account, - "template":stopped_vm.templateid - } - stopped_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - stopped_vm_status, - "Listed Stopped VM details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_04_list_Destroyed_vm(self): - """ - @Desc: Test List Destroyed VM's - @Steps: - Step1: Listing all the Destroyed VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Destroyed the VM deployed in step3 - Step5: Listing all the Destroyed VMs for a user again - Step6: Verifying that destroyed VM is not listed for User - Step7: Listing all the destroyed VMs as admin - Step8: Verifying that the size of the list is 1 - Step9: Verifying that the details of the Destroyed VM listed are same as the VM destroyed in Step4 - """ - # Listing all the Destroyed VM's for a User - list_destroyed_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Destroyed" - ) - self.assertIsNone( - list_destroyed_vms_before, - "Virtual Machine in Destroyed state already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - # Destroying the VM - VirtualMachine.delete(vm_created, self.userapiclient) - # Listing all the Destroyed VM's for a User - list_destroyed_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Destroyed" - ) - self.assertIsNone( - list_destroyed_vms_after, - "Destroyed VM is not in destroyed state" - ) - # Listing destroyed VMs as admin user - list_destroyed_vms_admin = VirtualMachine.list( - self.apiClient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Destroyed", - id=vm_created.id - ) - status = validateList(list_destroyed_vms_admin) - self.assertEquals( - PASS, - status[0], - "Destroyed VM is not in Destroyed state" - ) - # Verifying that the length of the destroyed VMs list should be 1 - self.assertEquals( - 1, - len(list_destroyed_vms_admin), - "Destroyed VM list count is not matching" - ) - destroyed_vm = list_destroyed_vms_admin[0] - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":"Destroyed", - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":destroyed_vm.id, - "name":destroyed_vm.name, - "displayname":destroyed_vm.displayname, - "state":destroyed_vm.state, - "zoneid":destroyed_vm.zoneid, - "account":destroyed_vm.account, - "template":destroyed_vm.templateid - } - destroyed_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - destroyed_vm_status, - "Listed Destroyed VM details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_05_list_vm_by_id(self): - """ - @Desc: Test List VM by Id - @Steps: - Step1: Listing all the VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Listing all the VMs for a user again - Step5: Verifying that the size of the list is increased by 1 - Step6: List a VM by specifying the Id if the VM deployed in Step3 - Step7: Verifying that the details of the Listed VM are same as the VM deployed in Step3 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - account=self.account.name - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VM's for a User - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - account=self.account.name - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "Listing of VM after creation failed" - ) - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing a VM by Id - list_vm_byid = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - id=vm_created.id - ) - status = validateList(list_vm_byid) - self.assertEquals( - PASS, - status[0], - "Listing of VM by Id failed" - ) - listed_vm = list_vm_byid[0] - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":vm_created.state, - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":listed_vm.id, - "name":listed_vm.name, - "displayname":listed_vm.displayname, - "state":listed_vm.state, - "zoneid":listed_vm.zoneid, - "account":listed_vm.account, - "template":listed_vm.templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM by Id details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_06_list_vm_by_name(self): - """ - @Desc: Test List VM's by Name - @Steps: - Step1: Listing all the VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a 2 VM's - Step4: Listing all the VMs for a user again - Step5: Verifying that list size is increased by 2 - Step6: Listing the VM by specifying complete name of VM-1 created in step3 - Step7: Verifying that the size of the list is 1 - Step8: Verifying that the details of the listed VM are same as the VM-1 created in step3 - Step9: Listing the VM by specifying the partial name of VM - Step10: Verifying that the size of the list is 2 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - vms = {} - for i in range(0, 2): - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - vms.update({i: vm_created}) - - # Listing all the VM's for a User - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM's creation failed" - ) - self.assertEquals( - 2, - len(list_vms_after), - "VM's list count is not matching" - ) - # Listing the VM by complete name - list_vm_byfullname = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - name=vms[0].name - ) - status = validateList(list_vm_byfullname) - self.assertEquals( - PASS, - status[0], - "Failed to list VM by Name" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vm_byfullname), - "VM list by full name count is not matching" - ) - # Verifying that the details of the listed VM are same as the VM created above - #Creating expected and actual values dictionaries - expected_dict = { - "id":vms[0].id, - "name":vms[0].name, - "displayname":vms[0].displayname, - "state":vms[0].state, - "zoneid":vms[0].zoneid, - "account":vms[0].account, - "template":vms[0].templateid - } - actual_dict = { - "id":list_vm_byfullname[0].id, - "name":list_vm_byfullname[0].name, - "displayname":list_vm_byfullname[0].displayname, - "state":list_vm_byfullname[0].state, - "zoneid":list_vm_byfullname[0].zoneid, - "account":list_vm_byfullname[0].account, - "template":list_vm_byfullname[0].templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM details are not as expected" - ) - # Listing the VM by partial name - list_vm_bypartialname = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - domainid=self.account.domainid, - name=vms[0].name[:1] - ) - status = validateList(list_vm_bypartialname) - self.assertEquals( - PASS, - status[0], - "Failed to list VM by Name" - ) - # Verifying that the size of the list is 2 - self.assertEquals( - 2, - len(list_vm_bypartialname), - "VM list by full name count is not matching" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_07_list_vm_by_name_state(self): - """ - @Desc: Test List VM's by Name and State - @Steps: - Step1: Listing all the VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Listing all the VMs for a user again - Step5: Verifying that list size is increased by 1 - Step6: Listing the VM by specifying name of VM created in step3 and state as Running (matching name and state) - Step7: Verifying that the size of the list is 1 - Step8: Verifying that the details of the listed VM are same as the VM created in step3 - Step9: Listing the VM by specifying name of VM created in step3 and state as Stopped (non matching state) - Step10: Verifying that the size of the list is 0 - Step11: Listing the VM by specifying non matching name and state as Running (non matching name) - Step12: Verifying that the size of the list is 0 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VM's for a User - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM's creation failed" - ) - self.assertEquals( - 1, - len(list_vms_after), - "VM's list count is not matching" - ) - # Listing the VM by matching Name and State - list_running_vm = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - name=vm_created.name, - state="Running" - ) - status = validateList(list_running_vm) - self.assertEquals( - PASS, - status[0], - "List VM by name and state failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_running_vm), - "Count of VM list by name and state is not matching" - ) - # Verifying that the details of the listed VM are same as the VM created above - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":"Running", - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":list_running_vm[0].id, - "name":list_running_vm[0].name, - "displayname":list_running_vm[0].displayname, - "state":list_running_vm[0].state, - "zoneid":list_running_vm[0].zoneid, - "account":list_running_vm[0].account, - "template":list_running_vm[0].templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM details are not as expected" - ) - # Listing the VM by matching name and non matching state - list_running_vm = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - name=vm_created.name, - state="Stopped" - ) - self.assertIsNone( - list_running_vm, - "Listed VM with non matching state" - ) - # Listing the VM by non matching name and matching state - list_running_vm = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - name="name", - state="Running" - ) - self.assertIsNone( - list_running_vm, - "Listed VM with non matching name" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_08_list_vm_by_zone(self): - """ - @Desc: Test List VM by Zone. - This test case is applicable for a setup having multiple zones. - @Steps: - Step1: Listing all the zones - Step2: Checking if there are multiple zones in the setup. - Continuing below steps only if there are multiple zones - Step3: Listing template for zone - Step4: Listing all the VMs for a user - Step5: Verifying that the size of the list is 0 - Step6: Deploying a VM - Step7: Listing all the VMs for a user again for matching zone - Step8: Verifying that the size of the list is 1 - Step9: Verifying that the details of the Listed VM are same as the VM deployed in Step6 - Step10: Listing all the VMs for a user again for non-matching zone - Step11: Verifying that the size of the list is 0 - """ - # Listing all the zones available - zones_list = Zone.list(self.apiClient) - status = validateList(zones_list) - self.assertEquals( - PASS, - status[0], - "zones not available in the given setup" - ) - current_zone = self.services["virtual_machine"]["zoneid"] - current_template = self.services["virtual_machine"]["template"] - # Checking if there are multiple zones in the setup. - if not len(zones_list) > 1: - self.debug("Setup is not having multiple zones") - else: - # Getting the template available under the zone - template = get_template( - self.apiClient, - zones_list[0].id, - self.services["ostype"] - ) - self.assertIsNotNone( - template, - "Template not found for zone" - ) - self.services["virtual_machine"]["zoneid"] = zones_list[0].id - self.services["virtual_machine"]["template"] = template.id - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[0].id - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again for matching zone - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[0].id - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - listed_vm = list_vms_after[0] - # Verifying that the details of the Listed VM are same as the VM deployed above - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":vm_created.state, - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":listed_vm.id, - "name":listed_vm.name, - "displayname":listed_vm.displayname, - "state":listed_vm.state, - "zoneid":listed_vm.zoneid, - "account":listed_vm.account, - "template":listed_vm.templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM by Id details are not as expected" - ) - # Listing all the VMs for a user again for non-matching zone - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[1].id - ) - self.assertIsNone( - list_vms, - "VM's listed for non matching zone" - ) - self.services["virtual_machine"]["zoneid"] = current_zone - self.services["virtual_machine"]["template"] = current_template - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_09_list_vm_by_zone_name(self): - """ - @Desc: Test List VM by Zone. - This test case is applicable for a setup having multiple zones. - @Steps: - Step1: Listing all the zones - Step2: Checking if there are multiple zones in the setup. - Continuing below steps only if there are multiple zones - Step3: Listing template for zone - Step4: Listing all the VMs for a user - Step5: Verifying that the size of the list is 0 - Step6: Deploying a VM - Step7: Listing all the VMs for a user again - Step8: Verifying that list size is increased by 1 - Step9: Listing the VM by specifying name of VM created in step6 and matching zone (matching name and zone) - Step10: Verifying that the size of the list is 1 - Step11: Verifying that the details of the listed VM are same as the VM created in step3 - Step12: Listing the VM by specifying name of VM created in step6 and non matching zone (non matching zone) - Step13: Verifying that the size of the list is 0 - Step14: Listing the VM by specifying non matching name and matching zone (non matching name) - Step15: Verifying that the size of the list is 0 - """ - # Listing all the zones available - zones_list = Zone.list(self.apiClient) - status = validateList(zones_list) - self.assertEquals( - PASS, - status[0], - "zones not available in the given setup" - ) - current_zone = self.services["virtual_machine"]["zoneid"] - current_template = self.services["virtual_machine"]["template"] - # Checking if there are multiple zones in the setup. - if not len(zones_list) > 1: - self.debug("Setup is not having multiple Zones") - else: - # Getting the template available under the zone - template = get_template( - self.apiClient, - zones_list[0].id, - self.services["ostype"] - ) - self.assertIsNotNone( - template, - "Template not found for zone" - ) - self.services["virtual_machine"]["zoneid"] = zones_list[0].id - self.services["virtual_machine"]["template"] = template.id - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[0].id, - account=self.account.name - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again for matching zone - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[0].id, - account=self.account.name - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing the VM by specifying name of VM created in above and matching zone - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[0].id, - name=vm_created.name - ) - status = validateList(list_vms) - self.assertEquals( - PASS, - status[0], - "Listing VM's by name and zone failed" - ) - # Verifying Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms), - "Count of listed VM's by name and zone is not as expected" - ) - listed_vm = list_vms[0] - # Verifying that the details of the Listed VM are same as the VM deployed above - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":vm_created.state, - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":listed_vm.id, - "name":listed_vm.name, - "displayname":listed_vm.displayname, - "state":listed_vm.state, - "zoneid":listed_vm.zoneid, - "account":listed_vm.account, - "template":listed_vm.templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM by Id details are not as expected" - ) - # Listing the VM by specifying name of VM created in step3 and non matching zone - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[1].id, - name=vm_created.name - ) - self.assertIsNone( - list_vms, - "VM's listed for non matching zone" - ) - # Listing the VM by specifying non matching name of VM and matching zone - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[0].id, - name="name" - ) - self.assertIsNone( - list_vms, - "VM's listed for non matching zone" - ) - self.services["virtual_machine"]["zoneid"] = current_zone - self.services["virtual_machine"]["template"] = current_template - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_10_list_vm_by_zone_name_state(self): - """ - @Desc: Test List VM by Zone. - @Steps: - Step1: Listing all the VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Listing all the VMs for a user again - Step5: Verifying that list size is increased by 1 - Step6: Listing the VM by specifying name of VM created in step3 and matching zone and state as Running - Step7: Verifying that the size of the list is 1 - Step8: Verifying that the details of the listed VM are same as the VM created in step3 - Step9: Listing the VM by specifying name of VM created in step3 and matching zone and state as Stopped - Step10: Verifying that the size of the list is 0 - Step11: Listing the VM by name, Zone and account - Step12: Verifying that the size of the list is 1 - Step13: Verifying that the details of the listed VM are same as the VM created in step3 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - account=self.account.name - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again for matching zone - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - account=self.account.name - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing the VM by specifying name of VM created in step3 and matching zone and state as Running - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - name=vm_created.name, - state="Running" - ) - status = validateList(list_vms) - self.assertEquals( - PASS, - status[0], - "Listing VM's by name and zone failed" - ) - # Verifying Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms), - "Count of listed VM's by name, zone and state is not as expected" - ) - listed_vm = list_vms[0] - # Verifying that the details of the Listed VM are same as the VM deployed above - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":vm_created.state, - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":listed_vm.id, - "name":listed_vm.name, - "displayname":listed_vm.displayname, - "state":listed_vm.state, - "zoneid":listed_vm.zoneid, - "account":listed_vm.account, - "template":listed_vm.templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM by Id details are not as expected" - ) - # Listing the VM by specifying name of VM created in step3, zone and State as Stopped - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - name=vm_created.name, - state="Stopped" - ) - self.assertIsNone( - list_vms, - "VM's listed for non matching zone" - ) - # Listing the VM by name, zone and account - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - name=vm_created.name, - account=self.account.name - ) - status = validateList(list_vms) - self.assertEquals( - PASS, - status[0], - "Listing VM's by name, account and zone failed" - ) - # Verifying Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms), - "Count of listed VM's by name, zone and account is not as expected" - ) - listed_vm = list_vms[0] - # Verifying that the details of the Listed VM are same as the VM deployed above - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":vm_created.state, - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":listed_vm.id, - "name":listed_vm.name, - "displayname":listed_vm.displayname, - "state":listed_vm.state, - "zoneid":listed_vm.zoneid, - "account":listed_vm.account, - "template":listed_vm.templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM by Id details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_11_register_reset_vm_sshkey(self): - """ - @Desc: Test to verify registering and reset of SSH Key for VM - @Steps: - Step1: Deploying a VM - Step2: Stopping the VM deployed in step1 - Step3: Listing all the SSH Key pairs - Step4: Registering a SSH Key pair - Step5: Listing all the SSh Key pairs again - Step6: Verifying that the key pairs list is increased by 1 - Step7: Resetting the VM SSH Key to the key pair registered in step4 - Step8: Verifying that the registered SSH Key pair is set to the VM - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Stopping the VM deployed above - vm_created.stop( - self.userapiclient, - forced=True - ) - # Listing all the SSH Key pairs - list_keypairs_before = SSHKeyPair.list( - self.userapiclient - ) - list_keypairs_before_size = 0 - if list_keypairs_before is not None: - list_keypairs_before_size = len(list_keypairs_before) - - # Registering new Key pair - new_keypair = SSHKeyPair.register( - self.userapiclient, - name="keypair1", - publickey="ssh-rsa: e6:9a:1e:b5:98:75:88:5d:56:bc:92:7b:43:48:05:b2" - ) - self.assertIsNotNone( - new_keypair, - "New Key pair generation failed" - ) - self.assertEquals( - "keypair1", - new_keypair.name, - "Key Pair not created with given name" - ) - # Listing all the SSH Key pairs again - list_keypairs_after = SSHKeyPair.list( - self.userapiclient - ) - status = validateList(list_keypairs_after) - self.assertEquals( - PASS, - status[0], - "Listing of Key pairs failed" - ) - # Verifying that list size is increased by 1 - self.assertEquals( - list_keypairs_before_size + 1, - len(list_keypairs_after), - "List count is not matching" - ) - # Resetting the VM SSH key to the Key pair created above - vm_created.resetSshKey( - self.userapiclient, - keypair=new_keypair.name - ) - # Listing VM details again - list_vm = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vm) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - self.assertEquals( - 1, - len(list_vm), - "VMs list is not as expected" - ) - # Verifying that VM's SSH keypair is set to newly created keypair - self.assertEquals( - new_keypair.name, - list_vm[0].keypair, - "VM is not set to newly created SSH Key pair" - ) - return - - @attr(tags=["advanced", "provisioning"]) - def test_12_vm_nics(self): - """ - @Desc: Test to verify Nics for a VM - @Steps: - Step1: Deploying a VM - Step2: Listing all the Networks - Step3: Verifying that the list size is 1 - Step4: Creating 1 network - Step5: Listing all the networks again - Step6: Verifying that the list size is 2 - Step7: Verifying that VM deployed in step1 has only 1 nic - and it is same as network listed in step3 - Step8: Adding the networks created in step4 to VM deployed in step1 - Step9: Verifying that VM deployed in step1 has 2 nics - Step10: Verifying that isdefault is set to true for only 1 nic - Step11: Verifying that isdefault is set to true for the Network created when deployed a VM - Step12: Making the nic created in step4 as default nic - Step13: Verifying that isdefault is set to true for only 1 nic - Step14: Verifying that the isdefault is set to true for the nic created in step4 - Step15: Removing the non-default nic from VM - Step16: Verifying that VM deployed in step1 has only 1 nic - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing all the networks before - list_network_before = Network.list( - self.userapiclient, - isdefault="true", - zoneid=self.zone.id, - account=self.account.name, - domainid=self.domain.id - ) - status = validateList(list_network_before) - self.assertEquals( - PASS, - status[0], - "Default Network not created when deploying a VM" - ) - # Verifying that only 1 network is created while deploying a VM - self.assertEquals( - 1, - len(list_network_before), - "More than 1 default network exists" - ) - network1 = list_network_before[0] - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat", - zoneid=self.zone.id - ) - self.assertIsNotNone( - network_offerings_list, - "Isolated Network Offerings with sourceNat enabled are not found" - ) - # Creating one more network - network2 = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network2, - "Network creation failed" - ) - self.cleanup.append(network2) - # Listing all the networks again - list_network_after = Network.list( - self.userapiclient, - zoneid=self.zone.id, - account=self.account.name, - domainid=self.domain.id - ) - status = validateList(list_network_after) - self.assertEquals( - PASS, - status[0], - "List of Networks failed" - ) - # Verifying that list size is 2 - self.assertEquals( - 2, - len(list_network_after), - "More than 1 default network exists" - ) - # Verifying that VM created is having only 1 nic - vm_nics_before = vm_created.nic - self.assertIsNotNone( - vm_nics_before, - "Nic not found for the VM deployed" - ) - self.assertEquals( - 1, - len(vm_nics_before), - "VM Nic count is not matching" - ) - # Verifying that the nic is same as the default network listed above - self.assertEquals( - network1.id, - vm_nics_before[0].networkid, - "Default NIC for VM is not as expected" - ) - # Adding network2 created above to VM - VirtualMachine.add_nic( - vm_created, - self.userapiclient, - network2.id - ) - # Listing the Vm details again - list_vms_after = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - vm = list_vms_after[0] - # Verifying that VM nics size is 2 now - vm_nics_after = vm.nic - self.assertIsNotNone( - vm_nics_after, - "Nic not found for the deployed VM" - ) - self.assertEquals( - 2, - len(vm_nics_after), - "VM NIC's count is not matching" - ) - # Verifying that isdefault is set to true for only 1 nic - default_count = 0 - for i in range(0, len(vm_nics_after)): - if vm_nics_after[i].isdefault is True: - default_count = default_count + 1 - default_nic = vm_nics_after[i] - else: - non_default_nic = vm_nics_after[i] - self.assertEquals( - 1, - default_count, - "Default NIC count is not matching" - ) - # Verifying that default NIC is same the network created when VM is deployed - self.assertEquals( - network1.id, - default_nic.networkid, - "Default NIC is not matching for VM" - ) - # Updating network 2 as default NIC - vm_created.update_default_nic( - self.userapiclient, - non_default_nic.id - ) - # Listing the Vm details again - list_vms_after = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - vm = list_vms_after[0] - # Verifying that VM nics size is 2 now - vm_nics_after = vm.nic - self.assertIsNotNone( - vm_nics_after, - "Nic not found for the deployed VM" - ) - self.assertEquals( - 2, - len(vm_nics_after), - "VM NIC's count is not matching" - ) - # Verifying that isdefault is set to true for only 1 nic - default_count = 0 - for i in range(0, len(vm_nics_after)): - if vm_nics_after[i].isdefault is True: - default_count = default_count + 1 - default_nic = vm_nics_after[i] - else: - non_default_nic = vm_nics_after[i] - - self.assertEquals( - 1, - default_count, - "Default NIC count is not matching" - ) - # Verifying that default NIC is same the newly updated network (network 2) - self.assertEquals( - network2.id, - default_nic.networkid, - "Default NIC is not matching for VM" - ) - # Deleting non default NIC - vm_created.remove_nic( - self.userapiclient, - non_default_nic.id - ) - # Listing the Vm details again - list_vms_after = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - vm = list_vms_after[0] - # Verifying that VM nics size is 1 now - vm_nics_after = vm.nic - self.assertIsNotNone( - vm_nics_after, - "Nic not found for the deployed VM" - ) - self.assertEquals( - 1, - len(vm_nics_after), - "VM NIC's count is not matching" - ) - # Verifying the nic network is same as the default nic network - self.assertEquals( - network2.id, - vm_nics_after[0].networkid, - "VM NIC is not same as expected" - ) - return - -class TestInstances(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestInstances, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - if cls.zone.localstorageenabled: - cls.storagetype = 'local' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' - cls.services["disk_offering"]["storagetype"] = 'local' - else: - cls.storagetype = 'shared' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' - cls.services["disk_offering"]["storagetype"] = 'shared' - - cls.services['mode'] = cls.zone.networktype - cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() - cls.services["virtual_machine"]["zoneid"] = cls.zone.id - cls.services["virtual_machine"]["template"] = cls.template.id - cls.services["custom_volume"]["zoneid"] = cls.zone.id - - # Creating Disk offering, Service Offering and Account - cls.disk_offering = DiskOffering.create( - cls.api_client, - cls.services["disk_offering"] - ) - cls.service_offering = ServiceOffering.create( - cls.api_client, - cls.services["service_offerings"]["tiny"] - ) - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - # Updating resource Limits - for i in range(0,12): - Resources.updateLimit( - cls.api_client, - account=cls.account.name, - domainid=cls.domain.id, - max=-1, - resourcetype=i - ) - cls._cleanup.append(cls.account) - cls._cleanup.append(cls.service_offering) - cls._cleanup.append(cls.disk_offering) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_13_attach_detach_iso(self): - """ - @Desc: Test Attach ISO to VM and Detach ISO from VM. - @Steps: - Step1: Listing all the VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Listing all the VMs for a user again - Step5: Verifying that list size is increased by 1 - Step6: Listing all the ready ISO's - Step7: If size of the list is >= 1 continuing to next steps - Step8: Attaching the ISO listed to VM deployed in Step3 - Step9: Verifying that the attached ISO details are associated with VM - Step10: Detaching the ISO attached in step8 - Step11: Verifying that detached ISO details are not associated with VM - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - account=self.account.name - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again for matching zone - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - account=self.account.name - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing the ISO's in ready state - isos_list = Iso.list( - self.userapiclient, - isready="true", - isofilter="executable", - zoneid=self.zone.id - ) - # Verifying if size of the list is >= 1 - if isos_list is not None: - iso_toattach = isos_list[0] - # Attaching ISO listed to VM deployed - VirtualMachine.attach_iso( - vm_created, - self.userapiclient, - iso_toattach - ) - list_vm = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vm) - self.assertEquals( - PASS, - status[0], - "VM listing by Id failed" - ) - # Verifying that attached ISO details are present in VM - self.assertEquals( - iso_toattach.name, - list_vm[0].isoname, - "Attached ISO name is not matching" - ) - self.assertEquals( - iso_toattach.displaytext, - list_vm[0].isodisplaytext, - "Attached ISO display is not matching" - ) - # Detaching ISO from VM - VirtualMachine.detach_iso( - vm_created, - self.userapiclient - ) - list_vm = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vm) - self.assertEquals( - PASS, - status[0], - "VM listing by Id failed" - ) - # Verifying that ISO details are NOT present in VM - self.assertIsNone( - list_vm[0].isoname, - "ISO not detached from VM" - ) - else: - self.fail("Executable ISO in Ready is not found in the given setup") - - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_14_vm_snapshot_pagination(self): - """ - @Desc: Test VM Snapshots pagination. - @Steps: - Step1: Deploying a VM - Step2: Listing all the Snapshots of the VM deployed in Step 1 - Step3: Verifying that the list size is 0 - Step4: Creating (pagesize + 1) number of Snapshots for the VM - Step5: Listing all the Snapshots of the VM deployed in Step 1 - Step6: Verifying that the list size is (pagesize + 1) - Step7: Listing all the VM snapshots in Page 1 with page size - Step8: Verifying that size of the list is same as page size - Step9: Listing all the VM snapshots in Page 2 with page size - Step10: Verifying that size of the list is 1 - Step11: Deleting VM snapshot in page 2 - Step12: Listing all the VM snapshots in Page 2 with page size - Step13: Verifying that size of the list is 0 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing all the VM snapshots for VM deployed above - list_snapshots_before = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - # Verifying that the VM snapshot list is None - self.assertIsNone( - list_snapshots_before, - "Snapshots already exists for newly created VM" - ) - # Creating pagesize + 1 number of VM snapshots - for i in range(0, (self.services["pagesize"] + 1)): - snapshot_created = VmSnapshot.create( - self.userapiclient, - vm_created.id, - ) - self.assertIsNotNone( - snapshot_created, - "Snapshot creation failed" - ) - - # Listing all the VM snapshots for VM again - list_snapshots_after = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - status = validateList(list_snapshots_after) - self.assertEquals( - PASS, - status[0], - "VM Snapshots creation failed" - ) - self.assertEquals( - self.services["pagesize"] + 1, - len(list_snapshots_after), - "Count of VM Snapshots is not matching" - ) - # Listing all the VM snapshots in Page 1 with page size - list_snapshots_page1 = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id, - page=1, - pagesize=self.services["pagesize"], - ) - status = validateList(list_snapshots_page1) - self.assertEquals( - PASS, - status[0], - "Listing of VM Snapshots failed in page 1" - ) - # Verifying the list size is equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_snapshots_page1), - "List VM Snapshot count is not matching in page 1" - ) - # Listing all the VM Snapshots in page 2 - list_snapshots_page2 = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id, - page=2, - pagesize=self.services["pagesize"], - ) - status = validateList(list_snapshots_page2) - self.assertEquals( - PASS, - status[0], - "Listing of VM Snapshots failed in page 2" - ) - # Verifying the list size is equal to 1 - self.assertEquals( - 1, - len(list_snapshots_page2), - "List VM Snapshot count is not matching in page 2" - ) - # Deleting VM Snapshot in page 2 - VmSnapshot.deleteVMSnapshot( - self.userapiclient, - snapshot_created.id - ) - # Listing all the VM Snapshots in page 2 again - list_snapshots_page2 = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id, - page=2, - pagesize=self.services["pagesize"], - ) - # Verifying the list size is equal to 0 - self.assertIsNone( - list_snapshots_page2, - "VM Snapshots exists in page 2" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_15_revert_vm_to_snapshot(self): - """ - @Desc: Test Revert VM to Snapshot functionality. - @Steps: - Step1: Deploying a VM - Step2: Listing all the Snapshots of the VM deployed in Step 1 - Step3: Verifying that the list size is 0 - Step4: Creating 2 Snapshots for the VM - Step5: Listing all the Snapshots of the VM deployed in Step 1 - Step6: Verifying that the list size is 2 - Step7: Verifying that only 1 snapshot is have current flag set to True - Step8: Verifying that the VM snapshot with current flag set as true is the latest snapshot created - Step9: Reverting VM to snapshot having current flag as false (non current snapshot) - Step10: Verifying that only 1 VM snapshot is having current flag set as true. - Step11: Verifying that the VM Snapshot with current flag set to true is the reverted snapshot in Step 8 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing all the VM snapshots for VM deployed above - list_snapshots_before = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - # Verifying that the VM snapshot list is None - self.assertIsNone( - list_snapshots_before, - "Snapshots already exists for newly created VM" - ) - # Creating 2 of VM snapshots - snapshot1 = VmSnapshot.create( - self.userapiclient, - vm_created.id, - ) - self.assertIsNotNone( - snapshot1, - "Snapshot creation failed" - ) - snapshot2 = VmSnapshot.create( - self.userapiclient, - vm_created.id, - ) - self.assertIsNotNone( - snapshot2, - "Snapshot creation failed" - ) - # Listing all the VM snapshots for VM again - list_snapshots_after = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - status = validateList(list_snapshots_after) - self.assertEquals( - PASS, - status[0], - "VM Snapshots creation failed" - ) - self.assertEquals( - 2, - len(list_snapshots_after), - "Count of VM Snapshots is not matching" - ) - # Verifying that only 1 snapshot is having current flag set to true - # and that snapshot is the latest snapshot created (snapshot2) - current_count = 0 - for i in range(0, len(list_snapshots_after)): - if(list_snapshots_after[i].current is True): - current_count = current_count + 1 - current_snapshot = list_snapshots_after[i] - - self.assertEquals( - 1, - current_count, - "count of VM Snapshot with current flag as true is not matching" - ) - self.assertEquals( - snapshot2.id, - current_snapshot.id, - "Latest snapshot taken is not marked as current" - ) - # Reverting the VM to Snapshot 1 - VmSnapshot.revertToSnapshot( - self.userapiclient, - snapshot1.id - ) - # Listing the VM snapshots again - list_snapshots_after = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - status = validateList(list_snapshots_after) - self.assertEquals( - PASS, - status[0], - "VM Snapshots creation failed" - ) - self.assertEquals( - 2, - len(list_snapshots_after), - "Count of VM Snapshots is not matching" - ) - # Verifying that only 1 snapshot is having current flag set to true - # and that snapshot is snapshot1 - current_count = 0 - for i in range(0, len(list_snapshots_after)): - if(list_snapshots_after[i].current is True): - current_count = current_count + 1 - current_snapshot = list_snapshots_after[i] - self.assertEquals( - 1, - current_count, - "count of VM Snapshot with current flag as true is not matching" - ) - self.assertEquals( - snapshot1.id, - current_snapshot.id, - "Current flag was set properly after reverting the VM to snapshot" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_16_list_vm_volumes_pagination(self): - """ - @Desc: Test to verify pagination of Volumes for a VM - @Steps: - Step1: Deploying a VM - Step2: Listing all the Volumes of the VM deployed in Step 1 - Step3: Verifying that the list size is 1 - Step4: Creating page size number of volumes - Step5: Attaching all the volumes created in step4 to VM deployed in Step1 - Step6: Listing all the Volumes for the VM in step1 - Step7: Verifying that the list size is equal to page size + 1 - Step8: Listing all the volumes of VM in page 1 - Step9: Verifying that the list size is equal to page size - Step10: Listing all the Volumes in Page 2 - Step11: Verifying that the list size is 1 - Step12: Detaching the volume from the VM - Step13: Listing all the Volumes in Page 2 - Step14: Verifying that list size is 0 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing all the Volumes for the VM deployed - list_volumes_before = Volume.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - status = validateList(list_volumes_before) - self.assertEquals( - PASS, - status[0], - "Root volume is not created for VM deployed" - ) - # Verifying the size of the list is 1 - self.assertEquals( - 1, - len(list_volumes_before), - "Volumes count is not matching" - ) - # Creating Page size number of volumes - for i in range(0, self.services["pagesize"]): - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - self.assertIsNotNone( - volume_created, - "Volume is not created" - ) - self.cleanup.append(volume_created) - # Attaching all the volumes created to VM - vm_created.attach_volume( - self.userapiclient, - volume_created - ) - - # List all the volumes for the VM again - list_volumes_after = Volume.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - status = validateList(list_volumes_after) - self.assertEquals( - PASS, - status[0], - "Volumes are not listed" - ) - # Verifying that size of the list is equal to page size + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_volumes_after), - "VM's volume count is not matching" - ) - # Listing all the volumes for a VM in page 1 - list_volumes_page1 = Volume.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id, - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_volumes_page1) - self.assertEquals( - PASS, - status[0], - "Volumes not listed in page1" - ) - # Verifying that list size is equal to page size - self.assertEquals( - self.services["pagesize"], - len(list_volumes_page1), - "VM's volume count is not matching in page 1" - ) - # Listing all the volumes for a VM in page 2 - list_volumes_page2 = Volume.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id, - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_volumes_page2) - self.assertEquals( - PASS, - status[0], - "Volumes not listed in page2" - ) - # Verifying that list size is equal to 1 - self.assertEquals( - 1, - len(list_volumes_page2), - "VM's volume count is not matching in page 1" - ) - # Detaching 1 volume from VM - vm_created.detach_volume( - self.userapiclient, - volume_created - ) - # Listing all the volumes for a VM in page 2 again - list_volumes_page2 = Volume.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id, - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that there are no volumes present in page 2 - self.assertIsNone( - list_volumes_page2, - "Volumes listed in page 2" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_17_running_vm_scaleup(self): - """ - @Desc: Test to verify change service for Running VM - @Steps: - Step1: Checking if dynamic scaling of virtual machines is enabled in zone and template. - If yes then continuing. - If not then printing message that scale up is not possible for Running VM - Step2: Deploying a VM - Step3: Listing all the existing service offerings - Step4: If there is a matching Service Offering for scale-up of running VM - use that service offering. If not create one service offering for scale up. - Step5: Perform change service (scale up) the Running VM deployed in step1 - Step6: Verifying that VM's service offerings is changed - """ - # Checking if Dynamic scaling of VM is supported or not - list_config = Configurations.list( - self.apiClient, - zoneid=self.zone.id, - name="enable.dynamic.scale.vm" - ) - status = validateList(list_config) - self.assertEquals( - PASS, - status[0], - "Listing of configuration failed" - ) - # Checking if dynamic scaling is allowed in Zone and Template - if not ((list_config[0].value is True) and (self.template.isdynamicallyscalable)): - self.debug("Scale up of Running VM is not possible as Zone/Template does not support") - else: - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing details of current Service Offering - vm_so_list = ServiceOffering.list( - self.userapiclient, - id=vm_created.serviceofferingid - ) - status = validateList(vm_so_list) - self.assertEquals( - PASS, - status[0], - "Listing of VM Service offering failed" - ) - current_so = vm_so_list[0] - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing all the existing service offerings - service_offerings_list = ServiceOffering.list( - self.userapiclient, - virtualmachineid=vm_created.id - ) - # Verifying if any Service offering available for scale up of VM - so_exists = False - if service_offerings_list is not None: - for i in range(0, len(service_offerings_list)): - if not ((current_so.cpunumber > service_offerings_list[i].cpunumber or\ - current_so.cpuspeed > service_offerings_list[i].cpuspeed or\ - current_so.memory > service_offerings_list[i].memory) or\ - (current_so.cpunumber == service_offerings_list[i].cpunumber and\ - current_so.cpuspeed == service_offerings_list[i].cpuspeed and\ - current_so.memory == service_offerings_list[i].memory)): - if(current_so.storagetype == service_offerings_list[i].storagetype): - so_exists = True - new_so = service_offerings_list[i] - break - # If service offering does not exists, then creating one service offering for scale up - if not so_exists: - self.services["service_offerings"]["small"]["storagetype"] = current_so.storagetype - new_so = ServiceOffering.create( - self.apiClient, - self.services["service_offerings"]["small"] - ) - self.cleanup.append(new_so) - # Scaling up the VM - vm_created.scale_virtualmachine( - self.userapiclient, - new_so.id - ) - # Listing VM details again - list_vms_after = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - self.assertEquals( - 1, - len(list_vms_after), - "VMs list is not as expected" - ) - # Verifying that VM's service offerings is changed - self.assertEquals( - new_so.id, - list_vms_after[0].serviceofferingid, - "VM is not containing New Service Offering" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_18_stopped_vm_change_service(self): - """ - @Desc: Test to verify change service for Stopped VM - @Steps: - Step1: Deploying a VM - Step2: Stopping the VM deployed in step1 - Step3: Listing all the existing service offerings - Step4: If there is a matching Service Offering for change service of stopped VM - use that service offering. If not create one service offering for change service. - Step5: Perform change service for the Stopped VM - Step6: Verifying that VM's service offerings is changed - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing details of current Service Offering - vm_so_list = ServiceOffering.list( - self.userapiclient, - id=vm_created.serviceofferingid - ) - status = validateList(vm_so_list) - self.assertEquals( - PASS, - status[0], - "Listing of VM Service offering failed" - ) - current_so = vm_so_list[0] - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Stopping the VM deployed above - vm_created.stop( - self.userapiclient, - forced=True - ) - # Listing all the service offerings - service_offerings_list = ServiceOffering.list( - self.userapiclient, - virtualmachineid=vm_created.id - ) - # Verifying if any Service offering available for change service of VM - so_exists = False - if service_offerings_list is not None: - for i in range(0, len(service_offerings_list)): - if ((current_so.id != service_offerings_list[i].id) and\ - (current_so.storagetype == service_offerings_list[i].storagetype)): - so_exists = True - new_so = service_offerings_list[i] - break - # If service offering does not exists, then creating one service offering for scale up - if not so_exists: - self.services["service_offerings"]["small"]["storagetype"] = current_so.storagetype - new_so = ServiceOffering.create( - self.apiClient, - self.services["service_offerings"]["small"] - ) - self.cleanup.append(new_so) - # Changing service for the VM - vm_created.scale_virtualmachine( - self.userapiclient, - new_so.id - ) - # Listing VM details again - list_vm = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vm) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - self.assertEquals( - 1, - len(list_vm), - "VMs list is not as expected" - ) - # Verifying that VM's service offerings is changed - self.assertEquals( - new_so.id, - list_vm[0].serviceofferingid, - "VM is not containing New Service Offering" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_19_create_reset_vm_sshkey(self): - """ - @Desc: Test to verify creation and reset of SSH Key for VM - @Steps: - Step1: Deploying a VM - Step2: Stopping the VM deployed in step1 - Step3: Listing all the SSH Key pairs - Step4: Creating a new SSH Key pair - Step5: Listing all the SSh Key pairs again - Step6: Verifying that the key pairs list is increased by 1 - Step7: Resetting the VM SSH Key to the key pair created in step4 - Step8: Verifying that the new SSH Key pair is set to the VM - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Stopping the VM deployed above - vm_created.stop( - self.userapiclient, - forced=True - ) - # Listing all the SSH Key pairs - list_keypairs_before = SSHKeyPair.list( - self.userapiclient - ) - list_keypairs_before_size = 0 - if list_keypairs_before is not None: - list_keypairs_before_size = len(list_keypairs_before) - - # Creating a new Key pair - new_keypair = SSHKeyPair.create( - self.userapiclient, - name="keypair1", - account=self.account.name, - domainid=self.domain.id - ) - self.assertIsNotNone( - new_keypair, - "New Key pair generation failed" - ) - self.assertEquals( - "keypair1", - new_keypair.name, - "Key Pair not created with given name" - ) - # Listing all the SSH Key pairs again - list_keypairs_after = SSHKeyPair.list( - self.userapiclient - ) - status = validateList(list_keypairs_after) - self.assertEquals( - PASS, - status[0], - "Listing of Key pairs failed" - ) - # Verifying that list size is increased by 1 - self.assertEquals( - list_keypairs_before_size + 1, - len(list_keypairs_after), - "List count is not matching" - ) - # Resetting the VM SSH key to the Key pair created above - vm_created.resetSshKey( - self.userapiclient, - keypair=new_keypair.name - ) - # Listing VM details again - list_vm = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vm) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - self.assertEquals( - 1, - len(list_vm), - "VMs list is not as expected" - ) - # Verifying that VM's SSH keypair is set to newly created keypair - self.assertEquals( - new_keypair.name, - list_vm[0].keypair, - "VM is not set to newly created SSH Key pair" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_20_update_vm_displayname_group(self): - """ - @Desc: Test to verify Update VM details - @Steps: - Step1: List all the VM's for a user - Step2: Deploy a VM with all parameters - Step3: Listing all the VM's again for the user - Step4: Verifying that list size is increased by 1 - Step5: Updating VM details - displayname, group - Step6: Listing the VM deployed in step 2 by ID - Step7: Verifying that displayname, group details of the VM are updated - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - self.services["virtual_machine"]["keyboard"] = "us" - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - group="groupName" - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Verifying the displayname and group details for deployed VM - self.assertEquals( - self.services["virtual_machine"]["displayname"], - vm_created.displayname, - "Display name of VM is not as expected" - ) - self.assertEquals( - "groupName", - vm_created.group, - "Group of VM is not as expected" - ) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Updating the VM details - displayname and group - vm_created.update( - self.userapiclient, - displayname="DisplayName", - group="Group", - haenable=False - ) - # Listing VM details again - list_vm = VirtualMachine.list( - self.userapiclient, - id=vm_created.id, - ) - status = validateList(list_vm) - self.assertEquals( - PASS, - status[0], - "Listing of VM by Id failed" - ) - self.assertEquals( - 1, - len(list_vm), - "Count of List VM by Id is not matching" - ) - # Verifying that displayname and group details are updated - self.assertEquals( - "DisplayName", - list_vm[0].displayname, - "Displayname of VM is not updated" - ) - self.assertEquals( - "Group", - list_vm[0].group, - "Group of VM is not updated" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_21_restore_vm(self): - """ - @Desc: Test to verify Restore VM - @Steps: - Step1: List all the VM's for a user - Step2: Deploy a VM with all parameters - Step3: Listing all the VM's again for the user - Step4: Verifying that list size is increased by 1 - Step5: Restoring the VM deployed in step2 - Step6: Verifying that restored VM details are same as the VM deployed in step2 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Restoring the VM - restored_vm = vm_created.restore(self.userapiclient) - self.assertIsNotNone( - restored_vm, - "VM restore failed" - ) - # Verifying the restored VM details - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":vm_created.state, - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":restored_vm.id, - "name":restored_vm.name, - "displayname":restored_vm.displayname, - "state":restored_vm.state, - "zoneid":restored_vm.zoneid, - "account":restored_vm.account, - "template":restored_vm.templateid - } - restored_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - restored_vm_status, - "Restored VM details are not as expected" - ) - return - - @attr(tags=["advanced", "selfservice"]) - def test_22_deploy_vm_multiple_networks(self): - """ - @Desc: Test to verify deploy VM with multiple networks - @Steps: - Step1: List all the networks for user - Step2: If size of list networks is greater than 2 then get all the networks id's - Else create 2 networks and get network id's - Step3: List all the VM's for a user - Step4: Deploy a VM with multiple network id's - Step5: Listing all the VM's again for the user - Step6: Verifying that list size is increased by 1 - Step7: Verify that VM is associated with multiple networks - """ - # Listing all the networks available - networks_list_before = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - networks_list_size = 0 - if networks_list_before is not None: - networks_list_size = len(networks_list_before) - - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat enabled are not found" - ) - while networks_list_size < 2: - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - networks_list_size = networks_list_size + 1 - - # Listing the networks again - networks_list_after = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Listing networks failed" - ) - # populating network id's - networkids = networks_list_after[0].id + "," + networks_list_after[1].id - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=networkids, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Verifying that the NIC's in VM created are same as provided - vm_nics = vm_created.nic - # Verifying that the size of nics is 2 - self.assertEquals( - 2, - len(vm_nics), - "NIC's count in VM created is not matching" - ) - # Verifying that NIC network ID's are as expected - for i in range(0, len(vm_nics)): - if vm_nics[i].isdefault is True: - self.assertEquals( - networks_list_after[0].id, - vm_nics[i].networkid, - "Default NIC is not as expected" - ) - else: - self.assertEquals( - networks_list_after[1].id, - vm_nics[i].networkid, - "Non Default NIC is not as expected" - ) - return - - @attr(tags=["basic", "provisioning"]) - def test_23_deploy_vm_multiple_securitygroups(self): - """ - @Desc: Test to verify deploy VM with multiple Security Groups - @Steps: - Step1: List all the security groups for user - Step2: If size of list security groups is greater than 2 then get all the security groups id's - Else creating 2 security groups and get security groups id's - Step3: List all the VM's for a user - Step4: Deploy a VM with multiple security groups id's - Step5: Listing all the VM's again for the user - Step6: Verifying that list size is increased by 1 - Step7: Verify that VM is associated with multiple security groups - """ - # Listing all the security groups available - security_groups_list = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - domainid=self.domain.id - ) - security_groups_list_size = 0 - if security_groups_list is not None: - security_groups_list_size = len(security_groups_list) - - while security_groups_list_size < 2: - # Creating a security group - security_group = SecurityGroup.create( - self.userapiclient, - self.services["security_group"], - account=self.account.name, - domainid=self.domain.id - ) - self.assertIsNotNone( - security_group, - "Security Group creation failed" - ) - self.cleanup.append(security_group) - security_groups_list_size = security_groups_list_size + 1 - - # Listing the networks again - security_groups_list = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - domainid=self.domain.id - ) - status = validateList(security_groups_list) - self.assertEquals( - PASS, - status[0], - "Listing Security Groups failed" - ) - # populating Security Groups id's - securitygroupids = {security_groups_list[0].id , security_groups_list[1].id} - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - securitygroupids=securitygroupids, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Verifying that the Security Groups's in VM created are same as provided - vm_securitygroups = vm_created.securitygroup - # Verifying that the size of security groups is 2 - self.assertEquals( - 2, - len(vm_securitygroups), - "Security Groups count in VM created is not matching" - ) - # Verifying that Security Group network ID's are as expected - vm_securitygroups_flag = True - for i in range(0, len(vm_securitygroups)): - if ((vm_securitygroups[i].id != security_groups_list[0].id) and\ - (vm_securitygroups[i].id != security_groups_list[1].id)): - vm_securitygroups_flag = False - break - - self.assertEquals( - True, - vm_securitygroups_flag, - "Security Groups in VM are not same as created" - ) - return \ No newline at end of file diff --git a/test/integration/component/test_escalations_ipaddresses.py b/test/integration/component/test_escalations_ipaddresses.py deleted file mode 100644 index 23dd76b9cf..0000000000 --- a/test/integration/component/test_escalations_ipaddresses.py +++ /dev/null @@ -1,4192 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -#Import Local Modules -from marvin.cloudstackTestCase import * -from marvin.cloudstackException import * -from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient -from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -from marvin.lib.utils import checkVolumeSize -from marvin.codes import SUCCESS -from nose.plugins.attrib import attr -from time import sleep - -class TestIpAddresses(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestIpAddresses, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - if cls.zone.localstorageenabled: - cls.storagetype = 'local' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' - else: - cls.storagetype = 'shared' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' - - cls.services['mode'] = cls.zone.networktype - cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() - cls.services["virtual_machine"]["zoneid"] = cls.zone.id - cls.services["virtual_machine"]["template"] = cls.template.id - cls.service_offering = ServiceOffering.create( - cls.api_client, - cls.services["service_offerings"]["tiny"] - ) - cls._cleanup.append(cls.service_offering) - cls.services['mode'] = cls.zone.networktype - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - cls._cleanup.append(cls.account) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created volumes - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - def __verify_values(self, expected_vals, actual_vals): - """ - @summary: Function to verify expected and actual values - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "provisioning"]) - def test_01_list_ipaddresses_pagination(self): - """ - @summary: Test List IP Addresses pagination - @Steps: - Step1: Creating a network for the user - Step2: Listing all the IP Addresses for a user - Step3: Verifying that no IP Addresses are listed - Step4: Associating (pagesize + 1) number of IP Addresses - Step5: Listing all the IP Addresses again - Step6: Verifying the length of the IP Addresses is (page size + 1) - Step7: Listing all the IP Addresses in page1 - Step8: Verifying that the length of the IP Addresses in page 1 is (page size) - Step9: Listing all the IP Addresses in page2 - Step10: Verifying that the length of the IP Addresses in page 2 is 1 - Step11: Dis-Associating the IP Addresses present in page 2 - Step12: Listing for the IP Addresses on page 2 - Step13: Verifying that no IP Addresses are listed - """ - # Listing all the networks available - networks_list_before = Network.list( - self.userapiclient, - forvpc="false", - domainid=self.domain.id, - account=self.account.name, - ) - self.assertIsNone( - networks_list_before, - "Networks listed for newly created user" - ) - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat enabled are not found" - ) - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - # Listing all the networks available - networks_list_after = Network.list( - self.userapiclient, - forvpc="false", - domainid=self.domain.id, - account=self.account.name, - ) - status = validateList(networks_list_after) - self.assertEquals( - PASS, - status[0], - "Network Creation Failed" - ) - self.assertEquals( - 1, - len(networks_list_after), - "Network creation failed" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - self.assertIsNone( - list_ipaddresses_before, - "IP Addresses listed for newly created user" - ) - # Associating (pagesize + 1) number of IP Addresses - for i in range(0, (self.services["pagesize"] + 1)): - ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - ipaddress, - "Failed to Associate IP Address" - ) - - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the volumes is (page size + 1) - self.assertEqual( - (self.services["pagesize"] + 1), - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing IP Address in page 1 - list_ipaddress_page1 = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_ipaddress_page1) - self.assertEquals( - PASS, - status[0], - "Failed to list IP Addresses in page1" - ) - # Verifying that list size is equals to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_ipaddress_page1), - "Failed to list pagesize number of IP Addresses in page1" - ) - # Listing IP Address in page 2 - list_ipaddress_page2 = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_ipaddress_page2) - self.assertEquals( - PASS, - status[0], - "Failed to list IP Addresses in page2" - ) - # Verifying that List size is equal to 1 - self.assertEquals( - 1, - len(list_ipaddress_page2), - "Failed to list IP Addresses in page2" - ) - # Dis-associating an IP Address - ipaddress.delete(self.userapiclient) - # Listing IP Address in page 2 - list_ipaddress_page2 = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that no IP Addresses are listed - self.assertIsNone( - list_ipaddress_page2, - "Disassociation of IP Address Failed" - ) - return - - @attr(tags=["advanced", "provisioning"]) - def test_02_list_ipaddresses_byid(self): - """ - @summary: Test List IP Addresses details by ID - @Steps: - Step1: Creating a network for the user - Step2: Listing all the IP Addresses for a user - Step3: Verifying that no IP Addresses are listed - Step4: Associating an IP Addresses for Network - Step5: Listing all the IP Addresses again - Step6: Verifying the length of the IP Addresses is 1 - Step7: Listing the IP Addresses by Id - Step8: Verifying that the length of the IP Addresses list is 1 - Step9: Verifying the details of the Listed IP Address - """ - # Listing all the networks available - networks_list_before = Network.list( - self.userapiclient, - forvpc="false", - domainid=self.domain.id, - account=self.account.name, - ) - self.assertIsNone( - networks_list_before, - "Networks listed for newly created user" - ) - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat enabled are not found" - ) - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - # Listing all the networks available - networks_list_after = Network.list( - self.userapiclient, - forvpc="false", - domainid=self.domain.id, - account=self.account.name, - ) - status = validateList(networks_list_after) - self.assertEquals( - PASS, - status[0], - "Network Creation Failed" - ) - self.assertEquals( - 1, - len(networks_list_after), - "Network creation failed" - ) - # Listing the Network By ID - network_list_byid = Network.list( - self.userapiclient, - listall=self.services["listall"], - id=network.id - ) - status = validateList(network_list_byid) - self.assertEquals( - PASS, - status[0], - "Failed to list Network by Id" - ) - self.assertEquals( - 1, - len(network_list_byid), - "Failed to list Network by Id" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - self.assertIsNone( - list_ipaddresses_before, - "IP Addresses listed for newly created user" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network_list_byid[0].id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing IP Address by id - list_ipaddress_byid = PublicIPAddress.list( - self.userapiclient, - id=associated_ipaddress.ipaddress.id - ) - status = validateList(list_ipaddress_byid) - self.assertEquals( - PASS, - status[0], - "Failed to list IP Addresses by ID" - ) - # Verifying that list size is equals to 1 - self.assertEquals( - 1, - len(list_ipaddress_byid), - "Failed to list IP Addresses by ID" - ) - # Verifying details of the listed IP Address to be same as IP Address created above - # Creating expected and actual values dictionaries - expected_dict = { - "id":associated_ipaddress.ipaddress.id, - "associatednetworkid":associated_ipaddress.ipaddress.associatednetworkid, - "associatednetworkname":associated_ipaddress.ipaddress.associatednetworkname, - "ipaddress":associated_ipaddress.ipaddress.ipaddress, - "issourcenat":associated_ipaddress.ipaddress.issourcenat, - "isstaticnat":associated_ipaddress.ipaddress.isstaticnat, - "networkid":associated_ipaddress.ipaddress.networkid - } - actual_dict = { - "id":list_ipaddress_byid[0].id, - "associatednetworkid":list_ipaddress_byid[0].associatednetworkid, - "associatednetworkname":list_ipaddress_byid[0].associatednetworkname, - "ipaddress":list_ipaddress_byid[0].ipaddress, - "issourcenat":list_ipaddress_byid[0].issourcenat, - "isstaticnat":list_ipaddress_byid[0].isstaticnat, - "networkid":list_ipaddress_byid[0].networkid - } - ipaddress_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - ipaddress_status, - "Listed IP Address details are not as expected" - ) - return - - @attr(tags=["advanced", "provisioning"]) - def test_03_associate_ipaddress_for_vpc(self): - """ - @summary: Test to Associate IP Address for VPC - @Steps: - Step1: Creating a VPC for the user - Step2: Listing all the IP Addresses for a user - Step3: Verifying that 1 IP Addresses is listed - Step4: Associating an IP Addresses for VPC - Step5: Listing all the IP Addresses again - Step6: Verifying the length of the IP Addresses list is 2 - Step7: Listing the IP Addresses by Id - Step8: Verifying that the length of the IP Addresses list is 1 - Step9: Verifying the details of the Listed IP Address - """ - # Listing all the vpc's for a user - list_vpc_before = VPC.list(self.userapiclient) - # Verifying No VPCs are listed - self.assertIsNone( - list_vpc_before, - "VPC's Listed for newly Created User" - ) - # Listing VPC Offerings - list_vpc_offering = VpcOffering.list(self.userapiclient) - status = validateList(list_vpc_offering) - self.assertEquals( - PASS, - status[0], - "list vpc offering is none") - # Creating a vpc - vpc_created = VPC.create( - self.userapiclient, - self.services["vpc"], - list_vpc_offering[0].id, - self.zone.id - ) - self.assertIsNotNone( - vpc_created, - "VPC Creation Failed" - ) - self.cleanup.append(vpc_created) - # Listing the vpc for a user after creating a vpc - list_vpc_after = VPC.list(self.userapiclient) - status = validateList(list_vpc_after) - self.assertEquals( - PASS, - status[0], - "list VPC not as expected" - ) - # Verifying the list vpc size is increased by 1 - self.assertEquals( - 1, - len(list_vpc_after), - "list VPC not equal as expected" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_before) - self.assertEquals( - PASS, - status[0], - "Failed to List VPC IP Address" - ) - self.assertEquals( - 1, - len(list_ipaddresses_before), - "Failed to List VPC IP Address" - ) - # Associating an IP Addresses to VPC created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - vpcid=vpc_created.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - len(list_ipaddresses_before) + 1, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing IP Address by id - list_ipaddress_byid = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - id=associated_ipaddress.ipaddress.id - ) - status = validateList(list_ipaddress_byid) - self.assertEquals( - PASS, - status[0], - "Failed to list IP Addresses by ID" - ) - # Verifying that list size is equals to 1 - self.assertEquals( - 1, - len(list_ipaddress_byid), - "Failed to list IP Addresses by ID" - ) - # Verifying details of the listed IP Address to be same as IP Address created above - # Creating expected and actual values dictionaries - expected_dict = { - "id":associated_ipaddress.ipaddress.id, - "associatednetworkid":associated_ipaddress.ipaddress.associatednetworkid, - "associatednetworkname":associated_ipaddress.ipaddress.associatednetworkname, - "ipaddress":associated_ipaddress.ipaddress.ipaddress, - "issourcenat":associated_ipaddress.ipaddress.issourcenat, - "isstaticnat":associated_ipaddress.ipaddress.isstaticnat, - "networkid":associated_ipaddress.ipaddress.networkid, - "vpcid":associated_ipaddress.ipaddress.vpcid - } - actual_dict = { - "id":list_ipaddress_byid[0].id, - "associatednetworkid":list_ipaddress_byid[0].associatednetworkid, - "associatednetworkname":list_ipaddress_byid[0].associatednetworkname, - "ipaddress":list_ipaddress_byid[0].ipaddress, - "issourcenat":list_ipaddress_byid[0].issourcenat, - "isstaticnat":list_ipaddress_byid[0].isstaticnat, - "networkid":list_ipaddress_byid[0].networkid, - "vpcid":list_ipaddress_byid[0].vpcid - } - ipaddress_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - ipaddress_status, - "Listed IP Address details are not as expected" - ) - return - - @attr(tags=["advanced", "provisioning"]) - def test_04_create_delete_lbrule_fornonvpc(self): - """ - @summary: Test to list, create and delete Load Balancer Rule for IP Address associated to Non VPC network - @Steps: - Step1: Creating a Network for the user - Step2: Associating an IP Addresses for Network - Step3: Listing Load Balancer Rules for the IP Address associated in Step2 - Step4: Verifying that no Load Balancer Rules are listed - Step5: Creating a Load Balancer Rule for IP Address associated in Step2 - Step6: Listing Load Balancer Rules for the IP Address associated in Step2 - Step7: Verifying 1 Load Balancer Rule is listed - Step8: Deleting the Load Balancer Rule created in Step5 - Step9: Listing Load Balancer Rules for the IP Address associated in Step2 - Step10: Verifying that no Load Balancer Rules are listed - """ - # Listing all the Networks's for a user - list_networks_before = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying No Networks are listed - self.assertIsNone( - list_networks_before, - "Networks listed for newly created User" - ) - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat, Lb enabled are not found" - ) - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying no IP Addresses are listed - self.assertIsNone( - list_ipaddresses_before, - "IP Addresses listed for newly created User" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing Load Balancer Rules for the Ip Address - list_lbrules_before = LoadBalancerRule.list( - self.userapiclient, - listall=self.services["listall"], - publicipid=associated_ipaddress.ipaddress.id - ) - # Verifying no Load Balancer Rules are listed - self.assertIsNone( - list_lbrules_before, - "Load Balancer Rules listed for newly Acquired Ip Address" - ) - self.services["lbrule"]["openfirewall"] = 'false' - # Creating a Load Balancer Rule for Ip Address - lb_rule = LoadBalancerRule.create( - self.userapiclient, - self.services["lbrule"], - ipaddressid=associated_ipaddress.ipaddress.id, - ) - self.assertIsNotNone( - lb_rule, - "Failed to create Load Balancer Rule" - ) - # Verifying details of created Load Balancer Rule - # Creating expected and actual values dictionaries - expected_dict = { - "algorithm":self.services["lbrule"]["alg"], - "privateport":str(self.services["lbrule"]["privateport"]), - "publicport":str(self.services["lbrule"]["publicport"]), - "name":self.services["lbrule"]["name"], - } - actual_dict = { - "algorithm":str(lb_rule.algorithm), - "privateport":str(lb_rule.privateport), - "publicport":str(lb_rule.publicport), - "name":str(lb_rule.name), - } - lbrule_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - lbrule_status, - "Created Load Balancer Rule details are not as expected" - ) - # Listing Load Balancer Rules for the Ip Address - list_lbrules_after = LoadBalancerRule.list( - self.userapiclient, - listall=self.services["listall"], - publicipid=associated_ipaddress.ipaddress.id - ) - status = validateList(list_lbrules_after) - self.assertEquals( - PASS, - status[0], - "Load Balancer Rule creation Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_lbrules_after), - "Load Balancer Rule creation Failed" - ) - # Deleting Load Balancer Rule - lb_rule.delete(self.userapiclient) - # Listing Load Balancer Rules for the Ip Address - list_lbrules_after = LoadBalancerRule.list( - self.userapiclient, - listall=self.services["listall"], - publicipid=associated_ipaddress.ipaddress.id - ) - # Verifying no Load Balancer Rules are Listed - self.assertIsNone( - list_lbrules_after, - "Failed to delete Load Balancer Rule" - ) - return - - @attr(tags=["advanced", "provisioning"]) - def test_05_create_delete_lbrule_forvpc(self): - """ - @summary: Test to list, create and delete Load Balancer Rule for IP Address associated to VPC - @Steps: - Step1: Creating a VPC for the user - Step2: Creating Network inside VPC - Step3: Associating an IP Addresses for VPC - Step4: Listing Load Balancer Rules for the IP Address associated in Step2 - Step5: Verifying that no Load Balancer Rules are listed - Step6: Creating a Load Balancer Rule for IP Address associated in Step2 - Step7: Listing Load Balancer Rules for the IP Address associated in Step2 - Step8: Verifying 1 Load Balancer Rule is listed - Step9: Deleting the Load Balancer Rule created in Step5 - Step10: Listing Load Balancer Rules for the IP Address associated in Step2 - Step11: Verifying that no Load Balancer Rules are listed - """ - # Listing all the vpc's for a user - list_vpc_before = VPC.list(self.userapiclient) - # Verifying No VPCs are listed - self.assertIsNone( - list_vpc_before, - "VPC's Listed for newly Created User" - ) - # Listing VPC Offerings - list_vpc_offering = VpcOffering.list(self.userapiclient) - status = validateList(list_vpc_offering) - self.assertEquals( - PASS, - status[0], - "list vpc offering is none") - # Creating a vpc - vpc_created = VPC.create( - self.userapiclient, - self.services["vpc"], - list_vpc_offering[0].id, - self.zone.id - ) - self.assertIsNotNone( - vpc_created, - "VPC Creation Failed" - ) - # Listing the vpc for a user after creating a vpc - list_vpc_after = VPC.list(self.userapiclient) - status = validateList(list_vpc_after) - self.assertEquals( - PASS, - status[0], - "list VPC not as expected" - ) - # Verifying the list vpc size is increased by 1 - self.assertEquals( - 1, - len(list_vpc_after), - "list VPC not equal as expected" - ) - #List network offering for vpc = true - network_offering_vpc_true_list = NetworkOffering.list( - self.userapiclient, - forvpc = "true", - zoneid = self.zone.id, - supportedServices = "Lb", - state = "Enabled" - ) - status = validateList(network_offering_vpc_true_list) - self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with Lb") - # Creating network under VPC - network_created = Network.create( - self.userapiclient, - self.services["ntwk"], - networkofferingid = network_offering_vpc_true_list[0].id, - vpcid = vpc_created.id, - zoneid=self.zone.id, - gateway= self.services["ntwk"]["gateway"], - netmask = self.services["ntwk"]["netmask"] - ) - self.cleanup.append(network_created) - self.assertIsNotNone( - network_created, - "Network is not created" - ) - self.cleanup.append(vpc_created) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_before) - self.assertEquals( - PASS, - status[0], - "list IP Addresses not as expected" - ) - # Verifying the list vpc size is increased by 1 - self.assertEquals( - 1, - len(list_ipaddresses_before), - "list IP Addresses not equal as expected" - ) - # Associating an IP Addresses to VPC created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - vpcid=vpc_created.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - len(list_ipaddresses_before) + 1, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing Load Balancer Rules for the Ip Address - list_lbrules_before = LoadBalancerRule.list( - self.userapiclient, - listall=self.services["listall"], - publicipid=associated_ipaddress.ipaddress.id - ) - # Verifying no Load Balancer Rules are listed - self.assertIsNone( - list_lbrules_before, - "Load Balancer Rules listed for newly Acquired Ip Address" - ) - self.services["lbrule"]["openfirewall"] = 'false' - # Creating a Load Balancer Rule for Ip Address - lb_rule = LoadBalancerRule.create( - self.userapiclient, - self.services["lbrule"], - ipaddressid=associated_ipaddress.ipaddress.id, - networkid=network_created.id - ) - self.assertIsNotNone( - lb_rule, - "Failed to create Load Balancer Rule" - ) - # Verifying details of created Load Balancer Rule - # Creating expected and actual values dictionaries - expected_dict = { - "algorithm":self.services["lbrule"]["alg"], - "privateport":str(self.services["lbrule"]["privateport"]), - "publicport":str(self.services["lbrule"]["publicport"]), - "name":self.services["lbrule"]["name"], - } - actual_dict = { - "algorithm":str(lb_rule.algorithm), - "privateport":str(lb_rule.privateport), - "publicport":str(lb_rule.publicport), - "name":str(lb_rule.name), - } - lbrule_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - lbrule_status, - "Created Load Balancer Rule details are not as expected" - ) - # Listing Load Balancer Rules for the Ip Address - list_lbrules_after = LoadBalancerRule.list( - self.userapiclient, - listall=self.services["listall"], - publicipid=associated_ipaddress.ipaddress.id, - ) - status = validateList(list_lbrules_after) - self.assertEquals( - PASS, - status[0], - "Load Balancer Rule creation Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_lbrules_after), - "Load Balancer Rule creation Failed" - ) - # Deleting Load Balancer Rule - lb_rule.delete(self.userapiclient) - # Listing Load Balancer Rules for the Ip Address - list_lbrules_after = LoadBalancerRule.list( - self.userapiclient, - listall=self.services["listall"], - publicipid=associated_ipaddress.ipaddress.id - ) - # Verifying no Load Balancer Rules are Listed - self.assertIsNone( - list_lbrules_after, - "Failed to delete Load Balancer Rule" - ) - return - - @attr(tags=["advanced", "provisioning"]) - def test_06_update_lbrule_name(self): - """ - @summary: Test to Update Load Balancer Rule Name for IP Address associated to Non VPC network - @Steps: - Step1: Creating a Network for the user - Step2: Associating an IP Addresses for Network - Step3: Listing Load Balancer Rules for the IP Address associated in Step2 - Step4: Verifying that no Load Balancer Rules are listed - Step5: Creating a Load Balancer Rule for IP Address associated in Step2 - Step6: Listing Load Balancer Rules for the IP Address associated in Step2 - Step7: Verifying 1 Load Balancer Rule is listed - Step8: Updating the Load Balancer Rule created in Step5 - Step9: Verifying that Load Balancer Rule details are updated - """ - # Listing all the Networks's for a user - list_networks_before = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying No Networks are listed - self.assertIsNone( - list_networks_before, - "Networks listed for newly created User" - ) - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat, Lb enabled are not found" - ) - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - # Listing Networks again - list_networks_after = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_networks_after) - self.assertEquals( - PASS, - status[0], - "Network Creation Failed" - ) - # Verifying network list count is increased by 1 - self.assertEquals( - 1, - len(list_networks_after), - "Network Creation Failed" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying no IP Addresses are listed - self.assertIsNone( - list_ipaddresses_before, - "IP Addresses listed for newly created User" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing Load Balancer Rules for the Ip Address - list_lbrules_before = LoadBalancerRule.list( - self.userapiclient, - listall=self.services["listall"], - publicipid=associated_ipaddress.ipaddress.id - ) - # Verifying no Load Balancer Rules are listed - self.assertIsNone( - list_lbrules_before, - "Load Balancer Rules listed for newly Acquired Ip Address" - ) - self.services["lbrule"]["openfirewall"] = 'false' - # Creating a Load Balancer Rule for Ip Address - lb_rule = LoadBalancerRule.create( - self.userapiclient, - self.services["lbrule"], - ipaddressid=associated_ipaddress.ipaddress.id, - ) - self.assertIsNotNone( - lb_rule, - "Failed to create Load Balancer Rule" - ) - # Listing Load Balancer Rules for the Ip Address - list_lbrules_after = LoadBalancerRule.list( - self.userapiclient, - listall=self.services["listall"], - publicipid=associated_ipaddress.ipaddress.id - ) - status = validateList(list_lbrules_after) - self.assertEquals( - PASS, - status[0], - "Load Balancer Rule creation Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_lbrules_after), - "Load Balancer Rule creation Failed" - ) - # Updating Load Balancer Rule Name - updated_lb_rule = LoadBalancerRule.update( - lb_rule, - self.userapiclient, - algorithm="source", - name="NewLBRuleName" - ) - self.assertIsNotNone( - updated_lb_rule, - "Failed to update Load Balancer Rule details" - ) - # Verifying details of the updated Load Balancer Rule - # Creating expected and actual values dictionaries - expected_dict = { - "id":lb_rule.id, - "account":lb_rule.account, - "algorithm":"source", - "domainid":lb_rule.domainid, - "name":"NewLBRuleName", - "networkid":lb_rule.networkid, - "zoneid":lb_rule.zoneid, - "privateport":lb_rule.privateport, - "publicip":lb_rule.publicip, - "publicport":lb_rule.publicport, - } - actual_dict = { - "id":updated_lb_rule.id, - "account":updated_lb_rule.account, - "algorithm":updated_lb_rule.algorithm, - "domainid":updated_lb_rule.domainid, - "name":updated_lb_rule.name, - "networkid":updated_lb_rule.networkid, - "zoneid":updated_lb_rule.zoneid, - "privateport":updated_lb_rule.privateport, - "publicip":updated_lb_rule.publicip, - "publicport":updated_lb_rule.publicport, - } - lbrule_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - lbrule_status, - "Updated Load Balancer Rule details are not as expected" - ) - return - - @attr(tags=["advanced", "provisioning"]) - def test_07_assign_remove_lbrule_toinstance(self): - """ - @summary: Test to Assign and Remove Load Balancer Rule to an Instance - @Steps: - Step1: Creating a Network for the user - Step2: Associating an IP Addresses for Network - Step3: Launching a VM using the network created in Step 1 - Step4: Creating a Load Balancer Rule for IP Address associated in Step2 - Step5: Listing Load Balancer Rule Instances for applied as true - Step6: Verifying no Load balancer rule instances are listed - Step7: Listing Load Balancer Rule Instances for applied as false - Step8: Verifying that list size is 1 - Step9: Assigning the Instance to Load Balancer Rule - Step10: Listing Load Balancer Rule Instances for applied as true - Step11: Verifying list size is 1 - Step12: Listing Load Balancer Rule Instances for applied as false - Step13: Verifying no Load balancer rule instances are listed - Step14: Removing the Load Balancer Rule assigned form Instance - Step15: Listing Load Balancer Rule Instances for applied as true - Step16: Verifying no Load balancer rule instances are listed - Step17: Listing Load Balancer Rule Instances for applied as false - Step18: Verifying that list size is 1 - """ - # Listing all the Networks's for a user - list_networks_before = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying No Networks are listed - self.assertIsNone( - list_networks_before, - "Networks listed for newly created User" - ) - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat, Lb enabled are not found" - ) - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying no IP Addresses are listed - self.assertIsNone( - list_ipaddresses_before, - "IP Addresses listed for newly created User" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Launching a Virtual Machine with above created Network - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=network.id, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "Failed to launch a VM under network created" - ) - self.cleanup.append(network) - # Listing Virtual Machines in Running state in the network created above - list_vms_running = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - account=self.account.name, - domainid=self.domain.id, - state="Running", - networkid=network.id - ) - status = validateList(list_vms_running) - self.assertEquals( - PASS, - status[0], - "VM Created is not in Running state" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_vms_running), - "VM Created is not in Running state" - ) - self.assertEquals( - vm_created.id, - list_vms_running[0].id, - "VM Created is not in Running state" - ) - # Listing Virtual Machines in Stopped state in the network created above - list_vms_stopped = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - account=self.account.name, - domainid=self.domain.id, - state="Stopped", - networkid=network.id - ) - # Verifying that no vms are listed - self.assertIsNone( - list_vms_stopped, - "Created VM is in Stopped state" - ) - # Listing Load Balancer Rules for the Ip Address - list_lbrules_before = LoadBalancerRule.list( - self.userapiclient, - listall=self.services["listall"], - publicipid=associated_ipaddress.ipaddress.id - ) - # Verifying no Load Balancer Rules are listed - self.assertIsNone( - list_lbrules_before, - "Load Balancer Rules listed for newly Acquired Ip Address" - ) - self.services["lbrule"]["openfirewall"] = 'false' - # Creating a Load Balancer Rule for Ip Address - lb_rule = LoadBalancerRule.create( - self.userapiclient, - self.services["lbrule"], - ipaddressid=associated_ipaddress.ipaddress.id, - ) - self.assertIsNotNone( - lb_rule, - "Failed to create Load Balancer Rule" - ) - # Listing Load Balancer Rules for the Ip Address - list_lbrules_after = LoadBalancerRule.list( - self.userapiclient, - listall=self.services["listall"], - publicipid=associated_ipaddress.ipaddress.id - ) - status = validateList(list_lbrules_after) - self.assertEquals( - PASS, - status[0], - "Load Balancer Rule creation Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_lbrules_after), - "Load Balancer Rule creation Failed" - ) - # Listing Load Balancer Rule Instances for applied as true - list_lbruleinstance_applied_true = LoadBalancerRule.listLoadBalancerRuleInstances( - self.userapiclient, - id=lb_rule.id, - applied="true" - ) - # Verifying No Instances are assigned to the Load Balancer Rule - self.assertIsNone( - list_lbruleinstance_applied_true, - "Instances are assigned to Newly created Load Balancer Rule" - ) - # Listing Load Balancer Rule Instances for applied as false - list_lbruleinstance_applied_false = LoadBalancerRule.listLoadBalancerRuleInstances( - self.userapiclient, - id=lb_rule.id, - applied="false" - ) - status = validateList(list_lbruleinstance_applied_false) - self.assertEquals( - PASS, - status[0], - "No Instances are available to assign to Load Balancer Rule" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_lbruleinstance_applied_false), - "No Instances are available to assign to Load Balancer Rule" - ) - # Verifying that Instance created above is listed - self.assertEquals( - vm_created.id, - list_lbruleinstance_applied_false[0].id, - "Failed to list Instance available to asign a Load Balancer Rule" - ) - # Assigning Instance created to Load Balancer Rule - LoadBalancerRule.assign( - lb_rule, - self.userapiclient, - vms=[vm_created] - ) - # Listing Load Balancer Rule Instances for applied as true - list_lbruleinstance_applied_true = LoadBalancerRule.listLoadBalancerRuleInstances( - self.userapiclient, - id=lb_rule.id, - applied="true" - ) - status = validateList(list_lbruleinstance_applied_false) - self.assertEquals( - PASS, - status[0], - "No Instances are available to assign to Load Balancer Rule" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_lbruleinstance_applied_false), - "No Instances are available to assign to Load Balancer Rule" - ) - # Verifying Instances is assigned to the Load Balancer Rule - self.assertEquals( - vm_created.id, - list_lbruleinstance_applied_true[0].id, - "Failed to assign Load Balancer Rule to given Instance" - ) - # Listing Load Balancer Rule Instances for applied as false - list_lbruleinstance_applied_false = LoadBalancerRule.listLoadBalancerRuleInstances( - self.userapiclient, - id=lb_rule.id, - applied="false" - ) - # Verifying No Load Balancer Rules Instances are available to assign - self.assertIsNone( - list_lbruleinstance_applied_false, - "Instances are available for assigning a Load Balancer Rule" - ) - # Removing Load balancer Rule from Instance - LoadBalancerRule.remove( - lb_rule, - self.userapiclient, - vms=[vm_created] - ) - # Listing Load Balancer Rule Instances for applied as true - list_lbruleinstance_applied_true = LoadBalancerRule.listLoadBalancerRuleInstances( - self.userapiclient, - id=lb_rule.id, - applied="true" - ) - # Verifying that there are no Instances assigned to the Load Balancer Rule - self.assertIsNone( - list_lbruleinstance_applied_true, - "Instances is assigned to Load balancer Rule" - ) - # Listing Load Balancer Rule Instances for applied as false - list_lbruleinstance_applied_false = LoadBalancerRule.listLoadBalancerRuleInstances( - self.userapiclient, - id=lb_rule.id, - applied="false" - ) - status = validateList(list_lbruleinstance_applied_false) - self.assertEquals( - PASS, - status[0], - "No Instances are available to assign to Load Balancer Rule" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_lbruleinstance_applied_false), - "No Instances are available to assign to Load Balancer Rule" - ) - # Verifying that Instance created above is listed - self.assertEquals( - vm_created.id, - list_lbruleinstance_applied_false[0].id, - "Failed to list Instance available to asign a Load Balancer Rule" - ) - # Destroying the VM Launched - vm_created.delete(self.userapiclient) - vm_created.expung(self.apiClient) - return - - @attr(tags=["advanced", "provisioning"]) - def test_08_list_create_delete_lbsticky_policy(self): - """ - @summary: Test to List, Create, Delete Load Balancer Stickyness Policy - @Steps: - Step1: Creating a Network for the user - Step2: Associating an IP Addresses for Network - Step3: Creating a Load Balancer Rule for IP Address associated in Step2 - Step4: Listing Load Balancer Sticky Policies for LB Rule created in Step3 - Step5: Verifying that no Load Balancer Sticky Policies are listed - Step6: Creating a Load Balancer Sticky Policies for LB Rule created in Step3 - Step7: Listing Load Balancer Sticky Policies for LB Rule created in Step3 - Step8: Verifying 1 Load Balancer Sticky Policy is listed - Step9: Deleting the Load Balancer Sticky Policies - Step10: Listing Load Balancer Sticky Policies for LB Rule created in Step3 - Step11: Verifying that no Load Balancer Sticky Policies are listed - """ - # Listing all the Networks's for a user - list_networks_before = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying No Networks are listed - self.assertIsNone( - list_networks_before, - "Networks listed for newly created User" - ) - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat, Lb enabled are not found" - ) - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - # Listing Networks again - list_networks_after = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_networks_after) - self.assertEquals( - PASS, - status[0], - "Network Creation Failed" - ) - # Verifying network list count is increased by 1 - self.assertEquals( - 1, - len(list_networks_after), - "Network Creation Failed" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying no IP Addresses are listed - self.assertIsNone( - list_ipaddresses_before, - "IP Addresses listed for newly created User" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing Load Balancer Rules for the Ip Address - list_lbrules_before = LoadBalancerRule.list( - self.userapiclient, - listall=self.services["listall"], - publicipid=associated_ipaddress.ipaddress.id - ) - # Verifying no Load Balancer Rules are listed - self.assertIsNone( - list_lbrules_before, - "Load Balancer Rules listed for newly Acquired Ip Address" - ) - self.services["lbrule"]["openfirewall"] = 'false' - # Creating a Load Balancer Rule for Ip Address - lb_rule = LoadBalancerRule.create( - self.userapiclient, - self.services["lbrule"], - ipaddressid=associated_ipaddress.ipaddress.id, - ) - self.assertIsNotNone( - lb_rule, - "Failed to create Load Balancer Rule" - ) - # Listing Load Balancer Rules for the Ip Address - list_lbrules_after = LoadBalancerRule.list( - self.userapiclient, - listall=self.services["listall"], - publicipid=associated_ipaddress.ipaddress.id - ) - status = validateList(list_lbrules_after) - self.assertEquals( - PASS, - status[0], - "Load Balancer Rule creation Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_lbrules_after), - "Load Balancer Rule creation Failed" - ) - # Listing Load Balancer Stickyness Policies for LB Rule - list_lbstickypolicy_before = LoadBalancerRule.listStickyPolicies( - self.userapiclient, - lbruleid=lb_rule.id, - listall=self.services["listall"] - ) - # Verifying no Sticky Policies are listed - self.assertEquals( - 0, - len(list_lbstickypolicy_before[0].stickinesspolicy), - "Sticky Policy listed for newly created Load Balancer Rule" - ) - # Creating a Sticy Policy for Load Balancer Rule - sticky_policy = LoadBalancerRule.createSticky( - lb_rule, - self.userapiclient, - methodname='LbCookie', - name='LbCookieSticky' - ) - self.assertIsNotNone( - sticky_policy, - "Failed to create Sticky Policy for Load Balancer Rule" - ) - # Verifying details of Sticky Policy created - # Creating expected and actual values dictionaries - expected_dict = { - "account":self.account.name, - "domainid":self.domain.id, - "lbruleid":lb_rule.id, - "methodname":"LbCookie", - "name":"LbCookieSticky", - } - actual_dict = { - "account":sticky_policy.account, - "domainid":sticky_policy.domainid, - "lbruleid":sticky_policy.lbruleid, - "methodname":sticky_policy.stickinesspolicy[0].methodname, - "name":sticky_policy.stickinesspolicy[0].name, - } - lbstickypolicy_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - lbstickypolicy_status, - "Created Load Balancer Sticky Policy details are not as expected" - ) - # Listing Load Balancer Stickyness Policies for LB Rule - list_lbstickypolicy_after = LoadBalancerRule.listStickyPolicies( - self.userapiclient, - lbruleid=lb_rule.id, - listall=self.services["listall"] - ) - status = validateList(list_lbstickypolicy_after[0].stickinesspolicy) - self.assertEquals( - PASS, - status[0], - "Load Balancer Sticky Policy creation Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_lbstickypolicy_after[0].stickinesspolicy), - "Load Balancer Sticky Policy creation Failed" - ) - # Deleting the Sticky Policy - deleted = LoadBalancerRule.deleteSticky( - lb_rule, - self.userapiclient, - id=sticky_policy.stickinesspolicy[0].id - ) - # Listing Load Balancer Stickyness Policies for LB Rule - list_lbstickypolicy_after = LoadBalancerRule.listStickyPolicies( - self.userapiclient, - lbruleid=lb_rule.id, - listall=self.services["listall"] - ) - # Verifying no Sticky Policies are listed - self.assertEquals( - 0, - len(list_lbstickypolicy_after[0].stickinesspolicy), - "Sticky Policy listed for newly created Load Balancer Rule" - ) - return - - @attr(tags=["advanced", "provisioning"]) - def test_09_create_delete_portforwarding_fornonvpc(self): - """ - @summary: Test to list, create and delete Port Forwarding for IP Address associated to Non VPC network - @Steps: - Step1: Creating a Network for the user - Step2: Associating an IP Addresses for Network - Step3: Launching Virtual Machine in network created in step 2 - Step4: Listing Port Forwarding Rules for the IP Address associated in Step2 - Step5: Verifying that no Port Forwarding Rules are listed - Step6: Creating a Port Forwarding Rule for IP Address associated in Step2 - Step7: Listing Port Forwarding Rules for the IP Address associated in Step2 - Step8: Verifying 1 Port Forwarding Rule is listed - Step9: Deleting the Port Forwarding Rule created in Step6 - Step10: Listing Port Forwarding Rules for the IP Address associated in Step2 - Step11: Verifying that no Port Forwarding Rules are listed - """ - # Listing all the Networks's for a user - list_networks_before = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying No Networks are listed - self.assertIsNone( - list_networks_before, - "Networks listed for newly created User" - ) - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,PortForwarding", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat, PortForwarding enabled are not found" - ) - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying no IP Addresses are listed - self.assertIsNone( - list_ipaddresses_before, - "IP Addresses listed for newly created User" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Launching a Virtual Machine with above created Network - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=network.id, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "Failed to launch a VM under network created" - ) - self.cleanup.append(network) - # Listing Virtual Machines in running state in above created network - list_vms_running = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - state="Running", - networkid=network.id - ) - status = validateList(list_vms_running) - self.assertEquals( - PASS, - status[0], - "VM Created is not in Running state" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_after), - "VM Created is not in Runnning state" - ) - self.assertEquals( - vm_created.id, - list_vms_running[0].id, - "VM Created is not in Runnning state" - ) - # Listing Virtual Machines in stopped state in above created network - list_vms_stopped = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - state="Stopped", - networkid=network.id - ) - # Verifying no VMs are in stopped state - self.assertIsNone( - list_vms_stopped, - "VM Created is in stopped state" - ) - # Listing Port Forwarding Rules for the IP Address associated - list_prtfwdrule_before = NATRule.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - # Verifying no port forwarding rules are listed - self.assertIsNone( - list_prtfwdrule_before, - "Port Forwarding Rules listed for newly associated IP Address" - ) - # Creating a Port Forwarding rule - portfwd_rule = NATRule.create( - self.userapiclient, - virtual_machine=vm_created, - services=self.services["natrule"], - ipaddressid=associated_ipaddress.ipaddress.id, - ) - self.assertIsNotNone( - portfwd_rule, - "Failed to create Port Forwarding Rule" - ) - # Verifying details of Sticky Policy created - # Creating expected and actual values dictionaries - expected_dict = { - "ipaddressid":associated_ipaddress.ipaddress.id, - "privateport":str(self.services["natrule"]["privateport"]), - "publicport":str(self.services["natrule"]["publicport"]), - "protocol":str(self.services["natrule"]["protocol"]).lower(), - } - actual_dict = { - "ipaddressid":portfwd_rule.ipaddressid, - "privateport":str(portfwd_rule.privateport), - "publicport":str(portfwd_rule.publicport), - "protocol":portfwd_rule.protocol, - } - portfwd_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - portfwd_status, - "Created Port Forward Rule details are not as expected" - ) - # Listing Port Forwarding Rules for the IP Address associated - list_prtfwdrule_after = NATRule.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - status = validateList(list_prtfwdrule_after) - self.assertEquals( - PASS, - status[0], - "Failed to create Port Forwarding Rule" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_prtfwdrule_after), - "Failed to create Port Forwarding Rule" - ) - # Deleting Port Forwarding Rule - portfwd_rule.delete(self.userapiclient) - # # Listing Port Forwarding Rules for the IP Address associated - list_prtfwdrule_after = NATRule.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - # Verifying no port forwarding rules are listed - self.assertIsNone( - list_prtfwdrule_after, - "Port Forwarding Rules listed after deletion" - ) - # Destroying the VM Launched - vm_created.delete(self.userapiclient) - vm_created.expung(self.apiClient) - return - - @attr(tags=["advanced", "provisioning"]) - def test_10_create_delete_portforwarding_forvpc(self): - """ - @summary: Test to list, create and delete Port Forwarding Rule for IP Address associated to VPC - @Steps: - Step1: Creating a VPC for the user - Step2: Creating Network inside VPC - Step3: Associating an IP Addresses for VPC - Step4: Launching a VM in the Network created in Step 2 - Step5: Listing Port Forwarding Rules for the IP Address associated in Step3 - Step6: Verifying that no Port Forwarding Rules are listed - Step7: Creating a Port Forwarding Rule for IP Address associated in Step3 - Step8: Listing Port Forwarding Rules for the IP Address associated in Step3 - Step9: Verifying 1 Port Forwarding Rule is listed - Step10: Deleting the Port Forwarding Rule created in Step7 - Step11: Listing Port Forwarding Rules for the IP Address associated in Step3 - Step12: Verifying that no Port Forwarding Rules are listed - """ - # Listing all the vpc's for a user - list_vpc_before = VPC.list(self.userapiclient) - # Verifying No VPCs are listed - self.assertIsNone( - list_vpc_before, - "VPC's Listed for newly Created User" - ) - # Listing VPC Offerings - list_vpc_offering = VpcOffering.list(self.userapiclient) - status = validateList(list_vpc_offering) - self.assertEquals( - PASS, - status[0], - "list vpc offering is none" - ) - # Creating a vpc - vpc_created = VPC.create( - self.userapiclient, - self.services["vpc"], - list_vpc_offering[0].id, - self.zone.id - ) - self.assertIsNotNone( - vpc_created, - "VPC Creation Failed" - ) - # Listing the vpc for a user after creating a vpc - list_vpc_after = VPC.list(self.userapiclient) - status = validateList(list_vpc_after) - self.assertEquals( - PASS, - status[0], - "list VPC not as expected" - ) - # Verifying the list vpc size is increased by 1 - self.assertEquals( - 1, - len(list_vpc_after), - "list VPC not equal as expected" - ) - #List network offering for vpc = true - network_offering_vpc_true_list = NetworkOffering.list( - self.userapiclient, - forvpc = "true", - zoneid = self.zone.id, - supportedServices = "SourceNat,PortForwarding", - state = "Enabled" - ) - status = validateList(network_offering_vpc_true_list) - self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with PortForwarding") - # Creating network under VPC - network_created = Network.create( - self.userapiclient, - self.services["ntwk"], - networkofferingid = network_offering_vpc_true_list[0].id, - vpcid = vpc_created.id, - zoneid=self.zone.id, - gateway= self.services["ntwk"]["gateway"], - netmask = self.services["ntwk"]["netmask"] - ) - self.assertIsNotNone( - network_created, - "Network is not created" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_before) - self.assertEquals( - PASS, - status[0], - "list IP Addresses not as expected" - ) - # Verifying the list vpc size is increased by 1 - self.assertEquals( - 1, - len(list_ipaddresses_before), - "list IP Addresses not equal as expected" - ) - # Associating an IP Addresses to VPC created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - vpcid=vpc_created.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - len(list_ipaddresses_before) + 1, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Launching a Virtual Machine with above created Network - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=network_created.id, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "Failed to launch a VM under network created" - ) - self.cleanup.append(network_created) - self.cleanup.append(vpc_created) - # Listing Port Forwarding Rules for the IP Address associated - list_prtfwdrule_before = NATRule.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - # Verifying no port forwarding rules are listed - self.assertIsNone( - list_prtfwdrule_before, - "Port Forwarding Rules listed for newly associated IP Address" - ) - # Creating a Port Forwarding rule - portfwd_rule = NATRule.create( - self.userapiclient, - virtual_machine=vm_created, - services=self.services["natrule"], - ipaddressid=associated_ipaddress.ipaddress.id, - networkid=network_created.id - ) - self.assertIsNotNone( - portfwd_rule, - "Failed to create Port Forwarding Rule" - ) - # Verifying details of Sticky Policy created - # Creating expected and actual values dictionaries - expected_dict = { - "ipaddressid":associated_ipaddress.ipaddress.id, - "privateport":str(self.services["natrule"]["privateport"]), - "publicport":str(self.services["natrule"]["publicport"]), - "protocol":str(self.services["natrule"]["protocol"]).lower(), - } - actual_dict = { - "ipaddressid":portfwd_rule.ipaddressid, - "privateport":str(portfwd_rule.privateport), - "publicport":str(portfwd_rule.publicport), - "protocol":portfwd_rule.protocol, - } - portfwd_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - portfwd_status, - "Created Port Forward Rule details are not as expected" - ) - # Listing Port Forwarding Rules for the IP Address associated - list_prtfwdrule_after = NATRule.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - status = validateList(list_prtfwdrule_after) - self.assertEquals( - PASS, - status[0], - "Failed to create Port Forwarding Rule" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_prtfwdrule_after), - "Failed to create Port Forwarding Rule" - ) - # Deleting Port Forwarding Rule - portfwd_rule.delete(self.userapiclient) - # # Listing Port Forwarding Rules for the IP Address associated - list_prtfwdrule_after = NATRule.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - # Verifying no port forwarding rules are listed - self.assertIsNone( - list_prtfwdrule_after, - "Port Forwarding Rules listed after deletion" - ) - # Destroying the VM Launched - vm_created.delete(self.userapiclient) - vm_created.expung(self.apiClient) - return - - @attr(tags=["advanced", "provisioning"]) - def test_11_create_delete_firewallrule(self): - """ - @summary: Test to list, create and delete Firewall Rule for IP Address associated to Non VPC network - @Steps: - Step1: Creating a Network for the user - Step2: Associating an IP Addresses for Network - Step3: Listing Firewall Rules for the IP Address associated in Step2 - Step4: Verifying that no Rules are listed - Step5: Creating a Firewall Rule for IP Address associated in Step2 - Step6: Listing Firewall Rules for the IP Address associated in Step2 - Step7: Verifying 1 Firewall Rule is listed - Step8: Deleting the Firewall Rule created in Step5 - Step9: Listing Firewall Rules for the IP Address associated in Step2 - Step10: Verifying that no Firewall Rules are listed - """ - # Listing all the Networks's for a user - list_networks_before = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying No Networks are listed - self.assertIsNone( - list_networks_before, - "Networks listed for newly created User" - ) - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Firewall", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat, Firewall enabled are not found" - ) - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying no IP Addresses are listed - self.assertIsNone( - list_ipaddresses_before, - "IP Addresses listed for newly created User" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing Firewall rules for the IP Associated - list_firewalls_before = FireWallRule.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - # Verifying no firewall rules are listed - self.assertIsNone( - list_firewalls_before, - "Firewall Rules listed for newly associated IP Address" - ) - # Creating a Firewall Rule - firewall_rule = FireWallRule.create( - self.userapiclient, - ipaddressid=associated_ipaddress.ipaddress.id, - protocol='tcp', - cidrlist='10.1.1.1/16', - startport='22', - endport='2222' - ) - self.assertIsNotNone( - firewall_rule, - "Failed to create Firewall Rule" - ) - # Verifying details of the created Firewall Rule - # Creating expected and actual values dictionaries - expected_dict = { - "ipaddressid":associated_ipaddress.ipaddress.id, - "startport":"22", - "endport":"2222", - "protocol":"tcp", - "cidrlist":"10.1.1.1/16" - } - actual_dict = { - "ipaddressid":firewall_rule.ipaddressid, - "startport":firewall_rule.startport, - "endport":firewall_rule.endport, - "protocol":firewall_rule.protocol, - "cidrlist":firewall_rule.cidrlist - } - firewall_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - firewall_status, - "Created Firewall Rule details are not as expected" - ) - # Listing Firewall rules for the IP Associated - list_firewalls_after = FireWallRule.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - status = validateList(list_firewalls_after) - self.assertEquals( - PASS, - status[0], - "Failed to create Firewall Rule" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_firewalls_after), - "Failed to create Firewall Rule" - ) - # Deleting the Firewall Rule - firewall_rule.delete(self.userapiclient) - # Listing Firewall rules for the IP Associated - list_firewalls_after = FireWallRule.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - # Verifying no firewall rules are listed - self.assertIsNone( - list_firewalls_after, - "Failed to create Firewall Rule" - ) - return - - @attr(tags=["advanced", "provisioning"]) - def test_12_create_delete_remoteaccessvpn(self): - """ - @summary: Test to list, create and delete Remote Access VPNs - @Steps: - Step1: Creating a Network for the user - Step2: Associating an IP Addresses for Network - Step3: Listing Remore Access VPNs for the IP Address associated in Step2 - Step4: Verifying that no Remore Access VPNs are listed - Step5: Creating a Remore Access VPN for IP Address associated in Step2 - Step6: Listing Remore Access VPNs for the IP Address associated in Step2 - Step7: Verifying 1 Remore Access VPN is listed - Step8: Deleting the Remore Access VPNs created in Step5 - Step9: Listing Remore Access VPNs for the IP Address associated in Step2 - Step10: Verifying that no Remore Access VPNs are listed - """ - # Listing all the Networks's for a user - list_networks_before = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying No Networks are listed - self.assertIsNone( - list_networks_before, - "Networks listed for newly created User" - ) - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Vpn", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat, Vpn enabled are not found" - ) - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying no IP Addresses are listed - self.assertIsNone( - list_ipaddresses_before, - "IP Addresses listed for newly created User" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing Remote access VPNs for the IP Associated - list_vpns_before = Vpn.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - # Verifying no Remote Access VPNs are listed - self.assertIsNone( - list_vpns_before, - "Remote Access VPNs listed for newly associated IP Address" - ) - # Creating a Remote Access VPN - vpn_created = Vpn.create( - self.userapiclient, - publicipid=associated_ipaddress.ipaddress.id, - account=self.account.name, - domainid=self.domain.id, - openfirewall='false' - ) - self.assertIsNotNone( - vpn_created, - "Failed to create Remote Access VPN" - ) - # Verifying details of the created Remote Access VPN - # Creating expected and actual values dictionaries - expected_dict = { - "ipaddressid":associated_ipaddress.ipaddress.id, - "account":self.account.name, - "domainid":self.domain.id, - "state":"Running", - } - actual_dict = { - "ipaddressid":vpn_created.publicipid, - "account":vpn_created.account, - "domainid":vpn_created.domainid, - "state":vpn_created.state, - } - vpn_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - vpn_status, - "Created Remote Access VPN details are not as expected" - ) - # Listing Remote Access VPNs for the IP Associated - list_vpns_after = Vpn.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - status = validateList(list_vpns_after) - self.assertEquals( - PASS, - status[0], - "Failed to create Remote Access VPN" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_vpns_after), - "Failed to create Remote Access VPN" - ) - # Deleting the Remote Access VPN - vpn_created.delete(self.userapiclient) - # Listing Remote Access VPNs for the IP Associated - list_vpns_after = Vpn.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - # Verifying no Remote Access VPNs are listed - self.assertIsNone( - list_vpns_after, - "Failed to create Remote Access VPN" - ) - return - - @attr(tags=["advanced", "provisioning"]) - def test_13_add_remove_vpnusers(self): - """ - @summary: Test to list, add and remove VPN Users - @Steps: - Step1: Creating a Network for the user - Step2: Associating an IP Addresses for Network - Step3: Launching a VM under network created in Step1 - Step4: Creating Remote Access VPN - Step5: Listing VPN Users - Step6: Verifying that no VPN Users are listed - Step7: Adding a VPN user - Step8: Listing VPN Users - Step9: Verifying 1 VPN is listed - Step10: Deleting VPN user - Step11: Listing VPN Users - Step12: Verifying that no VPN Users are listed - """ - # Listing all the Networks's for a user - list_networks_before = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying No Networks are listed - self.assertIsNone( - list_networks_before, - "Networks listed for newly created User" - ) - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Vpn", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat, Vpn enabled are not found" - ) - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying no IP Addresses are listed - self.assertIsNone( - list_ipaddresses_before, - "IP Addresses listed for newly created User" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Launching Virtual Machine - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=network.id, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "Failed to launch a VM under network created" - ) - # Listing Remote access VPNs for the IP Associated - list_vpns_before = Vpn.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - # Verifying no Remote Access VPNs are listed - self.assertIsNone( - list_vpns_before, - "Remote Access VPNs listed for newly associated IP Address" - ) - # Creating a Remote Access VPN - vpn_created = Vpn.create( - self.userapiclient, - publicipid=associated_ipaddress.ipaddress.id, - account=self.account.name, - domainid=self.domain.id, - openfirewall='false' - ) - self.assertIsNotNone( - vpn_created, - "Failed to create Remote Access VPN" - ) - # Listing Remote Access VPNs for the IP Associated - list_vpns_after = Vpn.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress.ipaddress.id - ) - status = validateList(list_vpns_after) - self.assertEquals( - PASS, - status[0], - "Failed to create Remote Access VPN" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_vpns_after), - "Failed to create Remote Access VPN" - ) - # Listing VPN Users - list_vpnusers_beore = VpnUser.list( - self.userapiclient, - listall=self.services["listall"], - account=self.account.name, - domainid=self.domain.id - ) - # Verifying no VPN Users listed - self.assertIsNone( - list_vpnusers_beore, - "VPN Users listed for newly created VPN" - ) - # Creating a VPN User - vpnuser_created = VpnUser.create( - self.userapiclient, - username=self.services["vpn_user"]["username"], - password=self.services["vpn_user"]["password"], - account=self.account.name, - domainid=self.domain.id - ) - self.assertIsNotNone( - vpnuser_created, - "Failed to create VPN User" - ) - # Listing VPN Users - list_vpnusers_after = VpnUser.list( - self.userapiclient, - listall=self.services["listall"], - account=self.account.name, - domainid=self.domain.id - ) - status = validateList(list_vpnusers_after) - self.assertEquals( - PASS, - status[0], - "Failed to list VPN user after creation" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_vpnusers_after), - "Failed to list VPN user after creation" - ) - # Deleting the VPN User - vpnuser_created.delete(self.userapiclient) - # Listing VPN Users - list_vpnusers_after = VpnUser.list( - self.userapiclient, - listall=self.services["listall"], - account=self.account.name, - domainid=self.domain.id - ) - # Verifying no VPN Users are listed - self.assertIsNone( - list_vpnusers_after, - "VPN User listed after deletion" - ) - # Destroying the VM - vm_created.delete(self.userapiclient) - vm_created.expung(self.apiClient) - return - - @attr(tags=["advanced", "provisioning"]) - def test_14_enable_disable_staticnat_fornonvpc(self): - """ - @summary: Test to Enable and Disable StaticNat for IP Address associated to Non VPC Network - @Steps: - Step1: Creating a Network for the user - Step2: Associating an IP Addresses for Network created in step1 - Step3: Associating one more Ip Address to Network created in step1 - Step4: Launching the VM in network created in step1 - Step5: Enabling the staticNat to IP Associated in Step3 - Step6: Verifying that StaticNat is enabled - Step7: Disabling the staticNat to IP Associated in Step3 - Step8: Verifying that StaticNat is disabled - """ - # Listing all the Networks's for a user - list_networks_before = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying No Networks are listed - self.assertIsNone( - list_networks_before, - "Networks listed for newly created User" - ) - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,StaticNat", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat, Vpn enabled are not found" - ) - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying no IP Addresses are listed - self.assertIsNone( - list_ipaddresses_before, - "IP Addresses listed for newly created User" - ) - # Associating an IP Addresses to Network created - associated_ipaddress1 = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress1, - "Failed to Associate IP Address" - ) - # Associating another IP Addresses to Network created - associated_ipaddress2 = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress2, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 2, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Launching a Virtual Machine - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=network.id, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "Failed to launch a VM under network created" - ) - # Enabling static Nat for Ip Address associated - StaticNATRule.enable( - self.userapiclient, - ipaddressid=associated_ipaddress2.ipaddress.id, - virtualmachineid=vm_created.id, - ) - # Listing Ip Address by id - list_ipaddress = PublicIPAddress.list( - self.userapiclient, - id=associated_ipaddress2.ipaddress.id, - listall=self.services["listall"] - ) - status = validateList(list_ipaddress) - self.assertEquals( - PASS, - status[0], - "Failed to List IP Address" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddress), - "Failed to List IP Address" - ) - self.assertEquals( - True, - list_ipaddress[0].isstaticnat, - "Failed to Enable Static Nat" - ) - # Disabling static Nat - StaticNATRule.disable( - self.userapiclient, - ipaddressid=associated_ipaddress2.ipaddress.id - ) - # Listing Ip Address by id - list_ipaddress = PublicIPAddress.list( - self.userapiclient, - id=associated_ipaddress2.ipaddress.id, - listall=self.services["listall"] - ) - status = validateList(list_ipaddress) - self.assertEquals( - PASS, - status[0], - "Failed to List IP Address" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddress), - "Failed to List IP Address" - ) - self.assertEquals( - False, - list_ipaddress[0].isstaticnat, - "Failed to Disable Static Nat" - ) - # Destroying the VM - vm_created.delete(self.userapiclient) - vm_created.expung(self.apiClient) - return - - @attr(tags=["advanced", "provisioning"]) - def test_15_enable_disable_staticnat_forvpc(self): - """ - @summary: Test to Enable and Disable StaticNat for IP Address associated to VPC Network - @Steps: - Step1: Creating a VPC - Step2: Creating a Network under VPC for the user - Step3: Associating an IP Addresses for Network created in step1 - Step4: Launching the VM in network created in step2 - Step5: Enabling the staticNat to IP Associated in Step3 - Step6: Verifying that StaticNat is enabled - Step7: Disabling the staticNat to IP Associated in Step3 - Step8: Verifying that StaticNat is disabled - """ - # Listing all the vpc's for a user - list_vpc_before = VPC.list(self.userapiclient) - # Verifying No VPCs are listed - self.assertIsNone( - list_vpc_before, - "VPC's Listed for newly Created User" - ) - # Listing VPC Offerings - list_vpc_offering = VpcOffering.list(self.userapiclient) - status = validateList(list_vpc_offering) - self.assertEquals( - PASS, - status[0], - "list vpc offering is none" - ) - # Creating a vpc - vpc_created = VPC.create( - self.userapiclient, - self.services["vpc"], - list_vpc_offering[0].id, - self.zone.id - ) - self.assertIsNotNone( - vpc_created, - "VPC Creation Failed" - ) - # Listing the vpc for a user after creating a vpc - list_vpc_after = VPC.list(self.userapiclient) - status = validateList(list_vpc_after) - self.assertEquals( - PASS, - status[0], - "list VPC not as expected" - ) - # Verifying the list vpc size is increased by 1 - self.assertEquals( - 1, - len(list_vpc_after), - "list VPC not equal as expected" - ) - #List network offering for vpc = true - network_offering_vpc_true_list = NetworkOffering.list( - self.userapiclient, - forvpc = "true", - zoneid = self.zone.id, - supportedServices = "SourceNat,PortForwarding,StaticNat", - state = "Enabled" - ) - status = validateList(network_offering_vpc_true_list) - self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with PortForwarding") - # Creating network under VPC - network_created = Network.create( - self.userapiclient, - self.services["ntwk"], - networkofferingid = network_offering_vpc_true_list[0].id, - vpcid = vpc_created.id, - zoneid=self.zone.id, - gateway= self.services["ntwk"]["gateway"], - netmask = self.services["ntwk"]["netmask"] - ) - self.assertIsNotNone( - network_created, - "Network is not created" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_before) - self.assertEquals( - PASS, - status[0], - "list IP Addresses not as expected" - ) - # Verifying the list vpc size is increased by 1 - self.assertEquals( - 1, - len(list_ipaddresses_before), - "list IP Addresses not equal as expected" - ) - # Associating an IP Addresses to VPC created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - vpcid=vpc_created.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - len(list_ipaddresses_before) + 1, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Launching a Virtual Machine with above created Network - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=network_created.id, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "Failed to launch a VM under network created" - ) - self.cleanup.append(network_created) - self.cleanup.append(vpc_created) - # Enabling static Nat for Ip Address associated - StaticNATRule.enable( - self.userapiclient, - ipaddressid=associated_ipaddress.ipaddress.id, - virtualmachineid=vm_created.id, - networkid=network_created.id - ) - # Listing Ip Address by id - list_ipaddress = PublicIPAddress.list( - self.userapiclient, - id=associated_ipaddress.ipaddress.id, - listall=self.services["listall"] - ) - status = validateList(list_ipaddress) - self.assertEquals( - PASS, - status[0], - "Failed to List IP Address" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddress), - "Failed to List IP Address" - ) - self.assertEquals( - True, - list_ipaddress[0].isstaticnat, - "Failed to Enable Static Nat" - ) - # Disabling static Nat - StaticNATRule.disable( - self.userapiclient, - ipaddressid=associated_ipaddress.ipaddress.id - ) - # Listing Ip Address by id - list_ipaddress = PublicIPAddress.list( - self.userapiclient, - id=associated_ipaddress.ipaddress.id, - listall=self.services["listall"] - ) - status = validateList(list_ipaddress) - self.assertEquals( - PASS, - status[0], - "Failed to List IP Address" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddress), - "Failed to List IP Address" - ) - self.assertEquals( - False, - list_ipaddress[0].isstaticnat, - "Failed to Disable Static Nat" - ) - # Destroying the VM - vm_created.delete(self.userapiclient) - vm_created.expung(self.apiClient) - return - - @attr(tags=["advanced", "provisioning"]) - def test_16_create_delete_ipforwardingrule(self): - """ - @summary: Test to list, create and delete IP Forwarding Rules for IP Address - @Steps: - Step1: Creating a Network for the user - Step2: Associating an IP Addresses for Network created in step1 - Step3: Associating one more Ip Address to Network created in step1 - Step4: Launching the VM in network created in step1 - Step5: Enabling the staticNat to IP Associated in Step3 - Step6: Listing IP Forwarding rules - Step7: Verifying no IP Forwarding rules are listed - Step8: Creating a IP Forwarding Rule - Step9: Listing IP Forwarding rules - Step10: Verifying 1 IP Forwarding rule is listed - Step11: Deleting the IP Forwarding rule - Step12: Listing IP Forwarding rules - Step13: Verifying no IP Forwarding rules are listed - """ - # Listing all the Networks's for a user - list_networks_before = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying No Networks are listed - self.assertIsNone( - list_networks_before, - "Networks listed for newly created User" - ) - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Vpn", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat, Vpn enabled are not found" - ) - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying no IP Addresses are listed - self.assertIsNone( - list_ipaddresses_before, - "IP Addresses listed for newly created User" - ) - # Associating an IP Addresses to Network created - associated_ipaddress1 = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress1, - "Failed to Associate IP Address" - ) - # Associating another IP Addresses to Network created - associated_ipaddress2 = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress2, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 2, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Launching a Virtual Machine - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=network.id, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "Failed to launch a VM under network created" - ) - # Enabling static Nat for Ip Address associated - StaticNATRule.enable( - self.userapiclient, - ipaddressid=associated_ipaddress2.ipaddress.id, - virtualmachineid=vm_created.id, - ) - # Listing Ip Address by id - list_ipaddress = PublicIPAddress.list( - self.userapiclient, - id=associated_ipaddress2.ipaddress.id, - listall=self.services["listall"] - ) - status = validateList(list_ipaddress) - self.assertEquals( - PASS, - status[0], - "Failed to List IP Address" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddress), - "Failed to List IP Address" - ) - self.assertEquals( - True, - list_ipaddress[0].isstaticnat, - "Failed to Enable Static Nat" - ) - # Listing IP Forwarding Rules - list_ipfwdrule_before = StaticNATRule.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress2.ipaddress.id - ) - # Verifying no IP Forwarding Rules are listed - self.assertIsNone( - list_ipfwdrule_before, - "IP Forwardign Rule listed for newly enabled StaticNat IP" - ) - # Creating IP Forwardign Rule - ipfwd_rule = StaticNATRule.createIpForwardingRule( - self.userapiclient, - startport='80', - endport='89', - protocol='tcp', - ipaddressid=associated_ipaddress2.ipaddress.id, - openfirewall=False - ) - self.assertIsNotNone( - ipfwd_rule, - "Failed to create IP Forwarding Rule" - ) - # Listing IP Forwarding Rules - list_ipfwdrule_after = StaticNATRule.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress2.ipaddress.id - ) - status = validateList(list_ipfwdrule_after) - self.assertEquals( - PASS, - status[0], - "Failed to List IP Forwarding Rule after Creation" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipfwdrule_after), - "Failed to List IP Forwarding Rule after Creation" - ) - # Deleting IP Forwarding Rule - ipfwd_rule.delete(self.userapiclient) - # Listing IP Forwarding Rules - list_ipfwdrule_after = StaticNATRule.list( - self.userapiclient, - listall=self.services["listall"], - ipaddressid=associated_ipaddress2.ipaddress.id - ) - # Verifying no IP Forwarding Rules are listed - self.assertIsNone( - list_ipfwdrule_after, - "IP Forwardign Rule listed after deletion" - ) - # Destroying the VM - vm_created.delete(self.userapiclient) - vm_created.expung(self.apiClient) - return - - @attr(tags=["advanced", "provisioning"]) - def test_17_create_update_autoscalepolicy(self): - """ - @summary: Test to list, create and update Autoscale Policy - @Steps: - Step1: Creating a Network Offering for Supported Service LB with Netscaler - Step2: Create a Network using Network Offering created in Step1 - Step3: Launching a VM using Network created in Step2 - Step4: Associating IP Address for Network created in Step2 - Step5: Listing Counters - Step6: Listing Conditions for the user - Step7: Verifying no Conditions are listed - Step8: Creating a 2 conditions - Step9: Listing conditions again - Step10: Verifying 2 conditions are listed - Step11: Listing Autoscale Policies for User - Step12: Verifying No Autoscale policy is listed - Step13: Creating Autoscale Policy using Condition1 - Step14: Verifying that Autoscale Policy is created with Condition1 - Step15: Listing Autoscale Policies - Step16: Verifying 1 Autoscale Policy is listed - Step17: Updating Autoscale Policy created in step13 with condition2 - Step18: Verifying Autoscale policy is updated with condition2 - """ - # Listing Network Offerings - list_nwoff_before = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - # Creating Network Offerign with LB as Netscalar - nwoff_created = NetworkOffering.create( - self.apiClient, - self.services["nw_off_isolated_netscaler"] - ) - self.assertIsNotNone( - nwoff_created, - "Failed to Create Network Offering with LB sercvice for Netscaler" - ) - # Enable Network offering - nwoff_created.update(self.apiClient, state='Enabled') - # Listing Network Offerings again - list_nwoff_after = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - self.assertEquals( - len(list_nwoff_before)+1, - len(list_nwoff_after), - "Failed to create Network Offering" - ) - # Creating a Network Using the Network Offering - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=nwoff_created.id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - self.cleanup.append(nwoff_created) - # Launching a Virtual Machine - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=network.id, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "Failed to launch a VM under network created" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_before) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed while launching a VM" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_before), - "IP Addresses Association Failed while launching a VM" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 2, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing Counters - list_counters = Autoscale.listCounters( - self.userapiclient, - ) - status = validateList(list_counters) - self.assertEquals( - PASS, - status[0], - "Failed to list counters" - ) - # Listing Conditions - list_conditions_before = Autoscale.listConditions( - self.userapiclient, - listall=self.services["listall"], - account=self.account.name, - domainid=self.domain.id - ) - self.assertIsNone( - list_conditions_before, - "Listed Conditions for newly created user" - ) - # Creating first Condition - condition_created1 = Autoscale.createCondition( - self.userapiclient, - counterid=list_counters[0].id, - relationaloperator='GT', - threshold='1000' - ) - self.assertIsNotNone( - condition_created1, - "Failed to create Condition" - ) - # Creating second Condition - condition_created2 = Autoscale.createCondition( - self.userapiclient, - counterid=list_counters[0].id, - relationaloperator='GT', - threshold='1500' - ) - self.assertIsNotNone( - condition_created2, - "Failed to create Condition" - ) - # Listing Conditions again - list_conditions_after = Autoscale.listConditions( - self.userapiclient, - listall=self.services["listall"], - account=self.account.name, - domainid=self.domain.id - ) - status = validateList(list_conditions_after) - self.assertEquals( - PASS, - status[0], - "Failed to list Conditions after creation" - ) - # Listing Autoscale policies - list_autoscalepolicies_before = Autoscale.listAutoscalePolicies( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying no Autoscale policies are listed - self.assertIsNone( - list_autoscalepolicies_before, - "Autoscale policies listed" - ) - # Creating Autoscale Policy - autoscalepolicy_created = Autoscale.createAutoscalePolicy( - self.userapiclient, - action='scaleup', - conditionids=condition_created1.id, - duration='100', - quiettime='100' - ) - self.assertIsNotNone( - autoscalepolicy_created, - "Failed to create Autoscale VM Policy" - ) - # Verifying autoscalepolicy is created using condition1 - self.assertEquals( - condition_created1.id, - autoscalepolicy_created.conditions[0].id, - "Autoscale Policy not created by given condition" - ) - # Listing Autoscale policies - list_autoscalepolicies_after = Autoscale.listAutoscalePolicies( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_autoscalepolicies_after) - self.assertEquals( - PASS, - status[0], - "Failed to list Autoscale Policy after creation" - ) - self.assertEquals( - 1, - len(list_autoscalepolicies_after), - "Autoscale Policies count is not matching" - ) - # Updating Autoscale Policy - autoscalepolicy_updated = Autoscale.updateAutoscalePolicy( - self.userapiclient, - id=autoscalepolicy_created.id, - conditionids=condition_created2.id, - duration='100', - quiettime='100' - ) - self.assertIsNotNone( - autoscalepolicy_updated, - "Failed to update Autoscale Policy" - ) - # Verifying the Autoscale Policy is updated - self.assertEquals( - condition_created2.id, - autoscalepolicy_updated.conditions[0].id, - "Autoscale Policy not updated to given condition" - ) - # Destroying the VM - vm_created.delete(self.userapiclient) - vm_created.expung(self.apiClient) - return - - @attr(tags=["advanced", "provisioning"]) - def test_18_create_update_autoscaleprofiles(self): - """ - @summary: Test to list, create and update Autoscale VM Profiles - @Steps: - Step1: Creating a Network Offering for Supported Service LB with Netscaler - Step2: Create a Network using Network Offering created in Step1 - Step3: Launching a VM using Network created in Step2 - Step4: Associating IP Address for Network created in Step2 - Step5: Listing Available Service Offerings - Step6: Listing all types of templates - Step7: Verifying only featured templates are listed for newly created user - Step8: Listing autoscale vm profiles - Step9: Verifying no Autoscale VM Profiles are listed - Step10: Creating a Autoscale VM Profile - Step11: Listing Autoscale VM Profile - Step12: Verifying 1 Autoscale VM Profile is listed - Step13: Listing Autoscale VM Profile by id - Step14: Verifying details of the created autoscale vm profile are matching with listed autoscal vm profile - Step15: Updating Autoscale VM profile with destroy vm grace period - Step16: Verifying that Autoscale VM is updated - """ - # Listing Network Offerings - list_nwoff_before = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - # Creating Network Offerign with LB as Netscalar - nwoff_created = NetworkOffering.create( - self.apiClient, - self.services["nw_off_isolated_netscaler"] - ) - self.assertIsNotNone( - nwoff_created, - "Failed to Create Network Offering with LB sercvice for Netscaler" - ) - # Enable Network offering - nwoff_created.update(self.apiClient, state='Enabled') - # Listing Network Offerings again - list_nwoff_after = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - self.assertEquals( - len(list_nwoff_before)+1, - len(list_nwoff_after), - "Failed to create Network Offering" - ) - # Creating a Network Using the Network Offering - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=nwoff_created.id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - self.cleanup.append(nwoff_created) - # Launching a Virtual Machine - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=network.id, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "Failed to launch a VM under network created" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_before) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed while launching a VM" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_before), - "IP Addresses Association Failed while launching a VM" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 2, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing Service Offerings - list_service_offerings = ServiceOffering.list( - self.userapiclient, - listall=self.services["listall"], - issystem='false' - ) - status = validateList(list_service_offerings) - self.assertEquals( - PASS, - status[0], - "Failed to list Service Offerings" - ) - # Listing Users - list_users = User.list( - self.apiClient, - listall=self.services["listall"], - account=self.account.name, - domainid=self.domain.id - ) - status = validateList(list_users) - self.assertEquals( - PASS, - status[0], - "Failed to list Users" - ) - # Listing Featured Templates - list_templates_featured = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter="featured", - zoneid=self.zone.id - ) - status = validateList(list_templates_featured) - self.assertEquals( - PASS, - status[0], - "Failed to list Featured Templates" - ) - # Listing Community Templates - list_templates_community = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter="community", - zoneid=self.zone.id - ) - self.assertIsNone( - list_templates_community, - "Community Templates listed for newly created User" - ) - # Listing selfexecutable Templates - list_templates_selfexecutable = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter="selfexecutable", - zoneid=self.zone.id - ) - self.assertIsNone( - list_templates_selfexecutable, - "Self Executable Templates listed for newly created User" - ) - # Listing Autoscale VM Profiles - list_autoscalevm_profiles_before = Autoscale.listAutoscaleVmPofiles( - self.userapiclient, - listall=self.services["listall"] - ) - self.assertIsNone( - list_autoscalevm_profiles_before, - "Autoscale VM Profiles listed" - ) - # Creating Autoscale VM Profile - counterparam = { "snmpcommunity": "public", "snmpport": "161"} - autoscalevm_profile = Autoscale.createAutoscaleVmProfile( - self.userapiclient, - serviceofferingid=list_service_offerings[0].id, - zoneid=self.zone.id, - templateid=list_templates_featured[0].id, - autoscaleuserid=list_users[0].id, - destroyvmgraceperiod='100', - counterparam=counterparam - ) - self.assertIsNotNone( - autoscalevm_profile, - "Failed to create Autoscale VM Profile" - ) - # Listing Autoscale VM Profiles - list_autoscalevm_profiles_after = Autoscale.listAutoscaleVmPofiles( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_autoscalevm_profiles_after) - self.assertEquals( - PASS, - status[0], - "Failed to list Autoscale VM Profile after creation" - ) - # Verifying only 1 autoscale vm profile is created - self.assertEquals( - 1, - len(list_autoscalevm_profiles_after), - "Count of Autoscale VM profiles listed is not matching" - ) - # Listing the Autoscale VM Profile by id - list_autoscalvmprofile = Autoscale.listAutoscaleVmPofiles( - self.userapiclient, - listall=self.services["listall"], - id=autoscalevm_profile.id - ) - status = validateList(list_autoscalvmprofile) - self.assertEquals( - PASS, - status[0], - "Failed to list Autoscale VM Profile by Id after creation" - ) - # Verifying details of the listed Autoscale VM Profile - # Creating expected and actual values dictionaries - expected_dict = { - "id":autoscalevm_profile.id, - "account":self.account.name, - "domainid":self.domain.id, - "autoscaleuserid":list_users[0].id, - "serviceofferingid":list_service_offerings[0].id, - "zoneid":self.zone.id, - "templateid":list_templates_featured[0].id, - "destroyvmgraceperiod":autoscalevm_profile.destroyvmgraceperiod - } - actual_dict = { - "id":list_autoscalvmprofile[0].id, - "account":list_autoscalvmprofile[0].account, - "domainid":list_autoscalvmprofile[0].domainid, - "autoscaleuserid":list_autoscalvmprofile[0].autoscaleuserid, - "serviceofferingid":list_autoscalvmprofile[0].serviceofferingid, - "zoneid":list_autoscalvmprofile[0].zoneid, - "templateid":list_autoscalvmprofile[0].templateid, - "destroyvmgraceperiod":list_autoscalvmprofile[0].destroyvmgraceperiod - } - autoscalevm_profile_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - autoscalevm_profile_status, - "Created Autoscale VM Profile details are not as expected" - ) - # Updating destroyvmgrageperiod for created Autoscale VM Profile - autoscalevm_profile_updated = Autoscale.updateAutoscaleVMProfile( - self.userapiclient, - id=autoscalevm_profile.id, - autoscaleuserid=list_users[0].id, - destroyvmgraceperiod='200', - templateid=list_templates_featured[0].id, - ) - self.assertIsNotNone( - autoscalevm_profile_updated, - "Failed to update Autoscale VM Profile" - ) - # Verifyign that Destroy VM Graceperiod is updated in autoscale VM Profile - self.assertEquals( - 200, - autoscalevm_profile_updated.destroyvmgraceperiod, - "Failed to update destroy vm grace period" - ) - # Destroying the VM - vm_created.delete(self.userapiclient) - vm_created.expung(self.apiClient) - return - - @attr(tags=["advanced", "provisioning"]) - def test_19_create_update_autoscalevmgroup(self): - """ - @summary: Test to list, create, update, enable, disable Autoscale VM Profiles - @Steps: - Step1: Creating a Network Offering for Supported Service LB with Netscaler - Step2: Create a Network using Network Offering created in Step1 - Step3: Launching a VM using Network created in Step2 - Step4: Associating IP Address for Network created in Step2 - Step5: Creating Scaleup condition and scaleup policy - Step6: Creating Scaledown condition and scaledown policy - Step7: Creating Autoscale VM profile - Step8: Creating Load Balancer Rule - Step9: Listing Autoscale Vm groups and verifying no Autoscale VM groups are listed - Step10: Creating Autoscale VM Group and verifying it was created - Step11: Listing Autoscale Vm groups and verifying 1 Autoscale VM groups is listed - Step12: Disabling Autoscale VM group and verifying it was disabled - Step13: Updating Autoscale VM group and verifying it was updated - Step14: Enabling Autoscale VM group and verifying it was enabled - """ - # Listing Network Offerings - list_nwoff_before = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - # Creating Network Offerign with LB as Netscalar - nwoff_created = NetworkOffering.create( - self.apiClient, - self.services["nw_off_isolated_netscaler"] - ) - self.assertIsNotNone( - nwoff_created, - "Failed to Create Network Offering with LB sercvice for Netscaler" - ) - # Enable Network offering - nwoff_created.update(self.apiClient, state='Enabled') - # Listing Network Offerings again - list_nwoff_after = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - self.assertEquals( - len(list_nwoff_before)+1, - len(list_nwoff_after), - "Failed to create Network Offering" - ) - # Creating a Network Using the Network Offering - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=nwoff_created.id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - self.cleanup.append(nwoff_created) - # Launching a Virtual Machine - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=network.id, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "Failed to launch a VM under network created" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_before) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed while launching a VM" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_before), - "IP Addresses Association Failed while launching a VM" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 2, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing Users - list_users = User.list( - self.apiClient, - listall=self.services["listall"], - account=self.account.name, - domainid=self.domain.id - ) - status = validateList(list_users) - self.assertEquals( - PASS, - status[0], - "Failed to list Users" - ) - # Listing counters - list_counters = Autoscale.listCounters(self.userapiclient) - status = validateList(list_counters) - self.assertEquals( - PASS, - status[0], - "Failed to list Counters" - ) - # Create Condition for scaleup Vm Policy - condition_scaleup = Autoscale.createCondition( - self.userapiclient, - counterid=list_counters[0].id, - relationaloperator='GT', - threshold='40' - ) - self.assertIsNotNone( - condition_scaleup, - "Failed to create Scaleup Condition" - ) - # Creating scaleup Vm Policy - scaleup_policy = Autoscale.createAutoscalePolicy( - self.userapiclient, - action='scaleup', - conditionids=condition_scaleup.id, - duration='40', - quiettime='300' - ) - self.assertIsNotNone( - scaleup_policy, - "Failed to create Scaleup VM Policy" - ) - # Create Condition for scaledown Vm Policy - condition_scaledown = Autoscale.createCondition( - self.userapiclient, - counterid=list_counters[0].id, - relationaloperator='GT', - threshold='10' - ) - self.assertIsNotNone( - condition_scaledown, - "Failed to create Scaledown Condition" - ) - # Creating scaledown Vm Policy - scaledown_policy = Autoscale.createAutoscalePolicy( - self.userapiclient, - action='scaledown', - conditionids=condition_scaledown.id, - duration='40', - quiettime='300' - ) - self.assertIsNotNone( - scaledown_policy, - "Failed to create Scaledown VM Policy" - ) - counterparam = { "snmpcommunity": "public", "snmpport": "161"} - # Create Autoscale VM Profile - vmprofile = Autoscale.createAutoscaleVmProfile( - self.userapiclient, - serviceofferingid=self.service_offering.id, - zoneid=self.zone.id, - templateid=self.template.id, - autoscaleuserid=list_users[0].id, - destroyvmgraceperiod='30', - counterparam=counterparam - ) - self.assertIsNotNone( - vmprofile, - "Failed to create Autoscale Vm Profile" - ) - self.services["lbrule"]["openfirewall"] = False - # Creating Load Balancer Rule - lbrule = LoadBalancerRule.create( - self.userapiclient, - self.services["lbrule"], - ipaddressid=associated_ipaddress.ipaddress.id, - accountid=self.account.name, - networkid=network.id, - domainid=self.domain.id - ) - self.assertIsNotNone( - lbrule, - "Failed to create Load Balancer Rule" - ) - # Listing Autoscale VM Groups - list_vmgroup_before = Autoscale.listAutoscaleVmGroup( - self.userapiclient, - listall=self.services["listall"], - lbruleid=lbrule.id - ) - # Verifying No Autoscale VM Groups are listed - self.assertIsNone( - list_vmgroup_before, - "Listed Autoscale VM Groups for newly created LB Rule" - ) - # Creating Autoscale VM Group - vmgroup = Autoscale.createAutoscaleVmGroup( - self.userapiclient, - lbruleid=lbrule.id, - minmembers='3', - maxmembers='10', - scaledownpolicyids=scaledown_policy.id, - scaleuppolicyids=scaleup_policy.id, - vmprofileid=vmprofile.id, - interval='30' - ) - self.assertIsNotNone( - vmgroup, - "Failed to create Autoscale VM Group" - ) - # Listing Autoscale VM Groups - list_vmgroup_after = Autoscale.listAutoscaleVmGroup( - self.userapiclient, - listall=self.services["listall"], - lbruleid=lbrule.id - ) - status = validateList(list_vmgroup_after) - self.assertEquals( - PASS, - status[0], - "Failed to list Autoscale VM group after creation" - ) - # Verifying only 1 Autoscale VM group is listed - self.assertEquals( - 1, - len(list_vmgroup_after), - "Autoscale VM group list count is not matching" - ) - # Disabling Autoscale VM group - vmgroup_disabled = Autoscale.disableAutoscaleVmGroup( - self.userapiclient, - id=vmgroup.id - ) - self.assertIsNotNone( - vmgroup_disabled, - "Failed to disable Autoscale VM group" - ) - # Verifyign the state of the VM Group afte renabling - self.assertEquals( - "disabled", - vmgroup_disabled.state, - "Disabled VM Group state is not matching" - ) - # Updating Autoscale VM Group - vmgroup_updated = Autoscale.updateAutoscaleVMGroup( - self.userapiclient, - id=vmgroup.id, - minmembers='3', - maxmembers='10', - scaledownpolicyids=scaledown_policy.id, - scaleuppolicyids=scaleup_policy.id, - interval='40' - ) - self.assertIsNotNone( - vmgroup_updated, - "Failed to update Autoscale VM group" - ) - self.assertEquals( - 40, - vmgroup_updated.interval, - "Updated Autoscale VM group interval value is not matching" - ) - # Enabling Autoscale VM group - vmgroup_enabled = Autoscale.enableAutoscaleVmGroup( - self.userapiclient, - id=vmgroup.id - ) - self.assertIsNotNone( - vmgroup_enabled, - "Failed to enable Autoscale VM group" - ) - # Verifyign the state of the VM Group afte renabling - self.assertEquals( - "enabled", - vmgroup_enabled.state, - "Enabled VM Group state is not matching" - ) - # Destroying the VM - vm_created.delete(self.userapiclient) - vm_created.expung(self.apiClient) - return - \ No newline at end of file diff --git a/test/integration/component/test_escalations_isos.py b/test/integration/component/test_escalations_isos.py deleted file mode 100644 index 387a681a03..0000000000 --- a/test/integration/component/test_escalations_isos.py +++ /dev/null @@ -1,783 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -#Import Local Modules -from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.cloudstackAPI import (createVolume, - createTemplate) -from marvin.lib.base import (Volume, - Iso, - VirtualMachine, - Template, - Snapshot, - SecurityGroup, - Account, - Zone, - Network, - NetworkOffering, - DiskOffering, - ServiceOffering, - VmSnapshot, - SnapshotPolicy, - SSHKeyPair, - Resources, - Configurations, - VpnCustomerGateway, - Hypervisor, - VpcOffering, - VPC, - NetworkACL) -from marvin.lib.common import (get_zone, - get_domain, - get_template, - list_os_types) -from marvin.lib.utils import (validateList, - cleanup_resources, - random_gen) -from marvin.codes import (PASS, FAIL, EMPTY_LIST) -from nose.plugins.attrib import attr -import time - -class TestIsos(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestIsos, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - cls.hypervisor = cls.testClient.getHypervisorInfo() - cls.services['mode'] = cls.zone.networktype - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - cls._cleanup.append(cls.account) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_01_list_isos_pagination(self): - """ - @Desc: Test to List ISO's pagination - @steps: - Step1: Listing all the ISO's for a user - Step2: Verifying that no ISO's are listed - Step3: Creating (page size + 1) number of ISO's - Step4: Listing all the ISO's again for a user - Step5: Verifying that list size is (page size + 1) - Step6: Listing all the ISO's in page1 - Step7: Verifying that list size is (page size) - Step8: Listing all the ISO's in page2 - Step9: Verifying that list size is 1 - Step10: Listing the ISO's by Id - Step11: Verifying if the ISO is downloaded and ready. - If yes the continuing - If not waiting and checking for iso to be ready till timeout - Step12: Deleting the ISO present in page 2 - Step13: Listing all the ISO's in page2 - Step14: Verifying that no ISO's are listed - """ - # Listing all the ISO's for a User - list_iso_before = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"] - ) - # Verifying that no ISOs are listed - self.assertIsNone( - list_iso_before, - "ISOs listed for newly created User" - ) - self.services["iso"]["zoneid"] = self.zone.id - # Creating pagesize + 1 number of ISO's - for i in range(0, (self.services["pagesize"] + 1)): - iso_created = Iso.create( - self.userapiclient, - self.services["iso"] - ) - self.assertIsNotNone( - iso_created, - "ISO creation failed" - ) - if(i < self.services["pagesize"]): - self.cleanup.append(iso_created) - - # Listing all the ISO's for a User - list_iso_after = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"] - ) - status = validateList(list_iso_after) - self.assertEquals( - PASS, - status[0], - "ISO's creation failed" - ) - # Verifying that list size is pagesize + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_iso_after), - "Failed to create pagesize + 1 number of ISO's" - ) - # Listing all the ISO's in page 1 - list_iso_page1 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_iso_page1) - self.assertEquals( - PASS, - status[0], - "Failed to list ISO's in page 1" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_iso_page1), - "Size of ISO's in page 1 is not matching" - ) - # Listing all the Templates in page 2 - list_iso_page2 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_iso_page2) - self.assertEquals( - PASS, - status[0], - "Failed to list ISo's in page 2" - ) - # Verifying the list size to be equal to 1 - self.assertEquals( - 1, - len(list_iso_page2), - "Size of ISO's in page 2 is not matching" - ) - # Verifying the state of the ISO to be ready. If not waiting for state to become ready - iso_ready = False - count = 0 - while iso_ready is False: - list_iso = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - id=iso_created.id - ) - status = validateList(list_iso) - self.assertEquals( - PASS, - status[0], - "Failed to list ISO by Id" - ) - if list_iso[0].isready is True: - iso_ready = True - elif (str(list_iso[0].status) == "Error"): - self.fail("Created ISO is in Errored state") - break - elif count > 10: - self.fail("Timed out before ISO came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Deleting the ISO present in page 2 - Iso.delete( - iso_created, - self.userapiclient - ) - # Listing all the ISO's in page 2 again - list_iso_page2 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that there are no ISO's listed - self.assertIsNone( - list_iso_page2, - "ISO's not deleted from page 2" - ) - del self.services["iso"]["zoneid"] - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_02_download_iso(self): - """ - @Desc: Test to Download ISO - @steps: - Step1: Listing all the ISO's for a user - Step2: Verifying that no ISO's are listed - Step3: Creating an ISO - Step4: Listing all the ISO's again for a user - Step5: Verifying that list size is 1 - Step6: Verifying if the ISO is in ready state. - If yes the continuing - If not waiting and checking for template to be ready till timeout - Step7: Downloading the ISO (Extract) - Step8: Verifying the details of downloaded ISO - """ - # Listing all the ISO's for a User - list_iso_before = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"] - ) - # Verifying that no ISOs are listed - self.assertIsNone( - list_iso_before, - "ISOs listed for newly created User" - ) - self.services["iso"]["zoneid"] = self.zone.id - self.services["iso"]["isextractable"] = True - # Creating an ISO's - iso_created = Iso.create( - self.userapiclient, - self.services["iso"] - ) - self.assertIsNotNone( - iso_created, - "ISO creation failed" - ) - self.cleanup.append(iso_created) - # Listing all the ISO's for a User - list_iso_after = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"] - ) - status = validateList(list_iso_after) - self.assertEquals( - PASS, - status[0], - "ISO's creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_iso_after), - "Failed to create an ISO's" - ) - # Verifying the state of the ISO to be ready. If not waiting for state to become ready - iso_ready = False - count = 0 - while iso_ready is False: - list_iso = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - id=iso_created.id - ) - status = validateList(list_iso) - self.assertEquals( - PASS, - status[0], - "Failed to list ISO by Id" - ) - if list_iso[0].isready is True: - iso_ready = True - elif (str(list_iso[0].status) == "Error"): - self.fail("Created ISO is in Errored state") - break - elif count > 10: - self.fail("Timed out before ISO came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Downloading the ISO - download_iso = Iso.extract( - self.userapiclient, - iso_created.id, - mode="HTTP_DOWNLOAD", - zoneid=self.zone.id - ) - self.assertIsNotNone( - download_iso, - "Download ISO failed" - ) - # Verifying the details of downloaded ISO - self.assertEquals( - "DOWNLOAD_URL_CREATED", - download_iso.state, - "Download URL not created for ISO" - ) - self.assertIsNotNone( - download_iso.url, - "Download URL not created for ISO" - ) - self.assertEquals( - iso_created.id, - download_iso.id, - "Download ISO details are not same as ISO created" - ) - del self.services["iso"]["zoneid"] - del self.services["iso"]["isextractable"] - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_03_edit_iso_details(self): - """ - @Desc: Test to Edit ISO name, displaytext, OSType - @steps: - Step1: Listing all the ISO's for a user - Step2: Verifying that no ISO's are listed - Step3: Creating an ISO - Step4: Listing all the ISO's again for a user - Step5: Verifying that list size is 1 - Step6: Verifying if the ISO is in ready state. - If yes the continuing - If not waiting and checking for template to be ready till timeout - Step7: Editing the ISO's name, displaytext - Step8: Verifying that ISO name and displaytext are edited - Step9: Editing the ISO name, displaytext, ostypeid - Step10: Verifying that ISO name, displaytext and ostypeid are edited - """ - # Listing all the ISO's for a User - list_iso_before = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"] - ) - # Verifying that no ISOs are listed - self.assertIsNone( - list_iso_before, - "ISOs listed for newly created User" - ) - self.services["iso"]["zoneid"] = self.zone.id - # Creating an ISO's - iso_created = Iso.create( - self.userapiclient, - self.services["iso"] - ) - self.assertIsNotNone( - iso_created, - "ISO creation failed" - ) - self.cleanup.append(iso_created) - # Listing all the ISO's for a User - list_iso_after = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"] - ) - status = validateList(list_iso_after) - self.assertEquals( - PASS, - status[0], - "ISO's creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_iso_after), - "Failed to create an ISO's" - ) - # Verifying the state of the ISO to be ready. If not waiting for state to become ready - iso_ready = False - count = 0 - while iso_ready is False: - list_iso = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - id=iso_created.id - ) - status = validateList(list_iso) - self.assertEquals( - PASS, - status[0], - "Failed to list ISO by Id" - ) - if list_iso[0].isready is True: - iso_ready = True - elif (str(list_iso[0].status) == "Error"): - self.fail("Created ISO is in Errored state") - break - elif count > 10: - self.fail("Timed out before ISO came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Editing the ISO name, displaytext - edited_iso = Iso.update( - iso_created, - self.userapiclient, - name="NewISOName", - displaytext="NewISODisplayText" - ) - self.assertIsNotNone( - edited_iso, - "Editing ISO failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":iso_created.id, - "name":"NewISOName", - "displaytest":"NewISODisplayText", - "account":iso_created.account, - "domainid":iso_created.domainid, - "isfeatured":iso_created.isfeatured, - "ostypeid":iso_created.ostypeid, - "ispublic":iso_created.ispublic, - } - actual_dict = { - "id":edited_iso.id, - "name":edited_iso.name, - "displaytest":edited_iso.displaytext, - "account":edited_iso.account, - "domainid":edited_iso.domainid, - "isfeatured":edited_iso.isfeatured, - "ostypeid":edited_iso.ostypeid, - "ispublic":edited_iso.ispublic, - } - edit_iso_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_iso_status, - "Edited ISO details are not as expected" - ) - # Editing the ISO name, displaytext, ostypeid - ostype_list = list_os_types(self.userapiclient) - status = validateList(ostype_list) - self.assertEquals( - PASS, - status[0], - "Failed to list OS Types" - ) - for i in range(0, len(ostype_list)): - if ostype_list[i].id != iso_created.ostypeid: - newostypeid = ostype_list[i].id - break - - edited_iso = Iso.update( - iso_created, - self.userapiclient, - name=iso_created.name, - displaytext=iso_created.displaytext, - ostypeid=newostypeid - ) - self.assertIsNotNone( - edited_iso, - "Editing ISO failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":iso_created.id, - "name":iso_created.name, - "displaytest":iso_created.displaytext, - "account":iso_created.account, - "domainid":iso_created.domainid, - "isfeatured":iso_created.isfeatured, - "ostypeid":newostypeid, - "ispublic":iso_created.ispublic, - } - actual_dict = { - "id":edited_iso.id, - "name":edited_iso.name, - "displaytest":edited_iso.displaytext, - "account":edited_iso.account, - "domainid":edited_iso.domainid, - "isfeatured":edited_iso.isfeatured, - "ostypeid":edited_iso.ostypeid, - "ispublic":edited_iso.ispublic, - } - edit_iso_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_iso_status, - "Edited ISO details are not as expected" - ) - del self.services["iso"]["zoneid"] - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_04_copy_iso(self): - """ - @Desc: Test to copy ISO from one zone to another - @steps: - Step1: Listing Zones available for a user - Step2: Verifying if the zones listed are greater than 1. - If Yes continuing. - If not halting the test. - Step3: Listing all the ISO's for a user in zone1 - Step4: Verifying that no ISO's are listed - Step5: Listing all the ISO's for a user in zone2 - Step6: Verifying that no ISO's are listed - Step7: Creating an ISO in zone 1 - Step8: Listing all the ISO's again for a user in zone1 - Step9: Verifying that list size is 1 - Step10: Listing all the ISO's for a user in zone2 - Step11: Verifying that no ISO's are listed - Step12: Copying the ISO created in step7 from zone1 to zone2 - Step13: Listing all the ISO's for a user in zone2 - Step14: Verifying that list size is 1 - Step15: Listing all the ISO's for a user in zone1 - Step16: Verifying that list size is 1 - """ - # Listing Zones available for a user - zones_list = Zone.list( - self.userapiclient, - available=True - ) - status = validateList(zones_list) - self.assertEquals( - PASS, - status[0], - "Failed to list Zones" - ) - if not len(zones_list) > 1: - self.fail("Enough zones doesnot exists to copy iso") - else: - # Listing all the ISO's for a User in Zone 1 - list_isos_zone1 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - zoneid=zones_list[0].id - ) - # Verifying that no ISO's are listed - self.assertIsNone( - list_isos_zone1, - "ISO's listed for newly created User in Zone1" - ) - # Listing all the ISO's for a User in Zone 2 - list_isos_zone2 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - zoneid=zones_list[1].id - ) - # Verifying that no ISO's are listed - self.assertIsNone( - list_isos_zone2, - "ISO's listed for newly created User in Zone2" - ) - self.services["iso"]["zoneid"] = zones_list[0].id - # Creating an ISO in Zone 1 - iso_created = Iso.create( - self.userapiclient, - self.services["iso"] - ) - self.assertIsNotNone( - iso_created, - "ISO creation failed" - ) - self.cleanup.append(iso_created) - # Listing all the ISO's for a User in Zone 1 - list_isos_zone1 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - zoneid=zones_list[0].id - ) - status = validateList(list_isos_zone1) - self.assertEquals( - PASS, - status[0], - "ISO creation failed in Zone1" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_isos_zone1), - "Failed to create a Template" - ) - # Listing all the ISO's for a User in Zone 2 - list_isos_zone2 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - zoneid=zones_list[1].id - ) - # Verifying that no ISO's are listed - self.assertIsNone( - list_isos_zone2, - "ISO's listed for newly created User in Zone2" - ) - # Verifying the state of the ISO to be ready. If not waiting for state to become ready - iso_ready = False - count = 0 - while iso_ready is False: - list_iso = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - id=iso_created.id - ) - status = validateList(list_iso) - self.assertEquals( - PASS, - status[0], - "Failed to list ISO by Id" - ) - if list_iso[0].isready is True: - iso_ready = True - elif (str(list_iso[0].status) == "Error"): - self.fail("Created ISO is in Errored state") - break - elif count > 10: - self.fail("Timed out before ISO came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Copying the ISO from Zone1 to Zone2 - copied_iso = Iso.copy( - self.userapiclient, - iso_created.id, - sourcezoneid=iso_created.zoneid, - destzoneid=zones_list[1].id - ) - self.assertIsNotNone( - copied_iso, - "Copying ISO from Zone1 to Zone2 failed" - ) - # Listing all the ISO's for a User in Zone 1 - list_isos_zone1 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - zoneid=zones_list[0].id - ) - status = validateList(list_isos_zone1) - self.assertEquals( - PASS, - status[0], - "ISO creation failed in Zone1" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_isos_zone1), - "Failed to create a Template" - ) - # Listing all the ISO's for a User in Zone 2 - list_isos_zone2 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - zoneid=zones_list[1].id - ) - status = validateList(list_isos_zone2) - self.assertEquals( - PASS, - status[0], - "ISO failed to copy into Zone2" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_isos_zone2), - "ISO failed to copy into Zone2" - ) - self.assertNotEquals( - "Connection refused", - list_isos_zone2[0].status, - "Failed to copy ISO" - ) - self.assertEquals( - True, - list_isos_zone2[0].isready, - "Failed to copy ISO" - ) - del self.services["iso"]["zoneid"] - return \ No newline at end of file diff --git a/test/integration/component/test_escalations_securitygroups.py b/test/integration/component/test_escalations_securitygroups.py deleted file mode 100644 index 8934088774..0000000000 --- a/test/integration/component/test_escalations_securitygroups.py +++ /dev/null @@ -1,588 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -#Import Local Modules -from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.cloudstackAPI import (createVolume, - createTemplate) -from marvin.lib.base import (Volume, - Iso, - VirtualMachine, - Template, - Snapshot, - SecurityGroup, - Account, - Zone, - Network, - NetworkOffering, - DiskOffering, - ServiceOffering, - VmSnapshot, - SnapshotPolicy, - SSHKeyPair, - Resources, - Configurations, - VpnCustomerGateway, - Hypervisor, - VpcOffering, - VPC, - NetworkACL) -from marvin.lib.common import (get_zone, - get_domain, - get_template, - list_os_types) -from marvin.lib.utils import (validateList, - cleanup_resources, - random_gen) -from marvin.codes import (PASS, FAIL, EMPTY_LIST) -from nose.plugins.attrib import attr -import time - -class TestSecurityGroups(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestSecurityGroups, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - cls.services['mode'] = cls.zone.networktype - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - cls._cleanup.append(cls.account) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["basic", "provisioning"]) - def test_01_list_securitygroups_pagination(self): - """ - @Desc: Test to List Security Groups pagination - @steps: - Step1: Listing all the Security Groups for a user - Step2: Verifying that list size is 1 - Step3: Creating (page size) number of Security Groups - Step4: Listing all the Security Groups again for a user - Step5: Verifying that list size is (page size + 1) - Step6: Listing all the Security Groups in page1 - Step7: Verifying that list size is (page size) - Step8: Listing all the Security Groups in page2 - Step9: Verifying that list size is 1 - Step10: Deleting the Security Group present in page 2 - Step11: Listing all the Security Groups in page2 - Step12: Verifying that no security groups are listed - """ - # Listing all the Security Groups for a User - list_securitygroups_before = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying that default security group is created - status = validateList(list_securitygroups_before) - self.assertEquals( - PASS, - status[0], - "Default Security Groups creation failed" - ) - # Verifying the size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_before), - "Count of Security Groups list is not matching" - ) - # Creating pagesize number of security groups - for i in range(0, (self.services["pagesize"])): - securitygroup_created = SecurityGroup.create( - self.userapiclient, - self.services["security_group"], - account=self.account.name, - domainid=self.domain.id, - description=self.services["security_group"]["name"] - ) - self.assertIsNotNone( - securitygroup_created, - "Security Group creation failed" - ) - if (i < self.services["pagesize"]): - self.cleanup.append(securitygroup_created) - - # Listing all the security groups for user again - list_securitygroups_after = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_securitygroups_after) - self.assertEquals( - PASS, - status[0], - "Security Groups creation failed" - ) - # Verifying that list size is pagesize + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_securitygroups_after), - "Failed to create pagesize + 1 number of Security Groups" - ) - # Listing all the security groups in page 1 - list_securitygroups_page1 = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_securitygroups_page1) - self.assertEquals( - PASS, - status[0], - "Failed to list security groups in page 1" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_securitygroups_page1), - "Size of security groups in page 1 is not matching" - ) - # Listing all the security groups in page 2 - list_securitygroups_page2 = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_securitygroups_page2) - self.assertEquals( - PASS, - status[0], - "Failed to list security groups in page 2" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - 1, - len(list_securitygroups_page2), - "Size of security groups in page 2 is not matching" - ) - # Deleting the security group present in page 2 - SecurityGroup.delete( - securitygroup_created, - self.userapiclient) - # Listing all the security groups in page 2 again - list_securitygroups_page2 = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that there are no security groups listed - self.assertIsNone( - list_securitygroups_page2, - "Security Groups not deleted from page 2" - ) - return - - @attr(tags=["basic", "provisioning"]) - def test_02_securitygroups_authorize_revoke_ingress(self): - """ - @Desc: Test to Authorize and Revoke Ingress for Security Group - @steps: - Step1: Listing all the Security Groups for a user - Step2: Verifying that list size is 1 - Step3: Creating a Security Groups - Step4: Listing all the Security Groups again for a user - Step5: Verifying that list size is 2 - Step6: Authorizing Ingress for the security group created in step3 - Step7: Listing the security groups by passing id of security group created in step3 - Step8: Verifying that list size is 1 - Step9: Verifying that Ingress is authorized to the security group - Step10: Verifying the details of the Ingress rule are as expected - Step11: Revoking Ingress for the security group created in step3 - Step12: Listing the security groups by passing id of security group created in step3 - Step13: Verifying that list size is 1 - Step14: Verifying that Ingress is revoked from the security group - """ - # Listing all the Security Groups for a User - list_securitygroups_before = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying that default security group is created - status = validateList(list_securitygroups_before) - self.assertEquals( - PASS, - status[0], - "Default Security Groups creation failed" - ) - # Verifying the size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_before), - "Count of Security Groups list is not matching" - ) - # Creating a security group - securitygroup_created = SecurityGroup.create( - self.userapiclient, - self.services["security_group"], - account=self.account.name, - domainid=self.domain.id, - description=self.services["security_group"]["name"] - ) - self.assertIsNotNone( - securitygroup_created, - "Security Group creation failed" - ) - self.cleanup.append(securitygroup_created) - - # Listing all the security groups for user again - list_securitygroups_after = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_securitygroups_after) - self.assertEquals( - PASS, - status[0], - "Security Groups creation failed" - ) - # Verifying that list size is 2 - self.assertEquals( - 2, - len(list_securitygroups_after), - "Failed to create Security Group" - ) - # Authorizing Ingress for the security group created in step3 - securitygroup_created.authorize( - self.userapiclient, - self.services["ingress_rule"], - self.account.name, - self.domain.id, - ) - # Listing the security group by Id - list_securitygroups_byid = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - id=securitygroup_created.id, - domainid=self.domain.id - ) - # Verifying that security group is listed - status = validateList(list_securitygroups_byid) - self.assertEquals( - PASS, - status[0], - "Listing of Security Groups by id failed" - ) - # Verifying size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_byid), - "Count of the listing security group by id is not matching" - ) - securitygroup_ingress = list_securitygroups_byid[0].ingressrule - # Validating the Ingress rule - status = validateList(securitygroup_ingress) - self.assertEquals( - PASS, - status[0], - "Security Groups Ingress rule authorization failed" - ) - self.assertEquals( - 1, - len(securitygroup_ingress), - "Security Group Ingress rules count is not matching" - ) - # Verifying the details of the Ingress rule are as expected - #Creating expected and actual values dictionaries - expected_dict = { - "cidr":self.services["ingress_rule"]["cidrlist"], - "protocol":self.services["ingress_rule"]["protocol"], - "startport":self.services["ingress_rule"]["startport"], - "endport":self.services["ingress_rule"]["endport"], - } - actual_dict = { - "cidr":str(securitygroup_ingress[0].cidr), - "protocol":str(securitygroup_ingress[0].protocol.upper()), - "startport":str(securitygroup_ingress[0].startport), - "endport":str(securitygroup_ingress[0].endport), - } - ingress_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - ingress_status, - "Listed Security group Ingress rule details are not as expected" - ) - # Revoking the Ingress rule from Security Group - securitygroup_created.revoke(self.userapiclient, securitygroup_ingress[0].ruleid) - # Listing the security group by Id - list_securitygroups_byid = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - id=securitygroup_created.id, - domainid=self.domain.id - ) - # Verifying that security group is listed - status = validateList(list_securitygroups_byid) - self.assertEquals( - PASS, - status[0], - "Listing of Security Groups by id failed" - ) - # Verifying size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_byid), - "Count of the listing security group by id is not matching" - ) - securitygroup_ingress = list_securitygroups_byid[0].ingressrule - # Verifying that Ingress rule is empty(revoked) - status = validateList(securitygroup_ingress) - self.assertEquals( - EMPTY_LIST, - status[2], - "Security Groups Ingress rule is not revoked" - ) - return - - @attr(tags=["basic", "provisioning"]) - def test_03_securitygroups_authorize_revoke_egress(self): - """ - @Desc: Test to Authorize and Revoke Egress for Security Group - @steps: - Step1: Listing all the Security Groups for a user - Step2: Verifying that list size is 1 - Step3: Creating a Security Groups - Step4: Listing all the Security Groups again for a user - Step5: Verifying that list size is 2 - Step6: Authorizing Egress for the security group created in step3 - Step7: Listing the security groups by passing id of security group created in step3 - Step8: Verifying that list size is 1 - Step9: Verifying that Egress is authorized to the security group - Step10: Verifying the details of the Egress rule are as expected - Step11: Revoking Egress for the security group created in step3 - Step12: Listing the security groups by passing id of security group created in step3 - Step13: Verifying that list size is 1 - Step14: Verifying that Egress is revoked from the security group - """ - # Listing all the Security Groups for a User - list_securitygroups_before = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying that default security group is created - status = validateList(list_securitygroups_before) - self.assertEquals( - PASS, - status[0], - "Default Security Groups creation failed" - ) - # Verifying the size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_before), - "Count of Security Groups list is not matching" - ) - # Creating a security group - securitygroup_created = SecurityGroup.create( - self.userapiclient, - self.services["security_group"], - account=self.account.name, - domainid=self.domain.id, - description=self.services["security_group"]["name"] - ) - self.assertIsNotNone( - securitygroup_created, - "Security Group creation failed" - ) - self.cleanup.append(securitygroup_created) - - # Listing all the security groups for user again - list_securitygroups_after = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_securitygroups_after) - self.assertEquals( - PASS, - status[0], - "Security Groups creation failed" - ) - # Verifying that list size is 2 - self.assertEquals( - 2, - len(list_securitygroups_after), - "Failed to create Security Group" - ) - # Authorizing Egress for the security group created in step3 - securitygroup_created.authorizeEgress( - self.userapiclient, - self.services["ingress_rule"], - self.account.name, - self.domain.id, - ) - # Listing the security group by Id - list_securitygroups_byid = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - id=securitygroup_created.id, - domainid=self.domain.id - ) - # Verifying that security group is listed - status = validateList(list_securitygroups_byid) - self.assertEquals( - PASS, - status[0], - "Listing of Security Groups by id failed" - ) - # Verifying size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_byid), - "Count of the listing security group by id is not matching" - ) - securitygroup_egress = list_securitygroups_byid[0].egressrule - # Validating the Ingress rule - status = validateList(securitygroup_egress) - self.assertEquals( - PASS, - status[0], - "Security Groups Egress rule authorization failed" - ) - self.assertEquals( - 1, - len(securitygroup_egress), - "Security Group Egress rules count is not matching" - ) - # Verifying the details of the Egress rule are as expected - #Creating expected and actual values dictionaries - expected_dict = { - "cidr":self.services["ingress_rule"]["cidrlist"], - "protocol":self.services["ingress_rule"]["protocol"], - "startport":self.services["ingress_rule"]["startport"], - "endport":self.services["ingress_rule"]["endport"], - } - actual_dict = { - "cidr":str(securitygroup_egress[0].cidr), - "protocol":str(securitygroup_egress[0].protocol.upper()), - "startport":str(securitygroup_egress[0].startport), - "endport":str(securitygroup_egress[0].endport), - } - ingress_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - ingress_status, - "Listed Security group Egress rule details are not as expected" - ) - # Revoking the Egress rule from Security Group - securitygroup_created.revokeEgress(self.userapiclient, securitygroup_egress[0].ruleid) - # Listing the security group by Id - list_securitygroups_byid = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - id=securitygroup_created.id, - domainid=self.domain.id - ) - # Verifying that security group is listed - status = validateList(list_securitygroups_byid) - self.assertEquals( - PASS, - status[0], - "Listing of Security Groups by id failed" - ) - # Verifying size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_byid), - "Count of the listing security group by id is not matching" - ) - securitygroup_egress = list_securitygroups_byid[0].egressrule - # Verifying that Ingress rule is empty(revoked) - status = validateList(securitygroup_egress) - self.assertEquals( - EMPTY_LIST, - status[2], - "Security Groups Egress rule is not revoked" - ) - return \ No newline at end of file diff --git a/test/integration/component/test_escalations_snapshots.py b/test/integration/component/test_escalations_snapshots.py deleted file mode 100644 index 2367253b58..0000000000 --- a/test/integration/component/test_escalations_snapshots.py +++ /dev/null @@ -1,647 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -#Import Local Modules -from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.cloudstackAPI import (createVolume, - createTemplate) -from marvin.lib.base import (Volume, - Iso, - VirtualMachine, - Template, - Snapshot, - SecurityGroup, - Account, - Zone, - Network, - NetworkOffering, - DiskOffering, - ServiceOffering, - VmSnapshot, - SnapshotPolicy, - SSHKeyPair, - Resources, - Configurations, - VpnCustomerGateway, - Hypervisor, - VpcOffering, - VPC, - NetworkACL) -from marvin.lib.common import (get_zone, - get_domain, - get_template, - list_os_types) -from marvin.lib.utils import (validateList, - cleanup_resources, - random_gen) -from marvin.codes import (PASS, FAIL, EMPTY_LIST) -from nose.plugins.attrib import attr -import time - -class TestSnapshots(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestSnapshots, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - if cls.zone.localstorageenabled: - cls.storagetype = 'local' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' - cls.services["disk_offering"]["storagetype"] = 'local' - else: - cls.storagetype = 'shared' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' - cls.services["disk_offering"]["storagetype"] = 'shared' - - cls.services['mode'] = cls.zone.networktype - cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() - cls.services["virtual_machine"]["zoneid"] = cls.zone.id - cls.services["virtual_machine"]["template"] = cls.template.id - cls.services["custom_volume"]["zoneid"] = cls.zone.id - # Creating Disk offering, Service Offering and Account - cls.disk_offering = DiskOffering.create( - cls.api_client, - cls.services["disk_offering"] - ) - cls._cleanup.append(cls.disk_offering) - cls.service_offering = ServiceOffering.create( - cls.api_client, - cls.services["service_offerings"]["tiny"] - ) - cls._cleanup.append(cls.service_offering) - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - cls._cleanup.append(cls.account) - # Creating Virtual Machine - cls.virtual_machine = VirtualMachine.create( - cls.userapiclient, - cls.services["virtual_machine"], - accountid=cls.account.name, - domainid=cls.account.domainid, - serviceofferingid=cls.service_offering.id, - ) - cls._cleanup.append(cls.virtual_machine) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_01_list_volume_snapshots_pagination(self): - """ - @Desc: Test to List Volume Snapshots pagination - @steps: - Step1: Listing all the volume snapshots for a user - Step2: Verifying that list size is 0 - Step3: Creating (page size + 1) number of volume snapshots - Step4: Listing all the volume snapshots again for a user - Step5: Verifying that list size is (page size + 1) - Step6: Listing all the volume snapshots in page1 - Step7: Verifying that list size is (page size) - Step8: Listing all the volume snapshots in page2 - Step9: Verifying that list size is 1 - Step10: Deleting the volume snapshot present in page 2 - Step11: Listing all the volume snapshots in page2 - Step12: Verifying that list size is 0 - """ - # Listing all the volume snapshots for a User - list_vol_snaps_before = Snapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying list size is 0 - self.assertIsNone( - list_vol_snaps_before, - "Volume snapshots exists for newly created user" - ) - # Listing the root volumes available for the user - volumes_list = Volume.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(volumes_list) - self.assertEquals( - PASS, - status[0], - "Root volume did not get created while deploying a VM" - ) - # Verifying list size to be 1 - self.assertEquals( - 1, - len(volumes_list), - "More than 1 root volume created for deployed VM" - ) - root_volume = volumes_list[0] - # Creating pagesize + 1 number of volume snapshots - for i in range(0, (self.services["pagesize"] + 1)): - snapshot_created = Snapshot.create( - self.userapiclient, - root_volume.id, - ) - self.assertIsNotNone( - snapshot_created, - "Snapshot creation failed" - ) - self.cleanup.append(snapshot_created) - - # Listing all the volume snapshots for user again - list_vol_snaps_after = Snapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_vol_snaps_after) - self.assertEquals( - PASS, - status[0], - "Volume snapshot creation failed" - ) - # Verifying that list size is pagesize + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_vol_snaps_after), - "Failed to create pagesize + 1 number of Volume snapshots" - ) - # Listing all the volume snapshots in page 1 - list_vol_snaps_page1 = Snapshot.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_vol_snaps_page1) - self.assertEquals( - PASS, - status[0], - "Failed to list volume snapshots in page 1" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_vol_snaps_page1), - "Size of volume snapshots in page 1 is not matching" - ) - # Listing all the volume snapshots in page 2 - list_vol_snaps_page2 = Snapshot.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_vol_snaps_page2) - self.assertEquals( - PASS, - status[0], - "Failed to list volume snapshots in page 2" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - 1, - len(list_vol_snaps_page2), - "Size of volume snapshots in page 2 is not matching" - ) - # Deleting the volume snapshot present in page 2 - Snapshot.delete( - snapshot_created, - self.userapiclient - ) - # Listing all the snapshots in page 2 again - list_vol_snaps_page2 = Snapshot.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that list size is 0 - self.assertIsNone( - list_vol_snaps_page2, - "Volume snapshot not deleted from page 2" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_02_list_volume_snapshots_byid(self): - """ - @Desc: Test to List Volume Snapshots by Id - @Steps: - Step1: Listing all the volume snapshots for a user - Step2: Verifying that list size is 0 - Step3: Creating a volume snapshot - Step4: Listing all the volume snapshots again for a user - Step5: Verifying that list size is 1 - Step6: Listing all the volume snapshots by specifying snapshot id - Step7: Verifying that list size is 1 - Step8: Verifying details of the listed volume snapshot - """ - # Listing all the volume snapshots for a User - list_vol_snaps_before = Snapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying list size is 0 - self.assertIsNone( - list_vol_snaps_before, - "Volume snapshots exists for newly created user" - ) - # Listing the root volumes available for the user - volumes_list = Volume.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(volumes_list) - self.assertEquals( - PASS, - status[0], - "Root volume did not get created while deploying a VM" - ) - # Verifying list size to be 1 - self.assertEquals( - 1, - len(volumes_list), - "More than 1 root volume created for deployed VM" - ) - root_volume = volumes_list[0] - # Creating a volume snapshot - snapshot_created = Snapshot.create( - self.userapiclient, - root_volume.id, - ) - self.assertIsNotNone( - snapshot_created, - "Snapshot creation failed" - ) - self.cleanup.append(snapshot_created) - # Listing all the volume snapshots for user again - list_vol_snaps_after = Snapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_vol_snaps_after) - self.assertEquals( - PASS, - status[0], - "Volume snapshot creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_vol_snaps_after), - "Failed to create Volume snapshot" - ) - # Listing volume snapshot by id - list_vol_snapshot = Snapshot.list( - self.userapiclient, - listall=self.services["listall"], - id=snapshot_created.id - ) - status = validateList(list_vol_snapshot) - self.assertEquals( - PASS, - status[0], - "Failed to list Volume snapshot by Id" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_vol_snapshot), - "Size of the list volume snapshot by Id is not matching" - ) - # Verifying details of the listed snapshot to be same as snapshot created above - #Creating expected and actual values dictionaries - expected_dict = { - "id":snapshot_created.id, - "name":snapshot_created.name, - "state":snapshot_created.state, - "intervaltype":snapshot_created.intervaltype, - "account":snapshot_created.account, - "domain":snapshot_created.domainid, - "volume":snapshot_created.volumeid - } - actual_dict = { - "id":list_vol_snapshot[0].id, - "name":list_vol_snapshot[0].name, - "state":list_vol_snapshot[0].state, - "intervaltype":list_vol_snapshot[0].intervaltype, - "account":list_vol_snapshot[0].account, - "domain":list_vol_snapshot[0].domainid, - "volume":list_vol_snapshot[0].volumeid - } - vol_snapshot_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - vol_snapshot_status, - "Listed Volume Snapshot details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_03_list_vm_snapshots_pagination(self): - """ - @Desc: Test to List VM Snapshots pagination - @Steps: - Step1: Listing all the VM snapshots for a user - Step2: Verifying that list size is 0 - Step3: Creating (page size + 1) number of VM snapshots - Step4: Listing all the VM snapshots again for a user - Step5: Verifying that list size is (page size + 1) - Step6: Listing all the VM snapshots in page1 - Step7: Verifying that list size is (page size) - Step8: Listing all the VM snapshots in page2 - Step9: Verifying that list size is 1 - Step10: Deleting the VM snapshot present in page 2 - Step11: Listing all the volume snapshots in page2 - Step12: Verifying that list size is 0 - """ - # Listing all the VM snapshots for a User - list_vm_snaps_before = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying list size is 0 - self.assertIsNone( - list_vm_snaps_before, - "VM snapshots exists for newly created user" - ) - # Creating pagesize + 1 number of VM snapshots - for i in range(0, (self.services["pagesize"] + 1)): - snapshot_created = VmSnapshot.create( - self.userapiclient, - self.virtual_machine.id, - ) - self.assertIsNotNone( - snapshot_created, - "Snapshot creation failed" - ) - - # Listing all the VM snapshots for user again - list_vm_snaps_after = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_vm_snaps_after) - self.assertEquals( - PASS, - status[0], - "VM snapshot creation failed" - ) - # Verifying that list size is pagesize + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_vm_snaps_after), - "Failed to create pagesize + 1 number of VM snapshots" - ) - # Listing all the VM snapshots in page 1 - list_vm_snaps_page1 = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_vm_snaps_page1) - self.assertEquals( - PASS, - status[0], - "Failed to list vm snapshots in page 1" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_vm_snaps_page1), - "Size of vm snapshots in page 1 is not matching" - ) - # Listing all the vm snapshots in page 2 - list_vm_snaps_page2 = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_vm_snaps_page2) - self.assertEquals( - PASS, - status[0], - "Failed to list vm snapshots in page 2" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - 1, - len(list_vm_snaps_page2), - "Size of vm snapshots in page 2 is not matching" - ) - # Deleting the vm snapshot present in page 2 - VmSnapshot.deleteVMSnapshot( - self.userapiclient, - snapshot_created.id - ) - # Listing all the snapshots in page 2 again - list_vm_snaps_page2 = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that list size is 0 - self.assertIsNone( - list_vm_snaps_page2, - "VM snapshot not deleted from page 2" - ) - # Deleting all the existing VM snapshots - list_vm_snaps = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vm_snaps) - self.assertEquals( - PASS, - status[0], - "All VM snapshots deleted" - ) - # Verifying that list size is equal to page size - self.assertEquals( - self.services["pagesize"], - len(list_vm_snaps), - "VM Snapshots count is not matching" - ) - # Deleting all the existing VM snapshots - for i in range(0, len(list_vm_snaps)): - VmSnapshot.deleteVMSnapshot( - self.userapiclient, - list_vm_snaps[i].id - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_04_list_vm_snapshots_byid(self): - """ - @summary: Test to List VM Snapshots by Id - - Step1: Listing all the VM snapshots for a user - Step2: Verifying that list size is 0 - Step3: Creating a VM snapshot - Step4: Listing all the VM snapshots again for a user - Step5: Verifying that list size is 1 - Step6: Listing all the VM snapshots by specifying snapshot id - Step7: Verifying that list size is 1 - Step8: Verifying details of the listed VM snapshot - """ - # Listing all the VM snapshots for a User - list_vm_snaps_before = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying list size is 0 - self.assertIsNone( - list_vm_snaps_before, - "VM snapshots exists for newly created user" - ) - # Creating a VM snapshot - snapshot_created = VmSnapshot.create( - self.userapiclient, - self.virtual_machine.id, - ) - self.assertIsNotNone( - snapshot_created, - "Snapshot creation failed" - ) - # Listing all the VM snapshots for user again - list_vm_snaps_after = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_vm_snaps_after) - self.assertEquals( - PASS, - status[0], - "VM snapshot creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_vm_snaps_after), - "Failed to create VM snapshot" - ) - # Listing vm snapshot by id - list_vm_snapshot = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - vmsnapshotid=snapshot_created.id - ) - status = validateList(list_vm_snapshot) - self.assertEquals( - PASS, - status[0], - "Failed to list VM snapshot by Id" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_vm_snapshot), - "Size of the list vm snapshot by Id is not matching" - ) - # Verifying details of the listed snapshot to be same as snapshot created above - #Creating expected and actual values dictionaries - expected_dict = { - "id":snapshot_created.id, - "name":snapshot_created.name, - "state":snapshot_created.state, - "vmid":snapshot_created.virtualmachineid, - } - actual_dict = { - "id":list_vm_snapshot[0].id, - "name":list_vm_snapshot[0].name, - "state":list_vm_snapshot[0].state, - "vmid":list_vm_snapshot[0].virtualmachineid, - } - vm_snapshot_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - vm_snapshot_status, - "Listed VM Snapshot details are not as expected" - ) - return \ No newline at end of file diff --git a/test/integration/component/test_escalations_templates.py b/test/integration/component/test_escalations_templates.py deleted file mode 100644 index 083ba90e32..0000000000 --- a/test/integration/component/test_escalations_templates.py +++ /dev/null @@ -1,944 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -#Import Local Modules -from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.cloudstackAPI import (createVolume, - createTemplate) -from marvin.lib.base import (Volume, - Iso, - VirtualMachine, - Template, - Snapshot, - SecurityGroup, - Account, - Zone, - Network, - NetworkOffering, - DiskOffering, - ServiceOffering, - VmSnapshot, - SnapshotPolicy, - SSHKeyPair, - Resources, - Configurations, - VpnCustomerGateway, - Hypervisor, - VpcOffering, - VPC, - NetworkACL) -from marvin.lib.common import (get_zone, - get_domain, - get_template, - list_os_types) -from marvin.lib.utils import (validateList, - cleanup_resources, - random_gen) -from marvin.codes import (PASS, FAIL, EMPTY_LIST) -from nose.plugins.attrib import attr -import time - -class TestTemplates(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestTemplates, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - cls.hypervisor = cls.testClient.getHypervisorInfo() - cls.services['mode'] = cls.zone.networktype - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - cls._cleanup.append(cls.account) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_01_list_templates_pagination(self): - """ - @Desc: Test to List Templates pagination - @steps: - Step1: Listing all the Templates for a user - Step2: Verifying that no Templates are listed - Step3: Creating (page size + 1) number of Templates - Step4: Listing all the Templates again for a user - Step5: Verifying that list size is (page size + 1) - Step6: Listing all the Templates in page1 - Step7: Verifying that list size is (page size) - Step8: Listing all the Templates in page2 - Step9: Verifying that list size is 1 - Step10: Listing the template by Id - Step11: Verifying if the template is downloaded and ready. - If yes the continuing - If not waiting and checking for template to be ready till timeout - Step12: Deleting the Template present in page 2 - Step13: Listing all the Templates in page2 - Step14: Verifying that no Templates are listed - """ - # Listing all the Templates for a User - list_templates_before = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"] - ) - # Verifying that no Templates are listed - self.assertIsNone( - list_templates_before, - "Templates listed for newly created User" - ) - self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" - self.services["template"]["format"] = "VHD" - self.services["template"]["ostype"] = self.services["ostype"] - # Creating pagesize + 1 number of Templates - for i in range(0, (self.services["pagesize"] + 1)): - template_created = Template.register( - self.userapiclient, - self.services["template"], - self.zone.id, - hypervisor=self.hypervisor - ) - self.assertIsNotNone( - template_created, - "Template creation failed" - ) - if(i < self.services["pagesize"]): - self.cleanup.append(template_created) - - # Listing all the Templates for a User - list_templates_after = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"] - ) - status = validateList(list_templates_after) - self.assertEquals( - PASS, - status[0], - "Templates creation failed" - ) - # Verifying that list size is pagesize + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_templates_after), - "Failed to create pagesize + 1 number of Templates" - ) - # Listing all the Templates in page 1 - list_templates_page1 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_templates_page1) - self.assertEquals( - PASS, - status[0], - "Failed to list Templates in page 1" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_templates_page1), - "Size of Templates in page 1 is not matching" - ) - # Listing all the Templates in page 2 - list_templates_page2 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_templates_page2) - self.assertEquals( - PASS, - status[0], - "Failed to list Templates in page 2" - ) - # Verifying the list size to be equal to 1 - self.assertEquals( - 1, - len(list_templates_page2), - "Size of Templates in page 2 is not matching" - ) - # Verifying the state of the template to be ready. If not waiting for state to become ready - template_ready = False - count = 0 - while template_ready is False: - list_template = Template.list( - self.userapiclient, - id=template_created.id, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - ) - status = validateList(list_template) - self.assertEquals( - PASS, - status[0], - "Failed to list Templates by Id" - ) - if list_template[0].isready is True: - template_ready = True - elif (str(list_template[0].status) == "Error"): - self.fail("Created Template is in Errored state") - break - elif count > 10: - self.fail("Timed out before Template came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Deleting the Template present in page 2 - Template.delete( - template_created, - self.userapiclient - ) - # Listing all the Templates in page 2 again - list_templates_page2 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that there are no Templates listed - self.assertIsNone( - list_templates_page2, - "Templates not deleted from page 2" - ) - del self.services["template"]["url"] - del self.services["template"]["format"] - del self.services["template"]["ostype"] - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_02_download_template(self): - """ - @Desc: Test to Download Template - @steps: - Step1: Listing all the Templates for a user - Step2: Verifying that no Templates are listed - Step3: Creating a Templates - Step4: Listing all the Templates again for a user - Step5: Verifying that list size is 1 - Step6: Verifying if the template is in ready state. - If yes the continuing - If not waiting and checking for template to be ready till timeout - Step7: Downloading the template (Extract) - Step8: Verifying that Template is downloaded - """ - # Listing all the Templates for a User - list_templates_before = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"] - ) - # Verifying that no Templates are listed - self.assertIsNone( - list_templates_before, - "Templates listed for newly created User" - ) - self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" - self.services["template"]["format"] = "VHD" - self.services["template"]["ostype"] = self.services["ostype"] - self.services["template"]["isextractable"] = True - # Creating aTemplate - template_created = Template.register( - self.userapiclient, - self.services["template"], - self.zone.id, - hypervisor=self.hypervisor - ) - self.assertIsNotNone( - template_created, - "Template creation failed" - ) - self.cleanup.append(template_created) - # Listing all the Templates for a User - list_templates_after = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"] - ) - status = validateList(list_templates_after) - self.assertEquals( - PASS, - status[0], - "Templates creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_templates_after), - "Failed to create a Template" - ) - # Verifying the state of the template to be ready. If not waiting for state to become ready till time out - template_ready = False - count = 0 - while template_ready is False: - list_template = Template.list( - self.userapiclient, - id=template_created.id, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - ) - status = validateList(list_template) - self.assertEquals( - PASS, - status[0], - "Failed to list Templates by Id" - ) - if list_template[0].isready is True: - template_ready = True - elif (str(list_template[0].status) == "Error"): - self.fail("Created Template is in Errored state") - break - elif count > 10: - self.fail("Timed out before Template came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Downloading the Template name - download_template = Template.extract( - self.userapiclient, - template_created.id, - mode="HTTP_DOWNLOAD", - zoneid=self.zone.id - ) - self.assertIsNotNone( - download_template, - "Download Template failed" - ) - # Verifying the details of downloaded template - self.assertEquals( - "DOWNLOAD_URL_CREATED", - download_template.state, - "Download URL not created for Template" - ) - self.assertIsNotNone( - download_template.url, - "Download URL not created for Template" - ) - self.assertEquals( - template_created.id, - download_template.id, - "Download Template details are not same as Template created" - ) - del self.services["template"]["url"] - del self.services["template"]["format"] - del self.services["template"]["ostype"] - del self.services["template"]["isextractable"] - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_03_edit_template_details(self): - """ - @Desc: Test to Edit Template name, displaytext, OSType - @steps: - Step1: Listing all the Templates for a user - Step2: Verifying that no Templates are listed - Step3: Creating a Templates - Step4: Listing all the Templates again for a user - Step5: Verifying that list size is 1 - Step6: Verifying if the template is in ready state. - If yes the continuing - If not waiting and checking for template to be ready till timeout - Step7: Editing the template name - Step8: Verifying that Template name is edited - Step9: Editing the template displaytext - Step10: Verifying that Template displaytext is edited - Step11: Editing the template ostypeid - Step12: Verifying that Template ostypeid is edited - Step13: Editing the template name, displaytext - Step14: Verifying that Template name, displaytext are edited - Step15: Editing the template name, displaytext, ostypeid - Step16: Verifying that Template name, displaytext and ostypeid are edited - """ - # Listing all the Templates for a User - list_templates_before = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"] - ) - # Verifying that no Templates are listed - self.assertIsNone( - list_templates_before, - "Templates listed for newly created User" - ) - self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" - self.services["template"]["format"] = "VHD" - self.services["template"]["ostype"] = self.services["ostype"] - # Creating aTemplate - template_created = Template.register( - self.userapiclient, - self.services["template"], - self.zone.id, - hypervisor=self.hypervisor - ) - self.assertIsNotNone( - template_created, - "Template creation failed" - ) - self.cleanup.append(template_created) - # Listing all the Templates for a User - list_templates_after = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"] - ) - status = validateList(list_templates_after) - self.assertEquals( - PASS, - status[0], - "Templates creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_templates_after), - "Failed to create a Template" - ) - # Verifying the state of the template to be ready. If not waiting for state to become ready till time out - template_ready = False - count = 0 - while template_ready is False: - list_template = Template.list( - self.userapiclient, - id=template_created.id, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - ) - status = validateList(list_template) - self.assertEquals( - PASS, - status[0], - "Failed to list Templates by Id" - ) - if list_template[0].isready is True: - template_ready = True - elif (str(list_template[0].status) == "Error"): - self.fail("Created Template is in Errored state") - break - elif count > 10: - self.fail("Timed out before Template came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Editing the Template name - edited_template = Template.update( - template_created, - self.userapiclient, - name="NewTemplateName" - ) - self.assertIsNotNone( - edited_template, - "Editing Template failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":template_created.id, - "name":"NewTemplateName", - "displaytest":template_created.displaytext, - "account":template_created.account, - "domainid":template_created.domainid, - "format":template_created.format, - "ostypeid":template_created.ostypeid, - "templatetype":template_created.templatetype, - } - actual_dict = { - "id":edited_template.id, - "name":edited_template.name, - "displaytest":edited_template.displaytext, - "account":edited_template.account, - "domainid":edited_template.domainid, - "format":edited_template.format, - "ostypeid":edited_template.ostypeid, - "templatetype":edited_template.templatetype, - } - edit_template_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_template_status, - "Edited Template details are not as expected" - ) - # Editing the Template displaytext - edited_template = Template.update( - template_created, - self.userapiclient, - displaytext="TemplateDisplaytext" - ) - self.assertIsNotNone( - edited_template, - "Editing Template failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":template_created.id, - "name":"NewTemplateName", - "displaytest":"TemplateDisplaytext", - "account":template_created.account, - "domainid":template_created.domainid, - "format":template_created.format, - "ostypeid":template_created.ostypeid, - "templatetype":template_created.templatetype, - } - actual_dict = { - "id":edited_template.id, - "name":edited_template.name, - "displaytest":edited_template.displaytext, - "account":edited_template.account, - "domainid":edited_template.domainid, - "format":edited_template.format, - "ostypeid":edited_template.ostypeid, - "templatetype":edited_template.templatetype, - } - edit_template_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_template_status, - "Edited Template details are not as expected" - ) - # Editing the Template ostypeid - ostype_list = list_os_types(self.userapiclient) - status = validateList(ostype_list) - self.assertEquals( - PASS, - status[0], - "Failed to list OS Types" - ) - for i in range(0, len(ostype_list)): - if ostype_list[i].id != template_created.ostypeid: - newostypeid = ostype_list[i].id - break - - edited_template = Template.update( - template_created, - self.userapiclient, - ostypeid=newostypeid - ) - self.assertIsNotNone( - edited_template, - "Editing Template failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":template_created.id, - "name":"NewTemplateName", - "displaytest":"TemplateDisplaytext", - "account":template_created.account, - "domainid":template_created.domainid, - "format":template_created.format, - "ostypeid":newostypeid, - "templatetype":template_created.templatetype, - } - actual_dict = { - "id":edited_template.id, - "name":edited_template.name, - "displaytest":edited_template.displaytext, - "account":edited_template.account, - "domainid":edited_template.domainid, - "format":edited_template.format, - "ostypeid":edited_template.ostypeid, - "templatetype":edited_template.templatetype, - } - edit_template_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_template_status, - "Edited Template details are not as expected" - ) - # Editing the Template name, displaytext - edited_template = Template.update( - template_created, - self.userapiclient, - name=template_created.name, - displaytext=template_created.displaytext - ) - self.assertIsNotNone( - edited_template, - "Editing Template failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":template_created.id, - "name":template_created.name, - "displaytest":template_created.displaytext, - "account":template_created.account, - "domainid":template_created.domainid, - "format":template_created.format, - "ostypeid":newostypeid, - "templatetype":template_created.templatetype, - } - actual_dict = { - "id":edited_template.id, - "name":edited_template.name, - "displaytest":edited_template.displaytext, - "account":edited_template.account, - "domainid":edited_template.domainid, - "format":edited_template.format, - "ostypeid":edited_template.ostypeid, - "templatetype":edited_template.templatetype, - } - edit_template_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_template_status, - "Edited Template details are not as expected" - ) - # Editing the Template name, displaytext, ostypeid - edited_template = Template.update( - template_created, - self.userapiclient, - name="NewTemplateName", - displaytext="TemplateDisplaytext", - ostypeid=template_created.ostypeid - ) - self.assertIsNotNone( - edited_template, - "Editing Template failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":template_created.id, - "name":"NewTemplateName", - "displaytest":"TemplateDisplaytext", - "account":template_created.account, - "domainid":template_created.domainid, - "format":template_created.format, - "ostypeid":template_created.ostypeid, - "templatetype":template_created.templatetype, - } - actual_dict = { - "id":edited_template.id, - "name":edited_template.name, - "displaytest":edited_template.displaytext, - "account":edited_template.account, - "domainid":edited_template.domainid, - "format":edited_template.format, - "ostypeid":edited_template.ostypeid, - "templatetype":edited_template.templatetype, - } - edit_template_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_template_status, - "Edited Template details are not as expected" - ) - del self.services["template"]["url"] - del self.services["template"]["format"] - del self.services["template"]["ostype"] - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_04_copy_template(self): - """ - @Desc: Test to copy Template from one zone to another - @steps: - Step1: Listing Zones available for a user - Step2: Verifying if the zones listed are greater than 1. - If Yes continuing. - If not halting the test. - Step3: Listing all the templates for a user in zone1 - Step4: Verifying that no templates are listed - Step5: Listing all the templates for a user in zone2 - Step6: Verifying that no templates are listed - Step7: Creating a Template in zone 1 - Step8: Listing all the Templates again for a user in zone1 - Step9: Verifying that list size is 1 - Step10: Listing all the templates for a user in zone2 - Step11: Verifying that no templates are listed - Step12: Copying the template created in step7 from zone1 to zone2 - Step13: Listing all the templates for a user in zone2 - Step14: Verifying that list size is 1 - Step15: Listing all the Templates for a user in zone1 - Step16: Verifying that list size is 1 - """ - # Listing Zones available for a user - zones_list = Zone.list( - self.userapiclient, - available=True - ) - status = validateList(zones_list) - self.assertEquals( - PASS, - status[0], - "Failed to list Zones" - ) - if not len(zones_list) > 1: - self.fail("Enough zones doesnot exists to copy template") - else: - # Listing all the Templates for a User in Zone 1 - list_templates_zone1 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - zoneid=zones_list[0].id - ) - # Verifying that no Templates are listed - self.assertIsNone( - list_templates_zone1, - "Templates listed for newly created User in Zone1" - ) - # Listing all the Templates for a User in Zone 2 - list_templates_zone2 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - zoneid=zones_list[1].id - ) - # Verifying that no Templates are listed - self.assertIsNone( - list_templates_zone2, - "Templates listed for newly created User in Zone2" - ) - self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" - self.services["template"]["format"] = "VHD" - self.services["template"]["ostype"] = self.services["ostype"] - #Listing Hypervisors in Zone 1 - hypervisor_list = Hypervisor.list( - self.apiClient, - zoneid=zones_list[0].id - ) - status = validateList(zones_list) - self.assertEquals( - PASS, - status[0], - "Failed to list Hypervisors in Zone 1" - ) - # Creating aTemplate in Zone 1 - template_created = Template.register( - self.userapiclient, - self.services["template"], - zones_list[0].id, - hypervisor=hypervisor_list[0].name - ) - self.assertIsNotNone( - template_created, - "Template creation failed" - ) - self.cleanup.append(template_created) - # Listing all the Templates for a User in Zone 1 - list_templates_zone1 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - zoneid=zones_list[0].id - ) - status = validateList(list_templates_zone1) - self.assertEquals( - PASS, - status[0], - "Templates creation failed in Zone1" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_templates_zone1), - "Failed to create a Template" - ) - # Listing all the Templates for a User in Zone 2 - list_templates_zone2 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - zoneid=zones_list[1].id - ) - # Verifying that no Templates are listed - self.assertIsNone( - list_templates_zone2, - "Templates listed for newly created User in Zone2" - ) - # Verifying the state of the template to be ready. If not waiting for state to become ready till time out - template_ready = False - count = 0 - while template_ready is False: - list_template = Template.list( - self.userapiclient, - id=template_created.id, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - ) - status = validateList(list_template) - self.assertEquals( - PASS, - status[0], - "Failed to list Templates by Id" - ) - if list_template[0].isready is True: - template_ready = True - elif (str(list_template[0].status) == "Error"): - self.fail("Created Template is in Errored state") - break - elif count > 10: - self.fail("Timed out before Template came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Copying the Template from Zone1 to Zone2 - copied_template = Template.copy( - self.userapiclient, - template_created.id, - sourcezoneid=template_created.zoneid, - destzoneid=zones_list[1].id - ) - self.assertIsNotNone( - copied_template, - "Copying Template from Zone1 to Zone2 failed" - ) - # Listing all the Templates for a User in Zone 1 - list_templates_zone1 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - zoneid=zones_list[0].id - ) - status = validateList(list_templates_zone1) - self.assertEquals( - PASS, - status[0], - "Templates creation failed in Zone1" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_templates_zone1), - "Failed to create a Template" - ) - # Listing all the Templates for a User in Zone 2 - list_templates_zone2 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - zoneid=zones_list[1].id - ) - status = validateList(list_templates_zone2) - self.assertEquals( - PASS, - status[0], - "Template failed to copy into Zone2" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_templates_zone2), - "Template failed to copy into Zone2" - ) - self.assertNotEquals( - "Connection refused", - list_templates_zone2[0].status, - "Failed to copy Template" - ) - self.assertEquals( - True, - list_templates_zone2[0].isready, - "Failed to copy Template" - ) - del self.services["template"]["url"] - del self.services["template"]["format"] - del self.services["template"]["ostype"] - return \ No newline at end of file diff --git a/test/integration/component/test_escalations_volumes.py b/test/integration/component/test_escalations_volumes.py deleted file mode 100644 index d1dae12681..0000000000 --- a/test/integration/component/test_escalations_volumes.py +++ /dev/null @@ -1,1703 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -#Import Local Modules -from marvin.cloudstackTestCase import * -from marvin.cloudstackException import * -from marvin.cloudstackAPI import * -from marvin.sshClient import SshClient -from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -from marvin.lib.utils import checkVolumeSize -from marvin.codes import SUCCESS -from nose.plugins.attrib import attr -from time import sleep - -class TestVolumes(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestVolumes, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - if cls.zone.localstorageenabled: - cls.storagetype = 'local' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' - cls.services["disk_offering"]["storagetype"] = 'local' - else: - cls.storagetype = 'shared' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' - cls.services["disk_offering"]["storagetype"] = 'shared' - - cls.services['mode'] = cls.zone.networktype - cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() - cls.services["virtual_machine"]["zoneid"] = cls.zone.id - cls.services["virtual_machine"]["template"] = cls.template.id - cls.services["custom_volume"]["zoneid"] = cls.zone.id - # Creating Disk offering, Service Offering and Account - cls.disk_offering = DiskOffering.create( - cls.api_client, - cls.services["disk_offering"] - ) - cls.service_offering = ServiceOffering.create( - cls.api_client, - cls.services["service_offerings"]["tiny"] - ) - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - # Creating Virtual Machine - cls.virtual_machine = VirtualMachine.create( - cls.userapiclient, - cls.services["virtual_machine"], - accountid=cls.account.name, - domainid=cls.account.domainid, - serviceofferingid=cls.service_offering.id, - ) - cls._cleanup.append(cls.virtual_machine) - cls._cleanup.append(cls.disk_offering) - cls._cleanup.append(cls.service_offering) - cls._cleanup.append(cls.account) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created volumes - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - - def __verify_values(self, expected_vals, actual_vals): - """ - @summary: Function to verify expected and actual values - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_01_list_volumes_pagination(self): - """ - @summary: Test List Volumes pagination - - Step1: Listing all the volumes for a user - Step2: Verifying listed volumes for account created at class level - Step3: If number of volumes is less than (page size + 1), then creating them - Step4: Listing all the volumes again after creation of volumes - Step5: Verifying the length of the volumes is (page size + 1) - Step6: Listing all the volumes in page1 - Step7: Verifying that the length of the volumes in page 1 is (page size) - Step8: Listing all the volumes in page2 - Step9: Verifying that the length of the volumes in page 2 is 1 - Step10: Deleting the volume present in page 2 - Step11: Listing for the volumes on page 2 - Step12: Verifying that there are no volumes present in page 2 - """ - # Listing all the volumes for a user - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - # Verifying listed volumes for account created at class level - self.assertIsNotNone( - list_volumes_before, - "create volume from VM failed at class setup method" - ) - self.assertEqual( - len(list_volumes_before), - 1, - "more than 1 volume created from VM at class level" - ) - - # If number of volumes is less than (pagesize + 1), then creating them - for i in range(0, (self.services["pagesize"])): - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - self.assertIsNotNone( - volume_created, - "Volume is not created" - ) - if(i < (self.services["pagesize"] - 1)): - self.cleanup.append(volume_created) - - self.assertEqual( - self.services["volume"]["diskname"], - volume_created.name, - "Newly created volume name and the test data volume name are not matching" - ) - - # Listing all the volumes again after creation of volumes - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - # Verifying the length of the volumes is (page size + 1) - self.assertEqual( - len(list_volumes_after), - (self.services["pagesize"] + 1), - "Number of volumes created is not matching expected" - ) - - # Listing all the volumes in page1 - list_volumes_page1 = Volume.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"] - ) - self.assertIsNotNone( - list_volumes_page1, - "No volumes found in Page 1" - ) - # Verifying that the length of the volumes in page 1 is (page size) - self.assertEqual( - len(list_volumes_page1), - self.services["pagesize"], - "List Volume response is not matching with the page size length for page 1" - ) - - # Listing all the volumes in page2 - list_volumes_page2 = Volume.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - self.assertIsNotNone( - list_volumes_page2, - "No volumes found in Page 2" - ) - # Verifying that the length of the volumes in page 2 is 1 - self.assertEqual( - len(list_volumes_page2), - 1, - "List Volume response is not matching with the page size length for page 2" - ) - volume_page2 = list_volumes_page2[0] - - # Verifying that the volume on page 2 is not present in page1 - for i in range(0, len(list_volumes_page1)): - volume_page1 = list_volumes_page1[i] - self.assertNotEquals( - volume_page2.id, - volume_page1.id, - "Volume listed in page 2 is also listed in page 1" - ) - - # Deleting a single volume - Volume.delete(volume_created, self.userapiclient) - - # Listing the volumes in page 2 - list_volume_response = Volume.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - # verifying that volume does not exists on page 2 - self.assertEqual( - list_volume_response, - None, - "Volume was not deleted" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_02_list_volume_byid(self): - """ - @summary: Test List Volumes with Id - - Step1: Listing all the volumes for a user before creating a data volume - Step2: Verifying the length of the list as 1 - Step3: Creating a data volume - Step4: Listing all the volumes for a user after creating a data volume - Step5: Verifying the list volume size is increased by 1 - Step6: List the volumes by specifying root volume Id - Step7: Verifying the details of the root volume - Step8: List the volumes by specifying data volume Id - Step9: Verifying the details of the data volume - """ - # Listing all the volumes for a user before creating a data volume - list_volumes_before = Volume.list( - self.userapiclient, - listall=self.services["listall"] - ) - self.assertIsNotNone( - list_volumes_before, - "create volume from VM failed at class setup method") - # Verifying the length of the list as 1 - self.assertEqual( - len(list_volumes_before), - 1, - "more than 1 volume created at class level" - ) - root_volume = list_volumes_before[0] - - # Creating a data volume - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - self.assertIsNotNone( - volume_created, - "Volume is not created" - ) - self.cleanup.append(volume_created) - - self.assertEqual( - self.services["volume"]["diskname"], - volume_created.name, - "Newly created volume name and the test data volume name are not matching" - ) - # Listing all the volumes for a user after creating a data volume - list_volumes_after = Volume.list( - self.userapiclient, - listall=self.services["listall"] - ) - self.assertIsNotNone( - list_volumes_after, - "Volume creation failed" - ) - # Verifying the list volume size is increased by 1 - self.assertEqual( - len(list_volumes_before) + 1, - len(list_volumes_after), - "list volume is not matching with Number of volumes created" - ) - - # Listing a Root Volume by Id and verifying the volume details - list_volumes_by_id = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=root_volume.id - ) - self.assertIsNotNone( - list_volumes_by_id, - "Root volume is not listed" - ) - self.assertEqual( - 1, - len(list_volumes_by_id), - "list volume is not matching with Number of volumes created" - ) - obtained_volume = list_volumes_by_id[0] - - #Creating expected and actual values dictionaries - expected_dict = { - "id":root_volume.id, - "name":root_volume.name, - "vmname":self.virtual_machine.name, - "state":"Ready", - "type":"ROOT", - "zoneid":self.zone.id, - "account":self.account.name, - "storagetype":self.storagetype, - "size":self.template.size - } - actual_dict = { - "id":obtained_volume.id, - "name":obtained_volume.name, - "vmname":obtained_volume.vmname, - "state":obtained_volume.state, - "type":obtained_volume.type, - "zoneid":obtained_volume.zoneid, - "account":obtained_volume.account, - "storagetype":obtained_volume.storagetype, - "size":obtained_volume.size, - } - root_volume_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - root_volume_status, - "Listed Root Volume details are not as expected" - ) - # Listing a Data Volume by Id and verifying the volume details - list_volumes_by_id = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - self.assertIsNotNone( - list_volumes_by_id, - "Data volume is not listed" - ) - self.assertEqual( - len(list_volumes_by_id), - 1, - "list volume is not matching with Number of volumes created" - ) - obtained_volume = list_volumes_by_id[0] - - #Creating expected and actual values dictionaries - expected_dict = { - "id":volume_created.id, - "name":volume_created.name, - "state":"Allocated", - "type":"DATADISK", - "zoneid":self.zone.id, - "account":self.account.name, - "storagetype":self.storagetype, - "size":self.disk_offering.disksize - } - actual_dict = { - "id":obtained_volume.id, - "name":obtained_volume.name, - "state":obtained_volume.state, - "type":obtained_volume.type, - "zoneid":obtained_volume.zoneid, - "account":obtained_volume.account, - "storagetype":obtained_volume.storagetype, - "size":obtained_volume.size/(1024*1024*1024), - } - root_volume_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - root_volume_status, - "Listed Data Volume details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_03_data_volume_resize(self): - """ - @summary: Test to verify creation and resize of data volume - - Step1: Listing the volumes for a user before creating data volume - Step2: Creating a data volume - Step3: Listing the volumes for a user after creating data volume - Step4: Attaching and Detaching data volume created to Virtual Machine - Step5: Verifying if there exists a disk offering with higher size - If not present creating it - Step6: Resizing data volume - """ - # Listing volumes for a user before creating a volume - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - # Creating a data volume - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - self.assertIsNotNone(volume_created, "Data volume creation failed") - - self.cleanup.append(volume_created) - - # Listing volumes for a user after creating data volume - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Data volume creation failed" - ) - - # Attaching data volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - - # Detaching data volume from Virtual Machine - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - - # Verifying if there exists a disk offering with higher size. If not present creating it - list_disk_offerings = DiskOffering.list(self.apiClient) - - large_disk_offering_exists = False - # Converting disk_size in bytes to GB - current_disk_size = volume_created.size/(1024*1024*1024) - - for disk_offering in list_disk_offerings: - if ((disk_offering.disksize > current_disk_size) and (not disk_offering.iscustomized) and disk_offering.storagetype == self.storagetype): - new_disk_offering = disk_offering - large_disk_offering_exists = True - break - - if large_disk_offering_exists == False: - new_size = (volume_created.size/(1024*1024*1024)) + 1 - self.services["disk_offering"]["disksize"] = new_size - new_disk_offering = DiskOffering.create( - self.apiClient, - self.services["disk_offering"] - ) - if new_disk_offering is not None: - self.cleanup.append(new_disk_offering) - else: - new_size = new_disk_offering.disksize - - # Resizing data volume - resized_volume = volume_created.resize( - self.userapiclient, - diskofferingid=new_disk_offering.id, - shrinkok='false', - ) - self.assertIsNotNone(resized_volume, "Resize Volume failed") - # Verifying data volume size is increased - self.assertEquals( - new_size, - (resized_volume.size/(1024*1024*1024)), - "volume not resized to expected value" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_04_custom_volume_resize(self): - """ - @summary: Test to verify creation and resize of custom volume - - Step1: Checking if Custom disk offering already exists. - If not present then creating custom Disk Offering - Step2: Listing the volumes for a user before creating custom volume - Step3: Creating a custom volume - Step4: Listing the volumes for a user after creating custom volume - Step5: Attaching and Detaching custom volume created to Virtual Machine - Step6: Resizing custom volume - """ - # Listing all the disk offerings - list_disk_offerings = DiskOffering.list(self.apiClient) - - custom_disk_offering_exists = False - - # Verifying if a custom disk offering already exists - if list_disk_offerings is not None: - for disk_offering in list_disk_offerings: - if (disk_offering.iscustomized and disk_offering.storagetype == self.storagetype): - custom_disk_offering = disk_offering - custom_disk_offering_exists = True - break - - # If a custom disk offering does not exists, then creating a custom disk offering - if custom_disk_offering_exists == False: - custom_disk_offering = DiskOffering.create( - self.apiClient, - self.services["disk_offering"], - custom=True - ) - if custom_disk_offering is not None: - self.cleanup.append(custom_disk_offering) - - # Listing the volumes for a user before creating custom volume - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - # Creating a custom volume - volume_created = Volume.create_custom_disk( - self.userapiclient, - self.services["custom_volume"], - account=self.account.name, - domainid=self.account.domainid, - diskofferingid=custom_disk_offering.id - ) - self.assertIsNotNone( - volume_created, - "Custom volume did not get created" - ) - - self.cleanup.append(volume_created) - - # Listing the volumes for a user after creating custom volume - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - # Verifyign that volume list is increased by 1 after creation of custion volume - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Custom volume did not get created" - ) - - # Attaching custom volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - - # Detaching custom volume from Virtual Machine - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - - # Resizing custom volume - # Increasing custom disk size by 1 - new_size = self.services["custom_volume"]["customdisksize"] + 1 - resized_volume = volume_created.resize( - self.userapiclient, - diskofferingid=custom_disk_offering.id, - shrinkok='false', - size=new_size) - self.assertIsNotNone(resized_volume, "Resize Volume failed") - # Verifying that custom disk size is increased - self.assertEquals( - new_size, - (resized_volume.size/(1024*1024*1024)), - "volume not resized to expected value" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_05_volume_snapshot(self): - """ - @summary: Test to verify creation of snapshot from volume and creation of template, volume from snapshot - - Step1: Creating a volume - Step2: Attaching and Detaching custom volume created to Virtual Machine - Step3: Creating Snapshot from volume - Step4: Creating Volume from snapshot - Step5: Creating Template from Snapshot - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - - self.assertIsNotNone(volume_created, "Volume not created") - - if volume_created is not None: - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - # Attaching and Detaching custom volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - # Creating Snapshot from volume - snapshot_created = Snapshot.create( - self.userapiclient, - volume_created.id, - ) - - self.assertIsNotNone(snapshot_created, "Snapshot not created") - - self.cleanup.append(snapshot_created) - - #Creating expected and actual values dictionaries - expected_dict = { - "id":volume_created.id, - "intervaltype":"MANUAL", - "snapshottype":"MANUAL", - "volumetype":volume_created.type, - "domain":self.domain.id - } - actual_dict = { - "id":snapshot_created.volumeid, - "intervaltype":snapshot_created.intervaltype, - "snapshottype":snapshot_created.snapshottype, - "volumetype":snapshot_created.volumetype, - "domain":snapshot_created.domainid, - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Snapshot created from Volume details are not as expected" - ) - # Creating Volume from snapshot - cmd = createVolume.createVolumeCmd() - cmd.name = "-".join([self.services["volume"]["diskname"], random_gen()]) - cmd.snapshotid = snapshot_created.id - - volume_from_snapshot = Volume(self.userapiclient.createVolume(cmd).__dict__) - - self.assertIsNotNone( - volume_from_snapshot, - "Volume creation failed from snapshot" - ) - self.cleanup.append(volume_from_snapshot) - - #Creating expected and actual values dictionaries - expected_dict = { - "snapshotid":snapshot_created.id, - "volumetype":snapshot_created.volumetype, - "size":self.disk_offering.disksize, - "accounr":self.account.name, - "domain":self.domain.id, - "storagetype":self.storagetype, - "zone":self.zone.id - } - actual_dict = { - "snapshotid":volume_from_snapshot.snapshotid, - "volumetype":volume_from_snapshot.type, - "size":volume_from_snapshot.size/(1024*1024*1024), - "accounr":volume_from_snapshot.account, - "domain":volume_from_snapshot.domainid, - "storagetype":volume_from_snapshot.storagetype, - "zone":volume_from_snapshot.zoneid, - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Volume created from Snapshot details are not as expected" - ) - # Creating Template from Snapshot - list_templates_before = Template.list(self.userapiclient, templatefilter='self') - - if list_templates_before is None: - templates_before_size = 0 - else: - templates_before_size = len(list_templates_before) - - cmd = createTemplate.createTemplateCmd() - cmd.name = self.services["ostype"] - cmd.displaytext = self.services["ostype"] - cmd.ostypeid = self.template.ostypeid - cmd.snapshotid = snapshot_created.id - cmd.ispublic = False - cmd.passwordenabled = False - - template_from_snapshot = Template(self.userapiclient.createTemplate(cmd).__dict__) - - self.assertIsNotNone( - template_from_snapshot, - "Template creation failed from snapshot" - ) - - self.cleanup.append(template_from_snapshot) - - #Creating expected and actual values dictionaries - expected_dict = { - "name":self.services["ostype"], - "ostypeid":self.template.ostypeid, - "type":"USER", - "zone":self.zone.id, - "domain":self.domain.id, - "account":self.account.name, - "passwordenabled":False, - "ispublic":False, - "size":self.disk_offering.disksize - } - actual_dict = { - "name":template_from_snapshot.name, - "ostypeid":template_from_snapshot.ostypeid, - "type":template_from_snapshot.templatetype, - "zone":template_from_snapshot.zoneid, - "domain":template_from_snapshot.domainid, - "account":template_from_snapshot.account, - "passwordenabled":template_from_snapshot.passwordenabled, - "ispublic":template_from_snapshot.ispublic, - "size":template_from_snapshot.size/(1024*1024*1024) - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Template created from Snapshot details are not as expected" - ) - - list_templates_after = Template.list(self.userapiclient, templatefilter='self') - - self.assertEquals( - templates_before_size + 1, - len(list_templates_after), - "Template creation failed from snapshot" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_06_volume_snapshot_policy_hourly(self): - """ - @summary: Test to verify creation of Hourly Snapshot policies from volume - - Step1: Creating a Volume. - Step2: Attaching volume created in Step2 to virtual machine - Step3: Detaching the volume created in step2 from virtual machine - Step4: Listing snapshot policies for a volume created in step1 - Step5: Creating Hourly snapshot policy - Step6: Listing snapshot policies for a volume created in step1 again - Step7: Verifyign that the list snapshot policy length is increased by 1 - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - - self.assertIsNotNone(volume_created, "Volume not created") - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - - # Attaching volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - # Detaching volume created from Virtual Machine - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - # Creating Hourly Snapshot Policy from volume - self.services["recurring_snapshot"]["intervaltype"] = 'hourly' - self.services["recurring_snapshot"]["schedule"] = '1' - - list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - snapshot_policy_before_size = 0 - - if list_snapshot_policy_before is not None: - snapshot_policy_before_size = len(list_snapshot_policy_before) - - snapshot_policy_hourly = SnapshotPolicy.create( - self.userapiclient, - volume_created.id, - self.services["recurring_snapshot"] - ) - self.assertIsNotNone( - snapshot_policy_hourly, - "Hourly Snapshot policy creation failed" - ) - #Creating expected and actual values dictionaries - expected_dict = { - "schedule":self.services["recurring_snapshot"]["schedule"], - "intervaltype":0, - "volumeid":volume_created.id - } - actual_dict = { - "schedule":snapshot_policy_hourly.schedule, - "intervaltype":snapshot_policy_hourly.intervaltype, - "volumeid":snapshot_policy_hourly.volumeid - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Hourly Snapshot Policy details are not as expected" - ) - - list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - self.assertIsNotNone( - list_snapshot_policy_after, - "Hourly Snapshot policy creation failed" - ) - self.assertEquals( - snapshot_policy_before_size + 1, - len(list_snapshot_policy_after), - "Hourly Snapshot policy creation failed" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_07_volume_snapshot_policy_daily(self): - """ - @summary: Test to verify creation of Daily Snapshot policies from volume - - Step1: Creating a Volume. - Step2: Attaching volume created in Step2 to virtual machine - Step3: Detaching the volume created in step2 from virtual machine - Step4: Listing snapshot policies for a volume created in step1 - Step5: Creating Daily snapshot policy - Step6: Listing snapshot policies for a volume created in step1 again - Step7: Verifyign that the list snapshot policy length is increased by 1 - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - - self.assertIsNotNone(volume_created, "Volume not created") - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - # Attaching volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - # Detaching volume created from Virtual Machine - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - # Creating Daily Snapshot Policy from volume - self.services["recurring_snapshot"]["intervaltype"] = 'daily' - self.services["recurring_snapshot"]["schedule"] = '00:00' - - list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - snapshot_policy_before_size = 0 - - if list_snapshot_policy_before is not None: - snapshot_policy_before_size = len(list_snapshot_policy_before) - - snapshot_policy_daily = SnapshotPolicy.create( - self.userapiclient, - volume_created.id, - self.services["recurring_snapshot"] - ) - self.assertIsNotNone( - snapshot_policy_daily, - "Daily Snapshot policy creation failed" - ) - #Creating expected and actual values dictionaries - expected_dict = { - "schedule":self.services["recurring_snapshot"]["schedule"], - "intervaltype":1, - "volumeid":volume_created.id - } - actual_dict = { - "schedule":snapshot_policy_daily.schedule, - "intervaltype":snapshot_policy_daily.intervaltype, - "volumeid":snapshot_policy_daily.volumeid - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Daily Snapshot Policy details are not as expected" - ) - - list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - self.assertIsNotNone( - list_snapshot_policy_after, - "Daily Snapshot policy creation failed" - ) - self.assertEquals( - snapshot_policy_before_size + 1, - len(list_snapshot_policy_after), - "Daily Snapshot policy creation failed" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_08_volume_snapshot_policy_weekly(self): - """ - @summary: Test to verify creation of Weekly Snapshot policies from volume - - Step1: Creating a Volume. - Step2: Attaching volume created in Step2 to virtual machine - Step3: Detaching the volume created in step2 from virtual machine - Step4: Listing snapshot policies for a volume created in step1 - Step5: Creating Weekly snapshot policy - Step6: Listing snapshot policies for a volume created in step1 again - Step7: Verifyign that the list snapshot policy length is increased by 1 - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - - self.assertIsNotNone(volume_created, "Volume not created") - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - - # Attaching volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - # Detaching volume created to Virtual Machine - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - # Creating Weekly Snapshot Policy from volume - self.services["recurring_snapshot"]["intervaltype"] = 'weekly' - self.services["recurring_snapshot"]["schedule"] = '00:00:1' - - list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - snapshot_policy_before_size = 0 - - if list_snapshot_policy_before is not None: - snapshot_policy_before_size = len(list_snapshot_policy_before) - - snapshot_policy_weekly = SnapshotPolicy.create( - self.userapiclient, - volume_created.id, - self.services["recurring_snapshot"] - ) - self.assertIsNotNone( - snapshot_policy_weekly, - "Weekly Snapshot policy creation failed" - ) - #Creating expected and actual values dictionaries - expected_dict = { - "schedule":self.services["recurring_snapshot"]["schedule"], - "intervaltype":2, - "volumeid":volume_created.id - } - actual_dict = { - "schedule":snapshot_policy_weekly.schedule, - "intervaltype":snapshot_policy_weekly.intervaltype, - "volumeid":snapshot_policy_weekly.volumeid - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Weekly Snapshot Policy details are not as expected" - ) - - list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - self.assertIsNotNone( - list_snapshot_policy_after, - "Weekly Snapshot policy creation failed" - ) - self.assertEquals( - snapshot_policy_before_size + 1, - len(list_snapshot_policy_after), - "Weekly Snapshot policy creation failed" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_09_volume_snapshot_policy_monthly(self): - """ - @summary: Test to verify creation of Monthly Snapshot policies from volume - - Step1: Creating a Volume. - Step2: Attaching volume created in Step2 to virtual machine - Step3: Detaching the volume created in step2 from virtual machine - Step4: Listing snapshot policies for a volume created in step1 - Step5: Creating Monthly snapshot policy - Step6: Listing snapshot policies for a volume created in step1 again - Step7: Verifyign that the list snapshot policy length is increased by 1 - Step8: Deleting monthly snapshot policy created in step5 - Step9: List snapshot policies for a volume again - Step10: Verifying that the list snapshot policy length is decreased by 1 - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - self.assertIsNotNone(volume_created, "Volume not created") - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - # Attaching and Detaching custom volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - # Creating Monthly Snapshot Policy from volume - self.services["recurring_snapshot"]["intervaltype"] = 'monthly' - self.services["recurring_snapshot"]["schedule"] = '00:00:1' - - list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - snapshot_policy_before_size = 0 - - if list_snapshot_policy_before is not None: - snapshot_policy_before_size = len(list_snapshot_policy_before) - - snapshot_policy_monthly = SnapshotPolicy.create( - self.userapiclient, - volume_created.id, - self.services["recurring_snapshot"]) - self.assertIsNotNone( - snapshot_policy_monthly, - "Monthly Snapshot policy creation failed" - ) - #Creating expected and actual values dictionaries - expected_dict = { - "schedule":self.services["recurring_snapshot"]["schedule"], - "intervaltype":3, - "volumeid":volume_created.id - } - actual_dict = { - "schedule":snapshot_policy_monthly.schedule, - "intervaltype":snapshot_policy_monthly.intervaltype, - "volumeid":snapshot_policy_monthly.volumeid - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Monthly Snapshot Policy details are not as expected" - ) - - list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - self.assertIsNotNone( - list_snapshot_policy_after, - "Monthly Snapshot policy creation failed" - ) - self.assertEquals( - snapshot_policy_before_size + 1, - len(list_snapshot_policy_after), - "Monthly Snapshot policy creation failed" - ) - # Deleting monthly snapshot policy - SnapshotPolicy.delete(snapshot_policy_monthly, self.userapiclient) - - list_snapshot_policies = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - self.assertIsNone( - list_snapshot_policies, - "Deletion of Monthly Snapshot policy failed" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_10_volume_snapshots_pagination(self): - """ - @summary: Test to verify pagination of snapshots for Volume - - Step1: Creating a Volume. - Step2: Attaching volume created in Step2 to virtual machine - Step3: Detaching the volume created in step2 from virtual machine - Step4: Listing all the snapshots for a volume - Step5: Creating Pagesize + 1 number of snapshots for a volume - Step6: Listing all the snapshots for a volume - Step7: Verifying that there are pagesize + 1 number of snapshots listsed - Step8: Listing all the snapshots in page 1 - Step9: Listing all the snapshots in page 2 - Step10: Deleting the snapshot present in page 2 - Step11: Listign the snapshots from page 2 again and verifyign that list returns none - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - # Creating a Volume - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - self.assertIsNotNone(volume_created, "Volume not created") - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - #Attaching volume to virtual machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - #Detaching volume from virtual machine - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - - #Creating 3 Snapshots from volume - list_snapshot_before = Snapshot.list( - self.userapiclient, - volumeid=volume_created.id, - listall=self.services["listall"] - ) - self.assertIsNone( - list_snapshot_before, - "Newly created volume is already having snapshots" - ) - - list_snapshot_before_size = 0 - for i in range(0, 3): - snapshot_created = Snapshot.create( - self.userapiclient, - volume_created.id, - ) - self.assertIsNotNone(snapshot_created, "Snapshot not created") - self.cleanup.append(snapshot_created) - - self.assertEquals( - volume_created.id, - snapshot_created.volumeid, - "Snapshot not created for given volume" - ) - - list_snapshot_after = Snapshot.list( - self.userapiclient, - volumeid=volume_created.id, - listall=self.services["listall"] - ) - self.assertEqual( - list_snapshot_before_size+3, - len(list_snapshot_after), - "Number of snapshots created is not matching expected" - ) - #Listing all the snapshots in page1 - list_snapshots_page1 = Snapshot.list( - self.userapiclient, - volumeid=volume_created.id, - listall=self.services["listall"], - page=1, - pagesize=2 - ) - self.assertEqual( - 2, - len(list_snapshots_page1), - "List snapshots response is not matching with the page size length for page 1" - ) - - #Listing all the snapshots in page2 and ensuring only 1 snapshot is present - list_snapshots_page2 = Snapshot.list( - self.userapiclient, - volumeid=volume_created.id, - listall=self.services["listall"], - page=2, - pagesize=2 - ) - self.assertEqual( - len(list_snapshots_page2), - 1, - "List snapshots response is not matching with the page size length for page 2" - ) - snapshot_page2 = list_snapshots_page2[0] - - # Verifying that the snapshot on page 2 is not present in page1 - for i in range(0, len(list_snapshots_page1)): - snapshot_page1 = list_snapshots_page1[i] - self.assertNotEquals( - snapshot_page2.id, - snapshot_page1.id, - "Snapshot listed in page 2 is also listed in page 1" - ) - # Deleting a single snapshot and verifying that snapshot does not exists on page 2 - Snapshot.delete(snapshot_created, self.userapiclient) - - list_snapshot_page2 = Snapshot.list( - self.userapiclient, - volumeid=volume_created.id, - listall=self.services["listall"], - page=2, - pagesize=2 - ) - self.assertEqual( - None, - list_snapshot_page2, - "Snapshot was not deleted" - ) - list_snapshot_page1 = Snapshot.list( - self.userapiclient, - volumeid=volume_created.id, - listall=self.services["listall"], - page=1, - pagesize=2 - ) - self.assertEqual( - 2, - len(list_snapshot_page1), - "Snapshots on page 1 are not matching" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_11_volume_extract(self): - """ - @summary: Test to verify extract/download a Volume - - Step1: Listing Volumes before creating a Volume - Step2: Creating a Volume. - Step3: Verifying that created volume is not none and adding to clean up - Step4: Listing the volumes after creation - Step5: Verifying that the list volume size is increased by 1 - Step6: Attaching volume created in Step2 to virtual machine - Step7: Detaching the volume created in step2 from virtual machine - Step8: Extracting/Downloadign the volume - Step9: Verifyign that a download URL is created for volume download - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertIsNotNone( - list_volumes_before, - "volume not created for the vm launched at class level" - ) - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - - self.assertIsNotNone(volume_created, "Volume not created") - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertIsNotNone( - list_volumes_after, - "volume creation failed" - ) - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - #Attaching and Detaching volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - #Extract/Download the volume - self.services["mode"] = "HTTP_DOWNLOAD" - - extract_volume_response = Volume.extract( - self.userapiclient, - volume_created.id, - self.zone.id, - self.services["mode"] - ) - self.assertIsNotNone(extract_volume_response, "Extract/Download volume failed") - - self.assertEquals( - "DOWNLOAD_URL_CREATED", - extract_volume_response.state, - "Failed to create Download URL" - ) - self.assertIsNotNone( - extract_volume_response.url, - "Extract/Download volume URL is NULL" - ) - self.assertTrue( - (extract_volume_response.url.find("http")!=-1), - "Extract/Download volume URL doesnot contain http" - ) - self.assertEquals( - volume_created.id, - extract_volume_response.id, - "Extracted/Downloaded volume is not matching with original volume" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_12_volume_upload(self): - """ - @summary: Test to verify upload volume - - Step1: Listing the volumes for a user before uploading volume - Step2: Uploading a volume - Step3: Listing the volumes for a user after uploading data volume - Step4: Verifying that the list volume length after upload is increased by 1 - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertIsNotNone( - list_volumes_before, - "volume not created for the vm launched at class level" - ) - #Uploading a Volume - volume_uploaded = Volume.upload( - self.userapiclient, - self.services["upload_volume"], - self.zone.id - ) - self.assertIsNotNone(volume_uploaded, "volume uploading failed") - - self.assertEquals( - self.services["upload_volume"]["diskname"], - volume_uploaded.name, - "Uploaded volume name is not matching with name provided while uploading") - - #Listing the volumes for a user after uploading data volume - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertIsNotNone( - list_volumes_after, - "volume not created for the vm launched at class level" - ) - #Asserting that the list volume length after upload is increased by 1 - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "upload volume failed" - ) - return \ No newline at end of file diff --git a/test/integration/component/test_escalations_vpncustomergateways.py b/test/integration/component/test_escalations_vpncustomergateways.py deleted file mode 100644 index dc6576863d..0000000000 --- a/test/integration/component/test_escalations_vpncustomergateways.py +++ /dev/null @@ -1,382 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -#Import Local Modules -from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.cloudstackAPI import (createVolume, - createTemplate) -from marvin.lib.base import (Volume, - Iso, - VirtualMachine, - Template, - Snapshot, - SecurityGroup, - Account, - Zone, - Network, - NetworkOffering, - DiskOffering, - ServiceOffering, - VmSnapshot, - SnapshotPolicy, - SSHKeyPair, - Resources, - Configurations, - VpnCustomerGateway, - Hypervisor, - VpcOffering, - VPC, - NetworkACL) -from marvin.lib.common import (get_zone, - get_domain, - get_template, - list_os_types) -from marvin.lib.utils import (validateList, - cleanup_resources, - random_gen) -from marvin.codes import (PASS, FAIL, EMPTY_LIST) -from nose.plugins.attrib import attr -import time - -class TestVpnCustomerGateways(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestVpnCustomerGateways, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - cls.services['mode'] = cls.zone.networktype - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - cls._cleanup.append(cls.account) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_01_list_vpncustomergateways_pagination(self): - """ - @Desc: Test to List VPN Customer Gateways pagination - @steps: - Step1: Listing all the VPN Customer Gateways for a user - Step2: Verifying that no VPN Customer Gateways are listed - Step3: Creating (page size + 1) number of VPN Customer Gateways - Step4: Listing all the VPN Customer Gateways again for a user - Step5: Verifying that list size is (page size + 1) - Step6: Listing all the VPN Customer Gateways in page1 - Step7: Verifying that list size is (page size) - Step8: Listing all the VPN Customer Gateways in page2 - Step9: Verifying that list size is 1 - Step10: Deleting the VPN Customer Gateways present in page 2 - Step11: Listing all the VPN Customer Gateways in page2 - Step12: Verifying that no VPN Customer Gateways are listed - """ - # Listing all the VPN Customer Gateways for a User - list_vpncustomergateways_before = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying that no VPN Customer Gateways are listed - self.assertIsNone( - list_vpncustomergateways_before, - "VPN Customer Gateways listed for newly created User" - ) - # Creating pagesize + 1 number of VPN Customer Gateways - for i in range(0, (self.services["pagesize"] + 1)): - vpncustomergateway_created = VpnCustomerGateway.create( - self.userapiclient, - self.services["vpncustomergateway"], - name="VPNCustGateway"+str(i+1), - gateway="10.102.153." + str(i+1), - cidrlist="10.0.0.0/24", - account=self.account.name, - domainid=self.domain.id - ) - self.assertIsNotNone( - vpncustomergateway_created, - "VPN Customer Gateway creation failed" - ) - if (i < self.services["pagesize"] + 1): - self.cleanup.append(vpncustomergateway_created) - - # Listing all the VPN Customer Gateways for a User - list_vpncustomergateways_after = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_vpncustomergateways_after) - self.assertEquals( - PASS, - status[0], - "VPN Customer Gateway creation failed" - ) - # Verifying that list size is pagesize + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_vpncustomergateways_after), - "Failed to create pagesize + 1 number of VPN Customer Gateways" - ) - # Listing all the VPN Customer Gateways in page 1 - list_vpncustomergateways_page1 = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_vpncustomergateways_page1) - self.assertEquals( - PASS, - status[0], - "Failed to list VPN Customer Gateways in page 1" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_vpncustomergateways_page1), - "Size of VPN Customer Gateways in page 1 is not matching" - ) - # Listing all the VPN Customer Gateways in page 2 - list_vpncustomergateways_page2 = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_vpncustomergateways_page2) - self.assertEquals( - PASS, - status[0], - "Failed to list VPN Customer Gateways in page 2" - ) - # Verifying the list size to be equal to 1 - self.assertEquals( - 1, - len(list_vpncustomergateways_page2), - "Size of VPN Customer Gateways in page 2 is not matching" - ) - # Deleting the VPM Customer Gateway present in page 2 - VpnCustomerGateway.delete( - vpncustomergateway_created, - self.userapiclient - ) - # Listing all the VPN Customer Gateways in page 2 again - list_vpncustomergateways_page2 = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that there are no VPN Customer Gateways listed - self.assertIsNone( - list_vpncustomergateways_page2, - "VPN Customer Gateways not deleted from page 2" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_02_update_vpncustomergateways(self): - """ - @Desc: Test to update VPN Customer Gateways pagination - @steps: - Step1: Listing all the VPN Customer Gateways for a user - Step2: Verifying that no VPN Customer Gateways are listed - Step3: Creating a VPN Customer Gateways - Step4: Listing all the VPN Customer Gateways again for a user - Step5: Verifying that list size is 1 - Step6: Updating the VPN Customer Gateways created in step3 - Step7: Listing the VPN customer gateway by id - Step8: Verifying that list size is 1 - Step9: Verifying the details of the listed VPN customer gateway are same as updated in step6 - """ - # Listing all the VPN Customer Gateways for a User - list_vpncustomergateways_before = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying that no VPN Customer Gateways are listed - self.assertIsNone( - list_vpncustomergateways_before, - "VPN Customer Gateways listed for newly created User" - ) - # Creating A VPN Customer Gateways - vpncustomergateway_created = VpnCustomerGateway.create( - self.userapiclient, - self.services["vpncustomergateway"], - name="VPNCustGateway", - gateway="10.102.153.90", - cidrlist="10.0.0.0/24", - account=self.account.name, - domainid=self.domain.id - ) - self.assertIsNotNone( - vpncustomergateway_created, - "VPN Customer Gateway creation failed" - ) - self.cleanup.append(vpncustomergateway_created) - # Listing all the VPN Customer Gateways for a User - list_vpncustomergateways_after = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_vpncustomergateways_after) - self.assertEquals( - PASS, - status[0], - "VPN Customer Gateway creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_vpncustomergateways_after), - "Failed to create VPN Customer Gateways" - ) - # Updating the VPN Customer gateway - vpncustomergateway_updated = VpnCustomerGateway.update( - vpncustomergateway_created, - self.userapiclient, - self.services["vpncustomergateway"], - name="NewVPNCustGateway", - gateway="10.102.153.90", - cidrlist="10.0.0.0/24", - ) - self.assertIsNotNone( - vpncustomergateway_updated, - "Updation of VPN Customer Gateway failed" - ) - # Listing the VPN Customer Gateways by Id - list_vpncustomergateway = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"], - id=vpncustomergateway_created.id - ) - status = validateList(list_vpncustomergateway) - self.assertEquals( - PASS, - status[0], - "Failed to list VPN Customer Gateways by Id" - ) - # Verifying the list size to be equal to 1 - self.assertEquals( - 1, - len(list_vpncustomergateway), - "Size of VPN Customer Gateways by id is not matching" - ) - # Verifying the details of the listed VPN Customer Gateway are same as updated - #Creating expected and actual values dictionaries - expected_dict = { - "name":vpncustomergateway_updated.name, - "id":vpncustomergateway_updated.id, - "account":vpncustomergateway_updated.account, - "domainid":vpncustomergateway_updated.domainid, - "gateway":vpncustomergateway_updated.gateway, - "cidrlist":vpncustomergateway_updated.cidrlist, - "seckey":vpncustomergateway_updated.ipsecpsk, - "ikepolicy":vpncustomergateway_updated.ikepolicy, - "ikelifetime":vpncustomergateway_updated.ikelifetime, - "esppolicy":vpncustomergateway_updated.esppolicy, - "esplifetime":vpncustomergateway_updated.esplifetime, - } - actual_dict = { - "name":list_vpncustomergateway[0].name, - "id":list_vpncustomergateway[0].id, - "account":list_vpncustomergateway[0].account, - "domainid":list_vpncustomergateway[0].domainid, - "gateway":list_vpncustomergateway[0].gateway, - "cidrlist":list_vpncustomergateway[0].cidrlist, - "seckey":list_vpncustomergateway[0].ipsecpsk, - "ikepolicy":list_vpncustomergateway[0].ikepolicy, - "ikelifetime":list_vpncustomergateway[0].ikelifetime, - "esppolicy":list_vpncustomergateway[0].esppolicy, - "esplifetime":list_vpncustomergateway[0].esplifetime, - } - vpncustomergateway_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - vpncustomergateway_status, - "Listed VPN Customer Gateway details are not as Updated" - ) - return \ No newline at end of file diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py index 7d08e89eff..03b03b61e3 100644 --- a/tools/marvin/marvin/lib/base.py +++ b/tools/marvin/marvin/lib/base.py @@ -20,7 +20,6 @@ """ import marvin -from utils import is_server_ssh_ready, random_gen from marvin.cloudstackAPI import * from marvin.codes import (FAILED, FAIL, PASS, RUNNING, STOPPED, STARTING, DESTROYED, EXPUNGING, @@ -614,12 +613,6 @@ def delete(self, apiclient): cmd.id = self.id apiclient.destroyVirtualMachine(cmd) - def expung(self, apiclient): - """Expung an Instance""" - cmd = expungeVirtualMachine.expungeVirtualMachineCmd() - cmd.id = self.id - apiclient.expungeVirtualMachine(cmd) - def migrate(self, apiclient, hostid=None): """migrate an Instance""" cmd = migrateVirtualMachine.migrateVirtualMachineCmd() @@ -1505,18 +1498,6 @@ def create(cls, apiclient, services, ipaddressid=None, cmd.vpcid = vpcid return StaticNATRule(apiclient.createFirewallRule(cmd).__dict__) - @classmethod - def createIpForwardingRule(cls, apiclient, startport, endport, protocol, ipaddressid, openfirewall): - """Creates static ip forwarding rule""" - - cmd = createIpForwardingRule.createIpForwardingRuleCmd() - cmd.startport = startport - cmd.endport = endport - cmd.protocol = protocol - cmd.openfirewall = openfirewall - cmd.ipaddressid = ipaddressid - return StaticNATRule(apiclient.createIpForwardingRule(cmd).__dict__) - def delete(self, apiclient): """Delete IP forwarding rule""" cmd = deleteIpForwardingRule.deleteIpForwardingRuleCmd() @@ -1648,162 +1629,6 @@ def list(cls, apiclient, **kwargs): cmd.listall=True return(apiclient.listFirewallRules(cmd)) -class Autoscale: - - """Manage Auto scale""" - - def __init__(self, items): - self.__dict__.update(items) - - @classmethod - def listCounters(cls, apiclient, **kwargs): - """Lists all available Counters.""" - - cmd = listCounters.listCountersCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listCounters(cmd)) - - @classmethod - def createCondition(cls, apiclient, counterid, relationaloperator, threshold): - """creates condition.""" - - cmd = createCondition.createConditionCmd() - cmd.counterid = counterid - cmd.relationaloperator = relationaloperator - cmd.threshold = threshold - return(apiclient.createCondition(cmd)) - - @classmethod - def listConditions(cls, apiclient, **kwargs): - """Lists all available Conditions.""" - - cmd = listConditions.listConditionsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listConditions(cmd)) - - @classmethod - def listAutoscalePolicies(cls, apiclient, **kwargs): - """Lists all available Autoscale Policies.""" - - cmd = listAutoScalePolicies.listAutoScalePoliciesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listAutoScalePolicies(cmd)) - - @classmethod - def createAutoscalePolicy(cls, apiclient, action, conditionids, duration, quiettime=None): - """creates condition.""" - - cmd = createAutoScalePolicy.createAutoScalePolicyCmd() - cmd.action = action - cmd.conditionids = conditionids - cmd.duration = duration - if quiettime: - cmd.quiettime = quiettime - - return(apiclient.createAutoScalePolicy(cmd)) - - @classmethod - def updateAutoscalePolicy(cls, apiclient, id, **kwargs): - """Updates Autoscale Policy.""" - - cmd = updateAutoScalePolicy.updateAutoScalePolicyCmd() - cmd.id = id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.updateAutoScalePolicy(cmd)) - - @classmethod - def listAutoscaleVmPofiles(cls, apiclient, **kwargs): - """Lists all available AutoscaleVM Profiles.""" - - cmd = listAutoScaleVmProfiles.listAutoScaleVmProfilesCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listAutoScaleVmProfiles(cmd)) - - @classmethod - def createAutoscaleVmProfile(cls, apiclient, serviceofferingid, zoneid, templateid, - autoscaleuserid=None, destroyvmgraceperiod=None, counterparam=None): - """creates Autoscale VM Profile.""" - - cmd = createAutoScaleVmProfile.createAutoScaleVmProfileCmd() - cmd.serviceofferingid = serviceofferingid - cmd.zoneid = zoneid - cmd.templateid = templateid - if autoscaleuserid: - cmd.autoscaleuserid = autoscaleuserid - - if destroyvmgraceperiod: - cmd.destroyvmgraceperiod = destroyvmgraceperiod - - if counterparam: - for name, value in counterparam.items(): - cmd.counterparam.append({ - 'name': name, - 'value': value - }) - - return(apiclient.createAutoScaleVmProfile(cmd)) - - @classmethod - def updateAutoscaleVMProfile(cls, apiclient, id, **kwargs): - """Updates Autoscale Policy.""" - - cmd = updateAutoScaleVmProfile.updateAutoScaleVmProfileCmd() - cmd.id = id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.updateAutoScaleVmProfile(cmd)) - - @classmethod - def createAutoscaleVmGroup(cls, apiclient, lbruleid, minmembers, maxmembers, - scaledownpolicyids, scaleuppolicyids, vmprofileid, interval=None): - """creates Autoscale VM Group.""" - - cmd = createAutoScaleVmGroup.createAutoScaleVmGroupCmd() - cmd.lbruleid = lbruleid - cmd.minmembers = minmembers - cmd.maxmembers = maxmembers - cmd.scaledownpolicyids = scaledownpolicyids - cmd.scaleuppolicyids = scaleuppolicyids - cmd.vmprofileid = vmprofileid - if interval: - cmd.interval = interval - - return(apiclient.createAutoScaleVmGroup(cmd)) - - @classmethod - def listAutoscaleVmGroup(cls, apiclient, **kwargs): - """Lists all available AutoscaleVM Group.""" - - cmd = listAutoScaleVmGroups.listAutoScaleVmGroupsCmd() - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.listAutoScaleVmGroups(cmd)) - - @classmethod - def enableAutoscaleVmGroup(cls, apiclient, id, **kwargs): - """Enables AutoscaleVM Group.""" - - cmd = enableAutoScaleVmGroup.enableAutoScaleVmGroupCmd() - cmd.id = id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.enableAutoScaleVmGroup(cmd)) - - @classmethod - def disableAutoscaleVmGroup(cls, apiclient, id, **kwargs): - """Disables AutoscaleVM Group.""" - - cmd = disableAutoScaleVmGroup.disableAutoScaleVmGroupCmd() - cmd.id = id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.disableAutoScaleVmGroup(cmd)) - - @classmethod - def updateAutoscaleVMGroup(cls, apiclient, id, **kwargs): - """Updates Autoscale VM Group.""" - - cmd = updateAutoScaleVmGroup.updateAutoScaleVmGroupCmd() - cmd.id = id - [setattr(cmd, k, v) for k, v in kwargs.items()] - return(apiclient.updateAutoScaleVmGroup(cmd)) - class ServiceOffering: @@ -2178,18 +2003,6 @@ def list(cls, apiclient, **kwargs): cmd.listall=True return(apiclient.listLoadBalancerRules(cmd)) - @classmethod - def listLoadBalancerRuleInstances(cls, apiclient, id, applied=None, **kwargs): - """Lists load balancing rule Instances""" - - cmd = listLoadBalancerRuleInstances.listLoadBalancerRuleInstancesCmd() - cmd.id = id - if applied: - cmd.applied = applied - - [setattr(cmd, k, v) for k, v in kwargs.items()] - return apiclient.listLoadBalancerRuleInstances(cmd) - class Cluster: @@ -2685,7 +2498,7 @@ def __init__(self, items): @classmethod def create(cls, apiclient, publicipid, account=None, domainid=None, - projectid=None, networkid=None, vpcid=None, openfirewall=None): + projectid=None, networkid=None, vpcid=None): """Create VPN for Public IP address""" cmd = createRemoteAccessVpn.createRemoteAccessVpnCmd() cmd.publicipid = publicipid @@ -2699,8 +2512,6 @@ def create(cls, apiclient, publicipid, account=None, domainid=None, cmd.networkid = networkid if vpcid: cmd.vpcid = vpcid - if openfirewall: - cmd.openfirewall = openfirewall return Vpn(apiclient.createRemoteAccessVpn(cmd).__dict__) def delete(self, apiclient): From 378e1da42c235d310df3d39d3d82270ef00546df Mon Sep 17 00:00:00 2001 From: vinayvarmav Date: Mon, 19 May 2014 16:46:06 +0530 Subject: [PATCH 464/683] CLOUDSTACK-6282 - Divided test_escalations.py into individual files based on functionality and added automed tests for Public IP Addresses --- .../component/test_escalations_instances.py | 3448 ++++++++++++++ .../component/test_escalations_ipaddresses.py | 4192 +++++++++++++++++ .../component/test_escalations_isos.py | 783 +++ .../test_escalations_securitygroups.py | 588 +++ .../component/test_escalations_snapshots.py | 647 +++ .../component/test_escalations_templates.py | 944 ++++ .../component/test_escalations_volumes.py | 1703 +++++++ .../test_escalations_vpncustomergateways.py | 382 ++ tools/marvin/marvin/lib/base.py | 191 +- 9 files changed, 12877 insertions(+), 1 deletion(-) create mode 100644 test/integration/component/test_escalations_instances.py create mode 100644 test/integration/component/test_escalations_ipaddresses.py create mode 100644 test/integration/component/test_escalations_isos.py create mode 100644 test/integration/component/test_escalations_securitygroups.py create mode 100644 test/integration/component/test_escalations_snapshots.py create mode 100644 test/integration/component/test_escalations_templates.py create mode 100644 test/integration/component/test_escalations_volumes.py create mode 100644 test/integration/component/test_escalations_vpncustomergateways.py diff --git a/test/integration/component/test_escalations_instances.py b/test/integration/component/test_escalations_instances.py new file mode 100644 index 0000000000..9e040db9f7 --- /dev/null +++ b/test/integration/component/test_escalations_instances.py @@ -0,0 +1,3448 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackAPI import (createVolume, + createTemplate) +from marvin.lib.base import (Volume, + Iso, + VirtualMachine, + Template, + Snapshot, + SecurityGroup, + Account, + Zone, + Network, + NetworkOffering, + DiskOffering, + ServiceOffering, + VmSnapshot, + SnapshotPolicy, + SSHKeyPair, + Resources, + Configurations, + VpnCustomerGateway, + Hypervisor, + VpcOffering, + VPC, + NetworkACL) +from marvin.lib.common import (get_zone, + get_domain, + get_template, + list_os_types) +from marvin.lib.utils import (validateList, + cleanup_resources, + random_gen) +from marvin.codes import (PASS, FAIL, EMPTY_LIST) +from nose.plugins.attrib import attr +import time + +class TestListInstances(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestListInstances, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + if cls.zone.localstorageenabled: + cls.storagetype = 'local' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' + cls.services["disk_offering"]["storagetype"] = 'local' + else: + cls.storagetype = 'shared' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' + cls.services["disk_offering"]["storagetype"] = 'shared' + + cls.services['mode'] = cls.zone.networktype + cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.services["custom_volume"]["zoneid"] = cls.zone.id + # Creating Disk offering, Service Offering and Account + cls.disk_offering = DiskOffering.create( + cls.api_client, + cls.services["disk_offering"] + ) + cls.service_offering = ServiceOffering.create( + cls.api_client, + cls.services["service_offerings"]["tiny"] + ) + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + # Updating resource Limits + for i in range(0,12): + Resources.updateLimit( + cls.api_client, + account=cls.account.name, + domainid=cls.domain.id, + max=-1, + resourcetype=i + ) + + cls._cleanup.append(cls.account) + cls._cleanup.append(cls.service_offering) + cls._cleanup.append(cls.disk_offering) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_01_list_instances_pagination(self): + """ + @Desc: Test List Instances pagination + @Steps: + Step1: Listing all the Instances for a user + Step2: Verifying listed Instances for account created at class level + Step3: If number of volumes is less than (page size + 1), then creating them + Step4: Listing all the volumes again after creation of volumes + Step5: Verifying the length of the volumes is (page size + 1) + Step6: Listing all the volumes in page1 + Step7: Verifying that the length of the volumes in page 1 is (page size) + Step8: Listing all the volumes in page2 + Step9: Verifying that the length of the volumes in page 2 is 1 + Step10: Deleting the volume present in page 2 + Step11: Listing for the volumes on page 2 + Step12: Verifying that there are no volumes present in page 2 + """ + # Listing all the instances for a user + list_instances_before = VirtualMachine.list(self.userapiclient, listall=self.services["listall"]) + + # Verifying listed instances for account created at class level + self.assertIsNone( + list_instances_before, + "Virtual Machine already exists for newly created user" + ) + # If number of instances are less than (pagesize + 1), then creating them + for i in range(0, (self.services["pagesize"] + 1)): + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + if(i < (self.services["pagesize"])): + self.cleanup.append(vm_created) + + self.assertEqual( + self.services["virtual_machine"]["displayname"], + vm_created.displayname, + "Newly created VM name and the test data VM name are not matching" + ) + + # Listing all the instances again after creating VM's + list_instances_after = VirtualMachine.list(self.userapiclient, listall=self.services["listall"]) + status = validateList(list_instances_after) + self.assertEquals( + PASS, + status[0], + "Listing of instances after creation failed" + ) + # Verifying the length of the instances is (page size + 1) + self.assertEqual( + len(list_instances_after), + (self.services["pagesize"] + 1), + "Number of instances created is not matching as expected" + ) + + # Listing all the volumes in page1 + list_instances_page1 = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid + ) + status = validateList(list_instances_page1) + self.assertEquals( + PASS, + status[0], + "Listing of instances in page1 failed" + ) + # Verifying that the length of the instances in page 1 is (page size) + self.assertEqual( + self.services["pagesize"], + len(list_instances_page1), + "List VM response is not matching with the page size length for page 1" + ) + + # Listing all the VM's in page2 + list_instances_page2 = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"], + domainid=self.account.domainid + ) + status = validateList(list_instances_page2) + self.assertEquals( + PASS, + status[0], + "Listing of instances in page2 failed" + ) + # Verifying that the length of the VM's in page 2 is 1 + self.assertEqual( + 1, + len(list_instances_page2), + "List VM response is not matching with the page size length for page 2" + ) + instance_page2 = list_instances_page2[0] + + # Verifying that the VM on page 2 is not present in page1 + for i in range(0, len(list_instances_page1)): + instance_page1 = list_instances_page1[i] + self.assertNotEquals( + instance_page2.id, + instance_page1.id, + "VM listed in page 2 is also listed in page 1" + ) + + # Deleting a single VM + VirtualMachine.delete(vm_created, self.userapiclient) + + # Listing the VM's in page 2 + list_instance_response = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"], + domainid=self.account.domainid + ) + # verifying that VM does not exists on page 2 + self.assertEqual( + list_instance_response, + None, + "VM was not deleted" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_02_list_Running_vm(self): + """ + @Desc: Test List Running VM's + @Steps: + Step1: Listing all the Running VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Listing all the Running VMs for a user again + Step5: Verifying that the size of the list is increased by 1 + Step6: Verifying that the details of the Running VM listed are same as the VM deployed in Step3 + """ + # Listing all the Running VM's for a User + list_running_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Running" + ) + self.assertIsNone( + list_running_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the Running VM's for a User + list_running_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Running" + ) + status = validateList(list_running_vms_after) + self.assertEquals( + PASS, + status[0], + "Newly created VM is not in Running state" + ) + # Verifying list size is 1 + self.assertEquals( + 1, + len(list_running_vms_after), + "Running VM list count is not matching" + ) + running_vm = list_running_vms_after[0] + + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":"Running", + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":running_vm.id, + "name":running_vm.name, + "displayname":running_vm.displayname, + "state":running_vm.state, + "zoneid":running_vm.zoneid, + "account":running_vm.account, + "template":running_vm.templateid + } + running_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + running_vm_status, + "Listed Running VM details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_03_list_Stopped_vm(self): + """ + @Desc: Test List Stopped VM's + @Steps: + Step1: Listing all the Stopped VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Stopping the VM deployed in step3 + Step5: Listing all the Stopped VMs for a user again + Step6: Verifying that the size of the list is increased by 1 + Step7: Verifying that the details of the Stopped VM listed are same as the VM stopped in Step4 + """ + # Listing all the Stopped VM's for a User + list_stopped_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Stopped" + ) + self.assertIsNone( + list_stopped_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Stopping the VM + VirtualMachine.stop(vm_created, self.userapiclient) + # Listing all the Stopped VM's for a User + list_stopped_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Stopped" + ) + status = validateList(list_stopped_vms_after) + self.assertEquals( + PASS, + status[0], + "Stopped VM is not in Stopped state" + ) + # Verifying list size is 1 + self.assertEquals( + 1, + len(list_stopped_vms_after), + "Stopped VM list count is not matching" + ) + stopped_vm = list_stopped_vms_after[0] + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":"Stopped", + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":stopped_vm.id, + "name":stopped_vm.name, + "displayname":stopped_vm.displayname, + "state":stopped_vm.state, + "zoneid":stopped_vm.zoneid, + "account":stopped_vm.account, + "template":stopped_vm.templateid + } + stopped_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + stopped_vm_status, + "Listed Stopped VM details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_04_list_Destroyed_vm(self): + """ + @Desc: Test List Destroyed VM's + @Steps: + Step1: Listing all the Destroyed VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Destroyed the VM deployed in step3 + Step5: Listing all the Destroyed VMs for a user again + Step6: Verifying that destroyed VM is not listed for User + Step7: Listing all the destroyed VMs as admin + Step8: Verifying that the size of the list is 1 + Step9: Verifying that the details of the Destroyed VM listed are same as the VM destroyed in Step4 + """ + # Listing all the Destroyed VM's for a User + list_destroyed_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Destroyed" + ) + self.assertIsNone( + list_destroyed_vms_before, + "Virtual Machine in Destroyed state already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + # Destroying the VM + VirtualMachine.delete(vm_created, self.userapiclient) + # Listing all the Destroyed VM's for a User + list_destroyed_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Destroyed" + ) + self.assertIsNone( + list_destroyed_vms_after, + "Destroyed VM is not in destroyed state" + ) + # Listing destroyed VMs as admin user + list_destroyed_vms_admin = VirtualMachine.list( + self.apiClient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + state="Destroyed", + id=vm_created.id + ) + status = validateList(list_destroyed_vms_admin) + self.assertEquals( + PASS, + status[0], + "Destroyed VM is not in Destroyed state" + ) + # Verifying that the length of the destroyed VMs list should be 1 + self.assertEquals( + 1, + len(list_destroyed_vms_admin), + "Destroyed VM list count is not matching" + ) + destroyed_vm = list_destroyed_vms_admin[0] + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":"Destroyed", + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":destroyed_vm.id, + "name":destroyed_vm.name, + "displayname":destroyed_vm.displayname, + "state":destroyed_vm.state, + "zoneid":destroyed_vm.zoneid, + "account":destroyed_vm.account, + "template":destroyed_vm.templateid + } + destroyed_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + destroyed_vm_status, + "Listed Destroyed VM details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_05_list_vm_by_id(self): + """ + @Desc: Test List VM by Id + @Steps: + Step1: Listing all the VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Listing all the VMs for a user again + Step5: Verifying that the size of the list is increased by 1 + Step6: List a VM by specifying the Id if the VM deployed in Step3 + Step7: Verifying that the details of the Listed VM are same as the VM deployed in Step3 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + account=self.account.name + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VM's for a User + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + account=self.account.name + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "Listing of VM after creation failed" + ) + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing a VM by Id + list_vm_byid = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + id=vm_created.id + ) + status = validateList(list_vm_byid) + self.assertEquals( + PASS, + status[0], + "Listing of VM by Id failed" + ) + listed_vm = list_vm_byid[0] + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":vm_created.state, + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":listed_vm.id, + "name":listed_vm.name, + "displayname":listed_vm.displayname, + "state":listed_vm.state, + "zoneid":listed_vm.zoneid, + "account":listed_vm.account, + "template":listed_vm.templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM by Id details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_06_list_vm_by_name(self): + """ + @Desc: Test List VM's by Name + @Steps: + Step1: Listing all the VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a 2 VM's + Step4: Listing all the VMs for a user again + Step5: Verifying that list size is increased by 2 + Step6: Listing the VM by specifying complete name of VM-1 created in step3 + Step7: Verifying that the size of the list is 1 + Step8: Verifying that the details of the listed VM are same as the VM-1 created in step3 + Step9: Listing the VM by specifying the partial name of VM + Step10: Verifying that the size of the list is 2 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + vms = {} + for i in range(0, 2): + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + vms.update({i: vm_created}) + + # Listing all the VM's for a User + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM's creation failed" + ) + self.assertEquals( + 2, + len(list_vms_after), + "VM's list count is not matching" + ) + # Listing the VM by complete name + list_vm_byfullname = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + name=vms[0].name + ) + status = validateList(list_vm_byfullname) + self.assertEquals( + PASS, + status[0], + "Failed to list VM by Name" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vm_byfullname), + "VM list by full name count is not matching" + ) + # Verifying that the details of the listed VM are same as the VM created above + #Creating expected and actual values dictionaries + expected_dict = { + "id":vms[0].id, + "name":vms[0].name, + "displayname":vms[0].displayname, + "state":vms[0].state, + "zoneid":vms[0].zoneid, + "account":vms[0].account, + "template":vms[0].templateid + } + actual_dict = { + "id":list_vm_byfullname[0].id, + "name":list_vm_byfullname[0].name, + "displayname":list_vm_byfullname[0].displayname, + "state":list_vm_byfullname[0].state, + "zoneid":list_vm_byfullname[0].zoneid, + "account":list_vm_byfullname[0].account, + "template":list_vm_byfullname[0].templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM details are not as expected" + ) + # Listing the VM by partial name + list_vm_bypartialname = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + domainid=self.account.domainid, + name=vms[0].name[:1] + ) + status = validateList(list_vm_bypartialname) + self.assertEquals( + PASS, + status[0], + "Failed to list VM by Name" + ) + # Verifying that the size of the list is 2 + self.assertEquals( + 2, + len(list_vm_bypartialname), + "VM list by full name count is not matching" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_07_list_vm_by_name_state(self): + """ + @Desc: Test List VM's by Name and State + @Steps: + Step1: Listing all the VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Listing all the VMs for a user again + Step5: Verifying that list size is increased by 1 + Step6: Listing the VM by specifying name of VM created in step3 and state as Running (matching name and state) + Step7: Verifying that the size of the list is 1 + Step8: Verifying that the details of the listed VM are same as the VM created in step3 + Step9: Listing the VM by specifying name of VM created in step3 and state as Stopped (non matching state) + Step10: Verifying that the size of the list is 0 + Step11: Listing the VM by specifying non matching name and state as Running (non matching name) + Step12: Verifying that the size of the list is 0 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VM's for a User + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM's creation failed" + ) + self.assertEquals( + 1, + len(list_vms_after), + "VM's list count is not matching" + ) + # Listing the VM by matching Name and State + list_running_vm = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + name=vm_created.name, + state="Running" + ) + status = validateList(list_running_vm) + self.assertEquals( + PASS, + status[0], + "List VM by name and state failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_running_vm), + "Count of VM list by name and state is not matching" + ) + # Verifying that the details of the listed VM are same as the VM created above + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":"Running", + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":list_running_vm[0].id, + "name":list_running_vm[0].name, + "displayname":list_running_vm[0].displayname, + "state":list_running_vm[0].state, + "zoneid":list_running_vm[0].zoneid, + "account":list_running_vm[0].account, + "template":list_running_vm[0].templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM details are not as expected" + ) + # Listing the VM by matching name and non matching state + list_running_vm = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + name=vm_created.name, + state="Stopped" + ) + self.assertIsNone( + list_running_vm, + "Listed VM with non matching state" + ) + # Listing the VM by non matching name and matching state + list_running_vm = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + name="name", + state="Running" + ) + self.assertIsNone( + list_running_vm, + "Listed VM with non matching name" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_08_list_vm_by_zone(self): + """ + @Desc: Test List VM by Zone. + This test case is applicable for a setup having multiple zones. + @Steps: + Step1: Listing all the zones + Step2: Checking if there are multiple zones in the setup. + Continuing below steps only if there are multiple zones + Step3: Listing template for zone + Step4: Listing all the VMs for a user + Step5: Verifying that the size of the list is 0 + Step6: Deploying a VM + Step7: Listing all the VMs for a user again for matching zone + Step8: Verifying that the size of the list is 1 + Step9: Verifying that the details of the Listed VM are same as the VM deployed in Step6 + Step10: Listing all the VMs for a user again for non-matching zone + Step11: Verifying that the size of the list is 0 + """ + # Listing all the zones available + zones_list = Zone.list(self.apiClient) + status = validateList(zones_list) + self.assertEquals( + PASS, + status[0], + "zones not available in the given setup" + ) + current_zone = self.services["virtual_machine"]["zoneid"] + current_template = self.services["virtual_machine"]["template"] + # Checking if there are multiple zones in the setup. + if not len(zones_list) > 1: + self.debug("Setup is not having multiple zones") + else: + # Getting the template available under the zone + template = get_template( + self.apiClient, + zones_list[0].id, + self.services["ostype"] + ) + self.assertIsNotNone( + template, + "Template not found for zone" + ) + self.services["virtual_machine"]["zoneid"] = zones_list[0].id + self.services["virtual_machine"]["template"] = template.id + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[0].id + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again for matching zone + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[0].id + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + listed_vm = list_vms_after[0] + # Verifying that the details of the Listed VM are same as the VM deployed above + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":vm_created.state, + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":listed_vm.id, + "name":listed_vm.name, + "displayname":listed_vm.displayname, + "state":listed_vm.state, + "zoneid":listed_vm.zoneid, + "account":listed_vm.account, + "template":listed_vm.templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM by Id details are not as expected" + ) + # Listing all the VMs for a user again for non-matching zone + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[1].id + ) + self.assertIsNone( + list_vms, + "VM's listed for non matching zone" + ) + self.services["virtual_machine"]["zoneid"] = current_zone + self.services["virtual_machine"]["template"] = current_template + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_09_list_vm_by_zone_name(self): + """ + @Desc: Test List VM by Zone. + This test case is applicable for a setup having multiple zones. + @Steps: + Step1: Listing all the zones + Step2: Checking if there are multiple zones in the setup. + Continuing below steps only if there are multiple zones + Step3: Listing template for zone + Step4: Listing all the VMs for a user + Step5: Verifying that the size of the list is 0 + Step6: Deploying a VM + Step7: Listing all the VMs for a user again + Step8: Verifying that list size is increased by 1 + Step9: Listing the VM by specifying name of VM created in step6 and matching zone (matching name and zone) + Step10: Verifying that the size of the list is 1 + Step11: Verifying that the details of the listed VM are same as the VM created in step3 + Step12: Listing the VM by specifying name of VM created in step6 and non matching zone (non matching zone) + Step13: Verifying that the size of the list is 0 + Step14: Listing the VM by specifying non matching name and matching zone (non matching name) + Step15: Verifying that the size of the list is 0 + """ + # Listing all the zones available + zones_list = Zone.list(self.apiClient) + status = validateList(zones_list) + self.assertEquals( + PASS, + status[0], + "zones not available in the given setup" + ) + current_zone = self.services["virtual_machine"]["zoneid"] + current_template = self.services["virtual_machine"]["template"] + # Checking if there are multiple zones in the setup. + if not len(zones_list) > 1: + self.debug("Setup is not having multiple Zones") + else: + # Getting the template available under the zone + template = get_template( + self.apiClient, + zones_list[0].id, + self.services["ostype"] + ) + self.assertIsNotNone( + template, + "Template not found for zone" + ) + self.services["virtual_machine"]["zoneid"] = zones_list[0].id + self.services["virtual_machine"]["template"] = template.id + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[0].id, + account=self.account.name + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again for matching zone + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[0].id, + account=self.account.name + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing the VM by specifying name of VM created in above and matching zone + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[0].id, + name=vm_created.name + ) + status = validateList(list_vms) + self.assertEquals( + PASS, + status[0], + "Listing VM's by name and zone failed" + ) + # Verifying Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms), + "Count of listed VM's by name and zone is not as expected" + ) + listed_vm = list_vms[0] + # Verifying that the details of the Listed VM are same as the VM deployed above + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":vm_created.state, + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":listed_vm.id, + "name":listed_vm.name, + "displayname":listed_vm.displayname, + "state":listed_vm.state, + "zoneid":listed_vm.zoneid, + "account":listed_vm.account, + "template":listed_vm.templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM by Id details are not as expected" + ) + # Listing the VM by specifying name of VM created in step3 and non matching zone + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[1].id, + name=vm_created.name + ) + self.assertIsNone( + list_vms, + "VM's listed for non matching zone" + ) + # Listing the VM by specifying non matching name of VM and matching zone + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=zones_list[0].id, + name="name" + ) + self.assertIsNone( + list_vms, + "VM's listed for non matching zone" + ) + self.services["virtual_machine"]["zoneid"] = current_zone + self.services["virtual_machine"]["template"] = current_template + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_10_list_vm_by_zone_name_state(self): + """ + @Desc: Test List VM by Zone. + @Steps: + Step1: Listing all the VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Listing all the VMs for a user again + Step5: Verifying that list size is increased by 1 + Step6: Listing the VM by specifying name of VM created in step3 and matching zone and state as Running + Step7: Verifying that the size of the list is 1 + Step8: Verifying that the details of the listed VM are same as the VM created in step3 + Step9: Listing the VM by specifying name of VM created in step3 and matching zone and state as Stopped + Step10: Verifying that the size of the list is 0 + Step11: Listing the VM by name, Zone and account + Step12: Verifying that the size of the list is 1 + Step13: Verifying that the details of the listed VM are same as the VM created in step3 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + account=self.account.name + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again for matching zone + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + account=self.account.name + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing the VM by specifying name of VM created in step3 and matching zone and state as Running + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + name=vm_created.name, + state="Running" + ) + status = validateList(list_vms) + self.assertEquals( + PASS, + status[0], + "Listing VM's by name and zone failed" + ) + # Verifying Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms), + "Count of listed VM's by name, zone and state is not as expected" + ) + listed_vm = list_vms[0] + # Verifying that the details of the Listed VM are same as the VM deployed above + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":vm_created.state, + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":listed_vm.id, + "name":listed_vm.name, + "displayname":listed_vm.displayname, + "state":listed_vm.state, + "zoneid":listed_vm.zoneid, + "account":listed_vm.account, + "template":listed_vm.templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM by Id details are not as expected" + ) + # Listing the VM by specifying name of VM created in step3, zone and State as Stopped + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + name=vm_created.name, + state="Stopped" + ) + self.assertIsNone( + list_vms, + "VM's listed for non matching zone" + ) + # Listing the VM by name, zone and account + list_vms = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + name=vm_created.name, + account=self.account.name + ) + status = validateList(list_vms) + self.assertEquals( + PASS, + status[0], + "Listing VM's by name, account and zone failed" + ) + # Verifying Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms), + "Count of listed VM's by name, zone and account is not as expected" + ) + listed_vm = list_vms[0] + # Verifying that the details of the Listed VM are same as the VM deployed above + #Creating expected and actual values dictionaries + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":vm_created.state, + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":listed_vm.id, + "name":listed_vm.name, + "displayname":listed_vm.displayname, + "state":listed_vm.state, + "zoneid":listed_vm.zoneid, + "account":listed_vm.account, + "template":listed_vm.templateid + } + list_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vm_status, + "Listed VM by Id details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_11_register_reset_vm_sshkey(self): + """ + @Desc: Test to verify registering and reset of SSH Key for VM + @Steps: + Step1: Deploying a VM + Step2: Stopping the VM deployed in step1 + Step3: Listing all the SSH Key pairs + Step4: Registering a SSH Key pair + Step5: Listing all the SSh Key pairs again + Step6: Verifying that the key pairs list is increased by 1 + Step7: Resetting the VM SSH Key to the key pair registered in step4 + Step8: Verifying that the registered SSH Key pair is set to the VM + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Stopping the VM deployed above + vm_created.stop( + self.userapiclient, + forced=True + ) + # Listing all the SSH Key pairs + list_keypairs_before = SSHKeyPair.list( + self.userapiclient + ) + list_keypairs_before_size = 0 + if list_keypairs_before is not None: + list_keypairs_before_size = len(list_keypairs_before) + + # Registering new Key pair + new_keypair = SSHKeyPair.register( + self.userapiclient, + name="keypair1", + publickey="ssh-rsa: e6:9a:1e:b5:98:75:88:5d:56:bc:92:7b:43:48:05:b2" + ) + self.assertIsNotNone( + new_keypair, + "New Key pair generation failed" + ) + self.assertEquals( + "keypair1", + new_keypair.name, + "Key Pair not created with given name" + ) + # Listing all the SSH Key pairs again + list_keypairs_after = SSHKeyPair.list( + self.userapiclient + ) + status = validateList(list_keypairs_after) + self.assertEquals( + PASS, + status[0], + "Listing of Key pairs failed" + ) + # Verifying that list size is increased by 1 + self.assertEquals( + list_keypairs_before_size + 1, + len(list_keypairs_after), + "List count is not matching" + ) + # Resetting the VM SSH key to the Key pair created above + vm_created.resetSshKey( + self.userapiclient, + keypair=new_keypair.name + ) + # Listing VM details again + list_vm = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vm) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + self.assertEquals( + 1, + len(list_vm), + "VMs list is not as expected" + ) + # Verifying that VM's SSH keypair is set to newly created keypair + self.assertEquals( + new_keypair.name, + list_vm[0].keypair, + "VM is not set to newly created SSH Key pair" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_12_vm_nics(self): + """ + @Desc: Test to verify Nics for a VM + @Steps: + Step1: Deploying a VM + Step2: Listing all the Networks + Step3: Verifying that the list size is 1 + Step4: Creating 1 network + Step5: Listing all the networks again + Step6: Verifying that the list size is 2 + Step7: Verifying that VM deployed in step1 has only 1 nic + and it is same as network listed in step3 + Step8: Adding the networks created in step4 to VM deployed in step1 + Step9: Verifying that VM deployed in step1 has 2 nics + Step10: Verifying that isdefault is set to true for only 1 nic + Step11: Verifying that isdefault is set to true for the Network created when deployed a VM + Step12: Making the nic created in step4 as default nic + Step13: Verifying that isdefault is set to true for only 1 nic + Step14: Verifying that the isdefault is set to true for the nic created in step4 + Step15: Removing the non-default nic from VM + Step16: Verifying that VM deployed in step1 has only 1 nic + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing all the networks before + list_network_before = Network.list( + self.userapiclient, + isdefault="true", + zoneid=self.zone.id, + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_network_before) + self.assertEquals( + PASS, + status[0], + "Default Network not created when deploying a VM" + ) + # Verifying that only 1 network is created while deploying a VM + self.assertEquals( + 1, + len(list_network_before), + "More than 1 default network exists" + ) + network1 = list_network_before[0] + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat", + zoneid=self.zone.id + ) + self.assertIsNotNone( + network_offerings_list, + "Isolated Network Offerings with sourceNat enabled are not found" + ) + # Creating one more network + network2 = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network2, + "Network creation failed" + ) + self.cleanup.append(network2) + # Listing all the networks again + list_network_after = Network.list( + self.userapiclient, + zoneid=self.zone.id, + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_network_after) + self.assertEquals( + PASS, + status[0], + "List of Networks failed" + ) + # Verifying that list size is 2 + self.assertEquals( + 2, + len(list_network_after), + "More than 1 default network exists" + ) + # Verifying that VM created is having only 1 nic + vm_nics_before = vm_created.nic + self.assertIsNotNone( + vm_nics_before, + "Nic not found for the VM deployed" + ) + self.assertEquals( + 1, + len(vm_nics_before), + "VM Nic count is not matching" + ) + # Verifying that the nic is same as the default network listed above + self.assertEquals( + network1.id, + vm_nics_before[0].networkid, + "Default NIC for VM is not as expected" + ) + # Adding network2 created above to VM + VirtualMachine.add_nic( + vm_created, + self.userapiclient, + network2.id + ) + # Listing the Vm details again + list_vms_after = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + vm = list_vms_after[0] + # Verifying that VM nics size is 2 now + vm_nics_after = vm.nic + self.assertIsNotNone( + vm_nics_after, + "Nic not found for the deployed VM" + ) + self.assertEquals( + 2, + len(vm_nics_after), + "VM NIC's count is not matching" + ) + # Verifying that isdefault is set to true for only 1 nic + default_count = 0 + for i in range(0, len(vm_nics_after)): + if vm_nics_after[i].isdefault is True: + default_count = default_count + 1 + default_nic = vm_nics_after[i] + else: + non_default_nic = vm_nics_after[i] + self.assertEquals( + 1, + default_count, + "Default NIC count is not matching" + ) + # Verifying that default NIC is same the network created when VM is deployed + self.assertEquals( + network1.id, + default_nic.networkid, + "Default NIC is not matching for VM" + ) + # Updating network 2 as default NIC + vm_created.update_default_nic( + self.userapiclient, + non_default_nic.id + ) + # Listing the Vm details again + list_vms_after = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + vm = list_vms_after[0] + # Verifying that VM nics size is 2 now + vm_nics_after = vm.nic + self.assertIsNotNone( + vm_nics_after, + "Nic not found for the deployed VM" + ) + self.assertEquals( + 2, + len(vm_nics_after), + "VM NIC's count is not matching" + ) + # Verifying that isdefault is set to true for only 1 nic + default_count = 0 + for i in range(0, len(vm_nics_after)): + if vm_nics_after[i].isdefault is True: + default_count = default_count + 1 + default_nic = vm_nics_after[i] + else: + non_default_nic = vm_nics_after[i] + + self.assertEquals( + 1, + default_count, + "Default NIC count is not matching" + ) + # Verifying that default NIC is same the newly updated network (network 2) + self.assertEquals( + network2.id, + default_nic.networkid, + "Default NIC is not matching for VM" + ) + # Deleting non default NIC + vm_created.remove_nic( + self.userapiclient, + non_default_nic.id + ) + # Listing the Vm details again + list_vms_after = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + vm = list_vms_after[0] + # Verifying that VM nics size is 1 now + vm_nics_after = vm.nic + self.assertIsNotNone( + vm_nics_after, + "Nic not found for the deployed VM" + ) + self.assertEquals( + 1, + len(vm_nics_after), + "VM NIC's count is not matching" + ) + # Verifying the nic network is same as the default nic network + self.assertEquals( + network2.id, + vm_nics_after[0].networkid, + "VM NIC is not same as expected" + ) + return + +class TestInstances(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestInstances, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + if cls.zone.localstorageenabled: + cls.storagetype = 'local' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' + cls.services["disk_offering"]["storagetype"] = 'local' + else: + cls.storagetype = 'shared' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' + cls.services["disk_offering"]["storagetype"] = 'shared' + + cls.services['mode'] = cls.zone.networktype + cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.services["custom_volume"]["zoneid"] = cls.zone.id + + # Creating Disk offering, Service Offering and Account + cls.disk_offering = DiskOffering.create( + cls.api_client, + cls.services["disk_offering"] + ) + cls.service_offering = ServiceOffering.create( + cls.api_client, + cls.services["service_offerings"]["tiny"] + ) + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + # Updating resource Limits + for i in range(0,12): + Resources.updateLimit( + cls.api_client, + account=cls.account.name, + domainid=cls.domain.id, + max=-1, + resourcetype=i + ) + cls._cleanup.append(cls.account) + cls._cleanup.append(cls.service_offering) + cls._cleanup.append(cls.disk_offering) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_13_attach_detach_iso(self): + """ + @Desc: Test Attach ISO to VM and Detach ISO from VM. + @Steps: + Step1: Listing all the VMs for a user + Step2: Verifying that the size of the list is 0 + Step3: Deploying a VM + Step4: Listing all the VMs for a user again + Step5: Verifying that list size is increased by 1 + Step6: Listing all the ready ISO's + Step7: If size of the list is >= 1 continuing to next steps + Step8: Attaching the ISO listed to VM deployed in Step3 + Step9: Verifying that the attached ISO details are associated with VM + Step10: Detaching the ISO attached in step8 + Step11: Verifying that detached ISO details are not associated with VM + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + account=self.account.name + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again for matching zone + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + domainid=self.account.domainid, + zoneid=self.zone.id, + account=self.account.name + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing the ISO's in ready state + isos_list = Iso.list( + self.userapiclient, + isready="true", + isofilter="executable", + zoneid=self.zone.id + ) + # Verifying if size of the list is >= 1 + if isos_list is not None: + iso_toattach = isos_list[0] + # Attaching ISO listed to VM deployed + VirtualMachine.attach_iso( + vm_created, + self.userapiclient, + iso_toattach + ) + list_vm = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vm) + self.assertEquals( + PASS, + status[0], + "VM listing by Id failed" + ) + # Verifying that attached ISO details are present in VM + self.assertEquals( + iso_toattach.name, + list_vm[0].isoname, + "Attached ISO name is not matching" + ) + self.assertEquals( + iso_toattach.displaytext, + list_vm[0].isodisplaytext, + "Attached ISO display is not matching" + ) + # Detaching ISO from VM + VirtualMachine.detach_iso( + vm_created, + self.userapiclient + ) + list_vm = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vm) + self.assertEquals( + PASS, + status[0], + "VM listing by Id failed" + ) + # Verifying that ISO details are NOT present in VM + self.assertIsNone( + list_vm[0].isoname, + "ISO not detached from VM" + ) + else: + self.fail("Executable ISO in Ready is not found in the given setup") + + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_14_vm_snapshot_pagination(self): + """ + @Desc: Test VM Snapshots pagination. + @Steps: + Step1: Deploying a VM + Step2: Listing all the Snapshots of the VM deployed in Step 1 + Step3: Verifying that the list size is 0 + Step4: Creating (pagesize + 1) number of Snapshots for the VM + Step5: Listing all the Snapshots of the VM deployed in Step 1 + Step6: Verifying that the list size is (pagesize + 1) + Step7: Listing all the VM snapshots in Page 1 with page size + Step8: Verifying that size of the list is same as page size + Step9: Listing all the VM snapshots in Page 2 with page size + Step10: Verifying that size of the list is 1 + Step11: Deleting VM snapshot in page 2 + Step12: Listing all the VM snapshots in Page 2 with page size + Step13: Verifying that size of the list is 0 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing all the VM snapshots for VM deployed above + list_snapshots_before = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + # Verifying that the VM snapshot list is None + self.assertIsNone( + list_snapshots_before, + "Snapshots already exists for newly created VM" + ) + # Creating pagesize + 1 number of VM snapshots + for i in range(0, (self.services["pagesize"] + 1)): + snapshot_created = VmSnapshot.create( + self.userapiclient, + vm_created.id, + ) + self.assertIsNotNone( + snapshot_created, + "Snapshot creation failed" + ) + + # Listing all the VM snapshots for VM again + list_snapshots_after = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + status = validateList(list_snapshots_after) + self.assertEquals( + PASS, + status[0], + "VM Snapshots creation failed" + ) + self.assertEquals( + self.services["pagesize"] + 1, + len(list_snapshots_after), + "Count of VM Snapshots is not matching" + ) + # Listing all the VM snapshots in Page 1 with page size + list_snapshots_page1 = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id, + page=1, + pagesize=self.services["pagesize"], + ) + status = validateList(list_snapshots_page1) + self.assertEquals( + PASS, + status[0], + "Listing of VM Snapshots failed in page 1" + ) + # Verifying the list size is equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_snapshots_page1), + "List VM Snapshot count is not matching in page 1" + ) + # Listing all the VM Snapshots in page 2 + list_snapshots_page2 = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id, + page=2, + pagesize=self.services["pagesize"], + ) + status = validateList(list_snapshots_page2) + self.assertEquals( + PASS, + status[0], + "Listing of VM Snapshots failed in page 2" + ) + # Verifying the list size is equal to 1 + self.assertEquals( + 1, + len(list_snapshots_page2), + "List VM Snapshot count is not matching in page 2" + ) + # Deleting VM Snapshot in page 2 + VmSnapshot.deleteVMSnapshot( + self.userapiclient, + snapshot_created.id + ) + # Listing all the VM Snapshots in page 2 again + list_snapshots_page2 = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id, + page=2, + pagesize=self.services["pagesize"], + ) + # Verifying the list size is equal to 0 + self.assertIsNone( + list_snapshots_page2, + "VM Snapshots exists in page 2" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_15_revert_vm_to_snapshot(self): + """ + @Desc: Test Revert VM to Snapshot functionality. + @Steps: + Step1: Deploying a VM + Step2: Listing all the Snapshots of the VM deployed in Step 1 + Step3: Verifying that the list size is 0 + Step4: Creating 2 Snapshots for the VM + Step5: Listing all the Snapshots of the VM deployed in Step 1 + Step6: Verifying that the list size is 2 + Step7: Verifying that only 1 snapshot is have current flag set to True + Step8: Verifying that the VM snapshot with current flag set as true is the latest snapshot created + Step9: Reverting VM to snapshot having current flag as false (non current snapshot) + Step10: Verifying that only 1 VM snapshot is having current flag set as true. + Step11: Verifying that the VM Snapshot with current flag set to true is the reverted snapshot in Step 8 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing all the VM snapshots for VM deployed above + list_snapshots_before = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + # Verifying that the VM snapshot list is None + self.assertIsNone( + list_snapshots_before, + "Snapshots already exists for newly created VM" + ) + # Creating 2 of VM snapshots + snapshot1 = VmSnapshot.create( + self.userapiclient, + vm_created.id, + ) + self.assertIsNotNone( + snapshot1, + "Snapshot creation failed" + ) + snapshot2 = VmSnapshot.create( + self.userapiclient, + vm_created.id, + ) + self.assertIsNotNone( + snapshot2, + "Snapshot creation failed" + ) + # Listing all the VM snapshots for VM again + list_snapshots_after = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + status = validateList(list_snapshots_after) + self.assertEquals( + PASS, + status[0], + "VM Snapshots creation failed" + ) + self.assertEquals( + 2, + len(list_snapshots_after), + "Count of VM Snapshots is not matching" + ) + # Verifying that only 1 snapshot is having current flag set to true + # and that snapshot is the latest snapshot created (snapshot2) + current_count = 0 + for i in range(0, len(list_snapshots_after)): + if(list_snapshots_after[i].current is True): + current_count = current_count + 1 + current_snapshot = list_snapshots_after[i] + + self.assertEquals( + 1, + current_count, + "count of VM Snapshot with current flag as true is not matching" + ) + self.assertEquals( + snapshot2.id, + current_snapshot.id, + "Latest snapshot taken is not marked as current" + ) + # Reverting the VM to Snapshot 1 + VmSnapshot.revertToSnapshot( + self.userapiclient, + snapshot1.id + ) + # Listing the VM snapshots again + list_snapshots_after = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + status = validateList(list_snapshots_after) + self.assertEquals( + PASS, + status[0], + "VM Snapshots creation failed" + ) + self.assertEquals( + 2, + len(list_snapshots_after), + "Count of VM Snapshots is not matching" + ) + # Verifying that only 1 snapshot is having current flag set to true + # and that snapshot is snapshot1 + current_count = 0 + for i in range(0, len(list_snapshots_after)): + if(list_snapshots_after[i].current is True): + current_count = current_count + 1 + current_snapshot = list_snapshots_after[i] + self.assertEquals( + 1, + current_count, + "count of VM Snapshot with current flag as true is not matching" + ) + self.assertEquals( + snapshot1.id, + current_snapshot.id, + "Current flag was set properly after reverting the VM to snapshot" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_16_list_vm_volumes_pagination(self): + """ + @Desc: Test to verify pagination of Volumes for a VM + @Steps: + Step1: Deploying a VM + Step2: Listing all the Volumes of the VM deployed in Step 1 + Step3: Verifying that the list size is 1 + Step4: Creating page size number of volumes + Step5: Attaching all the volumes created in step4 to VM deployed in Step1 + Step6: Listing all the Volumes for the VM in step1 + Step7: Verifying that the list size is equal to page size + 1 + Step8: Listing all the volumes of VM in page 1 + Step9: Verifying that the list size is equal to page size + Step10: Listing all the Volumes in Page 2 + Step11: Verifying that the list size is 1 + Step12: Detaching the volume from the VM + Step13: Listing all the Volumes in Page 2 + Step14: Verifying that list size is 0 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing all the Volumes for the VM deployed + list_volumes_before = Volume.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + status = validateList(list_volumes_before) + self.assertEquals( + PASS, + status[0], + "Root volume is not created for VM deployed" + ) + # Verifying the size of the list is 1 + self.assertEquals( + 1, + len(list_volumes_before), + "Volumes count is not matching" + ) + # Creating Page size number of volumes + for i in range(0, self.services["pagesize"]): + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + self.assertIsNotNone( + volume_created, + "Volume is not created" + ) + self.cleanup.append(volume_created) + # Attaching all the volumes created to VM + vm_created.attach_volume( + self.userapiclient, + volume_created + ) + + # List all the volumes for the VM again + list_volumes_after = Volume.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id + ) + status = validateList(list_volumes_after) + self.assertEquals( + PASS, + status[0], + "Volumes are not listed" + ) + # Verifying that size of the list is equal to page size + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_volumes_after), + "VM's volume count is not matching" + ) + # Listing all the volumes for a VM in page 1 + list_volumes_page1 = Volume.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id, + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_volumes_page1) + self.assertEquals( + PASS, + status[0], + "Volumes not listed in page1" + ) + # Verifying that list size is equal to page size + self.assertEquals( + self.services["pagesize"], + len(list_volumes_page1), + "VM's volume count is not matching in page 1" + ) + # Listing all the volumes for a VM in page 2 + list_volumes_page2 = Volume.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id, + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_volumes_page2) + self.assertEquals( + PASS, + status[0], + "Volumes not listed in page2" + ) + # Verifying that list size is equal to 1 + self.assertEquals( + 1, + len(list_volumes_page2), + "VM's volume count is not matching in page 1" + ) + # Detaching 1 volume from VM + vm_created.detach_volume( + self.userapiclient, + volume_created + ) + # Listing all the volumes for a VM in page 2 again + list_volumes_page2 = Volume.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id, + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that there are no volumes present in page 2 + self.assertIsNone( + list_volumes_page2, + "Volumes listed in page 2" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_17_running_vm_scaleup(self): + """ + @Desc: Test to verify change service for Running VM + @Steps: + Step1: Checking if dynamic scaling of virtual machines is enabled in zone and template. + If yes then continuing. + If not then printing message that scale up is not possible for Running VM + Step2: Deploying a VM + Step3: Listing all the existing service offerings + Step4: If there is a matching Service Offering for scale-up of running VM + use that service offering. If not create one service offering for scale up. + Step5: Perform change service (scale up) the Running VM deployed in step1 + Step6: Verifying that VM's service offerings is changed + """ + # Checking if Dynamic scaling of VM is supported or not + list_config = Configurations.list( + self.apiClient, + zoneid=self.zone.id, + name="enable.dynamic.scale.vm" + ) + status = validateList(list_config) + self.assertEquals( + PASS, + status[0], + "Listing of configuration failed" + ) + # Checking if dynamic scaling is allowed in Zone and Template + if not ((list_config[0].value is True) and (self.template.isdynamicallyscalable)): + self.debug("Scale up of Running VM is not possible as Zone/Template does not support") + else: + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing details of current Service Offering + vm_so_list = ServiceOffering.list( + self.userapiclient, + id=vm_created.serviceofferingid + ) + status = validateList(vm_so_list) + self.assertEquals( + PASS, + status[0], + "Listing of VM Service offering failed" + ) + current_so = vm_so_list[0] + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Listing all the existing service offerings + service_offerings_list = ServiceOffering.list( + self.userapiclient, + virtualmachineid=vm_created.id + ) + # Verifying if any Service offering available for scale up of VM + so_exists = False + if service_offerings_list is not None: + for i in range(0, len(service_offerings_list)): + if not ((current_so.cpunumber > service_offerings_list[i].cpunumber or\ + current_so.cpuspeed > service_offerings_list[i].cpuspeed or\ + current_so.memory > service_offerings_list[i].memory) or\ + (current_so.cpunumber == service_offerings_list[i].cpunumber and\ + current_so.cpuspeed == service_offerings_list[i].cpuspeed and\ + current_so.memory == service_offerings_list[i].memory)): + if(current_so.storagetype == service_offerings_list[i].storagetype): + so_exists = True + new_so = service_offerings_list[i] + break + # If service offering does not exists, then creating one service offering for scale up + if not so_exists: + self.services["service_offerings"]["small"]["storagetype"] = current_so.storagetype + new_so = ServiceOffering.create( + self.apiClient, + self.services["service_offerings"]["small"] + ) + self.cleanup.append(new_so) + # Scaling up the VM + vm_created.scale_virtualmachine( + self.userapiclient, + new_so.id + ) + # Listing VM details again + list_vms_after = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + self.assertEquals( + 1, + len(list_vms_after), + "VMs list is not as expected" + ) + # Verifying that VM's service offerings is changed + self.assertEquals( + new_so.id, + list_vms_after[0].serviceofferingid, + "VM is not containing New Service Offering" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_18_stopped_vm_change_service(self): + """ + @Desc: Test to verify change service for Stopped VM + @Steps: + Step1: Deploying a VM + Step2: Stopping the VM deployed in step1 + Step3: Listing all the existing service offerings + Step4: If there is a matching Service Offering for change service of stopped VM + use that service offering. If not create one service offering for change service. + Step5: Perform change service for the Stopped VM + Step6: Verifying that VM's service offerings is changed + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing details of current Service Offering + vm_so_list = ServiceOffering.list( + self.userapiclient, + id=vm_created.serviceofferingid + ) + status = validateList(vm_so_list) + self.assertEquals( + PASS, + status[0], + "Listing of VM Service offering failed" + ) + current_so = vm_so_list[0] + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Stopping the VM deployed above + vm_created.stop( + self.userapiclient, + forced=True + ) + # Listing all the service offerings + service_offerings_list = ServiceOffering.list( + self.userapiclient, + virtualmachineid=vm_created.id + ) + # Verifying if any Service offering available for change service of VM + so_exists = False + if service_offerings_list is not None: + for i in range(0, len(service_offerings_list)): + if ((current_so.id != service_offerings_list[i].id) and\ + (current_so.storagetype == service_offerings_list[i].storagetype)): + so_exists = True + new_so = service_offerings_list[i] + break + # If service offering does not exists, then creating one service offering for scale up + if not so_exists: + self.services["service_offerings"]["small"]["storagetype"] = current_so.storagetype + new_so = ServiceOffering.create( + self.apiClient, + self.services["service_offerings"]["small"] + ) + self.cleanup.append(new_so) + # Changing service for the VM + vm_created.scale_virtualmachine( + self.userapiclient, + new_so.id + ) + # Listing VM details again + list_vm = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vm) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + self.assertEquals( + 1, + len(list_vm), + "VMs list is not as expected" + ) + # Verifying that VM's service offerings is changed + self.assertEquals( + new_so.id, + list_vm[0].serviceofferingid, + "VM is not containing New Service Offering" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_19_create_reset_vm_sshkey(self): + """ + @Desc: Test to verify creation and reset of SSH Key for VM + @Steps: + Step1: Deploying a VM + Step2: Stopping the VM deployed in step1 + Step3: Listing all the SSH Key pairs + Step4: Creating a new SSH Key pair + Step5: Listing all the SSh Key pairs again + Step6: Verifying that the key pairs list is increased by 1 + Step7: Resetting the VM SSH Key to the key pair created in step4 + Step8: Verifying that the new SSH Key pair is set to the VM + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Stopping the VM deployed above + vm_created.stop( + self.userapiclient, + forced=True + ) + # Listing all the SSH Key pairs + list_keypairs_before = SSHKeyPair.list( + self.userapiclient + ) + list_keypairs_before_size = 0 + if list_keypairs_before is not None: + list_keypairs_before_size = len(list_keypairs_before) + + # Creating a new Key pair + new_keypair = SSHKeyPair.create( + self.userapiclient, + name="keypair1", + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNotNone( + new_keypair, + "New Key pair generation failed" + ) + self.assertEquals( + "keypair1", + new_keypair.name, + "Key Pair not created with given name" + ) + # Listing all the SSH Key pairs again + list_keypairs_after = SSHKeyPair.list( + self.userapiclient + ) + status = validateList(list_keypairs_after) + self.assertEquals( + PASS, + status[0], + "Listing of Key pairs failed" + ) + # Verifying that list size is increased by 1 + self.assertEquals( + list_keypairs_before_size + 1, + len(list_keypairs_after), + "List count is not matching" + ) + # Resetting the VM SSH key to the Key pair created above + vm_created.resetSshKey( + self.userapiclient, + keypair=new_keypair.name + ) + # Listing VM details again + list_vm = VirtualMachine.list( + self.userapiclient, + id=vm_created.id + ) + status = validateList(list_vm) + self.assertEquals( + PASS, + status[0], + "Listing of VM failed" + ) + self.assertEquals( + 1, + len(list_vm), + "VMs list is not as expected" + ) + # Verifying that VM's SSH keypair is set to newly created keypair + self.assertEquals( + new_keypair.name, + list_vm[0].keypair, + "VM is not set to newly created SSH Key pair" + ) + return + + @attr(tags=["advanced", "basic", "selfservice"]) + def test_20_update_vm_displayname_group(self): + """ + @Desc: Test to verify Update VM details + @Steps: + Step1: List all the VM's for a user + Step2: Deploy a VM with all parameters + Step3: Listing all the VM's again for the user + Step4: Verifying that list size is increased by 1 + Step5: Updating VM details - displayname, group + Step6: Listing the VM deployed in step 2 by ID + Step7: Verifying that displayname, group details of the VM are updated + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + self.services["virtual_machine"]["keyboard"] = "us" + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + group="groupName" + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Verifying the displayname and group details for deployed VM + self.assertEquals( + self.services["virtual_machine"]["displayname"], + vm_created.displayname, + "Display name of VM is not as expected" + ) + self.assertEquals( + "groupName", + vm_created.group, + "Group of VM is not as expected" + ) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Updating the VM details - displayname and group + vm_created.update( + self.userapiclient, + displayname="DisplayName", + group="Group", + haenable=False + ) + # Listing VM details again + list_vm = VirtualMachine.list( + self.userapiclient, + id=vm_created.id, + ) + status = validateList(list_vm) + self.assertEquals( + PASS, + status[0], + "Listing of VM by Id failed" + ) + self.assertEquals( + 1, + len(list_vm), + "Count of List VM by Id is not matching" + ) + # Verifying that displayname and group details are updated + self.assertEquals( + "DisplayName", + list_vm[0].displayname, + "Displayname of VM is not updated" + ) + self.assertEquals( + "Group", + list_vm[0].group, + "Group of VM is not updated" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_21_restore_vm(self): + """ + @Desc: Test to verify Restore VM + @Steps: + Step1: List all the VM's for a user + Step2: Deploy a VM with all parameters + Step3: Listing all the VM's again for the user + Step4: Verifying that list size is increased by 1 + Step5: Restoring the VM deployed in step2 + Step6: Verifying that restored VM details are same as the VM deployed in step2 + """ + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Restoring the VM + restored_vm = vm_created.restore(self.userapiclient) + self.assertIsNotNone( + restored_vm, + "VM restore failed" + ) + # Verifying the restored VM details + expected_dict = { + "id":vm_created.id, + "name":vm_created.name, + "displayname":vm_created.displayname, + "state":vm_created.state, + "zoneid":vm_created.zoneid, + "account":vm_created.account, + "template":vm_created.templateid + } + actual_dict = { + "id":restored_vm.id, + "name":restored_vm.name, + "displayname":restored_vm.displayname, + "state":restored_vm.state, + "zoneid":restored_vm.zoneid, + "account":restored_vm.account, + "template":restored_vm.templateid + } + restored_vm_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + restored_vm_status, + "Restored VM details are not as expected" + ) + return + + @attr(tags=["advanced", "selfservice"]) + def test_22_deploy_vm_multiple_networks(self): + """ + @Desc: Test to verify deploy VM with multiple networks + @Steps: + Step1: List all the networks for user + Step2: If size of list networks is greater than 2 then get all the networks id's + Else create 2 networks and get network id's + Step3: List all the VM's for a user + Step4: Deploy a VM with multiple network id's + Step5: Listing all the VM's again for the user + Step6: Verifying that list size is increased by 1 + Step7: Verify that VM is associated with multiple networks + """ + # Listing all the networks available + networks_list_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + networks_list_size = 0 + if networks_list_before is not None: + networks_list_size = len(networks_list_before) + + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat enabled are not found" + ) + while networks_list_size < 2: + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + networks_list_size = networks_list_size + 1 + + # Listing the networks again + networks_list_after = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Listing networks failed" + ) + # populating network id's + networkids = networks_list_after[0].id + "," + networks_list_after[1].id + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=networkids, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Verifying that the NIC's in VM created are same as provided + vm_nics = vm_created.nic + # Verifying that the size of nics is 2 + self.assertEquals( + 2, + len(vm_nics), + "NIC's count in VM created is not matching" + ) + # Verifying that NIC network ID's are as expected + for i in range(0, len(vm_nics)): + if vm_nics[i].isdefault is True: + self.assertEquals( + networks_list_after[0].id, + vm_nics[i].networkid, + "Default NIC is not as expected" + ) + else: + self.assertEquals( + networks_list_after[1].id, + vm_nics[i].networkid, + "Non Default NIC is not as expected" + ) + return + + @attr(tags=["basic", "provisioning"]) + def test_23_deploy_vm_multiple_securitygroups(self): + """ + @Desc: Test to verify deploy VM with multiple Security Groups + @Steps: + Step1: List all the security groups for user + Step2: If size of list security groups is greater than 2 then get all the security groups id's + Else creating 2 security groups and get security groups id's + Step3: List all the VM's for a user + Step4: Deploy a VM with multiple security groups id's + Step5: Listing all the VM's again for the user + Step6: Verifying that list size is increased by 1 + Step7: Verify that VM is associated with multiple security groups + """ + # Listing all the security groups available + security_groups_list = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + domainid=self.domain.id + ) + security_groups_list_size = 0 + if security_groups_list is not None: + security_groups_list_size = len(security_groups_list) + + while security_groups_list_size < 2: + # Creating a security group + security_group = SecurityGroup.create( + self.userapiclient, + self.services["security_group"], + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNotNone( + security_group, + "Security Group creation failed" + ) + self.cleanup.append(security_group) + security_groups_list_size = security_groups_list_size + 1 + + # Listing the networks again + security_groups_list = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + domainid=self.domain.id + ) + status = validateList(security_groups_list) + self.assertEquals( + PASS, + status[0], + "Listing Security Groups failed" + ) + # populating Security Groups id's + securitygroupids = {security_groups_list[0].id , security_groups_list[1].id} + # Listing all the VM's for a User + list_vms_before = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + self.assertIsNone( + list_vms_before, + "Virtual Machine already exists for newly created user" + ) + # Deploying a VM + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + securitygroupids=securitygroupids, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + self.cleanup.append(vm_created) + # Listing all the VMs for a user again + list_vms_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vms_after) + self.assertEquals( + PASS, + status[0], + "VM creation failed" + ) + # Verifying that the size of the list is 1 + self.assertEquals( + 1, + len(list_vms_after), + "VM list count is not matching" + ) + # Verifying that the Security Groups's in VM created are same as provided + vm_securitygroups = vm_created.securitygroup + # Verifying that the size of security groups is 2 + self.assertEquals( + 2, + len(vm_securitygroups), + "Security Groups count in VM created is not matching" + ) + # Verifying that Security Group network ID's are as expected + vm_securitygroups_flag = True + for i in range(0, len(vm_securitygroups)): + if ((vm_securitygroups[i].id != security_groups_list[0].id) and\ + (vm_securitygroups[i].id != security_groups_list[1].id)): + vm_securitygroups_flag = False + break + + self.assertEquals( + True, + vm_securitygroups_flag, + "Security Groups in VM are not same as created" + ) + return \ No newline at end of file diff --git a/test/integration/component/test_escalations_ipaddresses.py b/test/integration/component/test_escalations_ipaddresses.py new file mode 100644 index 0000000000..23dd76b9cf --- /dev/null +++ b/test/integration/component/test_escalations_ipaddresses.py @@ -0,0 +1,4192 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import * +from marvin.cloudstackException import * +from marvin.cloudstackAPI import * +from marvin.sshClient import SshClient +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * +from marvin.lib.utils import checkVolumeSize +from marvin.codes import SUCCESS +from nose.plugins.attrib import attr +from time import sleep + +class TestIpAddresses(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestIpAddresses, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + if cls.zone.localstorageenabled: + cls.storagetype = 'local' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' + else: + cls.storagetype = 'shared' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' + + cls.services['mode'] = cls.zone.networktype + cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.service_offering = ServiceOffering.create( + cls.api_client, + cls.services["service_offerings"]["tiny"] + ) + cls._cleanup.append(cls.service_offering) + cls.services['mode'] = cls.zone.networktype + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls._cleanup.append(cls.account) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created volumes + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + def __verify_values(self, expected_vals, actual_vals): + """ + @summary: Function to verify expected and actual values + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "provisioning"]) + def test_01_list_ipaddresses_pagination(self): + """ + @summary: Test List IP Addresses pagination + @Steps: + Step1: Creating a network for the user + Step2: Listing all the IP Addresses for a user + Step3: Verifying that no IP Addresses are listed + Step4: Associating (pagesize + 1) number of IP Addresses + Step5: Listing all the IP Addresses again + Step6: Verifying the length of the IP Addresses is (page size + 1) + Step7: Listing all the IP Addresses in page1 + Step8: Verifying that the length of the IP Addresses in page 1 is (page size) + Step9: Listing all the IP Addresses in page2 + Step10: Verifying that the length of the IP Addresses in page 2 is 1 + Step11: Dis-Associating the IP Addresses present in page 2 + Step12: Listing for the IP Addresses on page 2 + Step13: Verifying that no IP Addresses are listed + """ + # Listing all the networks available + networks_list_before = Network.list( + self.userapiclient, + forvpc="false", + domainid=self.domain.id, + account=self.account.name, + ) + self.assertIsNone( + networks_list_before, + "Networks listed for newly created user" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the networks available + networks_list_after = Network.list( + self.userapiclient, + forvpc="false", + domainid=self.domain.id, + account=self.account.name, + ) + status = validateList(networks_list_after) + self.assertEquals( + PASS, + status[0], + "Network Creation Failed" + ) + self.assertEquals( + 1, + len(networks_list_after), + "Network creation failed" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created user" + ) + # Associating (pagesize + 1) number of IP Addresses + for i in range(0, (self.services["pagesize"] + 1)): + ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + ipaddress, + "Failed to Associate IP Address" + ) + + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the volumes is (page size + 1) + self.assertEqual( + (self.services["pagesize"] + 1), + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing IP Address in page 1 + list_ipaddress_page1 = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_ipaddress_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list IP Addresses in page1" + ) + # Verifying that list size is equals to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_ipaddress_page1), + "Failed to list pagesize number of IP Addresses in page1" + ) + # Listing IP Address in page 2 + list_ipaddress_page2 = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_ipaddress_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list IP Addresses in page2" + ) + # Verifying that List size is equal to 1 + self.assertEquals( + 1, + len(list_ipaddress_page2), + "Failed to list IP Addresses in page2" + ) + # Dis-associating an IP Address + ipaddress.delete(self.userapiclient) + # Listing IP Address in page 2 + list_ipaddress_page2 = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that no IP Addresses are listed + self.assertIsNone( + list_ipaddress_page2, + "Disassociation of IP Address Failed" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_02_list_ipaddresses_byid(self): + """ + @summary: Test List IP Addresses details by ID + @Steps: + Step1: Creating a network for the user + Step2: Listing all the IP Addresses for a user + Step3: Verifying that no IP Addresses are listed + Step4: Associating an IP Addresses for Network + Step5: Listing all the IP Addresses again + Step6: Verifying the length of the IP Addresses is 1 + Step7: Listing the IP Addresses by Id + Step8: Verifying that the length of the IP Addresses list is 1 + Step9: Verifying the details of the Listed IP Address + """ + # Listing all the networks available + networks_list_before = Network.list( + self.userapiclient, + forvpc="false", + domainid=self.domain.id, + account=self.account.name, + ) + self.assertIsNone( + networks_list_before, + "Networks listed for newly created user" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the networks available + networks_list_after = Network.list( + self.userapiclient, + forvpc="false", + domainid=self.domain.id, + account=self.account.name, + ) + status = validateList(networks_list_after) + self.assertEquals( + PASS, + status[0], + "Network Creation Failed" + ) + self.assertEquals( + 1, + len(networks_list_after), + "Network creation failed" + ) + # Listing the Network By ID + network_list_byid = Network.list( + self.userapiclient, + listall=self.services["listall"], + id=network.id + ) + status = validateList(network_list_byid) + self.assertEquals( + PASS, + status[0], + "Failed to list Network by Id" + ) + self.assertEquals( + 1, + len(network_list_byid), + "Failed to list Network by Id" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created user" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network_list_byid[0].id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing IP Address by id + list_ipaddress_byid = PublicIPAddress.list( + self.userapiclient, + id=associated_ipaddress.ipaddress.id + ) + status = validateList(list_ipaddress_byid) + self.assertEquals( + PASS, + status[0], + "Failed to list IP Addresses by ID" + ) + # Verifying that list size is equals to 1 + self.assertEquals( + 1, + len(list_ipaddress_byid), + "Failed to list IP Addresses by ID" + ) + # Verifying details of the listed IP Address to be same as IP Address created above + # Creating expected and actual values dictionaries + expected_dict = { + "id":associated_ipaddress.ipaddress.id, + "associatednetworkid":associated_ipaddress.ipaddress.associatednetworkid, + "associatednetworkname":associated_ipaddress.ipaddress.associatednetworkname, + "ipaddress":associated_ipaddress.ipaddress.ipaddress, + "issourcenat":associated_ipaddress.ipaddress.issourcenat, + "isstaticnat":associated_ipaddress.ipaddress.isstaticnat, + "networkid":associated_ipaddress.ipaddress.networkid + } + actual_dict = { + "id":list_ipaddress_byid[0].id, + "associatednetworkid":list_ipaddress_byid[0].associatednetworkid, + "associatednetworkname":list_ipaddress_byid[0].associatednetworkname, + "ipaddress":list_ipaddress_byid[0].ipaddress, + "issourcenat":list_ipaddress_byid[0].issourcenat, + "isstaticnat":list_ipaddress_byid[0].isstaticnat, + "networkid":list_ipaddress_byid[0].networkid + } + ipaddress_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + ipaddress_status, + "Listed IP Address details are not as expected" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_03_associate_ipaddress_for_vpc(self): + """ + @summary: Test to Associate IP Address for VPC + @Steps: + Step1: Creating a VPC for the user + Step2: Listing all the IP Addresses for a user + Step3: Verifying that 1 IP Addresses is listed + Step4: Associating an IP Addresses for VPC + Step5: Listing all the IP Addresses again + Step6: Verifying the length of the IP Addresses list is 2 + Step7: Listing the IP Addresses by Id + Step8: Verifying that the length of the IP Addresses list is 1 + Step9: Verifying the details of the Listed IP Address + """ + # Listing all the vpc's for a user + list_vpc_before = VPC.list(self.userapiclient) + # Verifying No VPCs are listed + self.assertIsNone( + list_vpc_before, + "VPC's Listed for newly Created User" + ) + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals( + PASS, + status[0], + "list vpc offering is none") + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone( + vpc_created, + "VPC Creation Failed" + ) + self.cleanup.append(vpc_created) + # Listing the vpc for a user after creating a vpc + list_vpc_after = VPC.list(self.userapiclient) + status = validateList(list_vpc_after) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_vpc_after), + "list VPC not equal as expected" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "Failed to List VPC IP Address" + ) + self.assertEquals( + 1, + len(list_ipaddresses_before), + "Failed to List VPC IP Address" + ) + # Associating an IP Addresses to VPC created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + vpcid=vpc_created.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + len(list_ipaddresses_before) + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing IP Address by id + list_ipaddress_byid = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + id=associated_ipaddress.ipaddress.id + ) + status = validateList(list_ipaddress_byid) + self.assertEquals( + PASS, + status[0], + "Failed to list IP Addresses by ID" + ) + # Verifying that list size is equals to 1 + self.assertEquals( + 1, + len(list_ipaddress_byid), + "Failed to list IP Addresses by ID" + ) + # Verifying details of the listed IP Address to be same as IP Address created above + # Creating expected and actual values dictionaries + expected_dict = { + "id":associated_ipaddress.ipaddress.id, + "associatednetworkid":associated_ipaddress.ipaddress.associatednetworkid, + "associatednetworkname":associated_ipaddress.ipaddress.associatednetworkname, + "ipaddress":associated_ipaddress.ipaddress.ipaddress, + "issourcenat":associated_ipaddress.ipaddress.issourcenat, + "isstaticnat":associated_ipaddress.ipaddress.isstaticnat, + "networkid":associated_ipaddress.ipaddress.networkid, + "vpcid":associated_ipaddress.ipaddress.vpcid + } + actual_dict = { + "id":list_ipaddress_byid[0].id, + "associatednetworkid":list_ipaddress_byid[0].associatednetworkid, + "associatednetworkname":list_ipaddress_byid[0].associatednetworkname, + "ipaddress":list_ipaddress_byid[0].ipaddress, + "issourcenat":list_ipaddress_byid[0].issourcenat, + "isstaticnat":list_ipaddress_byid[0].isstaticnat, + "networkid":list_ipaddress_byid[0].networkid, + "vpcid":list_ipaddress_byid[0].vpcid + } + ipaddress_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + ipaddress_status, + "Listed IP Address details are not as expected" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_04_create_delete_lbrule_fornonvpc(self): + """ + @summary: Test to list, create and delete Load Balancer Rule for IP Address associated to Non VPC network + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Listing Load Balancer Rules for the IP Address associated in Step2 + Step4: Verifying that no Load Balancer Rules are listed + Step5: Creating a Load Balancer Rule for IP Address associated in Step2 + Step6: Listing Load Balancer Rules for the IP Address associated in Step2 + Step7: Verifying 1 Load Balancer Rule is listed + Step8: Deleting the Load Balancer Rule created in Step5 + Step9: Listing Load Balancer Rules for the IP Address associated in Step2 + Step10: Verifying that no Load Balancer Rules are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Lb enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_before = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are listed + self.assertIsNone( + list_lbrules_before, + "Load Balancer Rules listed for newly Acquired Ip Address" + ) + self.services["lbrule"]["openfirewall"] = 'false' + # Creating a Load Balancer Rule for Ip Address + lb_rule = LoadBalancerRule.create( + self.userapiclient, + self.services["lbrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + ) + self.assertIsNotNone( + lb_rule, + "Failed to create Load Balancer Rule" + ) + # Verifying details of created Load Balancer Rule + # Creating expected and actual values dictionaries + expected_dict = { + "algorithm":self.services["lbrule"]["alg"], + "privateport":str(self.services["lbrule"]["privateport"]), + "publicport":str(self.services["lbrule"]["publicport"]), + "name":self.services["lbrule"]["name"], + } + actual_dict = { + "algorithm":str(lb_rule.algorithm), + "privateport":str(lb_rule.privateport), + "publicport":str(lb_rule.publicport), + "name":str(lb_rule.name), + } + lbrule_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + lbrule_status, + "Created Load Balancer Rule details are not as expected" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_lbrules_after) + self.assertEquals( + PASS, + status[0], + "Load Balancer Rule creation Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbrules_after), + "Load Balancer Rule creation Failed" + ) + # Deleting Load Balancer Rule + lb_rule.delete(self.userapiclient) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are Listed + self.assertIsNone( + list_lbrules_after, + "Failed to delete Load Balancer Rule" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_05_create_delete_lbrule_forvpc(self): + """ + @summary: Test to list, create and delete Load Balancer Rule for IP Address associated to VPC + @Steps: + Step1: Creating a VPC for the user + Step2: Creating Network inside VPC + Step3: Associating an IP Addresses for VPC + Step4: Listing Load Balancer Rules for the IP Address associated in Step2 + Step5: Verifying that no Load Balancer Rules are listed + Step6: Creating a Load Balancer Rule for IP Address associated in Step2 + Step7: Listing Load Balancer Rules for the IP Address associated in Step2 + Step8: Verifying 1 Load Balancer Rule is listed + Step9: Deleting the Load Balancer Rule created in Step5 + Step10: Listing Load Balancer Rules for the IP Address associated in Step2 + Step11: Verifying that no Load Balancer Rules are listed + """ + # Listing all the vpc's for a user + list_vpc_before = VPC.list(self.userapiclient) + # Verifying No VPCs are listed + self.assertIsNone( + list_vpc_before, + "VPC's Listed for newly Created User" + ) + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals( + PASS, + status[0], + "list vpc offering is none") + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone( + vpc_created, + "VPC Creation Failed" + ) + # Listing the vpc for a user after creating a vpc + list_vpc_after = VPC.list(self.userapiclient) + status = validateList(list_vpc_after) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_vpc_after), + "list VPC not equal as expected" + ) + #List network offering for vpc = true + network_offering_vpc_true_list = NetworkOffering.list( + self.userapiclient, + forvpc = "true", + zoneid = self.zone.id, + supportedServices = "Lb", + state = "Enabled" + ) + status = validateList(network_offering_vpc_true_list) + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with Lb") + # Creating network under VPC + network_created = Network.create( + self.userapiclient, + self.services["ntwk"], + networkofferingid = network_offering_vpc_true_list[0].id, + vpcid = vpc_created.id, + zoneid=self.zone.id, + gateway= self.services["ntwk"]["gateway"], + netmask = self.services["ntwk"]["netmask"] + ) + self.cleanup.append(network_created) + self.assertIsNotNone( + network_created, + "Network is not created" + ) + self.cleanup.append(vpc_created) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "list IP Addresses not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_ipaddresses_before), + "list IP Addresses not equal as expected" + ) + # Associating an IP Addresses to VPC created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + vpcid=vpc_created.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + len(list_ipaddresses_before) + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_before = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are listed + self.assertIsNone( + list_lbrules_before, + "Load Balancer Rules listed for newly Acquired Ip Address" + ) + self.services["lbrule"]["openfirewall"] = 'false' + # Creating a Load Balancer Rule for Ip Address + lb_rule = LoadBalancerRule.create( + self.userapiclient, + self.services["lbrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + networkid=network_created.id + ) + self.assertIsNotNone( + lb_rule, + "Failed to create Load Balancer Rule" + ) + # Verifying details of created Load Balancer Rule + # Creating expected and actual values dictionaries + expected_dict = { + "algorithm":self.services["lbrule"]["alg"], + "privateport":str(self.services["lbrule"]["privateport"]), + "publicport":str(self.services["lbrule"]["publicport"]), + "name":self.services["lbrule"]["name"], + } + actual_dict = { + "algorithm":str(lb_rule.algorithm), + "privateport":str(lb_rule.privateport), + "publicport":str(lb_rule.publicport), + "name":str(lb_rule.name), + } + lbrule_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + lbrule_status, + "Created Load Balancer Rule details are not as expected" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id, + ) + status = validateList(list_lbrules_after) + self.assertEquals( + PASS, + status[0], + "Load Balancer Rule creation Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbrules_after), + "Load Balancer Rule creation Failed" + ) + # Deleting Load Balancer Rule + lb_rule.delete(self.userapiclient) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are Listed + self.assertIsNone( + list_lbrules_after, + "Failed to delete Load Balancer Rule" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_06_update_lbrule_name(self): + """ + @summary: Test to Update Load Balancer Rule Name for IP Address associated to Non VPC network + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Listing Load Balancer Rules for the IP Address associated in Step2 + Step4: Verifying that no Load Balancer Rules are listed + Step5: Creating a Load Balancer Rule for IP Address associated in Step2 + Step6: Listing Load Balancer Rules for the IP Address associated in Step2 + Step7: Verifying 1 Load Balancer Rule is listed + Step8: Updating the Load Balancer Rule created in Step5 + Step9: Verifying that Load Balancer Rule details are updated + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Lb enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing Networks again + list_networks_after = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_networks_after) + self.assertEquals( + PASS, + status[0], + "Network Creation Failed" + ) + # Verifying network list count is increased by 1 + self.assertEquals( + 1, + len(list_networks_after), + "Network Creation Failed" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_before = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are listed + self.assertIsNone( + list_lbrules_before, + "Load Balancer Rules listed for newly Acquired Ip Address" + ) + self.services["lbrule"]["openfirewall"] = 'false' + # Creating a Load Balancer Rule for Ip Address + lb_rule = LoadBalancerRule.create( + self.userapiclient, + self.services["lbrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + ) + self.assertIsNotNone( + lb_rule, + "Failed to create Load Balancer Rule" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_lbrules_after) + self.assertEquals( + PASS, + status[0], + "Load Balancer Rule creation Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbrules_after), + "Load Balancer Rule creation Failed" + ) + # Updating Load Balancer Rule Name + updated_lb_rule = LoadBalancerRule.update( + lb_rule, + self.userapiclient, + algorithm="source", + name="NewLBRuleName" + ) + self.assertIsNotNone( + updated_lb_rule, + "Failed to update Load Balancer Rule details" + ) + # Verifying details of the updated Load Balancer Rule + # Creating expected and actual values dictionaries + expected_dict = { + "id":lb_rule.id, + "account":lb_rule.account, + "algorithm":"source", + "domainid":lb_rule.domainid, + "name":"NewLBRuleName", + "networkid":lb_rule.networkid, + "zoneid":lb_rule.zoneid, + "privateport":lb_rule.privateport, + "publicip":lb_rule.publicip, + "publicport":lb_rule.publicport, + } + actual_dict = { + "id":updated_lb_rule.id, + "account":updated_lb_rule.account, + "algorithm":updated_lb_rule.algorithm, + "domainid":updated_lb_rule.domainid, + "name":updated_lb_rule.name, + "networkid":updated_lb_rule.networkid, + "zoneid":updated_lb_rule.zoneid, + "privateport":updated_lb_rule.privateport, + "publicip":updated_lb_rule.publicip, + "publicport":updated_lb_rule.publicport, + } + lbrule_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + lbrule_status, + "Updated Load Balancer Rule details are not as expected" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_07_assign_remove_lbrule_toinstance(self): + """ + @summary: Test to Assign and Remove Load Balancer Rule to an Instance + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Launching a VM using the network created in Step 1 + Step4: Creating a Load Balancer Rule for IP Address associated in Step2 + Step5: Listing Load Balancer Rule Instances for applied as true + Step6: Verifying no Load balancer rule instances are listed + Step7: Listing Load Balancer Rule Instances for applied as false + Step8: Verifying that list size is 1 + Step9: Assigning the Instance to Load Balancer Rule + Step10: Listing Load Balancer Rule Instances for applied as true + Step11: Verifying list size is 1 + Step12: Listing Load Balancer Rule Instances for applied as false + Step13: Verifying no Load balancer rule instances are listed + Step14: Removing the Load Balancer Rule assigned form Instance + Step15: Listing Load Balancer Rule Instances for applied as true + Step16: Verifying no Load balancer rule instances are listed + Step17: Listing Load Balancer Rule Instances for applied as false + Step18: Verifying that list size is 1 + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Lb enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching a Virtual Machine with above created Network + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + self.cleanup.append(network) + # Listing Virtual Machines in Running state in the network created above + list_vms_running = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id, + state="Running", + networkid=network.id + ) + status = validateList(list_vms_running) + self.assertEquals( + PASS, + status[0], + "VM Created is not in Running state" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_vms_running), + "VM Created is not in Running state" + ) + self.assertEquals( + vm_created.id, + list_vms_running[0].id, + "VM Created is not in Running state" + ) + # Listing Virtual Machines in Stopped state in the network created above + list_vms_stopped = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id, + state="Stopped", + networkid=network.id + ) + # Verifying that no vms are listed + self.assertIsNone( + list_vms_stopped, + "Created VM is in Stopped state" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_before = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are listed + self.assertIsNone( + list_lbrules_before, + "Load Balancer Rules listed for newly Acquired Ip Address" + ) + self.services["lbrule"]["openfirewall"] = 'false' + # Creating a Load Balancer Rule for Ip Address + lb_rule = LoadBalancerRule.create( + self.userapiclient, + self.services["lbrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + ) + self.assertIsNotNone( + lb_rule, + "Failed to create Load Balancer Rule" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_lbrules_after) + self.assertEquals( + PASS, + status[0], + "Load Balancer Rule creation Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbrules_after), + "Load Balancer Rule creation Failed" + ) + # Listing Load Balancer Rule Instances for applied as true + list_lbruleinstance_applied_true = LoadBalancerRule.listLoadBalancerRuleInstances( + self.userapiclient, + id=lb_rule.id, + applied="true" + ) + # Verifying No Instances are assigned to the Load Balancer Rule + self.assertIsNone( + list_lbruleinstance_applied_true, + "Instances are assigned to Newly created Load Balancer Rule" + ) + # Listing Load Balancer Rule Instances for applied as false + list_lbruleinstance_applied_false = LoadBalancerRule.listLoadBalancerRuleInstances( + self.userapiclient, + id=lb_rule.id, + applied="false" + ) + status = validateList(list_lbruleinstance_applied_false) + self.assertEquals( + PASS, + status[0], + "No Instances are available to assign to Load Balancer Rule" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbruleinstance_applied_false), + "No Instances are available to assign to Load Balancer Rule" + ) + # Verifying that Instance created above is listed + self.assertEquals( + vm_created.id, + list_lbruleinstance_applied_false[0].id, + "Failed to list Instance available to asign a Load Balancer Rule" + ) + # Assigning Instance created to Load Balancer Rule + LoadBalancerRule.assign( + lb_rule, + self.userapiclient, + vms=[vm_created] + ) + # Listing Load Balancer Rule Instances for applied as true + list_lbruleinstance_applied_true = LoadBalancerRule.listLoadBalancerRuleInstances( + self.userapiclient, + id=lb_rule.id, + applied="true" + ) + status = validateList(list_lbruleinstance_applied_false) + self.assertEquals( + PASS, + status[0], + "No Instances are available to assign to Load Balancer Rule" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbruleinstance_applied_false), + "No Instances are available to assign to Load Balancer Rule" + ) + # Verifying Instances is assigned to the Load Balancer Rule + self.assertEquals( + vm_created.id, + list_lbruleinstance_applied_true[0].id, + "Failed to assign Load Balancer Rule to given Instance" + ) + # Listing Load Balancer Rule Instances for applied as false + list_lbruleinstance_applied_false = LoadBalancerRule.listLoadBalancerRuleInstances( + self.userapiclient, + id=lb_rule.id, + applied="false" + ) + # Verifying No Load Balancer Rules Instances are available to assign + self.assertIsNone( + list_lbruleinstance_applied_false, + "Instances are available for assigning a Load Balancer Rule" + ) + # Removing Load balancer Rule from Instance + LoadBalancerRule.remove( + lb_rule, + self.userapiclient, + vms=[vm_created] + ) + # Listing Load Balancer Rule Instances for applied as true + list_lbruleinstance_applied_true = LoadBalancerRule.listLoadBalancerRuleInstances( + self.userapiclient, + id=lb_rule.id, + applied="true" + ) + # Verifying that there are no Instances assigned to the Load Balancer Rule + self.assertIsNone( + list_lbruleinstance_applied_true, + "Instances is assigned to Load balancer Rule" + ) + # Listing Load Balancer Rule Instances for applied as false + list_lbruleinstance_applied_false = LoadBalancerRule.listLoadBalancerRuleInstances( + self.userapiclient, + id=lb_rule.id, + applied="false" + ) + status = validateList(list_lbruleinstance_applied_false) + self.assertEquals( + PASS, + status[0], + "No Instances are available to assign to Load Balancer Rule" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbruleinstance_applied_false), + "No Instances are available to assign to Load Balancer Rule" + ) + # Verifying that Instance created above is listed + self.assertEquals( + vm_created.id, + list_lbruleinstance_applied_false[0].id, + "Failed to list Instance available to asign a Load Balancer Rule" + ) + # Destroying the VM Launched + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_08_list_create_delete_lbsticky_policy(self): + """ + @summary: Test to List, Create, Delete Load Balancer Stickyness Policy + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Creating a Load Balancer Rule for IP Address associated in Step2 + Step4: Listing Load Balancer Sticky Policies for LB Rule created in Step3 + Step5: Verifying that no Load Balancer Sticky Policies are listed + Step6: Creating a Load Balancer Sticky Policies for LB Rule created in Step3 + Step7: Listing Load Balancer Sticky Policies for LB Rule created in Step3 + Step8: Verifying 1 Load Balancer Sticky Policy is listed + Step9: Deleting the Load Balancer Sticky Policies + Step10: Listing Load Balancer Sticky Policies for LB Rule created in Step3 + Step11: Verifying that no Load Balancer Sticky Policies are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Lb enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing Networks again + list_networks_after = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_networks_after) + self.assertEquals( + PASS, + status[0], + "Network Creation Failed" + ) + # Verifying network list count is increased by 1 + self.assertEquals( + 1, + len(list_networks_after), + "Network Creation Failed" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_before = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + # Verifying no Load Balancer Rules are listed + self.assertIsNone( + list_lbrules_before, + "Load Balancer Rules listed for newly Acquired Ip Address" + ) + self.services["lbrule"]["openfirewall"] = 'false' + # Creating a Load Balancer Rule for Ip Address + lb_rule = LoadBalancerRule.create( + self.userapiclient, + self.services["lbrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + ) + self.assertIsNotNone( + lb_rule, + "Failed to create Load Balancer Rule" + ) + # Listing Load Balancer Rules for the Ip Address + list_lbrules_after = LoadBalancerRule.list( + self.userapiclient, + listall=self.services["listall"], + publicipid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_lbrules_after) + self.assertEquals( + PASS, + status[0], + "Load Balancer Rule creation Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbrules_after), + "Load Balancer Rule creation Failed" + ) + # Listing Load Balancer Stickyness Policies for LB Rule + list_lbstickypolicy_before = LoadBalancerRule.listStickyPolicies( + self.userapiclient, + lbruleid=lb_rule.id, + listall=self.services["listall"] + ) + # Verifying no Sticky Policies are listed + self.assertEquals( + 0, + len(list_lbstickypolicy_before[0].stickinesspolicy), + "Sticky Policy listed for newly created Load Balancer Rule" + ) + # Creating a Sticy Policy for Load Balancer Rule + sticky_policy = LoadBalancerRule.createSticky( + lb_rule, + self.userapiclient, + methodname='LbCookie', + name='LbCookieSticky' + ) + self.assertIsNotNone( + sticky_policy, + "Failed to create Sticky Policy for Load Balancer Rule" + ) + # Verifying details of Sticky Policy created + # Creating expected and actual values dictionaries + expected_dict = { + "account":self.account.name, + "domainid":self.domain.id, + "lbruleid":lb_rule.id, + "methodname":"LbCookie", + "name":"LbCookieSticky", + } + actual_dict = { + "account":sticky_policy.account, + "domainid":sticky_policy.domainid, + "lbruleid":sticky_policy.lbruleid, + "methodname":sticky_policy.stickinesspolicy[0].methodname, + "name":sticky_policy.stickinesspolicy[0].name, + } + lbstickypolicy_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + lbstickypolicy_status, + "Created Load Balancer Sticky Policy details are not as expected" + ) + # Listing Load Balancer Stickyness Policies for LB Rule + list_lbstickypolicy_after = LoadBalancerRule.listStickyPolicies( + self.userapiclient, + lbruleid=lb_rule.id, + listall=self.services["listall"] + ) + status = validateList(list_lbstickypolicy_after[0].stickinesspolicy) + self.assertEquals( + PASS, + status[0], + "Load Balancer Sticky Policy creation Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_lbstickypolicy_after[0].stickinesspolicy), + "Load Balancer Sticky Policy creation Failed" + ) + # Deleting the Sticky Policy + deleted = LoadBalancerRule.deleteSticky( + lb_rule, + self.userapiclient, + id=sticky_policy.stickinesspolicy[0].id + ) + # Listing Load Balancer Stickyness Policies for LB Rule + list_lbstickypolicy_after = LoadBalancerRule.listStickyPolicies( + self.userapiclient, + lbruleid=lb_rule.id, + listall=self.services["listall"] + ) + # Verifying no Sticky Policies are listed + self.assertEquals( + 0, + len(list_lbstickypolicy_after[0].stickinesspolicy), + "Sticky Policy listed for newly created Load Balancer Rule" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_09_create_delete_portforwarding_fornonvpc(self): + """ + @summary: Test to list, create and delete Port Forwarding for IP Address associated to Non VPC network + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Launching Virtual Machine in network created in step 2 + Step4: Listing Port Forwarding Rules for the IP Address associated in Step2 + Step5: Verifying that no Port Forwarding Rules are listed + Step6: Creating a Port Forwarding Rule for IP Address associated in Step2 + Step7: Listing Port Forwarding Rules for the IP Address associated in Step2 + Step8: Verifying 1 Port Forwarding Rule is listed + Step9: Deleting the Port Forwarding Rule created in Step6 + Step10: Listing Port Forwarding Rules for the IP Address associated in Step2 + Step11: Verifying that no Port Forwarding Rules are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,PortForwarding", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, PortForwarding enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching a Virtual Machine with above created Network + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + self.cleanup.append(network) + # Listing Virtual Machines in running state in above created network + list_vms_running = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + state="Running", + networkid=network.id + ) + status = validateList(list_vms_running) + self.assertEquals( + PASS, + status[0], + "VM Created is not in Running state" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "VM Created is not in Runnning state" + ) + self.assertEquals( + vm_created.id, + list_vms_running[0].id, + "VM Created is not in Runnning state" + ) + # Listing Virtual Machines in stopped state in above created network + list_vms_stopped = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + state="Stopped", + networkid=network.id + ) + # Verifying no VMs are in stopped state + self.assertIsNone( + list_vms_stopped, + "VM Created is in stopped state" + ) + # Listing Port Forwarding Rules for the IP Address associated + list_prtfwdrule_before = NATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no port forwarding rules are listed + self.assertIsNone( + list_prtfwdrule_before, + "Port Forwarding Rules listed for newly associated IP Address" + ) + # Creating a Port Forwarding rule + portfwd_rule = NATRule.create( + self.userapiclient, + virtual_machine=vm_created, + services=self.services["natrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + ) + self.assertIsNotNone( + portfwd_rule, + "Failed to create Port Forwarding Rule" + ) + # Verifying details of Sticky Policy created + # Creating expected and actual values dictionaries + expected_dict = { + "ipaddressid":associated_ipaddress.ipaddress.id, + "privateport":str(self.services["natrule"]["privateport"]), + "publicport":str(self.services["natrule"]["publicport"]), + "protocol":str(self.services["natrule"]["protocol"]).lower(), + } + actual_dict = { + "ipaddressid":portfwd_rule.ipaddressid, + "privateport":str(portfwd_rule.privateport), + "publicport":str(portfwd_rule.publicport), + "protocol":portfwd_rule.protocol, + } + portfwd_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + portfwd_status, + "Created Port Forward Rule details are not as expected" + ) + # Listing Port Forwarding Rules for the IP Address associated + list_prtfwdrule_after = NATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_prtfwdrule_after) + self.assertEquals( + PASS, + status[0], + "Failed to create Port Forwarding Rule" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_prtfwdrule_after), + "Failed to create Port Forwarding Rule" + ) + # Deleting Port Forwarding Rule + portfwd_rule.delete(self.userapiclient) + # # Listing Port Forwarding Rules for the IP Address associated + list_prtfwdrule_after = NATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no port forwarding rules are listed + self.assertIsNone( + list_prtfwdrule_after, + "Port Forwarding Rules listed after deletion" + ) + # Destroying the VM Launched + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_10_create_delete_portforwarding_forvpc(self): + """ + @summary: Test to list, create and delete Port Forwarding Rule for IP Address associated to VPC + @Steps: + Step1: Creating a VPC for the user + Step2: Creating Network inside VPC + Step3: Associating an IP Addresses for VPC + Step4: Launching a VM in the Network created in Step 2 + Step5: Listing Port Forwarding Rules for the IP Address associated in Step3 + Step6: Verifying that no Port Forwarding Rules are listed + Step7: Creating a Port Forwarding Rule for IP Address associated in Step3 + Step8: Listing Port Forwarding Rules for the IP Address associated in Step3 + Step9: Verifying 1 Port Forwarding Rule is listed + Step10: Deleting the Port Forwarding Rule created in Step7 + Step11: Listing Port Forwarding Rules for the IP Address associated in Step3 + Step12: Verifying that no Port Forwarding Rules are listed + """ + # Listing all the vpc's for a user + list_vpc_before = VPC.list(self.userapiclient) + # Verifying No VPCs are listed + self.assertIsNone( + list_vpc_before, + "VPC's Listed for newly Created User" + ) + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals( + PASS, + status[0], + "list vpc offering is none" + ) + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone( + vpc_created, + "VPC Creation Failed" + ) + # Listing the vpc for a user after creating a vpc + list_vpc_after = VPC.list(self.userapiclient) + status = validateList(list_vpc_after) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_vpc_after), + "list VPC not equal as expected" + ) + #List network offering for vpc = true + network_offering_vpc_true_list = NetworkOffering.list( + self.userapiclient, + forvpc = "true", + zoneid = self.zone.id, + supportedServices = "SourceNat,PortForwarding", + state = "Enabled" + ) + status = validateList(network_offering_vpc_true_list) + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with PortForwarding") + # Creating network under VPC + network_created = Network.create( + self.userapiclient, + self.services["ntwk"], + networkofferingid = network_offering_vpc_true_list[0].id, + vpcid = vpc_created.id, + zoneid=self.zone.id, + gateway= self.services["ntwk"]["gateway"], + netmask = self.services["ntwk"]["netmask"] + ) + self.assertIsNotNone( + network_created, + "Network is not created" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "list IP Addresses not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_ipaddresses_before), + "list IP Addresses not equal as expected" + ) + # Associating an IP Addresses to VPC created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + vpcid=vpc_created.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + len(list_ipaddresses_before) + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching a Virtual Machine with above created Network + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network_created.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + self.cleanup.append(network_created) + self.cleanup.append(vpc_created) + # Listing Port Forwarding Rules for the IP Address associated + list_prtfwdrule_before = NATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no port forwarding rules are listed + self.assertIsNone( + list_prtfwdrule_before, + "Port Forwarding Rules listed for newly associated IP Address" + ) + # Creating a Port Forwarding rule + portfwd_rule = NATRule.create( + self.userapiclient, + virtual_machine=vm_created, + services=self.services["natrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + networkid=network_created.id + ) + self.assertIsNotNone( + portfwd_rule, + "Failed to create Port Forwarding Rule" + ) + # Verifying details of Sticky Policy created + # Creating expected and actual values dictionaries + expected_dict = { + "ipaddressid":associated_ipaddress.ipaddress.id, + "privateport":str(self.services["natrule"]["privateport"]), + "publicport":str(self.services["natrule"]["publicport"]), + "protocol":str(self.services["natrule"]["protocol"]).lower(), + } + actual_dict = { + "ipaddressid":portfwd_rule.ipaddressid, + "privateport":str(portfwd_rule.privateport), + "publicport":str(portfwd_rule.publicport), + "protocol":portfwd_rule.protocol, + } + portfwd_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + portfwd_status, + "Created Port Forward Rule details are not as expected" + ) + # Listing Port Forwarding Rules for the IP Address associated + list_prtfwdrule_after = NATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_prtfwdrule_after) + self.assertEquals( + PASS, + status[0], + "Failed to create Port Forwarding Rule" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_prtfwdrule_after), + "Failed to create Port Forwarding Rule" + ) + # Deleting Port Forwarding Rule + portfwd_rule.delete(self.userapiclient) + # # Listing Port Forwarding Rules for the IP Address associated + list_prtfwdrule_after = NATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no port forwarding rules are listed + self.assertIsNone( + list_prtfwdrule_after, + "Port Forwarding Rules listed after deletion" + ) + # Destroying the VM Launched + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_11_create_delete_firewallrule(self): + """ + @summary: Test to list, create and delete Firewall Rule for IP Address associated to Non VPC network + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Listing Firewall Rules for the IP Address associated in Step2 + Step4: Verifying that no Rules are listed + Step5: Creating a Firewall Rule for IP Address associated in Step2 + Step6: Listing Firewall Rules for the IP Address associated in Step2 + Step7: Verifying 1 Firewall Rule is listed + Step8: Deleting the Firewall Rule created in Step5 + Step9: Listing Firewall Rules for the IP Address associated in Step2 + Step10: Verifying that no Firewall Rules are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Firewall", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Firewall enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Firewall rules for the IP Associated + list_firewalls_before = FireWallRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no firewall rules are listed + self.assertIsNone( + list_firewalls_before, + "Firewall Rules listed for newly associated IP Address" + ) + # Creating a Firewall Rule + firewall_rule = FireWallRule.create( + self.userapiclient, + ipaddressid=associated_ipaddress.ipaddress.id, + protocol='tcp', + cidrlist='10.1.1.1/16', + startport='22', + endport='2222' + ) + self.assertIsNotNone( + firewall_rule, + "Failed to create Firewall Rule" + ) + # Verifying details of the created Firewall Rule + # Creating expected and actual values dictionaries + expected_dict = { + "ipaddressid":associated_ipaddress.ipaddress.id, + "startport":"22", + "endport":"2222", + "protocol":"tcp", + "cidrlist":"10.1.1.1/16" + } + actual_dict = { + "ipaddressid":firewall_rule.ipaddressid, + "startport":firewall_rule.startport, + "endport":firewall_rule.endport, + "protocol":firewall_rule.protocol, + "cidrlist":firewall_rule.cidrlist + } + firewall_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + firewall_status, + "Created Firewall Rule details are not as expected" + ) + # Listing Firewall rules for the IP Associated + list_firewalls_after = FireWallRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_firewalls_after) + self.assertEquals( + PASS, + status[0], + "Failed to create Firewall Rule" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_firewalls_after), + "Failed to create Firewall Rule" + ) + # Deleting the Firewall Rule + firewall_rule.delete(self.userapiclient) + # Listing Firewall rules for the IP Associated + list_firewalls_after = FireWallRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no firewall rules are listed + self.assertIsNone( + list_firewalls_after, + "Failed to create Firewall Rule" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_12_create_delete_remoteaccessvpn(self): + """ + @summary: Test to list, create and delete Remote Access VPNs + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Listing Remore Access VPNs for the IP Address associated in Step2 + Step4: Verifying that no Remore Access VPNs are listed + Step5: Creating a Remore Access VPN for IP Address associated in Step2 + Step6: Listing Remore Access VPNs for the IP Address associated in Step2 + Step7: Verifying 1 Remore Access VPN is listed + Step8: Deleting the Remore Access VPNs created in Step5 + Step9: Listing Remore Access VPNs for the IP Address associated in Step2 + Step10: Verifying that no Remore Access VPNs are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Vpn", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Vpn enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Remote access VPNs for the IP Associated + list_vpns_before = Vpn.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no Remote Access VPNs are listed + self.assertIsNone( + list_vpns_before, + "Remote Access VPNs listed for newly associated IP Address" + ) + # Creating a Remote Access VPN + vpn_created = Vpn.create( + self.userapiclient, + publicipid=associated_ipaddress.ipaddress.id, + account=self.account.name, + domainid=self.domain.id, + openfirewall='false' + ) + self.assertIsNotNone( + vpn_created, + "Failed to create Remote Access VPN" + ) + # Verifying details of the created Remote Access VPN + # Creating expected and actual values dictionaries + expected_dict = { + "ipaddressid":associated_ipaddress.ipaddress.id, + "account":self.account.name, + "domainid":self.domain.id, + "state":"Running", + } + actual_dict = { + "ipaddressid":vpn_created.publicipid, + "account":vpn_created.account, + "domainid":vpn_created.domainid, + "state":vpn_created.state, + } + vpn_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + vpn_status, + "Created Remote Access VPN details are not as expected" + ) + # Listing Remote Access VPNs for the IP Associated + list_vpns_after = Vpn.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_vpns_after) + self.assertEquals( + PASS, + status[0], + "Failed to create Remote Access VPN" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_vpns_after), + "Failed to create Remote Access VPN" + ) + # Deleting the Remote Access VPN + vpn_created.delete(self.userapiclient) + # Listing Remote Access VPNs for the IP Associated + list_vpns_after = Vpn.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no Remote Access VPNs are listed + self.assertIsNone( + list_vpns_after, + "Failed to create Remote Access VPN" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_13_add_remove_vpnusers(self): + """ + @summary: Test to list, add and remove VPN Users + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network + Step3: Launching a VM under network created in Step1 + Step4: Creating Remote Access VPN + Step5: Listing VPN Users + Step6: Verifying that no VPN Users are listed + Step7: Adding a VPN user + Step8: Listing VPN Users + Step9: Verifying 1 VPN is listed + Step10: Deleting VPN user + Step11: Listing VPN Users + Step12: Verifying that no VPN Users are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Vpn", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Vpn enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Listing Remote access VPNs for the IP Associated + list_vpns_before = Vpn.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Verifying no Remote Access VPNs are listed + self.assertIsNone( + list_vpns_before, + "Remote Access VPNs listed for newly associated IP Address" + ) + # Creating a Remote Access VPN + vpn_created = Vpn.create( + self.userapiclient, + publicipid=associated_ipaddress.ipaddress.id, + account=self.account.name, + domainid=self.domain.id, + openfirewall='false' + ) + self.assertIsNotNone( + vpn_created, + "Failed to create Remote Access VPN" + ) + # Listing Remote Access VPNs for the IP Associated + list_vpns_after = Vpn.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress.ipaddress.id + ) + status = validateList(list_vpns_after) + self.assertEquals( + PASS, + status[0], + "Failed to create Remote Access VPN" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_vpns_after), + "Failed to create Remote Access VPN" + ) + # Listing VPN Users + list_vpnusers_beore = VpnUser.list( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + # Verifying no VPN Users listed + self.assertIsNone( + list_vpnusers_beore, + "VPN Users listed for newly created VPN" + ) + # Creating a VPN User + vpnuser_created = VpnUser.create( + self.userapiclient, + username=self.services["vpn_user"]["username"], + password=self.services["vpn_user"]["password"], + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNotNone( + vpnuser_created, + "Failed to create VPN User" + ) + # Listing VPN Users + list_vpnusers_after = VpnUser.list( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_vpnusers_after) + self.assertEquals( + PASS, + status[0], + "Failed to list VPN user after creation" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_vpnusers_after), + "Failed to list VPN user after creation" + ) + # Deleting the VPN User + vpnuser_created.delete(self.userapiclient) + # Listing VPN Users + list_vpnusers_after = VpnUser.list( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + # Verifying no VPN Users are listed + self.assertIsNone( + list_vpnusers_after, + "VPN User listed after deletion" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_14_enable_disable_staticnat_fornonvpc(self): + """ + @summary: Test to Enable and Disable StaticNat for IP Address associated to Non VPC Network + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network created in step1 + Step3: Associating one more Ip Address to Network created in step1 + Step4: Launching the VM in network created in step1 + Step5: Enabling the staticNat to IP Associated in Step3 + Step6: Verifying that StaticNat is enabled + Step7: Disabling the staticNat to IP Associated in Step3 + Step8: Verifying that StaticNat is disabled + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,StaticNat", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Vpn enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress1 = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress1, + "Failed to Associate IP Address" + ) + # Associating another IP Addresses to Network created + associated_ipaddress2 = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress2, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 2, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching a Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Enabling static Nat for Ip Address associated + StaticNATRule.enable( + self.userapiclient, + ipaddressid=associated_ipaddress2.ipaddress.id, + virtualmachineid=vm_created.id, + ) + # Listing Ip Address by id + list_ipaddress = PublicIPAddress.list( + self.userapiclient, + id=associated_ipaddress2.ipaddress.id, + listall=self.services["listall"] + ) + status = validateList(list_ipaddress) + self.assertEquals( + PASS, + status[0], + "Failed to List IP Address" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddress), + "Failed to List IP Address" + ) + self.assertEquals( + True, + list_ipaddress[0].isstaticnat, + "Failed to Enable Static Nat" + ) + # Disabling static Nat + StaticNATRule.disable( + self.userapiclient, + ipaddressid=associated_ipaddress2.ipaddress.id + ) + # Listing Ip Address by id + list_ipaddress = PublicIPAddress.list( + self.userapiclient, + id=associated_ipaddress2.ipaddress.id, + listall=self.services["listall"] + ) + status = validateList(list_ipaddress) + self.assertEquals( + PASS, + status[0], + "Failed to List IP Address" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddress), + "Failed to List IP Address" + ) + self.assertEquals( + False, + list_ipaddress[0].isstaticnat, + "Failed to Disable Static Nat" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_15_enable_disable_staticnat_forvpc(self): + """ + @summary: Test to Enable and Disable StaticNat for IP Address associated to VPC Network + @Steps: + Step1: Creating a VPC + Step2: Creating a Network under VPC for the user + Step3: Associating an IP Addresses for Network created in step1 + Step4: Launching the VM in network created in step2 + Step5: Enabling the staticNat to IP Associated in Step3 + Step6: Verifying that StaticNat is enabled + Step7: Disabling the staticNat to IP Associated in Step3 + Step8: Verifying that StaticNat is disabled + """ + # Listing all the vpc's for a user + list_vpc_before = VPC.list(self.userapiclient) + # Verifying No VPCs are listed + self.assertIsNone( + list_vpc_before, + "VPC's Listed for newly Created User" + ) + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals( + PASS, + status[0], + "list vpc offering is none" + ) + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone( + vpc_created, + "VPC Creation Failed" + ) + # Listing the vpc for a user after creating a vpc + list_vpc_after = VPC.list(self.userapiclient) + status = validateList(list_vpc_after) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_vpc_after), + "list VPC not equal as expected" + ) + #List network offering for vpc = true + network_offering_vpc_true_list = NetworkOffering.list( + self.userapiclient, + forvpc = "true", + zoneid = self.zone.id, + supportedServices = "SourceNat,PortForwarding,StaticNat", + state = "Enabled" + ) + status = validateList(network_offering_vpc_true_list) + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with PortForwarding") + # Creating network under VPC + network_created = Network.create( + self.userapiclient, + self.services["ntwk"], + networkofferingid = network_offering_vpc_true_list[0].id, + vpcid = vpc_created.id, + zoneid=self.zone.id, + gateway= self.services["ntwk"]["gateway"], + netmask = self.services["ntwk"]["netmask"] + ) + self.assertIsNotNone( + network_created, + "Network is not created" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "list IP Addresses not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_ipaddresses_before), + "list IP Addresses not equal as expected" + ) + # Associating an IP Addresses to VPC created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + vpcid=vpc_created.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + len(list_ipaddresses_before) + 1, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching a Virtual Machine with above created Network + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network_created.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + self.cleanup.append(network_created) + self.cleanup.append(vpc_created) + # Enabling static Nat for Ip Address associated + StaticNATRule.enable( + self.userapiclient, + ipaddressid=associated_ipaddress.ipaddress.id, + virtualmachineid=vm_created.id, + networkid=network_created.id + ) + # Listing Ip Address by id + list_ipaddress = PublicIPAddress.list( + self.userapiclient, + id=associated_ipaddress.ipaddress.id, + listall=self.services["listall"] + ) + status = validateList(list_ipaddress) + self.assertEquals( + PASS, + status[0], + "Failed to List IP Address" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddress), + "Failed to List IP Address" + ) + self.assertEquals( + True, + list_ipaddress[0].isstaticnat, + "Failed to Enable Static Nat" + ) + # Disabling static Nat + StaticNATRule.disable( + self.userapiclient, + ipaddressid=associated_ipaddress.ipaddress.id + ) + # Listing Ip Address by id + list_ipaddress = PublicIPAddress.list( + self.userapiclient, + id=associated_ipaddress.ipaddress.id, + listall=self.services["listall"] + ) + status = validateList(list_ipaddress) + self.assertEquals( + PASS, + status[0], + "Failed to List IP Address" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddress), + "Failed to List IP Address" + ) + self.assertEquals( + False, + list_ipaddress[0].isstaticnat, + "Failed to Disable Static Nat" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_16_create_delete_ipforwardingrule(self): + """ + @summary: Test to list, create and delete IP Forwarding Rules for IP Address + @Steps: + Step1: Creating a Network for the user + Step2: Associating an IP Addresses for Network created in step1 + Step3: Associating one more Ip Address to Network created in step1 + Step4: Launching the VM in network created in step1 + Step5: Enabling the staticNat to IP Associated in Step3 + Step6: Listing IP Forwarding rules + Step7: Verifying no IP Forwarding rules are listed + Step8: Creating a IP Forwarding Rule + Step9: Listing IP Forwarding rules + Step10: Verifying 1 IP Forwarding rule is listed + Step11: Deleting the IP Forwarding rule + Step12: Listing IP Forwarding rules + Step13: Verifying no IP Forwarding rules are listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Vpn", + zoneid=self.zone.id + ) + status = validateList(network_offerings_list) + self.assertEquals( + PASS, + status[0], + "Isolated Network Offerings with sourceNat, Vpn enabled are not found" + ) + # Creating a network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no IP Addresses are listed + self.assertIsNone( + list_ipaddresses_before, + "IP Addresses listed for newly created User" + ) + # Associating an IP Addresses to Network created + associated_ipaddress1 = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress1, + "Failed to Associate IP Address" + ) + # Associating another IP Addresses to Network created + associated_ipaddress2 = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress2, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 2, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Launching a Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Enabling static Nat for Ip Address associated + StaticNATRule.enable( + self.userapiclient, + ipaddressid=associated_ipaddress2.ipaddress.id, + virtualmachineid=vm_created.id, + ) + # Listing Ip Address by id + list_ipaddress = PublicIPAddress.list( + self.userapiclient, + id=associated_ipaddress2.ipaddress.id, + listall=self.services["listall"] + ) + status = validateList(list_ipaddress) + self.assertEquals( + PASS, + status[0], + "Failed to List IP Address" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddress), + "Failed to List IP Address" + ) + self.assertEquals( + True, + list_ipaddress[0].isstaticnat, + "Failed to Enable Static Nat" + ) + # Listing IP Forwarding Rules + list_ipfwdrule_before = StaticNATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress2.ipaddress.id + ) + # Verifying no IP Forwarding Rules are listed + self.assertIsNone( + list_ipfwdrule_before, + "IP Forwardign Rule listed for newly enabled StaticNat IP" + ) + # Creating IP Forwardign Rule + ipfwd_rule = StaticNATRule.createIpForwardingRule( + self.userapiclient, + startport='80', + endport='89', + protocol='tcp', + ipaddressid=associated_ipaddress2.ipaddress.id, + openfirewall=False + ) + self.assertIsNotNone( + ipfwd_rule, + "Failed to create IP Forwarding Rule" + ) + # Listing IP Forwarding Rules + list_ipfwdrule_after = StaticNATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress2.ipaddress.id + ) + status = validateList(list_ipfwdrule_after) + self.assertEquals( + PASS, + status[0], + "Failed to List IP Forwarding Rule after Creation" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipfwdrule_after), + "Failed to List IP Forwarding Rule after Creation" + ) + # Deleting IP Forwarding Rule + ipfwd_rule.delete(self.userapiclient) + # Listing IP Forwarding Rules + list_ipfwdrule_after = StaticNATRule.list( + self.userapiclient, + listall=self.services["listall"], + ipaddressid=associated_ipaddress2.ipaddress.id + ) + # Verifying no IP Forwarding Rules are listed + self.assertIsNone( + list_ipfwdrule_after, + "IP Forwardign Rule listed after deletion" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_17_create_update_autoscalepolicy(self): + """ + @summary: Test to list, create and update Autoscale Policy + @Steps: + Step1: Creating a Network Offering for Supported Service LB with Netscaler + Step2: Create a Network using Network Offering created in Step1 + Step3: Launching a VM using Network created in Step2 + Step4: Associating IP Address for Network created in Step2 + Step5: Listing Counters + Step6: Listing Conditions for the user + Step7: Verifying no Conditions are listed + Step8: Creating a 2 conditions + Step9: Listing conditions again + Step10: Verifying 2 conditions are listed + Step11: Listing Autoscale Policies for User + Step12: Verifying No Autoscale policy is listed + Step13: Creating Autoscale Policy using Condition1 + Step14: Verifying that Autoscale Policy is created with Condition1 + Step15: Listing Autoscale Policies + Step16: Verifying 1 Autoscale Policy is listed + Step17: Updating Autoscale Policy created in step13 with condition2 + Step18: Verifying Autoscale policy is updated with condition2 + """ + # Listing Network Offerings + list_nwoff_before = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + # Creating Network Offerign with LB as Netscalar + nwoff_created = NetworkOffering.create( + self.apiClient, + self.services["nw_off_isolated_netscaler"] + ) + self.assertIsNotNone( + nwoff_created, + "Failed to Create Network Offering with LB sercvice for Netscaler" + ) + # Enable Network offering + nwoff_created.update(self.apiClient, state='Enabled') + # Listing Network Offerings again + list_nwoff_after = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + self.assertEquals( + len(list_nwoff_before)+1, + len(list_nwoff_after), + "Failed to create Network Offering" + ) + # Creating a Network Using the Network Offering + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=nwoff_created.id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + self.cleanup.append(nwoff_created) + # Launching a Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed while launching a VM" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_before), + "IP Addresses Association Failed while launching a VM" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 2, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Counters + list_counters = Autoscale.listCounters( + self.userapiclient, + ) + status = validateList(list_counters) + self.assertEquals( + PASS, + status[0], + "Failed to list counters" + ) + # Listing Conditions + list_conditions_before = Autoscale.listConditions( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNone( + list_conditions_before, + "Listed Conditions for newly created user" + ) + # Creating first Condition + condition_created1 = Autoscale.createCondition( + self.userapiclient, + counterid=list_counters[0].id, + relationaloperator='GT', + threshold='1000' + ) + self.assertIsNotNone( + condition_created1, + "Failed to create Condition" + ) + # Creating second Condition + condition_created2 = Autoscale.createCondition( + self.userapiclient, + counterid=list_counters[0].id, + relationaloperator='GT', + threshold='1500' + ) + self.assertIsNotNone( + condition_created2, + "Failed to create Condition" + ) + # Listing Conditions again + list_conditions_after = Autoscale.listConditions( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_conditions_after) + self.assertEquals( + PASS, + status[0], + "Failed to list Conditions after creation" + ) + # Listing Autoscale policies + list_autoscalepolicies_before = Autoscale.listAutoscalePolicies( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no Autoscale policies are listed + self.assertIsNone( + list_autoscalepolicies_before, + "Autoscale policies listed" + ) + # Creating Autoscale Policy + autoscalepolicy_created = Autoscale.createAutoscalePolicy( + self.userapiclient, + action='scaleup', + conditionids=condition_created1.id, + duration='100', + quiettime='100' + ) + self.assertIsNotNone( + autoscalepolicy_created, + "Failed to create Autoscale VM Policy" + ) + # Verifying autoscalepolicy is created using condition1 + self.assertEquals( + condition_created1.id, + autoscalepolicy_created.conditions[0].id, + "Autoscale Policy not created by given condition" + ) + # Listing Autoscale policies + list_autoscalepolicies_after = Autoscale.listAutoscalePolicies( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_autoscalepolicies_after) + self.assertEquals( + PASS, + status[0], + "Failed to list Autoscale Policy after creation" + ) + self.assertEquals( + 1, + len(list_autoscalepolicies_after), + "Autoscale Policies count is not matching" + ) + # Updating Autoscale Policy + autoscalepolicy_updated = Autoscale.updateAutoscalePolicy( + self.userapiclient, + id=autoscalepolicy_created.id, + conditionids=condition_created2.id, + duration='100', + quiettime='100' + ) + self.assertIsNotNone( + autoscalepolicy_updated, + "Failed to update Autoscale Policy" + ) + # Verifying the Autoscale Policy is updated + self.assertEquals( + condition_created2.id, + autoscalepolicy_updated.conditions[0].id, + "Autoscale Policy not updated to given condition" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_18_create_update_autoscaleprofiles(self): + """ + @summary: Test to list, create and update Autoscale VM Profiles + @Steps: + Step1: Creating a Network Offering for Supported Service LB with Netscaler + Step2: Create a Network using Network Offering created in Step1 + Step3: Launching a VM using Network created in Step2 + Step4: Associating IP Address for Network created in Step2 + Step5: Listing Available Service Offerings + Step6: Listing all types of templates + Step7: Verifying only featured templates are listed for newly created user + Step8: Listing autoscale vm profiles + Step9: Verifying no Autoscale VM Profiles are listed + Step10: Creating a Autoscale VM Profile + Step11: Listing Autoscale VM Profile + Step12: Verifying 1 Autoscale VM Profile is listed + Step13: Listing Autoscale VM Profile by id + Step14: Verifying details of the created autoscale vm profile are matching with listed autoscal vm profile + Step15: Updating Autoscale VM profile with destroy vm grace period + Step16: Verifying that Autoscale VM is updated + """ + # Listing Network Offerings + list_nwoff_before = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + # Creating Network Offerign with LB as Netscalar + nwoff_created = NetworkOffering.create( + self.apiClient, + self.services["nw_off_isolated_netscaler"] + ) + self.assertIsNotNone( + nwoff_created, + "Failed to Create Network Offering with LB sercvice for Netscaler" + ) + # Enable Network offering + nwoff_created.update(self.apiClient, state='Enabled') + # Listing Network Offerings again + list_nwoff_after = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + self.assertEquals( + len(list_nwoff_before)+1, + len(list_nwoff_after), + "Failed to create Network Offering" + ) + # Creating a Network Using the Network Offering + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=nwoff_created.id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + self.cleanup.append(nwoff_created) + # Launching a Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed while launching a VM" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_before), + "IP Addresses Association Failed while launching a VM" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 2, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Service Offerings + list_service_offerings = ServiceOffering.list( + self.userapiclient, + listall=self.services["listall"], + issystem='false' + ) + status = validateList(list_service_offerings) + self.assertEquals( + PASS, + status[0], + "Failed to list Service Offerings" + ) + # Listing Users + list_users = User.list( + self.apiClient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_users) + self.assertEquals( + PASS, + status[0], + "Failed to list Users" + ) + # Listing Featured Templates + list_templates_featured = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter="featured", + zoneid=self.zone.id + ) + status = validateList(list_templates_featured) + self.assertEquals( + PASS, + status[0], + "Failed to list Featured Templates" + ) + # Listing Community Templates + list_templates_community = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter="community", + zoneid=self.zone.id + ) + self.assertIsNone( + list_templates_community, + "Community Templates listed for newly created User" + ) + # Listing selfexecutable Templates + list_templates_selfexecutable = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter="selfexecutable", + zoneid=self.zone.id + ) + self.assertIsNone( + list_templates_selfexecutable, + "Self Executable Templates listed for newly created User" + ) + # Listing Autoscale VM Profiles + list_autoscalevm_profiles_before = Autoscale.listAutoscaleVmPofiles( + self.userapiclient, + listall=self.services["listall"] + ) + self.assertIsNone( + list_autoscalevm_profiles_before, + "Autoscale VM Profiles listed" + ) + # Creating Autoscale VM Profile + counterparam = { "snmpcommunity": "public", "snmpport": "161"} + autoscalevm_profile = Autoscale.createAutoscaleVmProfile( + self.userapiclient, + serviceofferingid=list_service_offerings[0].id, + zoneid=self.zone.id, + templateid=list_templates_featured[0].id, + autoscaleuserid=list_users[0].id, + destroyvmgraceperiod='100', + counterparam=counterparam + ) + self.assertIsNotNone( + autoscalevm_profile, + "Failed to create Autoscale VM Profile" + ) + # Listing Autoscale VM Profiles + list_autoscalevm_profiles_after = Autoscale.listAutoscaleVmPofiles( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_autoscalevm_profiles_after) + self.assertEquals( + PASS, + status[0], + "Failed to list Autoscale VM Profile after creation" + ) + # Verifying only 1 autoscale vm profile is created + self.assertEquals( + 1, + len(list_autoscalevm_profiles_after), + "Count of Autoscale VM profiles listed is not matching" + ) + # Listing the Autoscale VM Profile by id + list_autoscalvmprofile = Autoscale.listAutoscaleVmPofiles( + self.userapiclient, + listall=self.services["listall"], + id=autoscalevm_profile.id + ) + status = validateList(list_autoscalvmprofile) + self.assertEquals( + PASS, + status[0], + "Failed to list Autoscale VM Profile by Id after creation" + ) + # Verifying details of the listed Autoscale VM Profile + # Creating expected and actual values dictionaries + expected_dict = { + "id":autoscalevm_profile.id, + "account":self.account.name, + "domainid":self.domain.id, + "autoscaleuserid":list_users[0].id, + "serviceofferingid":list_service_offerings[0].id, + "zoneid":self.zone.id, + "templateid":list_templates_featured[0].id, + "destroyvmgraceperiod":autoscalevm_profile.destroyvmgraceperiod + } + actual_dict = { + "id":list_autoscalvmprofile[0].id, + "account":list_autoscalvmprofile[0].account, + "domainid":list_autoscalvmprofile[0].domainid, + "autoscaleuserid":list_autoscalvmprofile[0].autoscaleuserid, + "serviceofferingid":list_autoscalvmprofile[0].serviceofferingid, + "zoneid":list_autoscalvmprofile[0].zoneid, + "templateid":list_autoscalvmprofile[0].templateid, + "destroyvmgraceperiod":list_autoscalvmprofile[0].destroyvmgraceperiod + } + autoscalevm_profile_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + autoscalevm_profile_status, + "Created Autoscale VM Profile details are not as expected" + ) + # Updating destroyvmgrageperiod for created Autoscale VM Profile + autoscalevm_profile_updated = Autoscale.updateAutoscaleVMProfile( + self.userapiclient, + id=autoscalevm_profile.id, + autoscaleuserid=list_users[0].id, + destroyvmgraceperiod='200', + templateid=list_templates_featured[0].id, + ) + self.assertIsNotNone( + autoscalevm_profile_updated, + "Failed to update Autoscale VM Profile" + ) + # Verifyign that Destroy VM Graceperiod is updated in autoscale VM Profile + self.assertEquals( + 200, + autoscalevm_profile_updated.destroyvmgraceperiod, + "Failed to update destroy vm grace period" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + + @attr(tags=["advanced", "provisioning"]) + def test_19_create_update_autoscalevmgroup(self): + """ + @summary: Test to list, create, update, enable, disable Autoscale VM Profiles + @Steps: + Step1: Creating a Network Offering for Supported Service LB with Netscaler + Step2: Create a Network using Network Offering created in Step1 + Step3: Launching a VM using Network created in Step2 + Step4: Associating IP Address for Network created in Step2 + Step5: Creating Scaleup condition and scaleup policy + Step6: Creating Scaledown condition and scaledown policy + Step7: Creating Autoscale VM profile + Step8: Creating Load Balancer Rule + Step9: Listing Autoscale Vm groups and verifying no Autoscale VM groups are listed + Step10: Creating Autoscale VM Group and verifying it was created + Step11: Listing Autoscale Vm groups and verifying 1 Autoscale VM groups is listed + Step12: Disabling Autoscale VM group and verifying it was disabled + Step13: Updating Autoscale VM group and verifying it was updated + Step14: Enabling Autoscale VM group and verifying it was enabled + """ + # Listing Network Offerings + list_nwoff_before = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + # Creating Network Offerign with LB as Netscalar + nwoff_created = NetworkOffering.create( + self.apiClient, + self.services["nw_off_isolated_netscaler"] + ) + self.assertIsNotNone( + nwoff_created, + "Failed to Create Network Offering with LB sercvice for Netscaler" + ) + # Enable Network offering + nwoff_created.update(self.apiClient, state='Enabled') + # Listing Network Offerings again + list_nwoff_after = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + self.assertEquals( + len(list_nwoff_before)+1, + len(list_nwoff_after), + "Failed to create Network Offering" + ) + # Creating a Network Using the Network Offering + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=nwoff_created.id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + self.cleanup.append(nwoff_created) + # Launching a Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed while launching a VM" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_before), + "IP Addresses Association Failed while launching a VM" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 2, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" + ) + # Listing Users + list_users = User.list( + self.apiClient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_users) + self.assertEquals( + PASS, + status[0], + "Failed to list Users" + ) + # Listing counters + list_counters = Autoscale.listCounters(self.userapiclient) + status = validateList(list_counters) + self.assertEquals( + PASS, + status[0], + "Failed to list Counters" + ) + # Create Condition for scaleup Vm Policy + condition_scaleup = Autoscale.createCondition( + self.userapiclient, + counterid=list_counters[0].id, + relationaloperator='GT', + threshold='40' + ) + self.assertIsNotNone( + condition_scaleup, + "Failed to create Scaleup Condition" + ) + # Creating scaleup Vm Policy + scaleup_policy = Autoscale.createAutoscalePolicy( + self.userapiclient, + action='scaleup', + conditionids=condition_scaleup.id, + duration='40', + quiettime='300' + ) + self.assertIsNotNone( + scaleup_policy, + "Failed to create Scaleup VM Policy" + ) + # Create Condition for scaledown Vm Policy + condition_scaledown = Autoscale.createCondition( + self.userapiclient, + counterid=list_counters[0].id, + relationaloperator='GT', + threshold='10' + ) + self.assertIsNotNone( + condition_scaledown, + "Failed to create Scaledown Condition" + ) + # Creating scaledown Vm Policy + scaledown_policy = Autoscale.createAutoscalePolicy( + self.userapiclient, + action='scaledown', + conditionids=condition_scaledown.id, + duration='40', + quiettime='300' + ) + self.assertIsNotNone( + scaledown_policy, + "Failed to create Scaledown VM Policy" + ) + counterparam = { "snmpcommunity": "public", "snmpport": "161"} + # Create Autoscale VM Profile + vmprofile = Autoscale.createAutoscaleVmProfile( + self.userapiclient, + serviceofferingid=self.service_offering.id, + zoneid=self.zone.id, + templateid=self.template.id, + autoscaleuserid=list_users[0].id, + destroyvmgraceperiod='30', + counterparam=counterparam + ) + self.assertIsNotNone( + vmprofile, + "Failed to create Autoscale Vm Profile" + ) + self.services["lbrule"]["openfirewall"] = False + # Creating Load Balancer Rule + lbrule = LoadBalancerRule.create( + self.userapiclient, + self.services["lbrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + accountid=self.account.name, + networkid=network.id, + domainid=self.domain.id + ) + self.assertIsNotNone( + lbrule, + "Failed to create Load Balancer Rule" + ) + # Listing Autoscale VM Groups + list_vmgroup_before = Autoscale.listAutoscaleVmGroup( + self.userapiclient, + listall=self.services["listall"], + lbruleid=lbrule.id + ) + # Verifying No Autoscale VM Groups are listed + self.assertIsNone( + list_vmgroup_before, + "Listed Autoscale VM Groups for newly created LB Rule" + ) + # Creating Autoscale VM Group + vmgroup = Autoscale.createAutoscaleVmGroup( + self.userapiclient, + lbruleid=lbrule.id, + minmembers='3', + maxmembers='10', + scaledownpolicyids=scaledown_policy.id, + scaleuppolicyids=scaleup_policy.id, + vmprofileid=vmprofile.id, + interval='30' + ) + self.assertIsNotNone( + vmgroup, + "Failed to create Autoscale VM Group" + ) + # Listing Autoscale VM Groups + list_vmgroup_after = Autoscale.listAutoscaleVmGroup( + self.userapiclient, + listall=self.services["listall"], + lbruleid=lbrule.id + ) + status = validateList(list_vmgroup_after) + self.assertEquals( + PASS, + status[0], + "Failed to list Autoscale VM group after creation" + ) + # Verifying only 1 Autoscale VM group is listed + self.assertEquals( + 1, + len(list_vmgroup_after), + "Autoscale VM group list count is not matching" + ) + # Disabling Autoscale VM group + vmgroup_disabled = Autoscale.disableAutoscaleVmGroup( + self.userapiclient, + id=vmgroup.id + ) + self.assertIsNotNone( + vmgroup_disabled, + "Failed to disable Autoscale VM group" + ) + # Verifyign the state of the VM Group afte renabling + self.assertEquals( + "disabled", + vmgroup_disabled.state, + "Disabled VM Group state is not matching" + ) + # Updating Autoscale VM Group + vmgroup_updated = Autoscale.updateAutoscaleVMGroup( + self.userapiclient, + id=vmgroup.id, + minmembers='3', + maxmembers='10', + scaledownpolicyids=scaledown_policy.id, + scaleuppolicyids=scaleup_policy.id, + interval='40' + ) + self.assertIsNotNone( + vmgroup_updated, + "Failed to update Autoscale VM group" + ) + self.assertEquals( + 40, + vmgroup_updated.interval, + "Updated Autoscale VM group interval value is not matching" + ) + # Enabling Autoscale VM group + vmgroup_enabled = Autoscale.enableAutoscaleVmGroup( + self.userapiclient, + id=vmgroup.id + ) + self.assertIsNotNone( + vmgroup_enabled, + "Failed to enable Autoscale VM group" + ) + # Verifyign the state of the VM Group afte renabling + self.assertEquals( + "enabled", + vmgroup_enabled.state, + "Enabled VM Group state is not matching" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + return + \ No newline at end of file diff --git a/test/integration/component/test_escalations_isos.py b/test/integration/component/test_escalations_isos.py new file mode 100644 index 0000000000..387a681a03 --- /dev/null +++ b/test/integration/component/test_escalations_isos.py @@ -0,0 +1,783 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackAPI import (createVolume, + createTemplate) +from marvin.lib.base import (Volume, + Iso, + VirtualMachine, + Template, + Snapshot, + SecurityGroup, + Account, + Zone, + Network, + NetworkOffering, + DiskOffering, + ServiceOffering, + VmSnapshot, + SnapshotPolicy, + SSHKeyPair, + Resources, + Configurations, + VpnCustomerGateway, + Hypervisor, + VpcOffering, + VPC, + NetworkACL) +from marvin.lib.common import (get_zone, + get_domain, + get_template, + list_os_types) +from marvin.lib.utils import (validateList, + cleanup_resources, + random_gen) +from marvin.codes import (PASS, FAIL, EMPTY_LIST) +from nose.plugins.attrib import attr +import time + +class TestIsos(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestIsos, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + cls.hypervisor = cls.testClient.getHypervisorInfo() + cls.services['mode'] = cls.zone.networktype + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls._cleanup.append(cls.account) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_01_list_isos_pagination(self): + """ + @Desc: Test to List ISO's pagination + @steps: + Step1: Listing all the ISO's for a user + Step2: Verifying that no ISO's are listed + Step3: Creating (page size + 1) number of ISO's + Step4: Listing all the ISO's again for a user + Step5: Verifying that list size is (page size + 1) + Step6: Listing all the ISO's in page1 + Step7: Verifying that list size is (page size) + Step8: Listing all the ISO's in page2 + Step9: Verifying that list size is 1 + Step10: Listing the ISO's by Id + Step11: Verifying if the ISO is downloaded and ready. + If yes the continuing + If not waiting and checking for iso to be ready till timeout + Step12: Deleting the ISO present in page 2 + Step13: Listing all the ISO's in page2 + Step14: Verifying that no ISO's are listed + """ + # Listing all the ISO's for a User + list_iso_before = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"] + ) + # Verifying that no ISOs are listed + self.assertIsNone( + list_iso_before, + "ISOs listed for newly created User" + ) + self.services["iso"]["zoneid"] = self.zone.id + # Creating pagesize + 1 number of ISO's + for i in range(0, (self.services["pagesize"] + 1)): + iso_created = Iso.create( + self.userapiclient, + self.services["iso"] + ) + self.assertIsNotNone( + iso_created, + "ISO creation failed" + ) + if(i < self.services["pagesize"]): + self.cleanup.append(iso_created) + + # Listing all the ISO's for a User + list_iso_after = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"] + ) + status = validateList(list_iso_after) + self.assertEquals( + PASS, + status[0], + "ISO's creation failed" + ) + # Verifying that list size is pagesize + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_iso_after), + "Failed to create pagesize + 1 number of ISO's" + ) + # Listing all the ISO's in page 1 + list_iso_page1 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_iso_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list ISO's in page 1" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_iso_page1), + "Size of ISO's in page 1 is not matching" + ) + # Listing all the Templates in page 2 + list_iso_page2 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_iso_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list ISo's in page 2" + ) + # Verifying the list size to be equal to 1 + self.assertEquals( + 1, + len(list_iso_page2), + "Size of ISO's in page 2 is not matching" + ) + # Verifying the state of the ISO to be ready. If not waiting for state to become ready + iso_ready = False + count = 0 + while iso_ready is False: + list_iso = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + id=iso_created.id + ) + status = validateList(list_iso) + self.assertEquals( + PASS, + status[0], + "Failed to list ISO by Id" + ) + if list_iso[0].isready is True: + iso_ready = True + elif (str(list_iso[0].status) == "Error"): + self.fail("Created ISO is in Errored state") + break + elif count > 10: + self.fail("Timed out before ISO came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Deleting the ISO present in page 2 + Iso.delete( + iso_created, + self.userapiclient + ) + # Listing all the ISO's in page 2 again + list_iso_page2 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that there are no ISO's listed + self.assertIsNone( + list_iso_page2, + "ISO's not deleted from page 2" + ) + del self.services["iso"]["zoneid"] + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_02_download_iso(self): + """ + @Desc: Test to Download ISO + @steps: + Step1: Listing all the ISO's for a user + Step2: Verifying that no ISO's are listed + Step3: Creating an ISO + Step4: Listing all the ISO's again for a user + Step5: Verifying that list size is 1 + Step6: Verifying if the ISO is in ready state. + If yes the continuing + If not waiting and checking for template to be ready till timeout + Step7: Downloading the ISO (Extract) + Step8: Verifying the details of downloaded ISO + """ + # Listing all the ISO's for a User + list_iso_before = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"] + ) + # Verifying that no ISOs are listed + self.assertIsNone( + list_iso_before, + "ISOs listed for newly created User" + ) + self.services["iso"]["zoneid"] = self.zone.id + self.services["iso"]["isextractable"] = True + # Creating an ISO's + iso_created = Iso.create( + self.userapiclient, + self.services["iso"] + ) + self.assertIsNotNone( + iso_created, + "ISO creation failed" + ) + self.cleanup.append(iso_created) + # Listing all the ISO's for a User + list_iso_after = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"] + ) + status = validateList(list_iso_after) + self.assertEquals( + PASS, + status[0], + "ISO's creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_iso_after), + "Failed to create an ISO's" + ) + # Verifying the state of the ISO to be ready. If not waiting for state to become ready + iso_ready = False + count = 0 + while iso_ready is False: + list_iso = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + id=iso_created.id + ) + status = validateList(list_iso) + self.assertEquals( + PASS, + status[0], + "Failed to list ISO by Id" + ) + if list_iso[0].isready is True: + iso_ready = True + elif (str(list_iso[0].status) == "Error"): + self.fail("Created ISO is in Errored state") + break + elif count > 10: + self.fail("Timed out before ISO came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Downloading the ISO + download_iso = Iso.extract( + self.userapiclient, + iso_created.id, + mode="HTTP_DOWNLOAD", + zoneid=self.zone.id + ) + self.assertIsNotNone( + download_iso, + "Download ISO failed" + ) + # Verifying the details of downloaded ISO + self.assertEquals( + "DOWNLOAD_URL_CREATED", + download_iso.state, + "Download URL not created for ISO" + ) + self.assertIsNotNone( + download_iso.url, + "Download URL not created for ISO" + ) + self.assertEquals( + iso_created.id, + download_iso.id, + "Download ISO details are not same as ISO created" + ) + del self.services["iso"]["zoneid"] + del self.services["iso"]["isextractable"] + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_03_edit_iso_details(self): + """ + @Desc: Test to Edit ISO name, displaytext, OSType + @steps: + Step1: Listing all the ISO's for a user + Step2: Verifying that no ISO's are listed + Step3: Creating an ISO + Step4: Listing all the ISO's again for a user + Step5: Verifying that list size is 1 + Step6: Verifying if the ISO is in ready state. + If yes the continuing + If not waiting and checking for template to be ready till timeout + Step7: Editing the ISO's name, displaytext + Step8: Verifying that ISO name and displaytext are edited + Step9: Editing the ISO name, displaytext, ostypeid + Step10: Verifying that ISO name, displaytext and ostypeid are edited + """ + # Listing all the ISO's for a User + list_iso_before = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"] + ) + # Verifying that no ISOs are listed + self.assertIsNone( + list_iso_before, + "ISOs listed for newly created User" + ) + self.services["iso"]["zoneid"] = self.zone.id + # Creating an ISO's + iso_created = Iso.create( + self.userapiclient, + self.services["iso"] + ) + self.assertIsNotNone( + iso_created, + "ISO creation failed" + ) + self.cleanup.append(iso_created) + # Listing all the ISO's for a User + list_iso_after = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"] + ) + status = validateList(list_iso_after) + self.assertEquals( + PASS, + status[0], + "ISO's creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_iso_after), + "Failed to create an ISO's" + ) + # Verifying the state of the ISO to be ready. If not waiting for state to become ready + iso_ready = False + count = 0 + while iso_ready is False: + list_iso = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + id=iso_created.id + ) + status = validateList(list_iso) + self.assertEquals( + PASS, + status[0], + "Failed to list ISO by Id" + ) + if list_iso[0].isready is True: + iso_ready = True + elif (str(list_iso[0].status) == "Error"): + self.fail("Created ISO is in Errored state") + break + elif count > 10: + self.fail("Timed out before ISO came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Editing the ISO name, displaytext + edited_iso = Iso.update( + iso_created, + self.userapiclient, + name="NewISOName", + displaytext="NewISODisplayText" + ) + self.assertIsNotNone( + edited_iso, + "Editing ISO failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":iso_created.id, + "name":"NewISOName", + "displaytest":"NewISODisplayText", + "account":iso_created.account, + "domainid":iso_created.domainid, + "isfeatured":iso_created.isfeatured, + "ostypeid":iso_created.ostypeid, + "ispublic":iso_created.ispublic, + } + actual_dict = { + "id":edited_iso.id, + "name":edited_iso.name, + "displaytest":edited_iso.displaytext, + "account":edited_iso.account, + "domainid":edited_iso.domainid, + "isfeatured":edited_iso.isfeatured, + "ostypeid":edited_iso.ostypeid, + "ispublic":edited_iso.ispublic, + } + edit_iso_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_iso_status, + "Edited ISO details are not as expected" + ) + # Editing the ISO name, displaytext, ostypeid + ostype_list = list_os_types(self.userapiclient) + status = validateList(ostype_list) + self.assertEquals( + PASS, + status[0], + "Failed to list OS Types" + ) + for i in range(0, len(ostype_list)): + if ostype_list[i].id != iso_created.ostypeid: + newostypeid = ostype_list[i].id + break + + edited_iso = Iso.update( + iso_created, + self.userapiclient, + name=iso_created.name, + displaytext=iso_created.displaytext, + ostypeid=newostypeid + ) + self.assertIsNotNone( + edited_iso, + "Editing ISO failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":iso_created.id, + "name":iso_created.name, + "displaytest":iso_created.displaytext, + "account":iso_created.account, + "domainid":iso_created.domainid, + "isfeatured":iso_created.isfeatured, + "ostypeid":newostypeid, + "ispublic":iso_created.ispublic, + } + actual_dict = { + "id":edited_iso.id, + "name":edited_iso.name, + "displaytest":edited_iso.displaytext, + "account":edited_iso.account, + "domainid":edited_iso.domainid, + "isfeatured":edited_iso.isfeatured, + "ostypeid":edited_iso.ostypeid, + "ispublic":edited_iso.ispublic, + } + edit_iso_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_iso_status, + "Edited ISO details are not as expected" + ) + del self.services["iso"]["zoneid"] + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_04_copy_iso(self): + """ + @Desc: Test to copy ISO from one zone to another + @steps: + Step1: Listing Zones available for a user + Step2: Verifying if the zones listed are greater than 1. + If Yes continuing. + If not halting the test. + Step3: Listing all the ISO's for a user in zone1 + Step4: Verifying that no ISO's are listed + Step5: Listing all the ISO's for a user in zone2 + Step6: Verifying that no ISO's are listed + Step7: Creating an ISO in zone 1 + Step8: Listing all the ISO's again for a user in zone1 + Step9: Verifying that list size is 1 + Step10: Listing all the ISO's for a user in zone2 + Step11: Verifying that no ISO's are listed + Step12: Copying the ISO created in step7 from zone1 to zone2 + Step13: Listing all the ISO's for a user in zone2 + Step14: Verifying that list size is 1 + Step15: Listing all the ISO's for a user in zone1 + Step16: Verifying that list size is 1 + """ + # Listing Zones available for a user + zones_list = Zone.list( + self.userapiclient, + available=True + ) + status = validateList(zones_list) + self.assertEquals( + PASS, + status[0], + "Failed to list Zones" + ) + if not len(zones_list) > 1: + self.fail("Enough zones doesnot exists to copy iso") + else: + # Listing all the ISO's for a User in Zone 1 + list_isos_zone1 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + zoneid=zones_list[0].id + ) + # Verifying that no ISO's are listed + self.assertIsNone( + list_isos_zone1, + "ISO's listed for newly created User in Zone1" + ) + # Listing all the ISO's for a User in Zone 2 + list_isos_zone2 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + zoneid=zones_list[1].id + ) + # Verifying that no ISO's are listed + self.assertIsNone( + list_isos_zone2, + "ISO's listed for newly created User in Zone2" + ) + self.services["iso"]["zoneid"] = zones_list[0].id + # Creating an ISO in Zone 1 + iso_created = Iso.create( + self.userapiclient, + self.services["iso"] + ) + self.assertIsNotNone( + iso_created, + "ISO creation failed" + ) + self.cleanup.append(iso_created) + # Listing all the ISO's for a User in Zone 1 + list_isos_zone1 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + zoneid=zones_list[0].id + ) + status = validateList(list_isos_zone1) + self.assertEquals( + PASS, + status[0], + "ISO creation failed in Zone1" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_isos_zone1), + "Failed to create a Template" + ) + # Listing all the ISO's for a User in Zone 2 + list_isos_zone2 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + zoneid=zones_list[1].id + ) + # Verifying that no ISO's are listed + self.assertIsNone( + list_isos_zone2, + "ISO's listed for newly created User in Zone2" + ) + # Verifying the state of the ISO to be ready. If not waiting for state to become ready + iso_ready = False + count = 0 + while iso_ready is False: + list_iso = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + id=iso_created.id + ) + status = validateList(list_iso) + self.assertEquals( + PASS, + status[0], + "Failed to list ISO by Id" + ) + if list_iso[0].isready is True: + iso_ready = True + elif (str(list_iso[0].status) == "Error"): + self.fail("Created ISO is in Errored state") + break + elif count > 10: + self.fail("Timed out before ISO came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Copying the ISO from Zone1 to Zone2 + copied_iso = Iso.copy( + self.userapiclient, + iso_created.id, + sourcezoneid=iso_created.zoneid, + destzoneid=zones_list[1].id + ) + self.assertIsNotNone( + copied_iso, + "Copying ISO from Zone1 to Zone2 failed" + ) + # Listing all the ISO's for a User in Zone 1 + list_isos_zone1 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + zoneid=zones_list[0].id + ) + status = validateList(list_isos_zone1) + self.assertEquals( + PASS, + status[0], + "ISO creation failed in Zone1" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_isos_zone1), + "Failed to create a Template" + ) + # Listing all the ISO's for a User in Zone 2 + list_isos_zone2 = Iso.list( + self.userapiclient, + listall=self.services["listall"], + isofilter=self.services["templatefilter"], + zoneid=zones_list[1].id + ) + status = validateList(list_isos_zone2) + self.assertEquals( + PASS, + status[0], + "ISO failed to copy into Zone2" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_isos_zone2), + "ISO failed to copy into Zone2" + ) + self.assertNotEquals( + "Connection refused", + list_isos_zone2[0].status, + "Failed to copy ISO" + ) + self.assertEquals( + True, + list_isos_zone2[0].isready, + "Failed to copy ISO" + ) + del self.services["iso"]["zoneid"] + return \ No newline at end of file diff --git a/test/integration/component/test_escalations_securitygroups.py b/test/integration/component/test_escalations_securitygroups.py new file mode 100644 index 0000000000..8934088774 --- /dev/null +++ b/test/integration/component/test_escalations_securitygroups.py @@ -0,0 +1,588 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackAPI import (createVolume, + createTemplate) +from marvin.lib.base import (Volume, + Iso, + VirtualMachine, + Template, + Snapshot, + SecurityGroup, + Account, + Zone, + Network, + NetworkOffering, + DiskOffering, + ServiceOffering, + VmSnapshot, + SnapshotPolicy, + SSHKeyPair, + Resources, + Configurations, + VpnCustomerGateway, + Hypervisor, + VpcOffering, + VPC, + NetworkACL) +from marvin.lib.common import (get_zone, + get_domain, + get_template, + list_os_types) +from marvin.lib.utils import (validateList, + cleanup_resources, + random_gen) +from marvin.codes import (PASS, FAIL, EMPTY_LIST) +from nose.plugins.attrib import attr +import time + +class TestSecurityGroups(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestSecurityGroups, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + cls.services['mode'] = cls.zone.networktype + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls._cleanup.append(cls.account) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["basic", "provisioning"]) + def test_01_list_securitygroups_pagination(self): + """ + @Desc: Test to List Security Groups pagination + @steps: + Step1: Listing all the Security Groups for a user + Step2: Verifying that list size is 1 + Step3: Creating (page size) number of Security Groups + Step4: Listing all the Security Groups again for a user + Step5: Verifying that list size is (page size + 1) + Step6: Listing all the Security Groups in page1 + Step7: Verifying that list size is (page size) + Step8: Listing all the Security Groups in page2 + Step9: Verifying that list size is 1 + Step10: Deleting the Security Group present in page 2 + Step11: Listing all the Security Groups in page2 + Step12: Verifying that no security groups are listed + """ + # Listing all the Security Groups for a User + list_securitygroups_before = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying that default security group is created + status = validateList(list_securitygroups_before) + self.assertEquals( + PASS, + status[0], + "Default Security Groups creation failed" + ) + # Verifying the size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_before), + "Count of Security Groups list is not matching" + ) + # Creating pagesize number of security groups + for i in range(0, (self.services["pagesize"])): + securitygroup_created = SecurityGroup.create( + self.userapiclient, + self.services["security_group"], + account=self.account.name, + domainid=self.domain.id, + description=self.services["security_group"]["name"] + ) + self.assertIsNotNone( + securitygroup_created, + "Security Group creation failed" + ) + if (i < self.services["pagesize"]): + self.cleanup.append(securitygroup_created) + + # Listing all the security groups for user again + list_securitygroups_after = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_securitygroups_after) + self.assertEquals( + PASS, + status[0], + "Security Groups creation failed" + ) + # Verifying that list size is pagesize + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_securitygroups_after), + "Failed to create pagesize + 1 number of Security Groups" + ) + # Listing all the security groups in page 1 + list_securitygroups_page1 = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_securitygroups_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list security groups in page 1" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_securitygroups_page1), + "Size of security groups in page 1 is not matching" + ) + # Listing all the security groups in page 2 + list_securitygroups_page2 = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_securitygroups_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list security groups in page 2" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + 1, + len(list_securitygroups_page2), + "Size of security groups in page 2 is not matching" + ) + # Deleting the security group present in page 2 + SecurityGroup.delete( + securitygroup_created, + self.userapiclient) + # Listing all the security groups in page 2 again + list_securitygroups_page2 = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that there are no security groups listed + self.assertIsNone( + list_securitygroups_page2, + "Security Groups not deleted from page 2" + ) + return + + @attr(tags=["basic", "provisioning"]) + def test_02_securitygroups_authorize_revoke_ingress(self): + """ + @Desc: Test to Authorize and Revoke Ingress for Security Group + @steps: + Step1: Listing all the Security Groups for a user + Step2: Verifying that list size is 1 + Step3: Creating a Security Groups + Step4: Listing all the Security Groups again for a user + Step5: Verifying that list size is 2 + Step6: Authorizing Ingress for the security group created in step3 + Step7: Listing the security groups by passing id of security group created in step3 + Step8: Verifying that list size is 1 + Step9: Verifying that Ingress is authorized to the security group + Step10: Verifying the details of the Ingress rule are as expected + Step11: Revoking Ingress for the security group created in step3 + Step12: Listing the security groups by passing id of security group created in step3 + Step13: Verifying that list size is 1 + Step14: Verifying that Ingress is revoked from the security group + """ + # Listing all the Security Groups for a User + list_securitygroups_before = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying that default security group is created + status = validateList(list_securitygroups_before) + self.assertEquals( + PASS, + status[0], + "Default Security Groups creation failed" + ) + # Verifying the size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_before), + "Count of Security Groups list is not matching" + ) + # Creating a security group + securitygroup_created = SecurityGroup.create( + self.userapiclient, + self.services["security_group"], + account=self.account.name, + domainid=self.domain.id, + description=self.services["security_group"]["name"] + ) + self.assertIsNotNone( + securitygroup_created, + "Security Group creation failed" + ) + self.cleanup.append(securitygroup_created) + + # Listing all the security groups for user again + list_securitygroups_after = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_securitygroups_after) + self.assertEquals( + PASS, + status[0], + "Security Groups creation failed" + ) + # Verifying that list size is 2 + self.assertEquals( + 2, + len(list_securitygroups_after), + "Failed to create Security Group" + ) + # Authorizing Ingress for the security group created in step3 + securitygroup_created.authorize( + self.userapiclient, + self.services["ingress_rule"], + self.account.name, + self.domain.id, + ) + # Listing the security group by Id + list_securitygroups_byid = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + id=securitygroup_created.id, + domainid=self.domain.id + ) + # Verifying that security group is listed + status = validateList(list_securitygroups_byid) + self.assertEquals( + PASS, + status[0], + "Listing of Security Groups by id failed" + ) + # Verifying size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_byid), + "Count of the listing security group by id is not matching" + ) + securitygroup_ingress = list_securitygroups_byid[0].ingressrule + # Validating the Ingress rule + status = validateList(securitygroup_ingress) + self.assertEquals( + PASS, + status[0], + "Security Groups Ingress rule authorization failed" + ) + self.assertEquals( + 1, + len(securitygroup_ingress), + "Security Group Ingress rules count is not matching" + ) + # Verifying the details of the Ingress rule are as expected + #Creating expected and actual values dictionaries + expected_dict = { + "cidr":self.services["ingress_rule"]["cidrlist"], + "protocol":self.services["ingress_rule"]["protocol"], + "startport":self.services["ingress_rule"]["startport"], + "endport":self.services["ingress_rule"]["endport"], + } + actual_dict = { + "cidr":str(securitygroup_ingress[0].cidr), + "protocol":str(securitygroup_ingress[0].protocol.upper()), + "startport":str(securitygroup_ingress[0].startport), + "endport":str(securitygroup_ingress[0].endport), + } + ingress_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + ingress_status, + "Listed Security group Ingress rule details are not as expected" + ) + # Revoking the Ingress rule from Security Group + securitygroup_created.revoke(self.userapiclient, securitygroup_ingress[0].ruleid) + # Listing the security group by Id + list_securitygroups_byid = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + id=securitygroup_created.id, + domainid=self.domain.id + ) + # Verifying that security group is listed + status = validateList(list_securitygroups_byid) + self.assertEquals( + PASS, + status[0], + "Listing of Security Groups by id failed" + ) + # Verifying size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_byid), + "Count of the listing security group by id is not matching" + ) + securitygroup_ingress = list_securitygroups_byid[0].ingressrule + # Verifying that Ingress rule is empty(revoked) + status = validateList(securitygroup_ingress) + self.assertEquals( + EMPTY_LIST, + status[2], + "Security Groups Ingress rule is not revoked" + ) + return + + @attr(tags=["basic", "provisioning"]) + def test_03_securitygroups_authorize_revoke_egress(self): + """ + @Desc: Test to Authorize and Revoke Egress for Security Group + @steps: + Step1: Listing all the Security Groups for a user + Step2: Verifying that list size is 1 + Step3: Creating a Security Groups + Step4: Listing all the Security Groups again for a user + Step5: Verifying that list size is 2 + Step6: Authorizing Egress for the security group created in step3 + Step7: Listing the security groups by passing id of security group created in step3 + Step8: Verifying that list size is 1 + Step9: Verifying that Egress is authorized to the security group + Step10: Verifying the details of the Egress rule are as expected + Step11: Revoking Egress for the security group created in step3 + Step12: Listing the security groups by passing id of security group created in step3 + Step13: Verifying that list size is 1 + Step14: Verifying that Egress is revoked from the security group + """ + # Listing all the Security Groups for a User + list_securitygroups_before = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying that default security group is created + status = validateList(list_securitygroups_before) + self.assertEquals( + PASS, + status[0], + "Default Security Groups creation failed" + ) + # Verifying the size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_before), + "Count of Security Groups list is not matching" + ) + # Creating a security group + securitygroup_created = SecurityGroup.create( + self.userapiclient, + self.services["security_group"], + account=self.account.name, + domainid=self.domain.id, + description=self.services["security_group"]["name"] + ) + self.assertIsNotNone( + securitygroup_created, + "Security Group creation failed" + ) + self.cleanup.append(securitygroup_created) + + # Listing all the security groups for user again + list_securitygroups_after = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_securitygroups_after) + self.assertEquals( + PASS, + status[0], + "Security Groups creation failed" + ) + # Verifying that list size is 2 + self.assertEquals( + 2, + len(list_securitygroups_after), + "Failed to create Security Group" + ) + # Authorizing Egress for the security group created in step3 + securitygroup_created.authorizeEgress( + self.userapiclient, + self.services["ingress_rule"], + self.account.name, + self.domain.id, + ) + # Listing the security group by Id + list_securitygroups_byid = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + id=securitygroup_created.id, + domainid=self.domain.id + ) + # Verifying that security group is listed + status = validateList(list_securitygroups_byid) + self.assertEquals( + PASS, + status[0], + "Listing of Security Groups by id failed" + ) + # Verifying size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_byid), + "Count of the listing security group by id is not matching" + ) + securitygroup_egress = list_securitygroups_byid[0].egressrule + # Validating the Ingress rule + status = validateList(securitygroup_egress) + self.assertEquals( + PASS, + status[0], + "Security Groups Egress rule authorization failed" + ) + self.assertEquals( + 1, + len(securitygroup_egress), + "Security Group Egress rules count is not matching" + ) + # Verifying the details of the Egress rule are as expected + #Creating expected and actual values dictionaries + expected_dict = { + "cidr":self.services["ingress_rule"]["cidrlist"], + "protocol":self.services["ingress_rule"]["protocol"], + "startport":self.services["ingress_rule"]["startport"], + "endport":self.services["ingress_rule"]["endport"], + } + actual_dict = { + "cidr":str(securitygroup_egress[0].cidr), + "protocol":str(securitygroup_egress[0].protocol.upper()), + "startport":str(securitygroup_egress[0].startport), + "endport":str(securitygroup_egress[0].endport), + } + ingress_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + ingress_status, + "Listed Security group Egress rule details are not as expected" + ) + # Revoking the Egress rule from Security Group + securitygroup_created.revokeEgress(self.userapiclient, securitygroup_egress[0].ruleid) + # Listing the security group by Id + list_securitygroups_byid = SecurityGroup.list( + self.userapiclient, + listall=self.services["listall"], + id=securitygroup_created.id, + domainid=self.domain.id + ) + # Verifying that security group is listed + status = validateList(list_securitygroups_byid) + self.assertEquals( + PASS, + status[0], + "Listing of Security Groups by id failed" + ) + # Verifying size of the list is 1 + self.assertEquals( + 1, + len(list_securitygroups_byid), + "Count of the listing security group by id is not matching" + ) + securitygroup_egress = list_securitygroups_byid[0].egressrule + # Verifying that Ingress rule is empty(revoked) + status = validateList(securitygroup_egress) + self.assertEquals( + EMPTY_LIST, + status[2], + "Security Groups Egress rule is not revoked" + ) + return \ No newline at end of file diff --git a/test/integration/component/test_escalations_snapshots.py b/test/integration/component/test_escalations_snapshots.py new file mode 100644 index 0000000000..2367253b58 --- /dev/null +++ b/test/integration/component/test_escalations_snapshots.py @@ -0,0 +1,647 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackAPI import (createVolume, + createTemplate) +from marvin.lib.base import (Volume, + Iso, + VirtualMachine, + Template, + Snapshot, + SecurityGroup, + Account, + Zone, + Network, + NetworkOffering, + DiskOffering, + ServiceOffering, + VmSnapshot, + SnapshotPolicy, + SSHKeyPair, + Resources, + Configurations, + VpnCustomerGateway, + Hypervisor, + VpcOffering, + VPC, + NetworkACL) +from marvin.lib.common import (get_zone, + get_domain, + get_template, + list_os_types) +from marvin.lib.utils import (validateList, + cleanup_resources, + random_gen) +from marvin.codes import (PASS, FAIL, EMPTY_LIST) +from nose.plugins.attrib import attr +import time + +class TestSnapshots(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestSnapshots, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + if cls.zone.localstorageenabled: + cls.storagetype = 'local' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' + cls.services["disk_offering"]["storagetype"] = 'local' + else: + cls.storagetype = 'shared' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' + cls.services["disk_offering"]["storagetype"] = 'shared' + + cls.services['mode'] = cls.zone.networktype + cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.services["custom_volume"]["zoneid"] = cls.zone.id + # Creating Disk offering, Service Offering and Account + cls.disk_offering = DiskOffering.create( + cls.api_client, + cls.services["disk_offering"] + ) + cls._cleanup.append(cls.disk_offering) + cls.service_offering = ServiceOffering.create( + cls.api_client, + cls.services["service_offerings"]["tiny"] + ) + cls._cleanup.append(cls.service_offering) + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls._cleanup.append(cls.account) + # Creating Virtual Machine + cls.virtual_machine = VirtualMachine.create( + cls.userapiclient, + cls.services["virtual_machine"], + accountid=cls.account.name, + domainid=cls.account.domainid, + serviceofferingid=cls.service_offering.id, + ) + cls._cleanup.append(cls.virtual_machine) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_01_list_volume_snapshots_pagination(self): + """ + @Desc: Test to List Volume Snapshots pagination + @steps: + Step1: Listing all the volume snapshots for a user + Step2: Verifying that list size is 0 + Step3: Creating (page size + 1) number of volume snapshots + Step4: Listing all the volume snapshots again for a user + Step5: Verifying that list size is (page size + 1) + Step6: Listing all the volume snapshots in page1 + Step7: Verifying that list size is (page size) + Step8: Listing all the volume snapshots in page2 + Step9: Verifying that list size is 1 + Step10: Deleting the volume snapshot present in page 2 + Step11: Listing all the volume snapshots in page2 + Step12: Verifying that list size is 0 + """ + # Listing all the volume snapshots for a User + list_vol_snaps_before = Snapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying list size is 0 + self.assertIsNone( + list_vol_snaps_before, + "Volume snapshots exists for newly created user" + ) + # Listing the root volumes available for the user + volumes_list = Volume.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(volumes_list) + self.assertEquals( + PASS, + status[0], + "Root volume did not get created while deploying a VM" + ) + # Verifying list size to be 1 + self.assertEquals( + 1, + len(volumes_list), + "More than 1 root volume created for deployed VM" + ) + root_volume = volumes_list[0] + # Creating pagesize + 1 number of volume snapshots + for i in range(0, (self.services["pagesize"] + 1)): + snapshot_created = Snapshot.create( + self.userapiclient, + root_volume.id, + ) + self.assertIsNotNone( + snapshot_created, + "Snapshot creation failed" + ) + self.cleanup.append(snapshot_created) + + # Listing all the volume snapshots for user again + list_vol_snaps_after = Snapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_vol_snaps_after) + self.assertEquals( + PASS, + status[0], + "Volume snapshot creation failed" + ) + # Verifying that list size is pagesize + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_vol_snaps_after), + "Failed to create pagesize + 1 number of Volume snapshots" + ) + # Listing all the volume snapshots in page 1 + list_vol_snaps_page1 = Snapshot.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vol_snaps_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list volume snapshots in page 1" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_vol_snaps_page1), + "Size of volume snapshots in page 1 is not matching" + ) + # Listing all the volume snapshots in page 2 + list_vol_snaps_page2 = Snapshot.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vol_snaps_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list volume snapshots in page 2" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + 1, + len(list_vol_snaps_page2), + "Size of volume snapshots in page 2 is not matching" + ) + # Deleting the volume snapshot present in page 2 + Snapshot.delete( + snapshot_created, + self.userapiclient + ) + # Listing all the snapshots in page 2 again + list_vol_snaps_page2 = Snapshot.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that list size is 0 + self.assertIsNone( + list_vol_snaps_page2, + "Volume snapshot not deleted from page 2" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_02_list_volume_snapshots_byid(self): + """ + @Desc: Test to List Volume Snapshots by Id + @Steps: + Step1: Listing all the volume snapshots for a user + Step2: Verifying that list size is 0 + Step3: Creating a volume snapshot + Step4: Listing all the volume snapshots again for a user + Step5: Verifying that list size is 1 + Step6: Listing all the volume snapshots by specifying snapshot id + Step7: Verifying that list size is 1 + Step8: Verifying details of the listed volume snapshot + """ + # Listing all the volume snapshots for a User + list_vol_snaps_before = Snapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying list size is 0 + self.assertIsNone( + list_vol_snaps_before, + "Volume snapshots exists for newly created user" + ) + # Listing the root volumes available for the user + volumes_list = Volume.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(volumes_list) + self.assertEquals( + PASS, + status[0], + "Root volume did not get created while deploying a VM" + ) + # Verifying list size to be 1 + self.assertEquals( + 1, + len(volumes_list), + "More than 1 root volume created for deployed VM" + ) + root_volume = volumes_list[0] + # Creating a volume snapshot + snapshot_created = Snapshot.create( + self.userapiclient, + root_volume.id, + ) + self.assertIsNotNone( + snapshot_created, + "Snapshot creation failed" + ) + self.cleanup.append(snapshot_created) + # Listing all the volume snapshots for user again + list_vol_snaps_after = Snapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_vol_snaps_after) + self.assertEquals( + PASS, + status[0], + "Volume snapshot creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_vol_snaps_after), + "Failed to create Volume snapshot" + ) + # Listing volume snapshot by id + list_vol_snapshot = Snapshot.list( + self.userapiclient, + listall=self.services["listall"], + id=snapshot_created.id + ) + status = validateList(list_vol_snapshot) + self.assertEquals( + PASS, + status[0], + "Failed to list Volume snapshot by Id" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_vol_snapshot), + "Size of the list volume snapshot by Id is not matching" + ) + # Verifying details of the listed snapshot to be same as snapshot created above + #Creating expected and actual values dictionaries + expected_dict = { + "id":snapshot_created.id, + "name":snapshot_created.name, + "state":snapshot_created.state, + "intervaltype":snapshot_created.intervaltype, + "account":snapshot_created.account, + "domain":snapshot_created.domainid, + "volume":snapshot_created.volumeid + } + actual_dict = { + "id":list_vol_snapshot[0].id, + "name":list_vol_snapshot[0].name, + "state":list_vol_snapshot[0].state, + "intervaltype":list_vol_snapshot[0].intervaltype, + "account":list_vol_snapshot[0].account, + "domain":list_vol_snapshot[0].domainid, + "volume":list_vol_snapshot[0].volumeid + } + vol_snapshot_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + vol_snapshot_status, + "Listed Volume Snapshot details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_03_list_vm_snapshots_pagination(self): + """ + @Desc: Test to List VM Snapshots pagination + @Steps: + Step1: Listing all the VM snapshots for a user + Step2: Verifying that list size is 0 + Step3: Creating (page size + 1) number of VM snapshots + Step4: Listing all the VM snapshots again for a user + Step5: Verifying that list size is (page size + 1) + Step6: Listing all the VM snapshots in page1 + Step7: Verifying that list size is (page size) + Step8: Listing all the VM snapshots in page2 + Step9: Verifying that list size is 1 + Step10: Deleting the VM snapshot present in page 2 + Step11: Listing all the volume snapshots in page2 + Step12: Verifying that list size is 0 + """ + # Listing all the VM snapshots for a User + list_vm_snaps_before = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying list size is 0 + self.assertIsNone( + list_vm_snaps_before, + "VM snapshots exists for newly created user" + ) + # Creating pagesize + 1 number of VM snapshots + for i in range(0, (self.services["pagesize"] + 1)): + snapshot_created = VmSnapshot.create( + self.userapiclient, + self.virtual_machine.id, + ) + self.assertIsNotNone( + snapshot_created, + "Snapshot creation failed" + ) + + # Listing all the VM snapshots for user again + list_vm_snaps_after = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_vm_snaps_after) + self.assertEquals( + PASS, + status[0], + "VM snapshot creation failed" + ) + # Verifying that list size is pagesize + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_vm_snaps_after), + "Failed to create pagesize + 1 number of VM snapshots" + ) + # Listing all the VM snapshots in page 1 + list_vm_snaps_page1 = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vm_snaps_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list vm snapshots in page 1" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_vm_snaps_page1), + "Size of vm snapshots in page 1 is not matching" + ) + # Listing all the vm snapshots in page 2 + list_vm_snaps_page2 = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vm_snaps_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list vm snapshots in page 2" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + 1, + len(list_vm_snaps_page2), + "Size of vm snapshots in page 2 is not matching" + ) + # Deleting the vm snapshot present in page 2 + VmSnapshot.deleteVMSnapshot( + self.userapiclient, + snapshot_created.id + ) + # Listing all the snapshots in page 2 again + list_vm_snaps_page2 = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that list size is 0 + self.assertIsNone( + list_vm_snaps_page2, + "VM snapshot not deleted from page 2" + ) + # Deleting all the existing VM snapshots + list_vm_snaps = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vm_snaps) + self.assertEquals( + PASS, + status[0], + "All VM snapshots deleted" + ) + # Verifying that list size is equal to page size + self.assertEquals( + self.services["pagesize"], + len(list_vm_snaps), + "VM Snapshots count is not matching" + ) + # Deleting all the existing VM snapshots + for i in range(0, len(list_vm_snaps)): + VmSnapshot.deleteVMSnapshot( + self.userapiclient, + list_vm_snaps[i].id + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_04_list_vm_snapshots_byid(self): + """ + @summary: Test to List VM Snapshots by Id + + Step1: Listing all the VM snapshots for a user + Step2: Verifying that list size is 0 + Step3: Creating a VM snapshot + Step4: Listing all the VM snapshots again for a user + Step5: Verifying that list size is 1 + Step6: Listing all the VM snapshots by specifying snapshot id + Step7: Verifying that list size is 1 + Step8: Verifying details of the listed VM snapshot + """ + # Listing all the VM snapshots for a User + list_vm_snaps_before = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying list size is 0 + self.assertIsNone( + list_vm_snaps_before, + "VM snapshots exists for newly created user" + ) + # Creating a VM snapshot + snapshot_created = VmSnapshot.create( + self.userapiclient, + self.virtual_machine.id, + ) + self.assertIsNotNone( + snapshot_created, + "Snapshot creation failed" + ) + # Listing all the VM snapshots for user again + list_vm_snaps_after = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_vm_snaps_after) + self.assertEquals( + PASS, + status[0], + "VM snapshot creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_vm_snaps_after), + "Failed to create VM snapshot" + ) + # Listing vm snapshot by id + list_vm_snapshot = VmSnapshot.list( + self.userapiclient, + listall=self.services["listall"], + vmsnapshotid=snapshot_created.id + ) + status = validateList(list_vm_snapshot) + self.assertEquals( + PASS, + status[0], + "Failed to list VM snapshot by Id" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_vm_snapshot), + "Size of the list vm snapshot by Id is not matching" + ) + # Verifying details of the listed snapshot to be same as snapshot created above + #Creating expected and actual values dictionaries + expected_dict = { + "id":snapshot_created.id, + "name":snapshot_created.name, + "state":snapshot_created.state, + "vmid":snapshot_created.virtualmachineid, + } + actual_dict = { + "id":list_vm_snapshot[0].id, + "name":list_vm_snapshot[0].name, + "state":list_vm_snapshot[0].state, + "vmid":list_vm_snapshot[0].virtualmachineid, + } + vm_snapshot_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + vm_snapshot_status, + "Listed VM Snapshot details are not as expected" + ) + return \ No newline at end of file diff --git a/test/integration/component/test_escalations_templates.py b/test/integration/component/test_escalations_templates.py new file mode 100644 index 0000000000..083ba90e32 --- /dev/null +++ b/test/integration/component/test_escalations_templates.py @@ -0,0 +1,944 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackAPI import (createVolume, + createTemplate) +from marvin.lib.base import (Volume, + Iso, + VirtualMachine, + Template, + Snapshot, + SecurityGroup, + Account, + Zone, + Network, + NetworkOffering, + DiskOffering, + ServiceOffering, + VmSnapshot, + SnapshotPolicy, + SSHKeyPair, + Resources, + Configurations, + VpnCustomerGateway, + Hypervisor, + VpcOffering, + VPC, + NetworkACL) +from marvin.lib.common import (get_zone, + get_domain, + get_template, + list_os_types) +from marvin.lib.utils import (validateList, + cleanup_resources, + random_gen) +from marvin.codes import (PASS, FAIL, EMPTY_LIST) +from nose.plugins.attrib import attr +import time + +class TestTemplates(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestTemplates, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + cls.hypervisor = cls.testClient.getHypervisorInfo() + cls.services['mode'] = cls.zone.networktype + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls._cleanup.append(cls.account) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_01_list_templates_pagination(self): + """ + @Desc: Test to List Templates pagination + @steps: + Step1: Listing all the Templates for a user + Step2: Verifying that no Templates are listed + Step3: Creating (page size + 1) number of Templates + Step4: Listing all the Templates again for a user + Step5: Verifying that list size is (page size + 1) + Step6: Listing all the Templates in page1 + Step7: Verifying that list size is (page size) + Step8: Listing all the Templates in page2 + Step9: Verifying that list size is 1 + Step10: Listing the template by Id + Step11: Verifying if the template is downloaded and ready. + If yes the continuing + If not waiting and checking for template to be ready till timeout + Step12: Deleting the Template present in page 2 + Step13: Listing all the Templates in page2 + Step14: Verifying that no Templates are listed + """ + # Listing all the Templates for a User + list_templates_before = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"] + ) + # Verifying that no Templates are listed + self.assertIsNone( + list_templates_before, + "Templates listed for newly created User" + ) + self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" + self.services["template"]["format"] = "VHD" + self.services["template"]["ostype"] = self.services["ostype"] + # Creating pagesize + 1 number of Templates + for i in range(0, (self.services["pagesize"] + 1)): + template_created = Template.register( + self.userapiclient, + self.services["template"], + self.zone.id, + hypervisor=self.hypervisor + ) + self.assertIsNotNone( + template_created, + "Template creation failed" + ) + if(i < self.services["pagesize"]): + self.cleanup.append(template_created) + + # Listing all the Templates for a User + list_templates_after = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"] + ) + status = validateList(list_templates_after) + self.assertEquals( + PASS, + status[0], + "Templates creation failed" + ) + # Verifying that list size is pagesize + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_templates_after), + "Failed to create pagesize + 1 number of Templates" + ) + # Listing all the Templates in page 1 + list_templates_page1 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_templates_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list Templates in page 1" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_templates_page1), + "Size of Templates in page 1 is not matching" + ) + # Listing all the Templates in page 2 + list_templates_page2 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_templates_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list Templates in page 2" + ) + # Verifying the list size to be equal to 1 + self.assertEquals( + 1, + len(list_templates_page2), + "Size of Templates in page 2 is not matching" + ) + # Verifying the state of the template to be ready. If not waiting for state to become ready + template_ready = False + count = 0 + while template_ready is False: + list_template = Template.list( + self.userapiclient, + id=template_created.id, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + ) + status = validateList(list_template) + self.assertEquals( + PASS, + status[0], + "Failed to list Templates by Id" + ) + if list_template[0].isready is True: + template_ready = True + elif (str(list_template[0].status) == "Error"): + self.fail("Created Template is in Errored state") + break + elif count > 10: + self.fail("Timed out before Template came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Deleting the Template present in page 2 + Template.delete( + template_created, + self.userapiclient + ) + # Listing all the Templates in page 2 again + list_templates_page2 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that there are no Templates listed + self.assertIsNone( + list_templates_page2, + "Templates not deleted from page 2" + ) + del self.services["template"]["url"] + del self.services["template"]["format"] + del self.services["template"]["ostype"] + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_02_download_template(self): + """ + @Desc: Test to Download Template + @steps: + Step1: Listing all the Templates for a user + Step2: Verifying that no Templates are listed + Step3: Creating a Templates + Step4: Listing all the Templates again for a user + Step5: Verifying that list size is 1 + Step6: Verifying if the template is in ready state. + If yes the continuing + If not waiting and checking for template to be ready till timeout + Step7: Downloading the template (Extract) + Step8: Verifying that Template is downloaded + """ + # Listing all the Templates for a User + list_templates_before = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"] + ) + # Verifying that no Templates are listed + self.assertIsNone( + list_templates_before, + "Templates listed for newly created User" + ) + self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" + self.services["template"]["format"] = "VHD" + self.services["template"]["ostype"] = self.services["ostype"] + self.services["template"]["isextractable"] = True + # Creating aTemplate + template_created = Template.register( + self.userapiclient, + self.services["template"], + self.zone.id, + hypervisor=self.hypervisor + ) + self.assertIsNotNone( + template_created, + "Template creation failed" + ) + self.cleanup.append(template_created) + # Listing all the Templates for a User + list_templates_after = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"] + ) + status = validateList(list_templates_after) + self.assertEquals( + PASS, + status[0], + "Templates creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_templates_after), + "Failed to create a Template" + ) + # Verifying the state of the template to be ready. If not waiting for state to become ready till time out + template_ready = False + count = 0 + while template_ready is False: + list_template = Template.list( + self.userapiclient, + id=template_created.id, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + ) + status = validateList(list_template) + self.assertEquals( + PASS, + status[0], + "Failed to list Templates by Id" + ) + if list_template[0].isready is True: + template_ready = True + elif (str(list_template[0].status) == "Error"): + self.fail("Created Template is in Errored state") + break + elif count > 10: + self.fail("Timed out before Template came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Downloading the Template name + download_template = Template.extract( + self.userapiclient, + template_created.id, + mode="HTTP_DOWNLOAD", + zoneid=self.zone.id + ) + self.assertIsNotNone( + download_template, + "Download Template failed" + ) + # Verifying the details of downloaded template + self.assertEquals( + "DOWNLOAD_URL_CREATED", + download_template.state, + "Download URL not created for Template" + ) + self.assertIsNotNone( + download_template.url, + "Download URL not created for Template" + ) + self.assertEquals( + template_created.id, + download_template.id, + "Download Template details are not same as Template created" + ) + del self.services["template"]["url"] + del self.services["template"]["format"] + del self.services["template"]["ostype"] + del self.services["template"]["isextractable"] + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_03_edit_template_details(self): + """ + @Desc: Test to Edit Template name, displaytext, OSType + @steps: + Step1: Listing all the Templates for a user + Step2: Verifying that no Templates are listed + Step3: Creating a Templates + Step4: Listing all the Templates again for a user + Step5: Verifying that list size is 1 + Step6: Verifying if the template is in ready state. + If yes the continuing + If not waiting and checking for template to be ready till timeout + Step7: Editing the template name + Step8: Verifying that Template name is edited + Step9: Editing the template displaytext + Step10: Verifying that Template displaytext is edited + Step11: Editing the template ostypeid + Step12: Verifying that Template ostypeid is edited + Step13: Editing the template name, displaytext + Step14: Verifying that Template name, displaytext are edited + Step15: Editing the template name, displaytext, ostypeid + Step16: Verifying that Template name, displaytext and ostypeid are edited + """ + # Listing all the Templates for a User + list_templates_before = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"] + ) + # Verifying that no Templates are listed + self.assertIsNone( + list_templates_before, + "Templates listed for newly created User" + ) + self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" + self.services["template"]["format"] = "VHD" + self.services["template"]["ostype"] = self.services["ostype"] + # Creating aTemplate + template_created = Template.register( + self.userapiclient, + self.services["template"], + self.zone.id, + hypervisor=self.hypervisor + ) + self.assertIsNotNone( + template_created, + "Template creation failed" + ) + self.cleanup.append(template_created) + # Listing all the Templates for a User + list_templates_after = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"] + ) + status = validateList(list_templates_after) + self.assertEquals( + PASS, + status[0], + "Templates creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_templates_after), + "Failed to create a Template" + ) + # Verifying the state of the template to be ready. If not waiting for state to become ready till time out + template_ready = False + count = 0 + while template_ready is False: + list_template = Template.list( + self.userapiclient, + id=template_created.id, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + ) + status = validateList(list_template) + self.assertEquals( + PASS, + status[0], + "Failed to list Templates by Id" + ) + if list_template[0].isready is True: + template_ready = True + elif (str(list_template[0].status) == "Error"): + self.fail("Created Template is in Errored state") + break + elif count > 10: + self.fail("Timed out before Template came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Editing the Template name + edited_template = Template.update( + template_created, + self.userapiclient, + name="NewTemplateName" + ) + self.assertIsNotNone( + edited_template, + "Editing Template failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":template_created.id, + "name":"NewTemplateName", + "displaytest":template_created.displaytext, + "account":template_created.account, + "domainid":template_created.domainid, + "format":template_created.format, + "ostypeid":template_created.ostypeid, + "templatetype":template_created.templatetype, + } + actual_dict = { + "id":edited_template.id, + "name":edited_template.name, + "displaytest":edited_template.displaytext, + "account":edited_template.account, + "domainid":edited_template.domainid, + "format":edited_template.format, + "ostypeid":edited_template.ostypeid, + "templatetype":edited_template.templatetype, + } + edit_template_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_template_status, + "Edited Template details are not as expected" + ) + # Editing the Template displaytext + edited_template = Template.update( + template_created, + self.userapiclient, + displaytext="TemplateDisplaytext" + ) + self.assertIsNotNone( + edited_template, + "Editing Template failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":template_created.id, + "name":"NewTemplateName", + "displaytest":"TemplateDisplaytext", + "account":template_created.account, + "domainid":template_created.domainid, + "format":template_created.format, + "ostypeid":template_created.ostypeid, + "templatetype":template_created.templatetype, + } + actual_dict = { + "id":edited_template.id, + "name":edited_template.name, + "displaytest":edited_template.displaytext, + "account":edited_template.account, + "domainid":edited_template.domainid, + "format":edited_template.format, + "ostypeid":edited_template.ostypeid, + "templatetype":edited_template.templatetype, + } + edit_template_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_template_status, + "Edited Template details are not as expected" + ) + # Editing the Template ostypeid + ostype_list = list_os_types(self.userapiclient) + status = validateList(ostype_list) + self.assertEquals( + PASS, + status[0], + "Failed to list OS Types" + ) + for i in range(0, len(ostype_list)): + if ostype_list[i].id != template_created.ostypeid: + newostypeid = ostype_list[i].id + break + + edited_template = Template.update( + template_created, + self.userapiclient, + ostypeid=newostypeid + ) + self.assertIsNotNone( + edited_template, + "Editing Template failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":template_created.id, + "name":"NewTemplateName", + "displaytest":"TemplateDisplaytext", + "account":template_created.account, + "domainid":template_created.domainid, + "format":template_created.format, + "ostypeid":newostypeid, + "templatetype":template_created.templatetype, + } + actual_dict = { + "id":edited_template.id, + "name":edited_template.name, + "displaytest":edited_template.displaytext, + "account":edited_template.account, + "domainid":edited_template.domainid, + "format":edited_template.format, + "ostypeid":edited_template.ostypeid, + "templatetype":edited_template.templatetype, + } + edit_template_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_template_status, + "Edited Template details are not as expected" + ) + # Editing the Template name, displaytext + edited_template = Template.update( + template_created, + self.userapiclient, + name=template_created.name, + displaytext=template_created.displaytext + ) + self.assertIsNotNone( + edited_template, + "Editing Template failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":template_created.id, + "name":template_created.name, + "displaytest":template_created.displaytext, + "account":template_created.account, + "domainid":template_created.domainid, + "format":template_created.format, + "ostypeid":newostypeid, + "templatetype":template_created.templatetype, + } + actual_dict = { + "id":edited_template.id, + "name":edited_template.name, + "displaytest":edited_template.displaytext, + "account":edited_template.account, + "domainid":edited_template.domainid, + "format":edited_template.format, + "ostypeid":edited_template.ostypeid, + "templatetype":edited_template.templatetype, + } + edit_template_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_template_status, + "Edited Template details are not as expected" + ) + # Editing the Template name, displaytext, ostypeid + edited_template = Template.update( + template_created, + self.userapiclient, + name="NewTemplateName", + displaytext="TemplateDisplaytext", + ostypeid=template_created.ostypeid + ) + self.assertIsNotNone( + edited_template, + "Editing Template failed" + ) + # Verifying the details of edited template + expected_dict = { + "id":template_created.id, + "name":"NewTemplateName", + "displaytest":"TemplateDisplaytext", + "account":template_created.account, + "domainid":template_created.domainid, + "format":template_created.format, + "ostypeid":template_created.ostypeid, + "templatetype":template_created.templatetype, + } + actual_dict = { + "id":edited_template.id, + "name":edited_template.name, + "displaytest":edited_template.displaytext, + "account":edited_template.account, + "domainid":edited_template.domainid, + "format":edited_template.format, + "ostypeid":edited_template.ostypeid, + "templatetype":edited_template.templatetype, + } + edit_template_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + edit_template_status, + "Edited Template details are not as expected" + ) + del self.services["template"]["url"] + del self.services["template"]["format"] + del self.services["template"]["ostype"] + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_04_copy_template(self): + """ + @Desc: Test to copy Template from one zone to another + @steps: + Step1: Listing Zones available for a user + Step2: Verifying if the zones listed are greater than 1. + If Yes continuing. + If not halting the test. + Step3: Listing all the templates for a user in zone1 + Step4: Verifying that no templates are listed + Step5: Listing all the templates for a user in zone2 + Step6: Verifying that no templates are listed + Step7: Creating a Template in zone 1 + Step8: Listing all the Templates again for a user in zone1 + Step9: Verifying that list size is 1 + Step10: Listing all the templates for a user in zone2 + Step11: Verifying that no templates are listed + Step12: Copying the template created in step7 from zone1 to zone2 + Step13: Listing all the templates for a user in zone2 + Step14: Verifying that list size is 1 + Step15: Listing all the Templates for a user in zone1 + Step16: Verifying that list size is 1 + """ + # Listing Zones available for a user + zones_list = Zone.list( + self.userapiclient, + available=True + ) + status = validateList(zones_list) + self.assertEquals( + PASS, + status[0], + "Failed to list Zones" + ) + if not len(zones_list) > 1: + self.fail("Enough zones doesnot exists to copy template") + else: + # Listing all the Templates for a User in Zone 1 + list_templates_zone1 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + zoneid=zones_list[0].id + ) + # Verifying that no Templates are listed + self.assertIsNone( + list_templates_zone1, + "Templates listed for newly created User in Zone1" + ) + # Listing all the Templates for a User in Zone 2 + list_templates_zone2 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + zoneid=zones_list[1].id + ) + # Verifying that no Templates are listed + self.assertIsNone( + list_templates_zone2, + "Templates listed for newly created User in Zone2" + ) + self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" + self.services["template"]["format"] = "VHD" + self.services["template"]["ostype"] = self.services["ostype"] + #Listing Hypervisors in Zone 1 + hypervisor_list = Hypervisor.list( + self.apiClient, + zoneid=zones_list[0].id + ) + status = validateList(zones_list) + self.assertEquals( + PASS, + status[0], + "Failed to list Hypervisors in Zone 1" + ) + # Creating aTemplate in Zone 1 + template_created = Template.register( + self.userapiclient, + self.services["template"], + zones_list[0].id, + hypervisor=hypervisor_list[0].name + ) + self.assertIsNotNone( + template_created, + "Template creation failed" + ) + self.cleanup.append(template_created) + # Listing all the Templates for a User in Zone 1 + list_templates_zone1 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + zoneid=zones_list[0].id + ) + status = validateList(list_templates_zone1) + self.assertEquals( + PASS, + status[0], + "Templates creation failed in Zone1" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_templates_zone1), + "Failed to create a Template" + ) + # Listing all the Templates for a User in Zone 2 + list_templates_zone2 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + zoneid=zones_list[1].id + ) + # Verifying that no Templates are listed + self.assertIsNone( + list_templates_zone2, + "Templates listed for newly created User in Zone2" + ) + # Verifying the state of the template to be ready. If not waiting for state to become ready till time out + template_ready = False + count = 0 + while template_ready is False: + list_template = Template.list( + self.userapiclient, + id=template_created.id, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + ) + status = validateList(list_template) + self.assertEquals( + PASS, + status[0], + "Failed to list Templates by Id" + ) + if list_template[0].isready is True: + template_ready = True + elif (str(list_template[0].status) == "Error"): + self.fail("Created Template is in Errored state") + break + elif count > 10: + self.fail("Timed out before Template came into ready state") + break + else: + time.sleep(self.services["sleep"]) + count = count + 1 + + # Copying the Template from Zone1 to Zone2 + copied_template = Template.copy( + self.userapiclient, + template_created.id, + sourcezoneid=template_created.zoneid, + destzoneid=zones_list[1].id + ) + self.assertIsNotNone( + copied_template, + "Copying Template from Zone1 to Zone2 failed" + ) + # Listing all the Templates for a User in Zone 1 + list_templates_zone1 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + zoneid=zones_list[0].id + ) + status = validateList(list_templates_zone1) + self.assertEquals( + PASS, + status[0], + "Templates creation failed in Zone1" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_templates_zone1), + "Failed to create a Template" + ) + # Listing all the Templates for a User in Zone 2 + list_templates_zone2 = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter=self.services["templatefilter"], + zoneid=zones_list[1].id + ) + status = validateList(list_templates_zone2) + self.assertEquals( + PASS, + status[0], + "Template failed to copy into Zone2" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_templates_zone2), + "Template failed to copy into Zone2" + ) + self.assertNotEquals( + "Connection refused", + list_templates_zone2[0].status, + "Failed to copy Template" + ) + self.assertEquals( + True, + list_templates_zone2[0].isready, + "Failed to copy Template" + ) + del self.services["template"]["url"] + del self.services["template"]["format"] + del self.services["template"]["ostype"] + return \ No newline at end of file diff --git a/test/integration/component/test_escalations_volumes.py b/test/integration/component/test_escalations_volumes.py new file mode 100644 index 0000000000..d1dae12681 --- /dev/null +++ b/test/integration/component/test_escalations_volumes.py @@ -0,0 +1,1703 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import * +from marvin.cloudstackException import * +from marvin.cloudstackAPI import * +from marvin.sshClient import SshClient +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * +from marvin.lib.utils import checkVolumeSize +from marvin.codes import SUCCESS +from nose.plugins.attrib import attr +from time import sleep + +class TestVolumes(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestVolumes, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + if cls.zone.localstorageenabled: + cls.storagetype = 'local' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' + cls.services["disk_offering"]["storagetype"] = 'local' + else: + cls.storagetype = 'shared' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' + cls.services["disk_offering"]["storagetype"] = 'shared' + + cls.services['mode'] = cls.zone.networktype + cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.services["custom_volume"]["zoneid"] = cls.zone.id + # Creating Disk offering, Service Offering and Account + cls.disk_offering = DiskOffering.create( + cls.api_client, + cls.services["disk_offering"] + ) + cls.service_offering = ServiceOffering.create( + cls.api_client, + cls.services["service_offerings"]["tiny"] + ) + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + # Creating Virtual Machine + cls.virtual_machine = VirtualMachine.create( + cls.userapiclient, + cls.services["virtual_machine"], + accountid=cls.account.name, + domainid=cls.account.domainid, + serviceofferingid=cls.service_offering.id, + ) + cls._cleanup.append(cls.virtual_machine) + cls._cleanup.append(cls.disk_offering) + cls._cleanup.append(cls.service_offering) + cls._cleanup.append(cls.account) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created volumes + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + + def __verify_values(self, expected_vals, actual_vals): + """ + @summary: Function to verify expected and actual values + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_01_list_volumes_pagination(self): + """ + @summary: Test List Volumes pagination + + Step1: Listing all the volumes for a user + Step2: Verifying listed volumes for account created at class level + Step3: If number of volumes is less than (page size + 1), then creating them + Step4: Listing all the volumes again after creation of volumes + Step5: Verifying the length of the volumes is (page size + 1) + Step6: Listing all the volumes in page1 + Step7: Verifying that the length of the volumes in page 1 is (page size) + Step8: Listing all the volumes in page2 + Step9: Verifying that the length of the volumes in page 2 is 1 + Step10: Deleting the volume present in page 2 + Step11: Listing for the volumes on page 2 + Step12: Verifying that there are no volumes present in page 2 + """ + # Listing all the volumes for a user + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + # Verifying listed volumes for account created at class level + self.assertIsNotNone( + list_volumes_before, + "create volume from VM failed at class setup method" + ) + self.assertEqual( + len(list_volumes_before), + 1, + "more than 1 volume created from VM at class level" + ) + + # If number of volumes is less than (pagesize + 1), then creating them + for i in range(0, (self.services["pagesize"])): + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + self.assertIsNotNone( + volume_created, + "Volume is not created" + ) + if(i < (self.services["pagesize"] - 1)): + self.cleanup.append(volume_created) + + self.assertEqual( + self.services["volume"]["diskname"], + volume_created.name, + "Newly created volume name and the test data volume name are not matching" + ) + + # Listing all the volumes again after creation of volumes + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + # Verifying the length of the volumes is (page size + 1) + self.assertEqual( + len(list_volumes_after), + (self.services["pagesize"] + 1), + "Number of volumes created is not matching expected" + ) + + # Listing all the volumes in page1 + list_volumes_page1 = Volume.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + self.assertIsNotNone( + list_volumes_page1, + "No volumes found in Page 1" + ) + # Verifying that the length of the volumes in page 1 is (page size) + self.assertEqual( + len(list_volumes_page1), + self.services["pagesize"], + "List Volume response is not matching with the page size length for page 1" + ) + + # Listing all the volumes in page2 + list_volumes_page2 = Volume.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + self.assertIsNotNone( + list_volumes_page2, + "No volumes found in Page 2" + ) + # Verifying that the length of the volumes in page 2 is 1 + self.assertEqual( + len(list_volumes_page2), + 1, + "List Volume response is not matching with the page size length for page 2" + ) + volume_page2 = list_volumes_page2[0] + + # Verifying that the volume on page 2 is not present in page1 + for i in range(0, len(list_volumes_page1)): + volume_page1 = list_volumes_page1[i] + self.assertNotEquals( + volume_page2.id, + volume_page1.id, + "Volume listed in page 2 is also listed in page 1" + ) + + # Deleting a single volume + Volume.delete(volume_created, self.userapiclient) + + # Listing the volumes in page 2 + list_volume_response = Volume.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + # verifying that volume does not exists on page 2 + self.assertEqual( + list_volume_response, + None, + "Volume was not deleted" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_02_list_volume_byid(self): + """ + @summary: Test List Volumes with Id + + Step1: Listing all the volumes for a user before creating a data volume + Step2: Verifying the length of the list as 1 + Step3: Creating a data volume + Step4: Listing all the volumes for a user after creating a data volume + Step5: Verifying the list volume size is increased by 1 + Step6: List the volumes by specifying root volume Id + Step7: Verifying the details of the root volume + Step8: List the volumes by specifying data volume Id + Step9: Verifying the details of the data volume + """ + # Listing all the volumes for a user before creating a data volume + list_volumes_before = Volume.list( + self.userapiclient, + listall=self.services["listall"] + ) + self.assertIsNotNone( + list_volumes_before, + "create volume from VM failed at class setup method") + # Verifying the length of the list as 1 + self.assertEqual( + len(list_volumes_before), + 1, + "more than 1 volume created at class level" + ) + root_volume = list_volumes_before[0] + + # Creating a data volume + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + self.assertIsNotNone( + volume_created, + "Volume is not created" + ) + self.cleanup.append(volume_created) + + self.assertEqual( + self.services["volume"]["diskname"], + volume_created.name, + "Newly created volume name and the test data volume name are not matching" + ) + # Listing all the volumes for a user after creating a data volume + list_volumes_after = Volume.list( + self.userapiclient, + listall=self.services["listall"] + ) + self.assertIsNotNone( + list_volumes_after, + "Volume creation failed" + ) + # Verifying the list volume size is increased by 1 + self.assertEqual( + len(list_volumes_before) + 1, + len(list_volumes_after), + "list volume is not matching with Number of volumes created" + ) + + # Listing a Root Volume by Id and verifying the volume details + list_volumes_by_id = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=root_volume.id + ) + self.assertIsNotNone( + list_volumes_by_id, + "Root volume is not listed" + ) + self.assertEqual( + 1, + len(list_volumes_by_id), + "list volume is not matching with Number of volumes created" + ) + obtained_volume = list_volumes_by_id[0] + + #Creating expected and actual values dictionaries + expected_dict = { + "id":root_volume.id, + "name":root_volume.name, + "vmname":self.virtual_machine.name, + "state":"Ready", + "type":"ROOT", + "zoneid":self.zone.id, + "account":self.account.name, + "storagetype":self.storagetype, + "size":self.template.size + } + actual_dict = { + "id":obtained_volume.id, + "name":obtained_volume.name, + "vmname":obtained_volume.vmname, + "state":obtained_volume.state, + "type":obtained_volume.type, + "zoneid":obtained_volume.zoneid, + "account":obtained_volume.account, + "storagetype":obtained_volume.storagetype, + "size":obtained_volume.size, + } + root_volume_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + root_volume_status, + "Listed Root Volume details are not as expected" + ) + # Listing a Data Volume by Id and verifying the volume details + list_volumes_by_id = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + self.assertIsNotNone( + list_volumes_by_id, + "Data volume is not listed" + ) + self.assertEqual( + len(list_volumes_by_id), + 1, + "list volume is not matching with Number of volumes created" + ) + obtained_volume = list_volumes_by_id[0] + + #Creating expected and actual values dictionaries + expected_dict = { + "id":volume_created.id, + "name":volume_created.name, + "state":"Allocated", + "type":"DATADISK", + "zoneid":self.zone.id, + "account":self.account.name, + "storagetype":self.storagetype, + "size":self.disk_offering.disksize + } + actual_dict = { + "id":obtained_volume.id, + "name":obtained_volume.name, + "state":obtained_volume.state, + "type":obtained_volume.type, + "zoneid":obtained_volume.zoneid, + "account":obtained_volume.account, + "storagetype":obtained_volume.storagetype, + "size":obtained_volume.size/(1024*1024*1024), + } + root_volume_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + root_volume_status, + "Listed Data Volume details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_03_data_volume_resize(self): + """ + @summary: Test to verify creation and resize of data volume + + Step1: Listing the volumes for a user before creating data volume + Step2: Creating a data volume + Step3: Listing the volumes for a user after creating data volume + Step4: Attaching and Detaching data volume created to Virtual Machine + Step5: Verifying if there exists a disk offering with higher size + If not present creating it + Step6: Resizing data volume + """ + # Listing volumes for a user before creating a volume + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + # Creating a data volume + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + self.assertIsNotNone(volume_created, "Data volume creation failed") + + self.cleanup.append(volume_created) + + # Listing volumes for a user after creating data volume + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Data volume creation failed" + ) + + # Attaching data volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + + # Detaching data volume from Virtual Machine + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + + # Verifying if there exists a disk offering with higher size. If not present creating it + list_disk_offerings = DiskOffering.list(self.apiClient) + + large_disk_offering_exists = False + # Converting disk_size in bytes to GB + current_disk_size = volume_created.size/(1024*1024*1024) + + for disk_offering in list_disk_offerings: + if ((disk_offering.disksize > current_disk_size) and (not disk_offering.iscustomized) and disk_offering.storagetype == self.storagetype): + new_disk_offering = disk_offering + large_disk_offering_exists = True + break + + if large_disk_offering_exists == False: + new_size = (volume_created.size/(1024*1024*1024)) + 1 + self.services["disk_offering"]["disksize"] = new_size + new_disk_offering = DiskOffering.create( + self.apiClient, + self.services["disk_offering"] + ) + if new_disk_offering is not None: + self.cleanup.append(new_disk_offering) + else: + new_size = new_disk_offering.disksize + + # Resizing data volume + resized_volume = volume_created.resize( + self.userapiclient, + diskofferingid=new_disk_offering.id, + shrinkok='false', + ) + self.assertIsNotNone(resized_volume, "Resize Volume failed") + # Verifying data volume size is increased + self.assertEquals( + new_size, + (resized_volume.size/(1024*1024*1024)), + "volume not resized to expected value" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_04_custom_volume_resize(self): + """ + @summary: Test to verify creation and resize of custom volume + + Step1: Checking if Custom disk offering already exists. + If not present then creating custom Disk Offering + Step2: Listing the volumes for a user before creating custom volume + Step3: Creating a custom volume + Step4: Listing the volumes for a user after creating custom volume + Step5: Attaching and Detaching custom volume created to Virtual Machine + Step6: Resizing custom volume + """ + # Listing all the disk offerings + list_disk_offerings = DiskOffering.list(self.apiClient) + + custom_disk_offering_exists = False + + # Verifying if a custom disk offering already exists + if list_disk_offerings is not None: + for disk_offering in list_disk_offerings: + if (disk_offering.iscustomized and disk_offering.storagetype == self.storagetype): + custom_disk_offering = disk_offering + custom_disk_offering_exists = True + break + + # If a custom disk offering does not exists, then creating a custom disk offering + if custom_disk_offering_exists == False: + custom_disk_offering = DiskOffering.create( + self.apiClient, + self.services["disk_offering"], + custom=True + ) + if custom_disk_offering is not None: + self.cleanup.append(custom_disk_offering) + + # Listing the volumes for a user before creating custom volume + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + # Creating a custom volume + volume_created = Volume.create_custom_disk( + self.userapiclient, + self.services["custom_volume"], + account=self.account.name, + domainid=self.account.domainid, + diskofferingid=custom_disk_offering.id + ) + self.assertIsNotNone( + volume_created, + "Custom volume did not get created" + ) + + self.cleanup.append(volume_created) + + # Listing the volumes for a user after creating custom volume + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + # Verifyign that volume list is increased by 1 after creation of custion volume + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Custom volume did not get created" + ) + + # Attaching custom volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + + # Detaching custom volume from Virtual Machine + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + + # Resizing custom volume + # Increasing custom disk size by 1 + new_size = self.services["custom_volume"]["customdisksize"] + 1 + resized_volume = volume_created.resize( + self.userapiclient, + diskofferingid=custom_disk_offering.id, + shrinkok='false', + size=new_size) + self.assertIsNotNone(resized_volume, "Resize Volume failed") + # Verifying that custom disk size is increased + self.assertEquals( + new_size, + (resized_volume.size/(1024*1024*1024)), + "volume not resized to expected value" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_05_volume_snapshot(self): + """ + @summary: Test to verify creation of snapshot from volume and creation of template, volume from snapshot + + Step1: Creating a volume + Step2: Attaching and Detaching custom volume created to Virtual Machine + Step3: Creating Snapshot from volume + Step4: Creating Volume from snapshot + Step5: Creating Template from Snapshot + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + + self.assertIsNotNone(volume_created, "Volume not created") + + if volume_created is not None: + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + # Attaching and Detaching custom volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + # Creating Snapshot from volume + snapshot_created = Snapshot.create( + self.userapiclient, + volume_created.id, + ) + + self.assertIsNotNone(snapshot_created, "Snapshot not created") + + self.cleanup.append(snapshot_created) + + #Creating expected and actual values dictionaries + expected_dict = { + "id":volume_created.id, + "intervaltype":"MANUAL", + "snapshottype":"MANUAL", + "volumetype":volume_created.type, + "domain":self.domain.id + } + actual_dict = { + "id":snapshot_created.volumeid, + "intervaltype":snapshot_created.intervaltype, + "snapshottype":snapshot_created.snapshottype, + "volumetype":snapshot_created.volumetype, + "domain":snapshot_created.domainid, + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Snapshot created from Volume details are not as expected" + ) + # Creating Volume from snapshot + cmd = createVolume.createVolumeCmd() + cmd.name = "-".join([self.services["volume"]["diskname"], random_gen()]) + cmd.snapshotid = snapshot_created.id + + volume_from_snapshot = Volume(self.userapiclient.createVolume(cmd).__dict__) + + self.assertIsNotNone( + volume_from_snapshot, + "Volume creation failed from snapshot" + ) + self.cleanup.append(volume_from_snapshot) + + #Creating expected and actual values dictionaries + expected_dict = { + "snapshotid":snapshot_created.id, + "volumetype":snapshot_created.volumetype, + "size":self.disk_offering.disksize, + "accounr":self.account.name, + "domain":self.domain.id, + "storagetype":self.storagetype, + "zone":self.zone.id + } + actual_dict = { + "snapshotid":volume_from_snapshot.snapshotid, + "volumetype":volume_from_snapshot.type, + "size":volume_from_snapshot.size/(1024*1024*1024), + "accounr":volume_from_snapshot.account, + "domain":volume_from_snapshot.domainid, + "storagetype":volume_from_snapshot.storagetype, + "zone":volume_from_snapshot.zoneid, + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Volume created from Snapshot details are not as expected" + ) + # Creating Template from Snapshot + list_templates_before = Template.list(self.userapiclient, templatefilter='self') + + if list_templates_before is None: + templates_before_size = 0 + else: + templates_before_size = len(list_templates_before) + + cmd = createTemplate.createTemplateCmd() + cmd.name = self.services["ostype"] + cmd.displaytext = self.services["ostype"] + cmd.ostypeid = self.template.ostypeid + cmd.snapshotid = snapshot_created.id + cmd.ispublic = False + cmd.passwordenabled = False + + template_from_snapshot = Template(self.userapiclient.createTemplate(cmd).__dict__) + + self.assertIsNotNone( + template_from_snapshot, + "Template creation failed from snapshot" + ) + + self.cleanup.append(template_from_snapshot) + + #Creating expected and actual values dictionaries + expected_dict = { + "name":self.services["ostype"], + "ostypeid":self.template.ostypeid, + "type":"USER", + "zone":self.zone.id, + "domain":self.domain.id, + "account":self.account.name, + "passwordenabled":False, + "ispublic":False, + "size":self.disk_offering.disksize + } + actual_dict = { + "name":template_from_snapshot.name, + "ostypeid":template_from_snapshot.ostypeid, + "type":template_from_snapshot.templatetype, + "zone":template_from_snapshot.zoneid, + "domain":template_from_snapshot.domainid, + "account":template_from_snapshot.account, + "passwordenabled":template_from_snapshot.passwordenabled, + "ispublic":template_from_snapshot.ispublic, + "size":template_from_snapshot.size/(1024*1024*1024) + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Template created from Snapshot details are not as expected" + ) + + list_templates_after = Template.list(self.userapiclient, templatefilter='self') + + self.assertEquals( + templates_before_size + 1, + len(list_templates_after), + "Template creation failed from snapshot" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_06_volume_snapshot_policy_hourly(self): + """ + @summary: Test to verify creation of Hourly Snapshot policies from volume + + Step1: Creating a Volume. + Step2: Attaching volume created in Step2 to virtual machine + Step3: Detaching the volume created in step2 from virtual machine + Step4: Listing snapshot policies for a volume created in step1 + Step5: Creating Hourly snapshot policy + Step6: Listing snapshot policies for a volume created in step1 again + Step7: Verifyign that the list snapshot policy length is increased by 1 + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + + self.assertIsNotNone(volume_created, "Volume not created") + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + + # Attaching volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + # Detaching volume created from Virtual Machine + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + # Creating Hourly Snapshot Policy from volume + self.services["recurring_snapshot"]["intervaltype"] = 'hourly' + self.services["recurring_snapshot"]["schedule"] = '1' + + list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + snapshot_policy_before_size = 0 + + if list_snapshot_policy_before is not None: + snapshot_policy_before_size = len(list_snapshot_policy_before) + + snapshot_policy_hourly = SnapshotPolicy.create( + self.userapiclient, + volume_created.id, + self.services["recurring_snapshot"] + ) + self.assertIsNotNone( + snapshot_policy_hourly, + "Hourly Snapshot policy creation failed" + ) + #Creating expected and actual values dictionaries + expected_dict = { + "schedule":self.services["recurring_snapshot"]["schedule"], + "intervaltype":0, + "volumeid":volume_created.id + } + actual_dict = { + "schedule":snapshot_policy_hourly.schedule, + "intervaltype":snapshot_policy_hourly.intervaltype, + "volumeid":snapshot_policy_hourly.volumeid + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Hourly Snapshot Policy details are not as expected" + ) + + list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + self.assertIsNotNone( + list_snapshot_policy_after, + "Hourly Snapshot policy creation failed" + ) + self.assertEquals( + snapshot_policy_before_size + 1, + len(list_snapshot_policy_after), + "Hourly Snapshot policy creation failed" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_07_volume_snapshot_policy_daily(self): + """ + @summary: Test to verify creation of Daily Snapshot policies from volume + + Step1: Creating a Volume. + Step2: Attaching volume created in Step2 to virtual machine + Step3: Detaching the volume created in step2 from virtual machine + Step4: Listing snapshot policies for a volume created in step1 + Step5: Creating Daily snapshot policy + Step6: Listing snapshot policies for a volume created in step1 again + Step7: Verifyign that the list snapshot policy length is increased by 1 + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + + self.assertIsNotNone(volume_created, "Volume not created") + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + # Attaching volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + # Detaching volume created from Virtual Machine + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + # Creating Daily Snapshot Policy from volume + self.services["recurring_snapshot"]["intervaltype"] = 'daily' + self.services["recurring_snapshot"]["schedule"] = '00:00' + + list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + snapshot_policy_before_size = 0 + + if list_snapshot_policy_before is not None: + snapshot_policy_before_size = len(list_snapshot_policy_before) + + snapshot_policy_daily = SnapshotPolicy.create( + self.userapiclient, + volume_created.id, + self.services["recurring_snapshot"] + ) + self.assertIsNotNone( + snapshot_policy_daily, + "Daily Snapshot policy creation failed" + ) + #Creating expected and actual values dictionaries + expected_dict = { + "schedule":self.services["recurring_snapshot"]["schedule"], + "intervaltype":1, + "volumeid":volume_created.id + } + actual_dict = { + "schedule":snapshot_policy_daily.schedule, + "intervaltype":snapshot_policy_daily.intervaltype, + "volumeid":snapshot_policy_daily.volumeid + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Daily Snapshot Policy details are not as expected" + ) + + list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + self.assertIsNotNone( + list_snapshot_policy_after, + "Daily Snapshot policy creation failed" + ) + self.assertEquals( + snapshot_policy_before_size + 1, + len(list_snapshot_policy_after), + "Daily Snapshot policy creation failed" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_08_volume_snapshot_policy_weekly(self): + """ + @summary: Test to verify creation of Weekly Snapshot policies from volume + + Step1: Creating a Volume. + Step2: Attaching volume created in Step2 to virtual machine + Step3: Detaching the volume created in step2 from virtual machine + Step4: Listing snapshot policies for a volume created in step1 + Step5: Creating Weekly snapshot policy + Step6: Listing snapshot policies for a volume created in step1 again + Step7: Verifyign that the list snapshot policy length is increased by 1 + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + + self.assertIsNotNone(volume_created, "Volume not created") + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + + # Attaching volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + # Detaching volume created to Virtual Machine + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + # Creating Weekly Snapshot Policy from volume + self.services["recurring_snapshot"]["intervaltype"] = 'weekly' + self.services["recurring_snapshot"]["schedule"] = '00:00:1' + + list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + snapshot_policy_before_size = 0 + + if list_snapshot_policy_before is not None: + snapshot_policy_before_size = len(list_snapshot_policy_before) + + snapshot_policy_weekly = SnapshotPolicy.create( + self.userapiclient, + volume_created.id, + self.services["recurring_snapshot"] + ) + self.assertIsNotNone( + snapshot_policy_weekly, + "Weekly Snapshot policy creation failed" + ) + #Creating expected and actual values dictionaries + expected_dict = { + "schedule":self.services["recurring_snapshot"]["schedule"], + "intervaltype":2, + "volumeid":volume_created.id + } + actual_dict = { + "schedule":snapshot_policy_weekly.schedule, + "intervaltype":snapshot_policy_weekly.intervaltype, + "volumeid":snapshot_policy_weekly.volumeid + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Weekly Snapshot Policy details are not as expected" + ) + + list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + self.assertIsNotNone( + list_snapshot_policy_after, + "Weekly Snapshot policy creation failed" + ) + self.assertEquals( + snapshot_policy_before_size + 1, + len(list_snapshot_policy_after), + "Weekly Snapshot policy creation failed" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_09_volume_snapshot_policy_monthly(self): + """ + @summary: Test to verify creation of Monthly Snapshot policies from volume + + Step1: Creating a Volume. + Step2: Attaching volume created in Step2 to virtual machine + Step3: Detaching the volume created in step2 from virtual machine + Step4: Listing snapshot policies for a volume created in step1 + Step5: Creating Monthly snapshot policy + Step6: Listing snapshot policies for a volume created in step1 again + Step7: Verifyign that the list snapshot policy length is increased by 1 + Step8: Deleting monthly snapshot policy created in step5 + Step9: List snapshot policies for a volume again + Step10: Verifying that the list snapshot policy length is decreased by 1 + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + self.assertIsNotNone(volume_created, "Volume not created") + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + # Attaching and Detaching custom volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + # Creating Monthly Snapshot Policy from volume + self.services["recurring_snapshot"]["intervaltype"] = 'monthly' + self.services["recurring_snapshot"]["schedule"] = '00:00:1' + + list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + snapshot_policy_before_size = 0 + + if list_snapshot_policy_before is not None: + snapshot_policy_before_size = len(list_snapshot_policy_before) + + snapshot_policy_monthly = SnapshotPolicy.create( + self.userapiclient, + volume_created.id, + self.services["recurring_snapshot"]) + self.assertIsNotNone( + snapshot_policy_monthly, + "Monthly Snapshot policy creation failed" + ) + #Creating expected and actual values dictionaries + expected_dict = { + "schedule":self.services["recurring_snapshot"]["schedule"], + "intervaltype":3, + "volumeid":volume_created.id + } + actual_dict = { + "schedule":snapshot_policy_monthly.schedule, + "intervaltype":snapshot_policy_monthly.intervaltype, + "volumeid":snapshot_policy_monthly.volumeid + } + status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + status, + "Monthly Snapshot Policy details are not as expected" + ) + + list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + self.assertIsNotNone( + list_snapshot_policy_after, + "Monthly Snapshot policy creation failed" + ) + self.assertEquals( + snapshot_policy_before_size + 1, + len(list_snapshot_policy_after), + "Monthly Snapshot policy creation failed" + ) + # Deleting monthly snapshot policy + SnapshotPolicy.delete(snapshot_policy_monthly, self.userapiclient) + + list_snapshot_policies = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) + + self.assertIsNone( + list_snapshot_policies, + "Deletion of Monthly Snapshot policy failed" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_10_volume_snapshots_pagination(self): + """ + @summary: Test to verify pagination of snapshots for Volume + + Step1: Creating a Volume. + Step2: Attaching volume created in Step2 to virtual machine + Step3: Detaching the volume created in step2 from virtual machine + Step4: Listing all the snapshots for a volume + Step5: Creating Pagesize + 1 number of snapshots for a volume + Step6: Listing all the snapshots for a volume + Step7: Verifying that there are pagesize + 1 number of snapshots listsed + Step8: Listing all the snapshots in page 1 + Step9: Listing all the snapshots in page 2 + Step10: Deleting the snapshot present in page 2 + Step11: Listign the snapshots from page 2 again and verifyign that list returns none + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + # Creating a Volume + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + self.assertIsNotNone(volume_created, "Volume not created") + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + #Attaching volume to virtual machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + #Detaching volume from virtual machine + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + + #Creating 3 Snapshots from volume + list_snapshot_before = Snapshot.list( + self.userapiclient, + volumeid=volume_created.id, + listall=self.services["listall"] + ) + self.assertIsNone( + list_snapshot_before, + "Newly created volume is already having snapshots" + ) + + list_snapshot_before_size = 0 + for i in range(0, 3): + snapshot_created = Snapshot.create( + self.userapiclient, + volume_created.id, + ) + self.assertIsNotNone(snapshot_created, "Snapshot not created") + self.cleanup.append(snapshot_created) + + self.assertEquals( + volume_created.id, + snapshot_created.volumeid, + "Snapshot not created for given volume" + ) + + list_snapshot_after = Snapshot.list( + self.userapiclient, + volumeid=volume_created.id, + listall=self.services["listall"] + ) + self.assertEqual( + list_snapshot_before_size+3, + len(list_snapshot_after), + "Number of snapshots created is not matching expected" + ) + #Listing all the snapshots in page1 + list_snapshots_page1 = Snapshot.list( + self.userapiclient, + volumeid=volume_created.id, + listall=self.services["listall"], + page=1, + pagesize=2 + ) + self.assertEqual( + 2, + len(list_snapshots_page1), + "List snapshots response is not matching with the page size length for page 1" + ) + + #Listing all the snapshots in page2 and ensuring only 1 snapshot is present + list_snapshots_page2 = Snapshot.list( + self.userapiclient, + volumeid=volume_created.id, + listall=self.services["listall"], + page=2, + pagesize=2 + ) + self.assertEqual( + len(list_snapshots_page2), + 1, + "List snapshots response is not matching with the page size length for page 2" + ) + snapshot_page2 = list_snapshots_page2[0] + + # Verifying that the snapshot on page 2 is not present in page1 + for i in range(0, len(list_snapshots_page1)): + snapshot_page1 = list_snapshots_page1[i] + self.assertNotEquals( + snapshot_page2.id, + snapshot_page1.id, + "Snapshot listed in page 2 is also listed in page 1" + ) + # Deleting a single snapshot and verifying that snapshot does not exists on page 2 + Snapshot.delete(snapshot_created, self.userapiclient) + + list_snapshot_page2 = Snapshot.list( + self.userapiclient, + volumeid=volume_created.id, + listall=self.services["listall"], + page=2, + pagesize=2 + ) + self.assertEqual( + None, + list_snapshot_page2, + "Snapshot was not deleted" + ) + list_snapshot_page1 = Snapshot.list( + self.userapiclient, + volumeid=volume_created.id, + listall=self.services["listall"], + page=1, + pagesize=2 + ) + self.assertEqual( + 2, + len(list_snapshot_page1), + "Snapshots on page 1 are not matching" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_11_volume_extract(self): + """ + @summary: Test to verify extract/download a Volume + + Step1: Listing Volumes before creating a Volume + Step2: Creating a Volume. + Step3: Verifying that created volume is not none and adding to clean up + Step4: Listing the volumes after creation + Step5: Verifying that the list volume size is increased by 1 + Step6: Attaching volume created in Step2 to virtual machine + Step7: Detaching the volume created in step2 from virtual machine + Step8: Extracting/Downloadign the volume + Step9: Verifyign that a download URL is created for volume download + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertIsNotNone( + list_volumes_before, + "volume not created for the vm launched at class level" + ) + volume_created = Volume.create( + self.userapiclient, + self.services["volume"], + zoneid=self.zone.id, + diskofferingid=self.disk_offering.id + ) + + self.assertIsNotNone(volume_created, "Volume not created") + self.cleanup.append(volume_created) + + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertIsNotNone( + list_volumes_after, + "volume creation failed" + ) + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "Volume not created" + ) + #Attaching and Detaching volume created to Virtual Machine + self.virtual_machine.attach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + attached_volume = list_volumes[0] + + self.assertIsNotNone( + attached_volume.vmname, + "VM is not attached to Volume" + ) + self.assertEquals( + self.virtual_machine.name, + attached_volume.vmname, + "VM Name is not matching with attached vm" + ) + self.virtual_machine.detach_volume( + self.userapiclient, + volume_created + ) + list_volumes = Volume.list( + self.userapiclient, + listall=self.services["listall"], + id=volume_created.id + ) + detached_volume = list_volumes[0] + self.assertIsNone( + detached_volume.vmname, + "VM is not detached from volume" + ) + #Extract/Download the volume + self.services["mode"] = "HTTP_DOWNLOAD" + + extract_volume_response = Volume.extract( + self.userapiclient, + volume_created.id, + self.zone.id, + self.services["mode"] + ) + self.assertIsNotNone(extract_volume_response, "Extract/Download volume failed") + + self.assertEquals( + "DOWNLOAD_URL_CREATED", + extract_volume_response.state, + "Failed to create Download URL" + ) + self.assertIsNotNone( + extract_volume_response.url, + "Extract/Download volume URL is NULL" + ) + self.assertTrue( + (extract_volume_response.url.find("http")!=-1), + "Extract/Download volume URL doesnot contain http" + ) + self.assertEquals( + volume_created.id, + extract_volume_response.id, + "Extracted/Downloaded volume is not matching with original volume" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_12_volume_upload(self): + """ + @summary: Test to verify upload volume + + Step1: Listing the volumes for a user before uploading volume + Step2: Uploading a volume + Step3: Listing the volumes for a user after uploading data volume + Step4: Verifying that the list volume length after upload is increased by 1 + """ + list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertIsNotNone( + list_volumes_before, + "volume not created for the vm launched at class level" + ) + #Uploading a Volume + volume_uploaded = Volume.upload( + self.userapiclient, + self.services["upload_volume"], + self.zone.id + ) + self.assertIsNotNone(volume_uploaded, "volume uploading failed") + + self.assertEquals( + self.services["upload_volume"]["diskname"], + volume_uploaded.name, + "Uploaded volume name is not matching with name provided while uploading") + + #Listing the volumes for a user after uploading data volume + list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) + + self.assertIsNotNone( + list_volumes_after, + "volume not created for the vm launched at class level" + ) + #Asserting that the list volume length after upload is increased by 1 + self.assertEquals( + len(list_volumes_before) + 1, + len(list_volumes_after), + "upload volume failed" + ) + return \ No newline at end of file diff --git a/test/integration/component/test_escalations_vpncustomergateways.py b/test/integration/component/test_escalations_vpncustomergateways.py new file mode 100644 index 0000000000..dc6576863d --- /dev/null +++ b/test/integration/component/test_escalations_vpncustomergateways.py @@ -0,0 +1,382 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +#Import Local Modules +from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackAPI import (createVolume, + createTemplate) +from marvin.lib.base import (Volume, + Iso, + VirtualMachine, + Template, + Snapshot, + SecurityGroup, + Account, + Zone, + Network, + NetworkOffering, + DiskOffering, + ServiceOffering, + VmSnapshot, + SnapshotPolicy, + SSHKeyPair, + Resources, + Configurations, + VpnCustomerGateway, + Hypervisor, + VpcOffering, + VPC, + NetworkACL) +from marvin.lib.common import (get_zone, + get_domain, + get_template, + list_os_types) +from marvin.lib.utils import (validateList, + cleanup_resources, + random_gen) +from marvin.codes import (PASS, FAIL, EMPTY_LIST) +from nose.plugins.attrib import attr +import time + +class TestVpnCustomerGateways(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestVpnCustomerGateways, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + cls.services['mode'] = cls.zone.networktype + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls._cleanup.append(cls.account) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + #Clean up, terminate the created resources + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + return + + def __verify_values(self, expected_vals, actual_vals): + """ + @Desc: Function to verify expected and actual values + @Steps: + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_01_list_vpncustomergateways_pagination(self): + """ + @Desc: Test to List VPN Customer Gateways pagination + @steps: + Step1: Listing all the VPN Customer Gateways for a user + Step2: Verifying that no VPN Customer Gateways are listed + Step3: Creating (page size + 1) number of VPN Customer Gateways + Step4: Listing all the VPN Customer Gateways again for a user + Step5: Verifying that list size is (page size + 1) + Step6: Listing all the VPN Customer Gateways in page1 + Step7: Verifying that list size is (page size) + Step8: Listing all the VPN Customer Gateways in page2 + Step9: Verifying that list size is 1 + Step10: Deleting the VPN Customer Gateways present in page 2 + Step11: Listing all the VPN Customer Gateways in page2 + Step12: Verifying that no VPN Customer Gateways are listed + """ + # Listing all the VPN Customer Gateways for a User + list_vpncustomergateways_before = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying that no VPN Customer Gateways are listed + self.assertIsNone( + list_vpncustomergateways_before, + "VPN Customer Gateways listed for newly created User" + ) + # Creating pagesize + 1 number of VPN Customer Gateways + for i in range(0, (self.services["pagesize"] + 1)): + vpncustomergateway_created = VpnCustomerGateway.create( + self.userapiclient, + self.services["vpncustomergateway"], + name="VPNCustGateway"+str(i+1), + gateway="10.102.153." + str(i+1), + cidrlist="10.0.0.0/24", + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNotNone( + vpncustomergateway_created, + "VPN Customer Gateway creation failed" + ) + if (i < self.services["pagesize"] + 1): + self.cleanup.append(vpncustomergateway_created) + + # Listing all the VPN Customer Gateways for a User + list_vpncustomergateways_after = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_vpncustomergateways_after) + self.assertEquals( + PASS, + status[0], + "VPN Customer Gateway creation failed" + ) + # Verifying that list size is pagesize + 1 + self.assertEquals( + self.services["pagesize"] + 1, + len(list_vpncustomergateways_after), + "Failed to create pagesize + 1 number of VPN Customer Gateways" + ) + # Listing all the VPN Customer Gateways in page 1 + list_vpncustomergateways_page1 = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vpncustomergateways_page1) + self.assertEquals( + PASS, + status[0], + "Failed to list VPN Customer Gateways in page 1" + ) + # Verifying the list size to be equal to pagesize + self.assertEquals( + self.services["pagesize"], + len(list_vpncustomergateways_page1), + "Size of VPN Customer Gateways in page 1 is not matching" + ) + # Listing all the VPN Customer Gateways in page 2 + list_vpncustomergateways_page2 = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vpncustomergateways_page2) + self.assertEquals( + PASS, + status[0], + "Failed to list VPN Customer Gateways in page 2" + ) + # Verifying the list size to be equal to 1 + self.assertEquals( + 1, + len(list_vpncustomergateways_page2), + "Size of VPN Customer Gateways in page 2 is not matching" + ) + # Deleting the VPM Customer Gateway present in page 2 + VpnCustomerGateway.delete( + vpncustomergateway_created, + self.userapiclient + ) + # Listing all the VPN Customer Gateways in page 2 again + list_vpncustomergateways_page2 = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + # Verifying that there are no VPN Customer Gateways listed + self.assertIsNone( + list_vpncustomergateways_page2, + "VPN Customer Gateways not deleted from page 2" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_02_update_vpncustomergateways(self): + """ + @Desc: Test to update VPN Customer Gateways pagination + @steps: + Step1: Listing all the VPN Customer Gateways for a user + Step2: Verifying that no VPN Customer Gateways are listed + Step3: Creating a VPN Customer Gateways + Step4: Listing all the VPN Customer Gateways again for a user + Step5: Verifying that list size is 1 + Step6: Updating the VPN Customer Gateways created in step3 + Step7: Listing the VPN customer gateway by id + Step8: Verifying that list size is 1 + Step9: Verifying the details of the listed VPN customer gateway are same as updated in step6 + """ + # Listing all the VPN Customer Gateways for a User + list_vpncustomergateways_before = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying that no VPN Customer Gateways are listed + self.assertIsNone( + list_vpncustomergateways_before, + "VPN Customer Gateways listed for newly created User" + ) + # Creating A VPN Customer Gateways + vpncustomergateway_created = VpnCustomerGateway.create( + self.userapiclient, + self.services["vpncustomergateway"], + name="VPNCustGateway", + gateway="10.102.153.90", + cidrlist="10.0.0.0/24", + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNotNone( + vpncustomergateway_created, + "VPN Customer Gateway creation failed" + ) + self.cleanup.append(vpncustomergateway_created) + # Listing all the VPN Customer Gateways for a User + list_vpncustomergateways_after = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_vpncustomergateways_after) + self.assertEquals( + PASS, + status[0], + "VPN Customer Gateway creation failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_vpncustomergateways_after), + "Failed to create VPN Customer Gateways" + ) + # Updating the VPN Customer gateway + vpncustomergateway_updated = VpnCustomerGateway.update( + vpncustomergateway_created, + self.userapiclient, + self.services["vpncustomergateway"], + name="NewVPNCustGateway", + gateway="10.102.153.90", + cidrlist="10.0.0.0/24", + ) + self.assertIsNotNone( + vpncustomergateway_updated, + "Updation of VPN Customer Gateway failed" + ) + # Listing the VPN Customer Gateways by Id + list_vpncustomergateway = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"], + id=vpncustomergateway_created.id + ) + status = validateList(list_vpncustomergateway) + self.assertEquals( + PASS, + status[0], + "Failed to list VPN Customer Gateways by Id" + ) + # Verifying the list size to be equal to 1 + self.assertEquals( + 1, + len(list_vpncustomergateway), + "Size of VPN Customer Gateways by id is not matching" + ) + # Verifying the details of the listed VPN Customer Gateway are same as updated + #Creating expected and actual values dictionaries + expected_dict = { + "name":vpncustomergateway_updated.name, + "id":vpncustomergateway_updated.id, + "account":vpncustomergateway_updated.account, + "domainid":vpncustomergateway_updated.domainid, + "gateway":vpncustomergateway_updated.gateway, + "cidrlist":vpncustomergateway_updated.cidrlist, + "seckey":vpncustomergateway_updated.ipsecpsk, + "ikepolicy":vpncustomergateway_updated.ikepolicy, + "ikelifetime":vpncustomergateway_updated.ikelifetime, + "esppolicy":vpncustomergateway_updated.esppolicy, + "esplifetime":vpncustomergateway_updated.esplifetime, + } + actual_dict = { + "name":list_vpncustomergateway[0].name, + "id":list_vpncustomergateway[0].id, + "account":list_vpncustomergateway[0].account, + "domainid":list_vpncustomergateway[0].domainid, + "gateway":list_vpncustomergateway[0].gateway, + "cidrlist":list_vpncustomergateway[0].cidrlist, + "seckey":list_vpncustomergateway[0].ipsecpsk, + "ikepolicy":list_vpncustomergateway[0].ikepolicy, + "ikelifetime":list_vpncustomergateway[0].ikelifetime, + "esppolicy":list_vpncustomergateway[0].esppolicy, + "esplifetime":list_vpncustomergateway[0].esplifetime, + } + vpncustomergateway_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + vpncustomergateway_status, + "Listed VPN Customer Gateway details are not as Updated" + ) + return \ No newline at end of file diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py index 03b03b61e3..7d08e89eff 100644 --- a/tools/marvin/marvin/lib/base.py +++ b/tools/marvin/marvin/lib/base.py @@ -20,6 +20,7 @@ """ import marvin +from utils import is_server_ssh_ready, random_gen from marvin.cloudstackAPI import * from marvin.codes import (FAILED, FAIL, PASS, RUNNING, STOPPED, STARTING, DESTROYED, EXPUNGING, @@ -613,6 +614,12 @@ def delete(self, apiclient): cmd.id = self.id apiclient.destroyVirtualMachine(cmd) + def expung(self, apiclient): + """Expung an Instance""" + cmd = expungeVirtualMachine.expungeVirtualMachineCmd() + cmd.id = self.id + apiclient.expungeVirtualMachine(cmd) + def migrate(self, apiclient, hostid=None): """migrate an Instance""" cmd = migrateVirtualMachine.migrateVirtualMachineCmd() @@ -1498,6 +1505,18 @@ def create(cls, apiclient, services, ipaddressid=None, cmd.vpcid = vpcid return StaticNATRule(apiclient.createFirewallRule(cmd).__dict__) + @classmethod + def createIpForwardingRule(cls, apiclient, startport, endport, protocol, ipaddressid, openfirewall): + """Creates static ip forwarding rule""" + + cmd = createIpForwardingRule.createIpForwardingRuleCmd() + cmd.startport = startport + cmd.endport = endport + cmd.protocol = protocol + cmd.openfirewall = openfirewall + cmd.ipaddressid = ipaddressid + return StaticNATRule(apiclient.createIpForwardingRule(cmd).__dict__) + def delete(self, apiclient): """Delete IP forwarding rule""" cmd = deleteIpForwardingRule.deleteIpForwardingRuleCmd() @@ -1629,6 +1648,162 @@ def list(cls, apiclient, **kwargs): cmd.listall=True return(apiclient.listFirewallRules(cmd)) +class Autoscale: + + """Manage Auto scale""" + + def __init__(self, items): + self.__dict__.update(items) + + @classmethod + def listCounters(cls, apiclient, **kwargs): + """Lists all available Counters.""" + + cmd = listCounters.listCountersCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listCounters(cmd)) + + @classmethod + def createCondition(cls, apiclient, counterid, relationaloperator, threshold): + """creates condition.""" + + cmd = createCondition.createConditionCmd() + cmd.counterid = counterid + cmd.relationaloperator = relationaloperator + cmd.threshold = threshold + return(apiclient.createCondition(cmd)) + + @classmethod + def listConditions(cls, apiclient, **kwargs): + """Lists all available Conditions.""" + + cmd = listConditions.listConditionsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listConditions(cmd)) + + @classmethod + def listAutoscalePolicies(cls, apiclient, **kwargs): + """Lists all available Autoscale Policies.""" + + cmd = listAutoScalePolicies.listAutoScalePoliciesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listAutoScalePolicies(cmd)) + + @classmethod + def createAutoscalePolicy(cls, apiclient, action, conditionids, duration, quiettime=None): + """creates condition.""" + + cmd = createAutoScalePolicy.createAutoScalePolicyCmd() + cmd.action = action + cmd.conditionids = conditionids + cmd.duration = duration + if quiettime: + cmd.quiettime = quiettime + + return(apiclient.createAutoScalePolicy(cmd)) + + @classmethod + def updateAutoscalePolicy(cls, apiclient, id, **kwargs): + """Updates Autoscale Policy.""" + + cmd = updateAutoScalePolicy.updateAutoScalePolicyCmd() + cmd.id = id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.updateAutoScalePolicy(cmd)) + + @classmethod + def listAutoscaleVmPofiles(cls, apiclient, **kwargs): + """Lists all available AutoscaleVM Profiles.""" + + cmd = listAutoScaleVmProfiles.listAutoScaleVmProfilesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listAutoScaleVmProfiles(cmd)) + + @classmethod + def createAutoscaleVmProfile(cls, apiclient, serviceofferingid, zoneid, templateid, + autoscaleuserid=None, destroyvmgraceperiod=None, counterparam=None): + """creates Autoscale VM Profile.""" + + cmd = createAutoScaleVmProfile.createAutoScaleVmProfileCmd() + cmd.serviceofferingid = serviceofferingid + cmd.zoneid = zoneid + cmd.templateid = templateid + if autoscaleuserid: + cmd.autoscaleuserid = autoscaleuserid + + if destroyvmgraceperiod: + cmd.destroyvmgraceperiod = destroyvmgraceperiod + + if counterparam: + for name, value in counterparam.items(): + cmd.counterparam.append({ + 'name': name, + 'value': value + }) + + return(apiclient.createAutoScaleVmProfile(cmd)) + + @classmethod + def updateAutoscaleVMProfile(cls, apiclient, id, **kwargs): + """Updates Autoscale Policy.""" + + cmd = updateAutoScaleVmProfile.updateAutoScaleVmProfileCmd() + cmd.id = id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.updateAutoScaleVmProfile(cmd)) + + @classmethod + def createAutoscaleVmGroup(cls, apiclient, lbruleid, minmembers, maxmembers, + scaledownpolicyids, scaleuppolicyids, vmprofileid, interval=None): + """creates Autoscale VM Group.""" + + cmd = createAutoScaleVmGroup.createAutoScaleVmGroupCmd() + cmd.lbruleid = lbruleid + cmd.minmembers = minmembers + cmd.maxmembers = maxmembers + cmd.scaledownpolicyids = scaledownpolicyids + cmd.scaleuppolicyids = scaleuppolicyids + cmd.vmprofileid = vmprofileid + if interval: + cmd.interval = interval + + return(apiclient.createAutoScaleVmGroup(cmd)) + + @classmethod + def listAutoscaleVmGroup(cls, apiclient, **kwargs): + """Lists all available AutoscaleVM Group.""" + + cmd = listAutoScaleVmGroups.listAutoScaleVmGroupsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listAutoScaleVmGroups(cmd)) + + @classmethod + def enableAutoscaleVmGroup(cls, apiclient, id, **kwargs): + """Enables AutoscaleVM Group.""" + + cmd = enableAutoScaleVmGroup.enableAutoScaleVmGroupCmd() + cmd.id = id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.enableAutoScaleVmGroup(cmd)) + + @classmethod + def disableAutoscaleVmGroup(cls, apiclient, id, **kwargs): + """Disables AutoscaleVM Group.""" + + cmd = disableAutoScaleVmGroup.disableAutoScaleVmGroupCmd() + cmd.id = id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.disableAutoScaleVmGroup(cmd)) + + @classmethod + def updateAutoscaleVMGroup(cls, apiclient, id, **kwargs): + """Updates Autoscale VM Group.""" + + cmd = updateAutoScaleVmGroup.updateAutoScaleVmGroupCmd() + cmd.id = id + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.updateAutoScaleVmGroup(cmd)) + class ServiceOffering: @@ -2003,6 +2178,18 @@ def list(cls, apiclient, **kwargs): cmd.listall=True return(apiclient.listLoadBalancerRules(cmd)) + @classmethod + def listLoadBalancerRuleInstances(cls, apiclient, id, applied=None, **kwargs): + """Lists load balancing rule Instances""" + + cmd = listLoadBalancerRuleInstances.listLoadBalancerRuleInstancesCmd() + cmd.id = id + if applied: + cmd.applied = applied + + [setattr(cmd, k, v) for k, v in kwargs.items()] + return apiclient.listLoadBalancerRuleInstances(cmd) + class Cluster: @@ -2498,7 +2685,7 @@ def __init__(self, items): @classmethod def create(cls, apiclient, publicipid, account=None, domainid=None, - projectid=None, networkid=None, vpcid=None): + projectid=None, networkid=None, vpcid=None, openfirewall=None): """Create VPN for Public IP address""" cmd = createRemoteAccessVpn.createRemoteAccessVpnCmd() cmd.publicipid = publicipid @@ -2512,6 +2699,8 @@ def create(cls, apiclient, publicipid, account=None, domainid=None, cmd.networkid = networkid if vpcid: cmd.vpcid = vpcid + if openfirewall: + cmd.openfirewall = openfirewall return Vpn(apiclient.createRemoteAccessVpn(cmd).__dict__) def delete(self, apiclient): From f748a552e9546e91e18c574b375f3ea6c8d7e043 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Wed, 14 May 2014 10:21:46 -0700 Subject: [PATCH 465/683] Disable IAM feature from 4.4 release. --- api/src/com/cloud/network/NetworkModel.java | 4 - api/src/com/cloud/user/AccountService.java | 7 +- .../cloudstack/acl/SecurityChecker.java | 6 +- .../address/AssociateIPAddrCmdByAdmin.java | 5 +- .../admin/vm/AddNicToVMCmdByAdmin.java | 1 + .../user/address/AssociateIPAddrCmd.java | 1 - .../firewall/CreatePortForwardingRuleCmd.java | 1 + .../AssignToLoadBalancerRuleCmd.java | 9 +- .../ListLBStickinessPoliciesCmd.java | 4 +- .../command/user/nat/DisableStaticNatCmd.java | 5 +- .../command/user/nat/EnableStaticNatCmd.java | 9 +- .../user/snapshot/CreateSnapshotCmd.java | 2 - .../api/command/user/vm/AddNicToVMCmd.java | 1 - .../user/vmsnapshot/CreateVMSnapshotCmd.java | 3 +- .../command/user/volume/AttachVolumeCmd.java | 4 +- .../command/user/volume/CreateVolumeCmd.java | 4 - client/pom.xml | 10 - client/tomcatconf/commands.properties.in | 15 - .../spring-core-registry-core-context.xml | 2 +- .../cloud/upgrade/dao/Upgrade430to440.java | 47 - .../db/src/com/cloud/utils/db/SearchBase.java | 12 +- .../lb/InternalLoadBalancerVMManagerImpl.java | 9 +- .../management/ServiceManagerImpl.java | 5 +- .../management/MockAccountManager.java | 86 +- .../spring-server-core-managers-context.xml | 1 - server/src/com/cloud/acl/DomainChecker.java | 19 +- server/src/com/cloud/api/ApiDispatcher.java | 22 + .../src/com/cloud/api/ApiResponseHelper.java | 2 +- .../api/dispatch/ParamProcessWorker.java | 107 +- .../com/cloud/api/query/QueryManagerImpl.java | 743 ++----- .../ConfigurationManagerImpl.java | 3 +- .../cloud/network/IpAddressManagerImpl.java | 17 +- .../com/cloud/network/NetworkModelImpl.java | 45 +- .../com/cloud/network/NetworkServiceImpl.java | 26 +- .../network/as/AutoScaleManagerImpl.java | 38 +- .../network/firewall/FirewallManagerImpl.java | 23 +- .../lb/LoadBalancingRulesManagerImpl.java | 52 +- .../VirtualNetworkApplianceManagerImpl.java | 10 +- .../cloud/network/rules/RulesManagerImpl.java | 46 +- .../security/SecurityGroupManagerImpl.java | 8 +- .../network/vpc/NetworkACLServiceImpl.java | 56 +- .../com/cloud/network/vpc/VpcManagerImpl.java | 65 +- .../vpn/RemoteAccessVpnManagerImpl.java | 42 +- .../network/vpn/Site2SiteVpnManagerImpl.java | 57 +- .../cloud/projects/ProjectManagerImpl.java | 18 +- .../ResourceLimitManagerImpl.java | 8 +- .../cloud/server/ManagementServerImpl.java | 36 +- .../cloud/servlet/ConsoleProxyServlet.java | 2 +- .../cloud/storage/VolumeApiServiceImpl.java | 23 +- .../storage/snapshot/SnapshotManagerImpl.java | 26 +- .../cloud/tags/TaggedResourceManagerImpl.java | 4 +- .../cloud/template/TemplateAdapterBase.java | 4 +- .../cloud/template/TemplateManagerImpl.java | 34 +- server/src/com/cloud/user/AccountManager.java | 33 +- .../com/cloud/user/AccountManagerImpl.java | 649 ++++-- .../src/com/cloud/vm/UserVmManagerImpl.java | 111 +- .../vm/snapshot/VMSnapshotManagerImpl.java | 25 +- .../affinity/AffinityGroupServiceImpl.java | 13 +- .../ApplicationLoadBalancerManagerImpl.java | 15 +- .../network/lb/CertServiceImpl.java | 8 +- .../GlobalLoadBalancingRulesServiceImpl.java | 14 +- .../cloud/event/EventControlsUnitTest.java | 2 +- .../cloud/network/MockNetworkModelImpl.java | 8 - .../cloud/user/MockAccountManagerImpl.java | 75 +- .../test/com/cloud/vm/UserVmManagerTest.java | 8 +- .../vm/snapshot/VMSnapshotManagerTest.java | 2 +- .../com/cloud/vpc/MockNetworkModelImpl.java | 8 - .../iam/RoleBasedEntityAccessChecker.java | 19 +- .../cloudstack/iam/server/IAMServiceImpl.java | 1811 +++++++++-------- services/pom.xml | 1 - test/integration/smoke/test_vm_iam.py | 719 ------- 71 files changed, 2087 insertions(+), 3223 deletions(-) delete mode 100644 test/integration/smoke/test_vm_iam.py diff --git a/api/src/com/cloud/network/NetworkModel.java b/api/src/com/cloud/network/NetworkModel.java index 1e0a8e88e4..f6555db565 100644 --- a/api/src/com/cloud/network/NetworkModel.java +++ b/api/src/com/cloud/network/NetworkModel.java @@ -22,8 +22,6 @@ import java.util.Map; import java.util.Set; -import org.apache.cloudstack.acl.SecurityChecker.AccessType; - import com.cloud.dc.Vlan; import com.cloud.exception.InsufficientAddressCapacityException; import com.cloud.exception.InvalidParameterValueException; @@ -275,6 +273,4 @@ public interface NetworkModel { boolean isNetworkReadyForGc(long networkId); boolean getNetworkEgressDefaultPolicy(Long networkId); - - void checkNetworkPermissions(Account owner, Network network, AccessType accessType); } \ No newline at end of file diff --git a/api/src/com/cloud/user/AccountService.java b/api/src/com/cloud/user/AccountService.java index 6cc86cda3f..eac8a76849 100755 --- a/api/src/com/cloud/user/AccountService.java +++ b/api/src/com/cloud/user/AccountService.java @@ -103,11 +103,12 @@ UserAccount createUserAccount(String userName, String password, String firstName RoleType getRoleType(Account account); - void checkAccess(Account caller, Domain domain) throws PermissionDeniedException; + void checkAccess(Account account, Domain domain) throws PermissionDeniedException; - void checkAccess(Account caller, AccessType accessType, ControlledEntity... entities) throws PermissionDeniedException; + void checkAccess(Account account, AccessType accessType, boolean sameOwner, ControlledEntity... entities) throws PermissionDeniedException; - void checkAccess(Account caller, AccessType accessType, String apiName, ControlledEntity... entities) throws PermissionDeniedException; + void checkAccess(Account account, AccessType accessType, boolean sameOwner, String apiName, + ControlledEntity... entities) throws PermissionDeniedException; Long finalyzeAccountId(String accountName, Long domainId, Long projectId, boolean enabledOnly); diff --git a/api/src/org/apache/cloudstack/acl/SecurityChecker.java b/api/src/org/apache/cloudstack/acl/SecurityChecker.java index 79366bdc97..4170871754 100644 --- a/api/src/org/apache/cloudstack/acl/SecurityChecker.java +++ b/api/src/org/apache/cloudstack/acl/SecurityChecker.java @@ -31,10 +31,10 @@ public interface SecurityChecker extends Adapter { public enum AccessType { - ListEntry, - UseEntry, - OperateEntry, ModifyProject, + OperateEntry, + UseEntry, + ListEntry } /** diff --git a/api/src/org/apache/cloudstack/api/command/admin/address/AssociateIPAddrCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/address/AssociateIPAddrCmdByAdmin.java index 494a6d66e4..dbff93f222 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/address/AssociateIPAddrCmdByAdmin.java +++ b/api/src/org/apache/cloudstack/api/command/admin/address/AssociateIPAddrCmdByAdmin.java @@ -31,11 +31,8 @@ import com.cloud.exception.ResourceAllocationException; import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.IpAddress; -import com.cloud.network.vpc.Vpc; -@APICommand(name = "associateIpAddress", description = "Acquires and associates a public IP to an account.", responseObject = IPAddressResponse.class, responseView = ResponseView.Full, - entityType = {IpAddress.class, Vpc.class}, - requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) +@APICommand(name = "associateIpAddress", description = "Acquires and associates a public IP to an account.", responseObject = IPAddressResponse.class, responseView = ResponseView.Full) public class AssociateIPAddrCmdByAdmin extends AssociateIPAddrCmd { public static final Logger s_logger = Logger.getLogger(AssociateIPAddrCmdByAdmin.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/admin/vm/AddNicToVMCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vm/AddNicToVMCmdByAdmin.java index 3dd22c15ad..945f8499fe 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vm/AddNicToVMCmdByAdmin.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vm/AddNicToVMCmdByAdmin.java @@ -33,6 +33,7 @@ import com.cloud.uservm.UserVm; import com.cloud.vm.VirtualMachine; + @APICommand(name = "addNicToVirtualMachine", description = "Adds VM to specified network by creating a NIC", responseObject = UserVmResponse.class, responseView = ResponseView.Full, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = true) public class AddNicToVMCmdByAdmin extends AddNicToVMCmd { diff --git a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java index 48fe43ee84..96174e1237 100644 --- a/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/address/AssociateIPAddrCmd.java @@ -58,7 +58,6 @@ import com.cloud.user.Account; @APICommand(name = "associateIpAddress", description = "Acquires and associates a public IP to an account.", responseObject = IPAddressResponse.class, responseView = ResponseView.Restricted, - entityType = {IpAddress.class, Vpc.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class AssociateIPAddrCmd extends BaseAsyncCreateCmd { public static final Logger s_logger = Logger.getLogger(AssociateIPAddrCmd.class.getName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java index 6fb120fa8b..865cd1b764 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreatePortForwardingRuleCmd.java @@ -49,6 +49,7 @@ import com.cloud.utils.net.NetUtils; import com.cloud.vm.VirtualMachine; + @APICommand(name = "createPortForwardingRule", description = "Creates a port forwarding rule", responseObject = FirewallRuleResponse.class, entityType = {FirewallRule.class, VirtualMachine.class, IpAddress.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java index db4d70e685..dd9adefb6c 100644 --- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/AssignToLoadBalancerRuleCmd.java @@ -23,11 +23,8 @@ import java.util.List; import java.util.Map; -import com.cloud.utils.net.NetUtils; import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.SecurityChecker.AccessType; -import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -41,15 +38,15 @@ import com.cloud.event.EventTypes; import com.cloud.exception.InvalidParameterValueException; -import com.cloud.network.rules.FirewallRule; import com.cloud.network.rules.LoadBalancer; import com.cloud.user.Account; import com.cloud.utils.StringUtils; +import com.cloud.utils.net.NetUtils; import com.cloud.vm.VirtualMachine; @APICommand(name = "assignToLoadBalancerRule", description = "Assigns virtual machine or a list of virtual machines to a load balancer rule.", - responseObject = SuccessResponse.class, entityType = {FirewallRule.class, VirtualMachine.class}, + responseObject = SuccessResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd { @@ -61,7 +58,6 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @ACL(accessType = AccessType.OperateEntry) @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, @@ -69,7 +65,6 @@ public class AssignToLoadBalancerRuleCmd extends BaseAsyncCmd { description = "the ID of the load balancer rule") private Long id; - @ACL(accessType = AccessType.OperateEntry) @Parameter(name = ApiConstants.VIRTUAL_MACHINE_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java index dd031913c1..9905c0b1ac 100644 --- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java @@ -86,7 +86,7 @@ public void execute() { if (lb != null) { //check permissions Account caller = CallContext.current().getCallingAccount(); - _accountService.checkAccess(caller, null, lb); + _accountService.checkAccess(caller, null, true, lb); List stickinessPolicies = _lbService.searchForLBStickinessPolicies(this); LBStickinessResponse spResponse = _responseGenerator.createLBStickinessPolicyResponse(stickinessPolicies, lb); spResponses.add(spResponse); @@ -94,7 +94,7 @@ public void execute() { } response.setResponseName(getCommandName()); - setResponseObject(response); + this.setResponseObject(response); } } diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/DisableStaticNatCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/DisableStaticNatCmd.java index 2a9311e963..1df77ec0fd 100644 --- a/api/src/org/apache/cloudstack/api/command/user/nat/DisableStaticNatCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/nat/DisableStaticNatCmd.java @@ -34,11 +34,8 @@ import com.cloud.exception.NetworkRuleConflictException; import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.IpAddress; -import com.cloud.network.vpc.Vpc; -import com.cloud.vm.VirtualMachine; @APICommand(name = "disableStaticNat", description = "Disables static rule for given ip address", responseObject = SuccessResponse.class, - entityType = {IpAddress.class, VirtualMachine.class, Vpc.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class DisableStaticNatCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(DeletePortForwardingRuleCmd.class.getName()); @@ -92,7 +89,7 @@ public void execute() throws ResourceUnavailableException, NetworkRuleConflictEx if (result) { SuccessResponse response = new SuccessResponse(getCommandName()); - setResponseObject(response); + this.setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to disable static nat"); } diff --git a/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java b/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java index 9d888760fa..aa4e28768a 100644 --- a/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/nat/EnableStaticNatCmd.java @@ -18,8 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.SecurityChecker.AccessType; -import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; @@ -35,13 +33,10 @@ import com.cloud.exception.NetworkRuleConflictException; import com.cloud.exception.ResourceUnavailableException; import com.cloud.network.IpAddress; -import com.cloud.network.vpc.Vpc; import com.cloud.user.Account; import com.cloud.uservm.UserVm; -import com.cloud.vm.VirtualMachine; @APICommand(name = "enableStaticNat", description = "Enables static nat for given ip address", responseObject = SuccessResponse.class, - entityType = {IpAddress.class, VirtualMachine.class, Vpc.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class EnableStaticNatCmd extends BaseCmd { public static final Logger s_logger = Logger.getLogger(CreateIpForwardingRuleCmd.class.getName()); @@ -52,12 +47,10 @@ public class EnableStaticNatCmd extends BaseCmd { //////////////// API parameters ///////////////////// ///////////////////////////////////////////////////// - @ACL(accessType = AccessType.OperateEntry) @Parameter(name = ApiConstants.IP_ADDRESS_ID, type = CommandType.UUID, entityType = IPAddressResponse.class, required = true, description = "the public IP " + "address id for which static nat feature is being enabled") private Long ipAddressId; - @ACL(accessType = AccessType.OperateEntry) @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, entityType = UserVmResponse.class, required = true, description = "the ID of " + "the virtual machine for enabling static nat feature") private Long virtualMachineId; @@ -140,7 +133,7 @@ public void execute() throws ResourceUnavailableException { boolean result = _rulesService.enableStaticNat(ipAddressId, virtualMachineId, getNetworkId(), getVmSecondaryIp()); if (result) { SuccessResponse response = new SuccessResponse(getCommandName()); - setResponseObject(response); + this.setResponseObject(response); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to enable static nat"); } diff --git a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java index bd8662e146..df7fe8296b 100644 --- a/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/snapshot/CreateSnapshotCmd.java @@ -18,7 +18,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -63,7 +62,6 @@ public class CreateSnapshotCmd extends BaseAsyncCreateCmd { description = "The domain ID of the snapshot. If used with the account parameter, specifies a domain for the account associated with the disk volume.") private Long domainId; - @ACL @Parameter(name = ApiConstants.VOLUME_ID, type = CommandType.UUID, entityType = VolumeResponse.class, required = true, description = "The ID of the disk volume") private Long volumeId; diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java index fd30152ae0..f265ecf236 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/AddNicToVMCmd.java @@ -54,7 +54,6 @@ public class AddNicToVMCmd extends BaseAsyncCmd { required=true, description="Virtual Machine ID") private Long vmId; - @ACL @Parameter(name = ApiConstants.NETWORK_ID, type = CommandType.UUID, entityType = NetworkResponse.class, required = true, description = "Network ID") private Long netId; diff --git a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java index 1310ba5b75..10ff5cddb1 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vmsnapshot/CreateVMSnapshotCmd.java @@ -19,6 +19,7 @@ import java.util.logging.Logger; +import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -42,7 +43,7 @@ public class CreateVMSnapshotCmd extends BaseAsyncCreateCmd { public static final Logger s_logger = Logger.getLogger(CreateVMSnapshotCmd.class.getName()); private static final String s_name = "createvmsnapshotresponse"; - @ACL + @ACL(accessType = AccessType.OperateEntry) @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, required = true, entityType = UserVmResponse.class, description = "The ID of the vm") private Long vmId; diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java index 8034745951..467ffc4afd 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/AttachVolumeCmd.java @@ -37,8 +37,7 @@ import com.cloud.user.Account; import com.cloud.vm.VirtualMachine; -@APICommand(name = "attachVolume", description = "Attaches a disk volume to a virtual machine.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = { - VirtualMachine.class, Volume.class}, +@APICommand(name = "attachVolume", description = "Attaches a disk volume to a virtual machine.", responseObject = VolumeResponse.class, responseView = ResponseView.Restricted, entityType = {VirtualMachine.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) public class AttachVolumeCmd extends BaseAsyncCmd { public static final Logger s_logger = Logger.getLogger(AttachVolumeCmd.class.getName()); @@ -53,7 +52,6 @@ public class AttachVolumeCmd extends BaseAsyncCmd { + "* 4 - /dev/xvde" + "* 5 - /dev/xvdf" + "* 6 - /dev/xvdg" + "* 7 - /dev/xvdh" + "* 8 - /dev/xvdi" + "* 9 - /dev/xvdj") private Long deviceId; - @ACL(accessType = AccessType.OperateEntry) @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = VolumeResponse.class, required = true, description = "the ID of the disk volume") private Long id; diff --git a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java index dc912610b4..1e3c01cec9 100644 --- a/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/volume/CreateVolumeCmd.java @@ -19,8 +19,6 @@ import org.apache.log4j.Logger; import org.apache.cloudstack.acl.RoleType; -import org.apache.cloudstack.acl.SecurityChecker.AccessType; -import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiCommandJobType; import org.apache.cloudstack.api.ApiConstants; @@ -93,7 +91,6 @@ public class CreateVolumeCmd extends BaseAsyncCreateCustomIdCmd { @Parameter(name = ApiConstants.MAX_IOPS, type = CommandType.LONG, description = "max iops") private Long maxIops; - @ACL @Parameter(name = ApiConstants.SNAPSHOT_ID, type = CommandType.UUID, entityType = SnapshotResponse.class, @@ -106,7 +103,6 @@ public class CreateVolumeCmd extends BaseAsyncCreateCustomIdCmd { @Parameter(name = ApiConstants.DISPLAY_VOLUME, type = CommandType.BOOLEAN, description = "an optional field, whether to display the volume to the end user or not.", authorized = {RoleType.Admin}) private Boolean displayVolume; - @ACL(accessType = AccessType.OperateEntry) @Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, entityType = UserVmResponse.class, diff --git a/client/pom.xml b/client/pom.xml index eda8a8560f..1a972c9d3d 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -226,16 +226,6 @@ cloud-mom-inmemory ${project.version} - - org.apache.cloudstack - cloud-plugin-iam - ${project.version} - - - org.apache.cloudstack - cloud-iam - ${project.version} - org.apache.cloudstack cloud-framework-ipc diff --git a/client/tomcatconf/commands.properties.in b/client/tomcatconf/commands.properties.in index da3fbfc00d..d247aa0347 100644 --- a/client/tomcatconf/commands.properties.in +++ b/client/tomcatconf/commands.properties.in @@ -732,21 +732,6 @@ listLdapUsers=3 ldapCreateAccount=3 importLdapUsers=3 -### IAM commands -createIAMPolicy=1 -deleteIAMPolicy=1 -listIAMPolicies=1 -addIAMPermissionToIAMPolicy=1 -removeIAMPermissionFromIAMPolicy=1 -createIAMGroup=1 -deleteIAMGroup=1 -listIAMGroups=1 -addAccountToIAMGroup=1 -removeAccountFromIAMGroup=1 -attachIAMPolicyToIAMGroup=1 -removeIAMPolicyFromIAMGroup=1 -attachIAMPolicyToAccount=1 -removeIAMPolicyFromAccount=1 #### juniper-contrail commands createServiceInstance=1 diff --git a/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml b/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml index 0f58d7d35e..d54823a33e 100644 --- a/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml +++ b/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml @@ -46,7 +46,7 @@ + value="AffinityGroupAccessChecker,DomainChecker" /> 0) { - return _specifiedAttrs.get(0); - } - // look for attributes from joins - for (JoinBuilder> join : _joins.values()) { - SearchBase sb = join.getT(); - if (sb.getSpecifiedAttribute() != null) { - return sb.getSpecifiedAttribute(); - } - } - throw new CloudRuntimeException("Unable to find any specified attributes. You sure you know what you're doing?"); + return _specifiedAttrs.get(0); } protected List getSpecifiedAttributes() { diff --git a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java index 89707c9dd2..aa763d582b 100644 --- a/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java +++ b/plugins/network-elements/internal-loadbalancer/src/org/apache/cloudstack/network/lb/InternalLoadBalancerVMManagerImpl.java @@ -27,12 +27,11 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.log4j.Logger; - import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.lb.ApplicationLoadBalancerRuleVO; import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao; +import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; import com.cloud.agent.api.Answer; @@ -520,7 +519,7 @@ public boolean destroyInternalLbVm(long vmId, Account caller, Long callerUserId) return true; } - _accountMgr.checkAccess(caller, null, internalLbVm); + _accountMgr.checkAccess(caller, null, true, internalLbVm); _itMgr.expunge(internalLbVm.getUuid()); _internalLbVmDao.remove(internalLbVm.getId()); @@ -535,7 +534,7 @@ public VirtualRouter stopInternalLbVm(long vmId, boolean forced, Account caller, } //check permissions - _accountMgr.checkAccess(caller, null, internalLbVm); + _accountMgr.checkAccess(caller, null, true, internalLbVm); return stopInternalLbVm(internalLbVm, forced, caller, callerUserId); } @@ -913,7 +912,7 @@ public VirtualRouter startInternalLbVm(long internalLbVmId, Account caller, long } //check permissions - _accountMgr.checkAccess(caller, null, internalLbVm); + _accountMgr.checkAccess(caller, null, true, internalLbVm); return startInternalLbVm(internalLbVm, caller, callerUserId, null); } diff --git a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java index acd9b4e86f..f34eaccbb0 100644 --- a/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java +++ b/plugins/network-elements/juniper-contrail/src/org/apache/cloudstack/network/contrail/management/ServiceManagerImpl.java @@ -30,7 +30,6 @@ import net.juniper.contrail.api.ApiConnector; import net.juniper.contrail.api.types.ServiceInstance; -import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.network.contrail.api.response.ServiceInstanceResponse; import org.apache.cloudstack.network.contrail.model.ServiceInstanceModel; @@ -137,10 +136,10 @@ public ServiceVirtualMachine createServiceInstance(DataCenter zone, Account owne // TODO: permission model. // service instances need to be able to access the public network. if (left.getTrafficType() == TrafficType.Guest) { - _networkModel.checkNetworkPermissions(owner, left, AccessType.UseEntry); + _networkModel.checkNetworkPermissions(owner, left); } if (right.getTrafficType() == TrafficType.Guest) { - _networkModel.checkNetworkPermissions(owner, right, AccessType.UseEntry); + _networkModel.checkNetworkPermissions(owner, right); } final ApiConnector api = _manager.getApiConnector(); diff --git a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/MockAccountManager.java b/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/MockAccountManager.java index a39fb434b0..1a29f9c529 100644 --- a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/MockAccountManager.java +++ b/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/MockAccountManager.java @@ -34,6 +34,7 @@ import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd; import org.apache.cloudstack.context.CallContext; +import com.cloud.api.query.vo.ControlledViewEntity; import com.cloud.configuration.ResourceLimit; import com.cloud.configuration.dao.ResourceCountDao; import com.cloud.domain.Domain; @@ -100,6 +101,11 @@ public UserAccount getUserAccountById(Long userId) { return null; } + @Override + public void checkAccess(Account arg0, AccessType arg1, boolean arg2, ControlledEntity... arg3) throws PermissionDeniedException { + // TODO Auto-generated method stub + } + @Override public String[] createApiKeyAndSecretKey(RegisterCmd arg0) { // TODO Auto-generated method stub @@ -202,19 +208,7 @@ public void buildACLSearchParameters(Account caller, Long id, String accountName } - @Override - public void buildACLSearchBuilder(SearchBuilder sb, boolean isRecursive, List permittedDomains, List permittedAccounts, - List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria) { - // TODO Auto-generated method stub - } - - @Override - public void buildACLSearchCriteria(SearchCriteria sc, boolean isRecursive, List permittedDomains, List permittedAccounts, - List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria) { - // TODO Auto-generated method stub - - } @Override public void buildACLViewSearchCriteria(SearchCriteria sc, SearchCriteria aclSc, boolean isRecursive, @@ -247,6 +241,57 @@ public UserAccount authenticateUser(String arg0, String arg1, Long arg2, String return null; } + @Override + public void buildACLSearchBuilder( + SearchBuilder arg0, Long arg1, + boolean arg2, List arg3, ListProjectResourcesCriteria arg4) { + // TODO Auto-generated method stub + + } + + @Override + public void buildACLSearchCriteria( + SearchCriteria arg0, Long arg1, + boolean arg2, List arg3, ListProjectResourcesCriteria arg4) { + // TODO Auto-generated method stub + + } + + @Override + public void buildACLSearchParameters(Account arg0, Long arg1, String arg2, + Long arg3, List arg4, + Ternary arg5, + boolean arg6, boolean arg7) { + // TODO Auto-generated method stub + + } + + @Override + public void buildACLViewSearchBuilder(SearchBuilder sb, Long domainId, boolean isRecursive, List permittedAccounts, + ListProjectResourcesCriteria listProjectResourcesCriteria) { + // TODO Auto-generated method stub + + } + + @Override + public void buildACLViewSearchBuilder(SearchBuilder sb, Long domainId, boolean isRecursive, List permittedAccounts, + ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds) { + // TODO Auto-generated method stub + } + + @Override + public void buildACLViewSearchCriteria(SearchCriteria sc, Long domainId, boolean isRecursive, List permittedAccounts, + ListProjectResourcesCriteria listProjectResourcesCriteria) { + // TODO Auto-generated method stub + + } + + @Override + public void buildACLViewSearchCriteria(SearchCriteria sc, Long domainId, boolean isRecursive, List permittedAccounts, + ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds) { + // TODO Auto-generated method stub + + } @Override public Long checkAccessAndSpecifyAuthority(Account arg0, Long arg1) { @@ -362,24 +407,15 @@ public void logoutUser(long userId) { } - - @Override - public Long finalyzeAccountId(String accountName, Long domainId, Long projectId, boolean enabledOnly) { - // TODO Auto-generated method stub - return null; - } - @Override - public void checkAccess(Account account, AccessType accessType, ControlledEntity... entities) throws PermissionDeniedException { + public void checkAccess(Account account, AccessType accessType, boolean sameOwner, String apiName, + ControlledEntity... entities) throws PermissionDeniedException { // TODO Auto-generated method stub - } @Override - public void checkAccess(Account account, AccessType accessType, String apiName, ControlledEntity... entities) throws PermissionDeniedException { + public Long finalyzeAccountId(String accountName, Long domainId, Long projectId, boolean enabledOnly) { // TODO Auto-generated method stub - + return null; } - - } diff --git a/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml b/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml index 09abcb767b..fc1c7e23b9 100644 --- a/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml +++ b/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml @@ -74,7 +74,6 @@ - diff --git a/server/src/com/cloud/acl/DomainChecker.java b/server/src/com/cloud/acl/DomainChecker.java index 9ee65db935..729a0d1e2a 100755 --- a/server/src/com/cloud/acl/DomainChecker.java +++ b/server/src/com/cloud/acl/DomainChecker.java @@ -19,7 +19,6 @@ import javax.ejb.Local; import javax.inject.Inject; -import org.apache.log4j.Logger; import org.springframework.stereotype.Component; import org.apache.cloudstack.acl.ControlledEntity; @@ -51,8 +50,6 @@ @Local(value = SecurityChecker.class) public class DomainChecker extends AdapterBase implements SecurityChecker { - public static final Logger s_logger = Logger.getLogger(DomainChecker.class); - @Inject DomainDao _domainDao; @Inject @@ -104,15 +101,6 @@ public boolean checkAccess(User user, Domain domain) throws PermissionDeniedExce @Override public boolean checkAccess(Account caller, ControlledEntity entity, AccessType accessType) throws PermissionDeniedException { - - if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || _accountService.isRootAdmin(caller.getId())) { - // no need to make permission checks if the system/root admin makes the call - if (s_logger.isTraceEnabled()) { - s_logger.trace("No need to make permission check for System/RootAdmin account, returning true"); - } - return true; - } - if (entity instanceof VirtualMachineTemplate) { VirtualMachineTemplate template = (VirtualMachineTemplate)entity; @@ -344,15 +332,20 @@ public boolean checkAccess(Account caller, ControlledEntity entity, AccessType a if (action != null && ("SystemCapability".equals(action))) { if (caller != null && caller.getType() == Account.ACCOUNT_TYPE_ADMIN) { return true; + } else { + return false; } - } else if (action != null && ("DomainCapability".equals(action))) { if (caller != null && caller.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) { return true; + } else { + return false; } } else if (action != null && ("DomainResourceCapability".equals(action))) { if (caller != null && caller.getType() == Account.ACCOUNT_TYPE_RESOURCE_DOMAIN_ADMIN) { return true; + } else { + return false; } } return checkAccess(caller, entity, accessType); diff --git a/server/src/com/cloud/api/ApiDispatcher.java b/server/src/com/cloud/api/ApiDispatcher.java index b6b9b2915a..3447662b2b 100755 --- a/server/src/com/cloud/api/ApiDispatcher.java +++ b/server/src/com/cloud/api/ApiDispatcher.java @@ -23,6 +23,10 @@ import org.apache.log4j.Logger; +import org.apache.cloudstack.acl.ControlledEntity; +import org.apache.cloudstack.acl.InfrastructureEntity; +import org.apache.cloudstack.acl.SecurityChecker.AccessType; +import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseAsyncCmd; import org.apache.cloudstack.api.BaseAsyncCreateCmd; @@ -36,6 +40,7 @@ import com.cloud.api.dispatch.DispatchChain; import com.cloud.api.dispatch.DispatchChainFactory; import com.cloud.api.dispatch.DispatchTask; +import com.cloud.user.Account; import com.cloud.user.AccountManager; public class ApiDispatcher { @@ -74,6 +79,23 @@ public void dispatchCreateCmd(final BaseAsyncCreateCmd cmd, final Map entitiesToAccess) { + Account caller = CallContext.current().getCallingAccount(); + + APICommand commandAnnotation = cmd.getClass().getAnnotation(APICommand.class); + String apiName = commandAnnotation != null ? commandAnnotation.name() : null; + + if (!entitiesToAccess.isEmpty()) { + for (Object entity : entitiesToAccess.keySet()) { + if (entity instanceof ControlledEntity) { + _accountMgr.checkAccess(caller, entitiesToAccess.get(entity), false, apiName, (ControlledEntity) entity); + } else if (entity instanceof InfrastructureEntity) { + //FIXME: Move this code in adapter, remove code from Account manager + } + } + } + } + public void dispatch(final BaseCmd cmd, final Map params, final boolean execute) throws Exception { // Let the chain of responsibility dispatch gradually standardDispatchChain.dispatch(new DispatchTask(cmd, params)); diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 6746c130d3..a4f08fd4e3 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -1855,7 +1855,7 @@ public AsyncJobResponse queryJobResult(QueryAsyncJobResultCmd cmd) { throw new PermissionDeniedException("Account " + caller + " is not authorized to see job id=" + job.getId()); } } else if (_accountMgr.isDomainAdmin(caller.getId())) { - _accountMgr.checkAccess(caller, null, jobOwner); + _accountMgr.checkAccess(caller, null, true, jobOwner); } return createAsyncJobResponse(_jobMgr.queryJob(cmd.getId(), true)); diff --git a/server/src/com/cloud/api/dispatch/ParamProcessWorker.java b/server/src/com/cloud/api/dispatch/ParamProcessWorker.java index ba5bebff64..0bb0220039 100644 --- a/server/src/com/cloud/api/dispatch/ParamProcessWorker.java +++ b/server/src/com/cloud/api/dispatch/ParamProcessWorker.java @@ -40,7 +40,6 @@ import org.apache.cloudstack.acl.SecurityChecker; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.ACL; -import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.BaseAsyncCreateCmd; import org.apache.cloudstack.api.BaseCmd; @@ -56,11 +55,7 @@ import org.apache.cloudstack.api.command.user.event.ListEventsCmd; import org.apache.cloudstack.context.CallContext; -import com.cloud.dc.DataCenter; import com.cloud.exception.InvalidParameterValueException; -import com.cloud.exception.PermissionDeniedException; -import com.cloud.offering.DiskOffering; -import com.cloud.offering.ServiceOffering; import com.cloud.user.Account; import com.cloud.user.AccountManager; import com.cloud.utils.DateUtil; @@ -222,111 +217,27 @@ public void processParameters(final BaseCmd cmd, final Map params) { } - private void doAccessChecks(final BaseCmd cmd, final Map entitiesToAccess) { + private void doAccessChecks(BaseCmd cmd, Map entitiesToAccess) { Account caller = CallContext.current().getCallingAccount(); - Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId()); - if (owner == null) { - owner = caller; - } + Account owner = _accountMgr.getActiveAccountById(cmd.getEntityOwnerId()); if (cmd instanceof BaseAsyncCreateCmd) { - if (owner.getId() != caller.getId()) { - // mimic impersonation either by passing (account, domainId) or through derived owner from other api parameters - // in this case, we should check access using the owner - _accountMgr.checkAccess(caller, null, owner); - } - } else { - // check access using the caller for other operational cmds - owner = caller; + // check that caller can access the owner account. + _accountMgr.checkAccess(caller, null, true, owner); } - APICommand commandAnnotation = cmd.getClass().getAnnotation(APICommand.class); - - String apiName = commandAnnotation != null ? commandAnnotation.name() : null; - if (!entitiesToAccess.isEmpty()) { - List entitiesToOperate = new ArrayList(); + // check that caller can access the owner account. + _accountMgr.checkAccess(caller, null, true, owner); for (Object entity : entitiesToAccess.keySet()) { if (entity instanceof ControlledEntity) { - - if (AccessType.OperateEntry == entitiesToAccess.get(entity)) { - entitiesToOperate.add((ControlledEntity) entity); - } else { - _accountMgr.checkAccess(owner, entitiesToAccess.get(entity), apiName, - (ControlledEntity) entity); - } + _accountMgr.checkAccess(caller, entitiesToAccess.get(entity), true, (ControlledEntity) entity); } else if (entity instanceof InfrastructureEntity) { - if (entity instanceof DataCenter) { - checkZoneAccess(owner, (DataCenter)entity); - } else if (entity instanceof ServiceOffering) { - checkServiceOfferingAccess(owner, (ServiceOffering)entity); - } else if (entity instanceof DiskOffering) { - checkDiskOfferingAccess(owner, (DiskOffering)entity); - } - } - } - - if (!entitiesToOperate.isEmpty()) { - _accountMgr.checkAccess(owner, AccessType.OperateEntry, apiName, - entitiesToOperate.toArray(new ControlledEntity[entitiesToOperate.size()])); - } - - } - } - - private void checkDiskOfferingAccess(Account caller, DiskOffering dof) { - for (SecurityChecker checker : _secChecker) { - if (checker.checkAccess(caller, dof)) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Access granted to " + caller + " to disk offering:" + dof.getId() + " by " - + checker.getName()); - } - return; - } else { - throw new PermissionDeniedException("Access denied to " + caller + " by " + checker.getName()); - } - } - - assert false : "How can all of the security checkers pass on checking this caller?"; - throw new PermissionDeniedException("There's no way to confirm " + caller + " has access to disk offering:" - + dof.getId()); - } - - private void checkServiceOfferingAccess(Account caller, ServiceOffering sof) { - for (SecurityChecker checker : _secChecker) { - if (checker.checkAccess(caller, sof)) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Access granted to " + caller + " to service offering:" + sof.getId() + " by " - + checker.getName()); + // FIXME: Move this code in adapter, remove code from + // Account manager } - return; - } else { - throw new PermissionDeniedException("Access denied to " + caller + " by " + checker.getName()); } } - - assert false : "How can all of the security checkers pass on checking this caller?"; - throw new PermissionDeniedException("There's no way to confirm " + caller + " has access to service offering:" - + sof.getId()); - } - - private void checkZoneAccess(Account caller, DataCenter zone) { - for (SecurityChecker checker : _secChecker) { - if (checker.checkAccess(caller, zone)) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Access granted to " + caller + " to zone:" + zone.getId() + " by " - + checker.getName()); - } - return; - } else { - throw new PermissionDeniedException("Access denied to " + caller + " by " + checker.getName() - + " for zone " + zone.getId()); - } - } - - assert false : "How can all of the security checkers pass on checking this caller?"; - throw new PermissionDeniedException("There's no way to confirm " + caller + " has access to zone:" - + zone.getId()); } @SuppressWarnings({"unchecked", "rawtypes"}) diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java index a2437b8900..e675e83b9b 100644 --- a/server/src/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/com/cloud/api/query/QueryManagerImpl.java @@ -478,9 +478,7 @@ public ListResponse searchForEvents(ListEventsCmd cmd) { private Pair, Integer> searchForEventsInternal(ListEventsCmd cmd) { Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Long id = cmd.getId(); String type = cmd.getType(); @@ -493,14 +491,16 @@ private Pair, Integer> searchForEventsInternal(ListEventsCmd c Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, "listEvents"); - //Long domainId = domainIdRecursiveListProject.first(); + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, + domainIdRecursiveListProject, cmd.listAll(), false); + Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(EventJoinVO.class, "createDate", false, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchBuilder sb = _eventJoinDao.createSearchBuilder(); + _accountMgr.buildACLViewSearchBuilder(sb, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); sb.and("levelL", sb.entity().getLevel(), SearchCriteria.Op.LIKE); @@ -516,9 +516,9 @@ private Pair, Integer> searchForEventsInternal(ListEventsCmd c sb.and("archived", sb.entity().getArchived(), SearchCriteria.Op.EQ); SearchCriteria sc = sb.create(); - SearchCriteria aclSc = _eventJoinDao.createSearchCriteria(); - // building ACL search criteria - _accountMgr.buildACLViewSearchCriteria(sc, aclSc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + // building ACL condition + _accountMgr.buildACLViewSearchCriteria(sc, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); // For end users display only enabled events if (!_accountMgr.isRootAdmin(caller.getId())) { @@ -597,9 +597,7 @@ public ListResponse listTags(ListTagsCmd cmd) { private Pair, Integer> listTagsInternal(ListTagsCmd cmd) { Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); String key = cmd.getKey(); String value = cmd.getValue(); String resourceId = cmd.getResourceId(); @@ -610,14 +608,16 @@ private Pair, Integer> listTagsInternal(ListTagsCmd cmd) Ternary domainIdRecursiveListProject = new Ternary(cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, null, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, listAll, false, "listTags"); + _accountMgr.buildACLSearchParameters(caller, null, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, + domainIdRecursiveListProject, listAll, false); Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(ResourceTagJoinVO.class, "resourceType", false, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchBuilder sb = _resourceTagJoinDao.createSearchBuilder(); + _accountMgr.buildACLViewSearchBuilder(sb, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); sb.and("key", sb.entity().getKey(), SearchCriteria.Op.EQ); sb.and("value", sb.entity().getValue(), SearchCriteria.Op.EQ); @@ -633,9 +633,8 @@ private Pair, Integer> listTagsInternal(ListTagsCmd cmd) // now set the SC criteria... SearchCriteria sc = sb.create(); - SearchCriteria aclSc = _resourceTagJoinDao.createSearchCriteria(); - // building ACL search criteria - _accountMgr.buildACLViewSearchCriteria(sc, aclSc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLViewSearchCriteria(sc, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); if (key != null) { sc.setParameters("key", key); @@ -677,29 +676,28 @@ private Pair, Integer> searchForVmGroupsInternal(ListV String keyword = cmd.getKeyword(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, "listInstanceGroups"); - // Long domainId = domainIdRecursiveListProject.first(); + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, + domainIdRecursiveListProject, cmd.listAll(), false); + Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(InstanceGroupJoinVO.class, "id", true, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchBuilder sb = _vmGroupJoinDao.createSearchBuilder(); + _accountMgr.buildACLViewSearchBuilder(sb, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE); SearchCriteria sc = sb.create(); - SearchCriteria aclSc = _vmGroupJoinDao.createSearchCriteria(); - // building ACL search criteria - _accountMgr.buildACLViewSearchCriteria(sc, aclSc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLViewSearchCriteria(sc, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); if (keyword != null) { @@ -996,9 +994,7 @@ private Pair, Integer> searchForSecurityGroupsInternal String securityGroup = cmd.getSecurityGroupName(); Long id = cmd.getId(); Object keyword = cmd.getKeyword(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Map tags = cmd.getTags(); if (instanceId != null) { @@ -1006,14 +1002,14 @@ private Pair, Integer> searchForSecurityGroupsInternal if (userVM == null) { throw new InvalidParameterValueException("Unable to list network groups for virtual machine instance " + instanceId + "; instance not found."); } - _accountMgr.checkAccess(caller, null, userVM); + _accountMgr.checkAccess(caller, null, true, userVM); return listSecurityGroupRulesByVM(instanceId.longValue(), cmd.getStartIndex(), cmd.getPageSizeVal()); } Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, "listSecurityGroups"); + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, + domainIdRecursiveListProject, cmd.listAll(), false); Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); @@ -1022,13 +1018,15 @@ private Pair, Integer> searchForSecurityGroupsInternal SearchBuilder sb = _securityGroupJoinDao.createSearchBuilder(); sb.select(null, Func.DISTINCT, sb.entity().getId()); // select distinct // ids + _accountMgr.buildACLViewSearchBuilder(sb, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); + sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); sb.and("name", sb.entity().getName(), SearchCriteria.Op.EQ); SearchCriteria sc = sb.create(); - SearchCriteria aclSc = _securityGroupJoinDao.createSearchCriteria(); - // building ACL search criteria - _accountMgr.buildACLViewSearchCriteria(sc, aclSc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLViewSearchCriteria(sc, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); if (id != null) { sc.setParameters("id", id); @@ -1120,19 +1118,12 @@ private Pair, Integer> searchForRoutersInternal(BaseLis Long podId, Long clusterId, Long hostId, String keyword, Long networkId, Long vpcId, Boolean forVpc, String role, String version) { Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - String action = "listRouters"; - if (cmd instanceof ListInternalLBVMsCmd) { - action = "listInternalLoadBalancerVMs"; - } - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, action); - + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, + domainIdRecursiveListProject, cmd.listAll(), false); Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); @@ -1145,6 +1136,8 @@ private Pair, Integer> searchForRoutersInternal(BaseLis // number of // records with // pagination + _accountMgr.buildACLViewSearchBuilder(sb, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); sb.and("name", sb.entity().getInstanceName(), SearchCriteria.Op.LIKE); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); @@ -1171,9 +1164,8 @@ private Pair, Integer> searchForRoutersInternal(BaseLis } SearchCriteria sc = sb.create(); - SearchCriteria aclSc = _routerJoinDao.createSearchCriteria(); - // building ACL search criteria - _accountMgr.buildACLViewSearchCriteria(sc, aclSc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLViewSearchCriteria(sc, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); if (keyword != null) { SearchCriteria ssc = _routerJoinDao.createSearchCriteria(); @@ -1406,21 +1398,20 @@ public Pair, Integer> listProjectInvitationsIntern boolean listAll = cmd.listAll(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary( domainId, isRecursive, null); - _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, listAll, true, "listProjectInvitations"); - //domainId = domainIdRecursiveListProject.first(); - + _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedAccounts, + domainIdRecursiveListProject, listAll, true); + domainId = domainIdRecursiveListProject.first(); isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(ProjectInvitationJoinVO.class, "id", true, startIndex, pageSizeVal); SearchBuilder sb = _projectInvitationJoinDao.createSearchBuilder(); + _accountMgr.buildACLViewSearchBuilder(sb, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); sb.and("projectId", sb.entity().getProjectId(), SearchCriteria.Op.EQ); sb.and("state", sb.entity().getState(), SearchCriteria.Op.EQ); @@ -1428,9 +1419,8 @@ public Pair, Integer> listProjectInvitationsIntern sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); SearchCriteria sc = sb.create(); - SearchCriteria aclSc = _projectInvitationJoinDao.createSearchCriteria(); - // building ACL search criteria - _accountMgr.buildACLViewSearchCriteria(sc, aclSc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLViewSearchCriteria(sc, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); if (projectId != null) { sc.setParameters("projectId", projectId); @@ -1835,19 +1825,53 @@ public ListResponse searchForAccounts(ListAccountsCmd cmd) { private Pair, Integer> searchForAccountsInternal(ListAccountsCmd cmd) { Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); - List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); - - boolean listAll = cmd.listAll(); - Long id = cmd.getId(); + Long domainId = cmd.getDomainId(); + Long accountId = cmd.getId(); String accountName = cmd.getSearchName(); - Ternary domainIdRecursiveListProject = new Ternary( - cmd.getDomainId(), cmd.isRecursive(), null); - // ListAccountsCmd is not BaseListAccountResourcesCmd, so no (domainId, accountName) combination - _accountMgr.buildACLSearchParameters(caller, id, null, null, permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, listAll, false, "listAccounts"); - Boolean isRecursive = domainIdRecursiveListProject.second(); + boolean isRecursive = cmd.isRecursive(); + boolean listAll = cmd.listAll(); + Boolean listForDomain = false; + + if (accountId != null) { + Account account = _accountDao.findById(accountId); + if (account == null || account.getId() == Account.ACCOUNT_ID_SYSTEM) { + throw new InvalidParameterValueException("Unable to find account by id " + accountId); + } + + _accountMgr.checkAccess(caller, null, true, account); + } + + if (domainId != null) { + Domain domain = _domainDao.findById(domainId); + if (domain == null) { + throw new InvalidParameterValueException("Domain id=" + domainId + " doesn't exist"); + } + + _accountMgr.checkAccess(caller, domain); + + if (accountName != null) { + Account account = _accountDao.findActiveAccount(accountName, domainId); + if (account == null || account.getId() == Account.ACCOUNT_ID_SYSTEM) { + throw new InvalidParameterValueException("Unable to find account by name " + accountName + + " in domain " + domainId); + } + _accountMgr.checkAccess(caller, null, true, account); + } + } + + if (accountId == null) { + if (_accountMgr.isAdmin(caller.getId()) && listAll && domainId == null) { + listForDomain = true; + isRecursive = true; + if (domainId == null) { + domainId = caller.getDomainId(); + } + } else if (_accountMgr.isAdmin(caller.getId()) && domainId != null) { + listForDomain = true; + } else { + accountId = caller.getAccountId(); + } + } Filter searchFilter = new Filter(AccountJoinVO.class, "id", true, cmd.getStartIndex(), cmd.getPageSizeVal()); @@ -1858,6 +1882,7 @@ private Pair, Integer> searchForAccountsInternal(ListAccount SearchBuilder sb = _accountJoinDao.createSearchBuilder(); sb.and("accountName", sb.entity().getAccountName(), SearchCriteria.Op.EQ); + sb.and("domainId", sb.entity().getDomainId(), SearchCriteria.Op.EQ); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); sb.and("type", sb.entity().getType(), SearchCriteria.Op.EQ); sb.and("state", sb.entity().getState(), SearchCriteria.Op.EQ); @@ -1865,32 +1890,12 @@ private Pair, Integer> searchForAccountsInternal(ListAccount sb.and("typeNEQ", sb.entity().getType(), SearchCriteria.Op.NEQ); sb.and("idNEQ", sb.entity().getId(), SearchCriteria.Op.NEQ); - SearchCriteria sc = sb.create(); - SearchCriteria aclSc = _accountJoinDao.createSearchCriteria(); - // building ACL search criteria. Here we cannot use the common accountMgr.buildACLViewSearchCriteria because - // 1) AccountJoinVO does not have accountId field, permittedAccounts correspond to list of resource ids. - // 2) AccountJoinVO use type not accountType field to indicate its type - if (!permittedDomains.isEmpty() || !permittedAccounts.isEmpty() || !permittedResources.isEmpty()) { - if (!permittedDomains.isEmpty()) { - if (isRecursive) { - for (int i = 0; i < permittedDomains.size(); i++) { - Domain domain = _domainDao.findById(permittedDomains.get(i)); - aclSc.addOr("domainPath", SearchCriteria.Op.LIKE, domain.getPath() + "%"); - } - } else { - aclSc.addOr("domainId", SearchCriteria.Op.IN, permittedDomains.toArray()); - } - } - if (!permittedAccounts.isEmpty()) { - aclSc.addOr("id", SearchCriteria.Op.IN, permittedAccounts.toArray()); - } - if (!permittedResources.isEmpty()) { - aclSc.addOr("id", SearchCriteria.Op.IN, permittedResources.toArray()); - } - - sc.addAnd("id", SearchCriteria.Op.SC, aclSc); + if (listForDomain && isRecursive) { + sb.and("path", sb.entity().getDomainPath(), SearchCriteria.Op.LIKE); } + SearchCriteria sc = sb.create(); + sc.setParameters("idNEQ", Account.ACCOUNT_ID_SYSTEM); if (keyword != null) { @@ -1917,10 +1922,19 @@ private Pair, Integer> searchForAccountsInternal(ListAccount } // don't return account of type project to the end user - sc.setParameters("typeNEQ", Account.ACCOUNT_TYPE_PROJECT); + sc.setParameters("typeNEQ", 5); - if (id != null) { - sc.setParameters("id", id); + if (accountId != null) { + sc.setParameters("id", accountId); + } + + if (listForDomain) { + if (isRecursive) { + Domain domain = _domainDao.findById(domainId); + sc.setParameters("path", domain.getPath() + "%"); + } else { + sc.setParameters("domainId", domainId); + } } return _accountJoinDao.searchAndCount(sc, searchFilter); @@ -1939,20 +1953,17 @@ private Pair, Integer> searchForAsyncJobsInternal(ListAsync Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, null, cmd.getAccountName(), null, permittedDomains, permittedAccounts, permittedResources, domainIdRecursiveListProject, - cmd.listAll(), false, "listAsyncJobs"); + _accountMgr.buildACLSearchParameters(caller, null, cmd.getAccountName(), null, permittedAccounts, + domainIdRecursiveListProject, cmd.listAll(), false); Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(AsyncJobJoinVO.class, "id", true, cmd.getStartIndex(), cmd.getPageSizeVal()); - /* SearchBuilder sb = _jobJoinDao.createSearchBuilder(); sb.and("accountIdIN", sb.entity().getAccountId(), SearchCriteria.Op.IN); boolean accountJoinIsDone = false; @@ -1976,7 +1987,8 @@ private Pair, Integer> searchForAsyncJobsInternal(ListAsync } } - + Object keyword = cmd.getKeyword(); + Object startDate = cmd.getStartDate(); SearchCriteria sc = sb.create(); if (listProjectResourcesCriteria != null) { @@ -1993,17 +2005,6 @@ private Pair, Integer> searchForAsyncJobsInternal(ListAsync sc.setParameters("domainId", domainId); } } - */ - - Object keyword = cmd.getKeyword(); - Object startDate = cmd.getStartDate(); - - // populate the search criteria with the values passed in - SearchCriteria sc = _jobJoinDao.createSearchCriteria(); - SearchCriteria aclSc = _jobJoinDao.createSearchCriteria(); - - // building ACL search criteria - _accountMgr.buildACLViewSearchCriteria(sc, aclSc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); if (keyword != null) { sc.addAnd("cmd", SearchCriteria.Op.LIKE, "%" + keyword + "%"); @@ -2466,7 +2467,7 @@ private Pair, Integer> searchForServiceOfferingsInte throw ex; } - _accountMgr.checkAccess(caller, null, vmInstance); + _accountMgr.checkAccess(caller, null, true, vmInstance); ServiceOfferingVO offering = _srvOfferingDao.findByIdIncludingRemoved(vmInstance.getId(), vmInstance.getServiceOfferingId()); sc.addAnd("id", SearchCriteria.Op.NEQ, offering.getId()); @@ -2806,366 +2807,6 @@ public ListResponse listTemplates(ListTemplatesCmd cmd) { return response; } - // Temporarily disable this method which used IAM model to do template list - private Pair, Integer> searchForTemplatesInternalIAM(ListTemplatesCmd cmd) { - TemplateFilter templateFilter = TemplateFilter.valueOf(cmd.getTemplateFilter()); - Long id = cmd.getId(); - Map tags = cmd.getTags(); - boolean showRemovedTmpl = cmd.getShowRemoved(); - Account caller = CallContext.current().getCallingAccount(); - - // TODO: listAll flag has some conflicts with TemplateFilter parameter - boolean listAll = false; - if (templateFilter != null && templateFilter == TemplateFilter.all) { - if (_accountMgr.isNormalUser(caller.getId())) { - throw new InvalidParameterValueException("Filter " + TemplateFilter.all - + " can be specified by admin only"); - } - listAll = true; - } - - List permittedDomains = new ArrayList(); - List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); - - Ternary domainIdRecursiveListProject = new Ternary( - cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, listAll, false, "listTemplates"); - - Boolean isRecursive = domainIdRecursiveListProject.second(); - ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); - - boolean showDomr = ((templateFilter != TemplateFilter.selfexecutable) && (templateFilter != TemplateFilter.featured)); - HypervisorType hypervisorType = HypervisorType.getType(cmd.getHypervisor()); - - return searchForTemplatesInternalIAM(id, cmd.getTemplateName(), cmd.getKeyword(), templateFilter, false, null, - cmd.getPageSizeVal(), cmd.getStartIndex(), cmd.getZoneId(), hypervisorType, showDomr, - cmd.listInReadyState(), permittedDomains, permittedAccounts, permittedResources, isRecursive, caller, listProjectResourcesCriteria, tags, showRemovedTmpl); - } - - // Temporarily disable this method which used IAM model to do template list - private Pair, Integer> searchForTemplatesInternalIAM(Long templateId, String name, - String keyword, TemplateFilter templateFilter, boolean isIso, Boolean bootable, Long pageSize, - Long startIndex, Long zoneId, HypervisorType hyperType, boolean showDomr, boolean onlyReady, - List permittedDomains, List permittedAccounts, List permittedResources, boolean isRecursive, Account caller, - ListProjectResourcesCriteria listProjectResourcesCriteria, - Map tags, boolean showRemovedTmpl) { - - // check if zone is configured, if not, just return empty list - List hypers = null; - if (!isIso) { - hypers = _resourceMgr.listAvailHypervisorInZone(null, null); - if (hypers == null || hypers.isEmpty()) { - return new Pair, Integer>(new ArrayList(), 0); - } - } - - VMTemplateVO template = null; - - Boolean isAscending = Boolean.parseBoolean(_configDao.getValue("sortkey.algorithm")); - isAscending = (isAscending == null ? true : isAscending); - Filter searchFilter = new Filter(TemplateJoinVO.class, "sortKey", isAscending, startIndex, pageSize); - - SearchBuilder sb = _templateJoinDao.createSearchBuilder(); - sb.select(null, Func.DISTINCT, sb.entity().getTempZonePair()); // select distinct (templateId, zoneId) pair - SearchCriteria sc = sb.create(); - - // verify templateId parameter and specially handle it - if (templateId != null) { - template = _templateDao.findByIdIncludingRemoved(templateId); // Done for backward compatibility - Bug-5221 - if (template == null) { - throw new InvalidParameterValueException("Please specify a valid template ID."); - }// If ISO requested then it should be ISO. - if (isIso && template.getFormat() != ImageFormat.ISO) { - s_logger.error("Template Id " + templateId + " is not an ISO"); - InvalidParameterValueException ex = new InvalidParameterValueException("Specified Template Id is not an ISO"); - ex.addProxyObject(template.getUuid(), "templateId"); - throw ex; - }// If ISO not requested then it shouldn't be an ISO. - if (!isIso && template.getFormat() == ImageFormat.ISO) { - s_logger.error("Incorrect format of the template id " + templateId); - InvalidParameterValueException ex = new InvalidParameterValueException("Incorrect format " + template.getFormat() + " of the specified template id"); - ex.addProxyObject(template.getUuid(), "templateId"); - throw ex; - } - - // if template is not public, perform permission check here - if (!template.isPublicTemplate() && !_accountMgr.isRootAdmin(caller.getId())) { - Account owner = _accountMgr.getAccount(template.getAccountId()); - _accountMgr.checkAccess(caller, null, owner); - } - - // if templateId is specified, then we will just use the id to - // search and ignore other query parameters - sc.addAnd("id", SearchCriteria.Op.EQ, templateId); - } else { - if (!isIso) { - // add hypervisor criteria for template case - if (hypers != null && !hypers.isEmpty()) { - String[] relatedHypers = new String[hypers.size()]; - for (int i = 0; i < hypers.size(); i++) { - relatedHypers[i] = hypers.get(i).toString(); - } - sc.addAnd("hypervisorType", SearchCriteria.Op.IN, relatedHypers); - } - } - - // control different template filters - DomainVO callerDomain = _domainDao.findById(caller.getDomainId()); - if (templateFilter == TemplateFilter.featured || templateFilter == TemplateFilter.community) { - sc.addAnd("publicTemplate", SearchCriteria.Op.EQ, true); - if (templateFilter == TemplateFilter.featured) { - sc.addAnd("featured", SearchCriteria.Op.EQ, true); - } else { - sc.addAnd("featured", SearchCriteria.Op.EQ, false); - } - - /* We don't need this any more to check domain id, based on CLOUDSTACK-5987 - // for public templates, we should get all public templates from all domains in the system - // get all parent domain ID's all the way till root domain - List domainTree = new ArrayList(); - DomainVO domainTreeNode = _domainDao.findById(Domain.ROOT_DOMAIN); // fix for CLOUDSTACK-5987 - domainTree.add(domainTreeNode.getId()); - - // get all child domain ID's under root - List allChildDomains = _domainDao.findAllChildren(domainTreeNode.getPath(), domainTreeNode.getId()); - for (DomainVO childDomain : allChildDomains) { - domainTree.add(childDomain.getId()); - } - - SearchCriteria scc = _templateJoinDao.createSearchCriteria(); - scc.addOr("domainId", SearchCriteria.Op.IN, domainTree.toArray()); - scc.addOr("domainId", SearchCriteria.Op.NULL); - sc.addAnd("domainId", SearchCriteria.Op.SC, scc); - */ - } else if (templateFilter == TemplateFilter.self || templateFilter == TemplateFilter.selfexecutable) { - if (permittedDomains.contains(caller.getDomainId())) { - // this caller acts like a domain admin - - sc.addAnd("domainPath", SearchCriteria.Op.LIKE, callerDomain.getPath() + "%"); - } else { - // only display templates owned by caller for resource owner only - sc.addAnd("accountId", SearchCriteria.Op.EQ, caller.getAccountId()); - } - } else if (templateFilter == TemplateFilter.sharedexecutable || templateFilter == TemplateFilter.shared) { - // exclude the caller, only include those granted and not owned by self - permittedDomains.remove(caller.getDomainId()); - permittedAccounts.remove(caller.getAccountId()); - for (Long tid : permittedResources) { - // remove it if it is owned by the caller - VMTemplateVO tmpl = _templateDao.findById(tid); - if (tmpl != null && tmpl.getAccountId() == caller.getAccountId()) { - permittedResources.remove(tid); - } - } - // building ACL search criteria - SearchCriteria aclSc = _templateJoinDao.createSearchCriteria(); - _accountMgr.buildACLViewSearchCriteria(sc, aclSc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); - } else if (templateFilter == TemplateFilter.executable) { - // public template + self template - SearchCriteria scc = _templateJoinDao.createSearchCriteria(); - scc.addOr("publicTemplate", SearchCriteria.Op.EQ, true); - // plus self owned templates or domain tree templates for domain admin - if (permittedDomains.contains(caller.getDomainId())) { - // this caller acts like a domain admin - sc.addOr("domainPath", SearchCriteria.Op.LIKE, callerDomain.getPath() + "%"); - } else { - // only display templates owned by caller for resource owner only - sc.addOr("accountId", SearchCriteria.Op.EQ, caller.getAccountId()); - } - sc.addAnd("publicTemplate", SearchCriteria.Op.SC, scc); - } - - // add tags criteria - if (tags != null && !tags.isEmpty()) { - SearchCriteria scc = _templateJoinDao.createSearchCriteria(); - for (String key : tags.keySet()) { - SearchCriteria scTag = _templateJoinDao.createSearchCriteria(); - scTag.addAnd("tagKey", SearchCriteria.Op.EQ, key); - scTag.addAnd("tagValue", SearchCriteria.Op.EQ, tags.get(key)); - if (isIso) { - scTag.addAnd("tagResourceType", SearchCriteria.Op.EQ, ResourceObjectType.ISO); - } else { - scTag.addAnd("tagResourceType", SearchCriteria.Op.EQ, ResourceObjectType.Template); - } - scc.addOr("tagKey", SearchCriteria.Op.SC, scTag); - } - sc.addAnd("tagKey", SearchCriteria.Op.SC, scc); - } - - // other criteria - - if (keyword != null) { - sc.addAnd("name", SearchCriteria.Op.LIKE, "%" + keyword + "%"); - } else if (name != null) { - sc.addAnd("name", SearchCriteria.Op.EQ, name); - } - - if (isIso) { - sc.addAnd("format", SearchCriteria.Op.EQ, "ISO"); - - } else { - sc.addAnd("format", SearchCriteria.Op.NEQ, "ISO"); - } - - if (!hyperType.equals(HypervisorType.None)) { - sc.addAnd("hypervisorType", SearchCriteria.Op.EQ, hyperType); - } - - if (bootable != null) { - sc.addAnd("bootable", SearchCriteria.Op.EQ, bootable); - } - - if (onlyReady) { - SearchCriteria readySc = _templateJoinDao.createSearchCriteria(); - readySc.addOr("state", SearchCriteria.Op.EQ, TemplateState.Ready); - readySc.addOr("format", SearchCriteria.Op.EQ, ImageFormat.BAREMETAL); - SearchCriteria isoPerhostSc = _templateJoinDao.createSearchCriteria(); - isoPerhostSc.addAnd("format", SearchCriteria.Op.EQ, ImageFormat.ISO); - isoPerhostSc.addAnd("templateType", SearchCriteria.Op.EQ, TemplateType.PERHOST); - readySc.addOr("templateType", SearchCriteria.Op.SC, isoPerhostSc); - sc.addAnd("state", SearchCriteria.Op.SC, readySc); - } - - if (!showDomr) { - // excluding system template - sc.addAnd("templateType", SearchCriteria.Op.NEQ, Storage.TemplateType.SYSTEM); - } - } - - if (zoneId != null) { - SearchCriteria zoneSc = _templateJoinDao.createSearchCriteria(); - zoneSc.addOr("dataCenterId", SearchCriteria.Op.EQ, zoneId); - zoneSc.addOr("dataStoreScope", SearchCriteria.Op.EQ, ScopeType.REGION); - // handle the case where xs-tools.iso and vmware-tools.iso do not - // have data_center information in template_view - SearchCriteria isoPerhostSc = _templateJoinDao.createSearchCriteria(); - isoPerhostSc.addAnd("format", SearchCriteria.Op.EQ, ImageFormat.ISO); - isoPerhostSc.addAnd("templateType", SearchCriteria.Op.EQ, TemplateType.PERHOST); - zoneSc.addOr("templateType", SearchCriteria.Op.SC, isoPerhostSc); - sc.addAnd("dataCenterId", SearchCriteria.Op.SC, zoneSc); - } - - // don't return removed template, this should not be needed since we - // changed annotation for removed field in TemplateJoinVO. - // sc.addAnd("removed", SearchCriteria.Op.NULL); - - // search unique templates and find details by Ids - Pair, Integer> uniqueTmplPair = null; - if(showRemovedTmpl){ - uniqueTmplPair = _templateJoinDao.searchIncludingRemovedAndCount(sc, searchFilter); - } else { - sc.addAnd("templateState", SearchCriteria.Op.EQ, State.Active); - uniqueTmplPair = _templateJoinDao.searchAndCount(sc, searchFilter); - } - - Integer count = uniqueTmplPair.second(); - if (count.intValue() == 0) { - // empty result - return uniqueTmplPair; - } - List uniqueTmpls = uniqueTmplPair.first(); - String[] tzIds = new String[uniqueTmpls.size()]; - int i = 0; - for (TemplateJoinVO v : uniqueTmpls) { - tzIds[i++] = v.getTempZonePair(); - } - List vrs = _templateJoinDao.searchByTemplateZonePair(showRemovedTmpl, tzIds); - return new Pair, Integer>(vrs, count); - - // TODO: revisit the special logic for iso search in - // VMTemplateDaoImpl.searchForTemplates and understand why we need to - // specially handle ISO. The original logic is very twisted and no idea - // about what the code was doing. - - } - - // This method should only be used for keeping old listTemplates and listAffinityGroups behavior, PLEASE DON'T USE IT FOR USE LIST APIs - private void buildTemplateAffinityGroupSearchParameters(Account caller, Long id, String accountName, Long projectId, List - permittedAccounts, Ternary domainIdRecursiveListProject, - boolean listAll, boolean forProjectInvitation) { - Long domainId = domainIdRecursiveListProject.first(); - if (domainId != null) { - Domain domain = _domainDao.findById(domainId); - if (domain == null) { - throw new InvalidParameterValueException("Unable to find domain by id " + domainId); - } - // check permissions - _accountMgr.checkAccess(caller, domain); - } - - if (accountName != null) { - if (projectId != null) { - throw new InvalidParameterValueException("Account and projectId can't be specified together"); - } - - Account userAccount = null; - Domain domain = null; - if (domainId != null) { - userAccount = _accountDao.findActiveAccount(accountName, domainId); - domain = _domainDao.findById(domainId); - } else { - userAccount = _accountDao.findActiveAccount(accountName, caller.getDomainId()); - domain = _domainDao.findById(caller.getDomainId()); - } - - if (userAccount != null) { - _accountMgr.checkAccess(caller, null, userAccount); - // check permissions - permittedAccounts.add(userAccount.getId()); - } else { - throw new InvalidParameterValueException("could not find account " + accountName + " in domain " + domain.getUuid()); - } - } - - // set project information - if (projectId != null) { - if (!forProjectInvitation) { - if (projectId.longValue() == -1) { - if (_accountMgr.isNormalUser(caller.getId())) { - permittedAccounts.addAll(_projectMgr.listPermittedProjectAccounts(caller.getId())); - } else { - domainIdRecursiveListProject.third(Project.ListProjectResourcesCriteria.ListProjectResourcesOnly); - } - } else { - Project project = _projectMgr.getProject(projectId); - if (project == null) { - throw new InvalidParameterValueException("Unable to find project by id " + projectId); - } - if (!_projectMgr.canAccessProjectAccount(caller, project.getProjectAccountId())) { - throw new PermissionDeniedException("Account " + caller + " can't access project id=" + projectId); - } - permittedAccounts.add(project.getProjectAccountId()); - } - } - } else { - if (id == null) { - domainIdRecursiveListProject.third(Project.ListProjectResourcesCriteria.SkipProjectResources); - } - if (permittedAccounts.isEmpty() && domainId == null) { - if (_accountMgr.isNormalUser(caller.getId())) { - permittedAccounts.add(caller.getId()); - } else if (!listAll) { - if (id == null) { - permittedAccounts.add(caller.getId()); - } else if (!_accountMgr.isRootAdmin(caller.getId())) { - domainIdRecursiveListProject.first(caller.getDomainId()); - domainIdRecursiveListProject.second(true); - } - } else if (domainId == null) { - if (_accountMgr.isDomainAdmin(caller.getId())) { - domainIdRecursiveListProject.first(caller.getDomainId()); - domainIdRecursiveListProject.second(true); - } - } - } else if (domainId != null) { - if (_accountMgr.isNormalUser(caller.getId())) { - permittedAccounts.add(caller.getId()); - } - } - } - } private Pair, Integer> searchForTemplatesInternal(ListTemplatesCmd cmd) { TemplateFilter templateFilter = TemplateFilter.valueOf(cmd.getTemplateFilter()); @@ -3186,7 +2827,7 @@ private Pair, Integer> searchForTemplatesInternal(ListTempl List permittedAccountIds = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - buildTemplateAffinityGroupSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccountIds, + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccountIds, domainIdRecursiveListProject, listAll, false); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); List permittedAccounts = new ArrayList(); @@ -3251,7 +2892,7 @@ private Pair, Integer> searchForTemplatesInternal(Long temp // if template is not public, perform permission check here if (!template.isPublicTemplate() && caller.getType() != Account.ACCOUNT_TYPE_ADMIN) { Account owner = _accountMgr.getAccount(template.getAccountId()); - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, true, owner); } // if templateId is specified, then we will just use the id to @@ -3263,7 +2904,7 @@ private Pair, Integer> searchForTemplatesInternal(Long temp if (!permittedAccounts.isEmpty()) { domain = _domainDao.findById(permittedAccounts.get(0).getDomainId()); } else { - domain = _domainDao.findById(DomainVO.ROOT_DOMAIN); + domain = _domainDao.findById(Domain.ROOT_DOMAIN); } // List hypers = null; @@ -3496,7 +3137,7 @@ private Pair, Integer> searchForIsosInternal(ListIsosCmd cm List permittedAccountIds = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - buildTemplateAffinityGroupSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccountIds, + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccountIds, domainIdRecursiveListProject, listAll, false); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); List permittedAccounts = new ArrayList(); @@ -3511,43 +3152,6 @@ private Pair, Integer> searchForIsosInternal(ListIsosCmd cm cmd.listInReadyState(), permittedAccounts, caller, listProjectResourcesCriteria, tags, showRemovedISO); } - private Pair, Integer> searchForIsosInternalIAM(ListIsosCmd cmd) { - TemplateFilter isoFilter = TemplateFilter.valueOf(cmd.getIsoFilter()); - Long id = cmd.getId(); - Map tags = cmd.getTags(); - boolean showRemovedISO = cmd.getShowRemoved(); - Account caller = CallContext.current().getCallingAccount(); - - boolean listAll = false; - if (isoFilter != null && isoFilter == TemplateFilter.all) { - if (_accountMgr.isNormalUser(caller.getId())) { - throw new InvalidParameterValueException("Filter " + TemplateFilter.all - + " can be specified by admin only"); - } - listAll = true; - } - - List permittedDomains = new ArrayList(); - List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); - - Ternary domainIdRecursiveListProject = new Ternary( - cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, "listIsos"); - Boolean isRecursive = domainIdRecursiveListProject.second(); - ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); -// List permittedAccounts = new ArrayList(); -// for (Long accountId : permittedAccountIds) { -// permittedAccounts.add(_accountMgr.getAccount(accountId)); -// } - - HypervisorType hypervisorType = HypervisorType.getType(cmd.getHypervisor()); - - return searchForTemplatesInternalIAM(cmd.getId(), cmd.getIsoName(), cmd.getKeyword(), isoFilter, true, - cmd.isBootable(), cmd.getPageSizeVal(), cmd.getStartIndex(), cmd.getZoneId(), hypervisorType, true, - cmd.listInReadyState(), permittedDomains, permittedAccounts, permittedResources, isRecursive, caller, listProjectResourcesCriteria, tags, showRemovedISO); - } @Override public ListResponse listAffinityGroups(Long affinityGroupId, String affinityGroupName, @@ -3576,14 +3180,14 @@ public Pair, Integer> listAffinityGroupsInternal(Long throw new InvalidParameterValueException("Unable to list affinity groups for virtual machine instance " + vmId + "; instance not found."); } - _accountMgr.checkAccess(caller, null, userVM); + _accountMgr.checkAccess(caller, null, true, userVM); return listAffinityGroupsByVM(vmId.longValue(), startIndex, pageSize); } List permittedAccounts = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary( domainId, isRecursive, null); - buildTemplateAffinityGroupSearchParameters(caller, affinityGroupId, accountName, null, permittedAccounts, + _accountMgr.buildACLSearchParameters(caller, affinityGroupId, accountName, null, permittedAccounts, domainIdRecursiveListProject, listAll, true); domainId = domainIdRecursiveListProject.first(); isRecursive = domainIdRecursiveListProject.second(); @@ -3717,121 +3321,6 @@ private SearchCriteria buildAffinityGroupSearchCriteria(Lon return sc; } - public Pair, Integer> listAffinityGroupsInternalIAM(Long affinityGroupId, - String affinityGroupName, String affinityGroupType, Long vmId, String accountName, Long domainId, - boolean isRecursive, boolean listAll, Long startIndex, Long pageSize, String keyword) { - - Account caller = CallContext.current().getCallingAccount(); - - caller.getAccountId(); - - if (vmId != null) { - UserVmVO userVM = _userVmDao.findById(vmId); - if (userVM == null) { - throw new InvalidParameterValueException("Unable to list affinity groups for virtual machine instance " + vmId + "; instance not found."); - } - _accountMgr.checkAccess(caller, null, userVM); - return listAffinityGroupsByVM(vmId.longValue(), startIndex, pageSize); - } - - List permittedDomains = new ArrayList(); - List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); - Ternary domainIdRecursiveListProject = new Ternary( - domainId, isRecursive, null); - _accountMgr.buildACLSearchParameters(caller, affinityGroupId, accountName, null, permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, listAll, true, "listAffinityGroups"); - //domainId = domainIdRecursiveListProject.first(); - isRecursive = domainIdRecursiveListProject.second(); - ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); - - Filter searchFilter = new Filter(AffinityGroupJoinVO.class, "id", true, startIndex, pageSize); - SearchCriteria sc = buildAffinityGroupSearchCriteriaIAM(isRecursive, - permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria, affinityGroupId, affinityGroupName, affinityGroupType, keyword); - - Pair, Integer> uniqueGroupsPair = _affinityGroupJoinDao.searchAndCount(sc, searchFilter); - // search group details by ids - List vrs = new ArrayList(); - Integer count = uniqueGroupsPair.second(); - if (count.intValue() != 0) { - List uniqueGroups = uniqueGroupsPair.first(); - Long[] vrIds = new Long[uniqueGroups.size()]; - int i = 0; - for (AffinityGroupJoinVO v : uniqueGroups) { - vrIds[i++] = v.getId(); - } - vrs = _affinityGroupJoinDao.searchByIds(vrIds); - } - - /* TODO: confirm with Prachi if we still need this complicated logic with new ACL model - if (!permittedAccounts.isEmpty()) { - // add domain level affinity groups - if (domainId != null) { - SearchCriteria scDomain = buildAffinityGroupSearchCriteria(null, isRecursive, - new ArrayList(), listProjectResourcesCriteria, affinityGroupId, affinityGroupName, - affinityGroupType, keyword); - vrs.addAll(listDomainLevelAffinityGroups(scDomain, searchFilter, domainId)); - } else { - - for (Long permAcctId : permittedAccounts) { - Account permittedAcct = _accountDao.findById(permAcctId); - SearchCriteria scDomain = buildAffinityGroupSearchCriteria( - null, isRecursive, new ArrayList(), - listProjectResourcesCriteria, affinityGroupId, affinityGroupName, affinityGroupType, keyword); - - vrs.addAll(listDomainLevelAffinityGroups(scDomain, searchFilter, permittedAcct.getDomainId())); - } - } - } else if (((permittedAccounts.isEmpty()) && (domainId != null) && isRecursive)) { - // list all domain level affinity groups for the domain admin case - SearchCriteria scDomain = buildAffinityGroupSearchCriteria(null, isRecursive, - new ArrayList(), listProjectResourcesCriteria, affinityGroupId, affinityGroupName, - affinityGroupType, keyword); - vrs.addAll(listDomainLevelAffinityGroups(scDomain, searchFilter, domainId)); - } - */ - - return new Pair, Integer>(vrs, vrs.size()); - - } - - private SearchCriteria buildAffinityGroupSearchCriteriaIAM(boolean isRecursive, - List permittedDomains, List permittedAccounts, List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria, - Long affinityGroupId, String affinityGroupName, String affinityGroupType, String keyword) { - - SearchBuilder groupSearch = _affinityGroupJoinDao.createSearchBuilder(); - groupSearch.select(null, Func.DISTINCT, groupSearch.entity().getId()); // select - // distinct - - SearchCriteria sc = groupSearch.create(); - SearchCriteria aclSc = _affinityGroupJoinDao.createSearchCriteria(); - // building ACL search criteria - _accountMgr.buildACLViewSearchCriteria(sc, aclSc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); - - if (affinityGroupId != null) { - sc.addAnd("id", SearchCriteria.Op.EQ, affinityGroupId); - } - - if (affinityGroupName != null) { - sc.addAnd("name", SearchCriteria.Op.EQ, affinityGroupName); - } - - if (affinityGroupType != null) { - sc.addAnd("type", SearchCriteria.Op.EQ, affinityGroupType); - } - - if (keyword != null) { - SearchCriteria ssc = _affinityGroupJoinDao.createSearchCriteria(); - ssc.addOr("name", SearchCriteria.Op.LIKE, "%" + keyword + "%"); - ssc.addOr("type", SearchCriteria.Op.LIKE, "%" + keyword + "%"); - - sc.addAnd("name", SearchCriteria.Op.SC, ssc); - } - - return sc; - - } - private Pair, Integer> listAffinityGroupsByVM(long vmId, long pageInd, long pageSize) { Filter sf = new Filter(SecurityGroupVMMapVO.class, null, true, pageInd, pageSize); Pair, Integer> agVmMappingPair = _affinityGroupVMMapDao.listByInstanceId(vmId, sf); diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 231b5e1dc2..3f79a76410 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -39,7 +39,6 @@ import org.apache.log4j.Logger; import org.apache.cloudstack.acl.SecurityChecker; -import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.affinity.AffinityGroup; import org.apache.cloudstack.affinity.AffinityGroupService; import org.apache.cloudstack.affinity.dao.AffinityGroupDao; @@ -4328,7 +4327,7 @@ public List searchForNetworkOfferings(ListNetworkOffe throw new InvalidParameterValueException("Can't update system networks"); } - _accountMgr.checkAccess(caller, AccessType.ListEntry, network); + _accountMgr.checkAccess(caller, null, true, network); List offeringIds = _networkModel.listNetworkOfferingsForUpgrade(networkId); diff --git a/server/src/com/cloud/network/IpAddressManagerImpl.java b/server/src/com/cloud/network/IpAddressManagerImpl.java index 746221fca1..9b1f9bd7ed 100644 --- a/server/src/com/cloud/network/IpAddressManagerImpl.java +++ b/server/src/com/cloud/network/IpAddressManagerImpl.java @@ -29,8 +29,6 @@ import javax.inject.Inject; -import org.apache.log4j.Logger; - import org.apache.cloudstack.acl.ControlledEntity.ACLType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.context.CallContext; @@ -42,6 +40,7 @@ import org.apache.cloudstack.region.PortableIpDao; import org.apache.cloudstack.region.PortableIpVO; import org.apache.cloudstack.region.Region; +import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; import com.cloud.alert.AlertManager; @@ -410,7 +409,7 @@ private IpAddress allocateIP(Account ipOwner, boolean isSystem, long zoneId) thr Account caller = CallContext.current().getCallingAccount(); long callerUserId = CallContext.current().getCallingUserId(); // check permissions - _accountMgr.checkAccess(caller, null, ipOwner); + _accountMgr.checkAccess(caller, null, false, ipOwner); DataCenter zone = _entityMgr.findById(DataCenter.class, zoneId); @@ -1165,14 +1164,15 @@ public IPAddressVO associateIPToGuestNetwork(long ipId, long networkId, boolean if (zone.getNetworkType() == NetworkType.Advanced) { if (network.getGuestType() == Network.GuestType.Shared) { if (isSharedNetworkOfferingWithServices(network.getNetworkOfferingId())) { - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), AccessType.UseEntry, network); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), AccessType.UseEntry, false, + network); } else { throw new InvalidParameterValueException("IP can be associated with guest network of 'shared' type only if " + "network services Source Nat, Static Nat, Port Forwarding, Load balancing, firewall are enabled in the network"); } } } else { - _accountMgr.checkAccess(caller, null, ipToAssoc); + _accountMgr.checkAccess(caller, null, true, ipToAssoc); } owner = _accountMgr.getAccount(ipToAssoc.getAllocatedToAccountId()); } else { @@ -1187,7 +1187,7 @@ public IPAddressVO associateIPToGuestNetwork(long ipId, long networkId, boolean Network network = _networksDao.findById(networkId); if (network != null) { - _accountMgr.checkAccess(owner, AccessType.UseEntry, network); + _accountMgr.checkAccess(owner, AccessType.UseEntry, false, network); } else { s_logger.debug("Unable to find ip address by id: " + ipId); return null; @@ -1319,10 +1319,11 @@ public IPAddressVO disassociatePortableIPToGuestNetwork(long ipId, long networkI if (zone.getNetworkType() == NetworkType.Advanced) { if (network.getGuestType() == Network.GuestType.Shared) { assert (isSharedNetworkOfferingWithServices(network.getNetworkOfferingId())); - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), AccessType.UseEntry, network); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), AccessType.UseEntry, false, + network); } } else { - _accountMgr.checkAccess(caller, null, ipToAssoc); + _accountMgr.checkAccess(caller, null, true, ipToAssoc); } owner = _accountMgr.getAccount(ipToAssoc.getAllocatedToAccountId()); } else { diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java index f84eccd9af..7b4b2bebdb 100755 --- a/server/src/com/cloud/network/NetworkModelImpl.java +++ b/server/src/com/cloud/network/NetworkModelImpl.java @@ -34,9 +34,7 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.SecurityChecker; import org.apache.cloudstack.acl.ControlledEntity.ACLType; -import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao; @@ -99,7 +97,6 @@ import com.cloud.projects.dao.ProjectAccountDao; import com.cloud.server.ConfigurationServer; import com.cloud.user.Account; -import com.cloud.user.AccountManager; import com.cloud.user.AccountVO; import com.cloud.user.DomainManager; import com.cloud.user.dao.AccountDao; @@ -176,8 +173,7 @@ public void setNetworkElements(List networkElements) { FirewallRulesDao _firewallDao; @Inject DomainManager _domainMgr; - @Inject - AccountManager _accountMgr; + @Inject NetworkOfferingServiceMapDao _ntwkOfferingSrvcDao; @Inject @@ -220,16 +216,6 @@ public void setNetworkElements(List networkElements) { static HashMap> s_serviceToImplementedProvidersMap = new HashMap>(); static HashMap s_providerToNetworkElementMap = new HashMap(); - List _securityCheckers; - - public List getSecurityCheckers() { - return _securityCheckers; - } - - public void setSecurityCheckers(List securityCheckers) { - _securityCheckers = securityCheckers; - } - /** * */ @@ -1580,35 +1566,6 @@ public void checkNetworkPermissions(Account owner, Network network) { } } - @Override - public void checkNetworkPermissions(Account owner, Network network, AccessType accessType) { - if (network == null) { - throw new CloudRuntimeException("cannot check permissions on (Network) "); - } - - AccountVO networkOwner = _accountDao.findById(network.getAccountId()); - if (networkOwner == null) { - throw new PermissionDeniedException("Unable to use network with id= " + ((NetworkVO) network).getUuid() - + ", network does not have an owner"); - } - if (owner.getType() != Account.ACCOUNT_TYPE_PROJECT && networkOwner.getType() == Account.ACCOUNT_TYPE_PROJECT) { - if (!_projectAccountDao.canAccessProjectAccount(owner.getAccountId(), network.getAccountId())) { - throw new PermissionDeniedException("Unable to use network with id= " + ((NetworkVO) network).getUuid() - + ", permission denied"); - } - } else { - // Go through IAM (SecurityCheckers) - for (SecurityChecker checker : _securityCheckers) { - if (checker.checkAccess(owner, accessType, null, network)) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Access to " + network + " granted to " + owner + " by " + checker.getName()); - } - break; - } - } - } - } - @Override public String getDefaultPublicTrafficLabel(long dcId, HypervisorType hypervisorType) { try { diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java index ec9fa12b14..95d3decb10 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -542,7 +542,7 @@ public IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId, Boolea // if shared network in the advanced zone, then check the caller against the network for 'AccessType.UseNetwork' if (zone.getNetworkType() == NetworkType.Advanced) { if (isSharedNetworkOfferingWithServices(network.getNetworkOfferingId())) { - _accountMgr.checkAccess(caller, AccessType.UseEntry, network); + _accountMgr.checkAccess(caller, AccessType.UseEntry, false, network); if (s_logger.isDebugEnabled()) { s_logger.debug("Associate IP address called by the user " + callerUserId + " account " + ipOwner.getId()); } @@ -554,7 +554,7 @@ public IpAddress allocateIP(Account ipOwner, long zoneId, Long networkId, Boolea } } } else { - _accountMgr.checkAccess(caller, null, ipOwner); + _accountMgr.checkAccess(caller, null, false, ipOwner); } return _ipAddrMgr.allocateIp(ipOwner, false, caller, callerUserId, zone, displayIp); @@ -585,7 +585,7 @@ public IpAddress allocatePortableIP(Account ipOwner, int regionId, Long zoneId, // if shared network in the advanced zone, then check the caller against the network for 'AccessType.UseNetwork' if (zone.getNetworkType() == NetworkType.Advanced) { if (isSharedNetworkOfferingWithServices(network.getNetworkOfferingId())) { - _accountMgr.checkAccess(caller, AccessType.UseEntry, network); + _accountMgr.checkAccess(caller, AccessType.UseEntry, false, network); if (s_logger.isDebugEnabled()) { s_logger.debug("Associate IP address called by the user " + callerUserId + " account " + ipOwner.getId()); } @@ -605,7 +605,7 @@ public IpAddress allocatePortableIP(Account ipOwner, int regionId, Long zoneId, } } - _accountMgr.checkAccess(caller, null, ipOwner); + _accountMgr.checkAccess(caller, null, false, ipOwner); return _ipAddrMgr.allocatePortableIp(ipOwner, caller, zoneId, null, null); } @@ -671,7 +671,7 @@ public NicSecondaryIp allocateSecondaryGuestIP(final long nicId, String requeste final Account ipOwner = _accountMgr.getAccount(vm.getAccountId()); // verify permissions - _accountMgr.checkAccess(caller, null, vm); + _accountMgr.checkAccess(caller, null, true, vm); Network network = _networksDao.findById(networkId); if (network == null) { @@ -767,7 +767,7 @@ public boolean releaseSecondaryIpFromNic(long ipAddressId) { throw new InvalidParameterValueException("There is no vm with the given secondary ip"); } // verify permissions - _accountMgr.checkAccess(caller, null, vm); + _accountMgr.checkAccess(caller, null, true, vm); Network network = _networksDao.findById(secIpVO.getNetworkId()); @@ -891,7 +891,7 @@ private boolean releaseIpAddressInternal(long ipAddressId) throws InsufficientAd // verify permissions if (ipVO.getAllocatedToAccountId() != null) { - _accountMgr.checkAccess(caller, null, ipVO); + _accountMgr.checkAccess(caller, null, true, ipVO); } if (ipVO.isSourceNat()) { @@ -1432,7 +1432,7 @@ public Pair, Integer> searchForNetworks(ListNetworksCmd throw new InvalidParameterValueException("Unable to find account " + accountName + " in specified domain"); } - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, true, owner); permittedAccounts.add(owner.getId()); } } @@ -1816,7 +1816,7 @@ public boolean deleteNetwork(long networkId, boolean forced) { Account owner = _accountMgr.getAccount(network.getAccountId()); // Perform permission check - _accountMgr.checkAccess(caller, null, network); + _accountMgr.checkAccess(caller, null, true, network); if (forced && !_accountMgr.isRootAdmin(caller.getId())) { throw new InvalidParameterValueException("Delete network with 'forced' option can only be called by root admins"); @@ -1860,7 +1860,7 @@ public boolean restartNetwork(RestartNetworkCmd cmd, boolean cleanup) throws Con throw new InvalidParameterException("Unable to restart a running SDN network."); } - _accountMgr.checkAccess(callerAccount, null, network); + _accountMgr.checkAccess(callerAccount, null, true, network); boolean success = _networkMgr.restartNetwork(networkId, callerAccount, callerUser, cleanup); @@ -1996,7 +1996,7 @@ public Network updateGuestNetwork(final long networkId, String name, String disp throw new InvalidParameterValueException("Can't allow networks which traffic type is not " + TrafficType.Guest); } - _accountMgr.checkAccess(callerAccount, null, network); + _accountMgr.checkAccess(callerAccount, null, true, network); if (name != null) { network.setName(name); @@ -4045,7 +4045,7 @@ public List listNics(ListNicsCmd cmd) { throw ex; } - _accountMgr.checkAccess(caller, null, userVm); + _accountMgr.checkAccess(caller, null, true, userVm); return _networkMgr.listVmNics(vmId, nicId, networkId); } @@ -4069,7 +4069,7 @@ public IpAddress updateIP(Long id, String customId, Boolean displayIp) { // verify permissions if (ipVO.getAllocatedToAccountId() != null) { - _accountMgr.checkAccess(caller, null, ipVO); + _accountMgr.checkAccess(caller, null, true, ipVO); } else if (caller.getType() != Account.ACCOUNT_TYPE_ADMIN) { throw new PermissionDeniedException("Only Root admin can update non-allocated ip addresses"); } diff --git a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java index 09c6694701..d4de462511 100644 --- a/server/src/com/cloud/network/as/AutoScaleManagerImpl.java +++ b/server/src/com/cloud/network/as/AutoScaleManagerImpl.java @@ -116,9 +116,9 @@ import com.cloud.utils.db.JoinBuilder; import com.cloud.utils.db.SearchBuilder; import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.TransactionCallback; import com.cloud.utils.db.SearchCriteria.Op; import com.cloud.utils.db.Transaction; -import com.cloud.utils.db.TransactionCallback; import com.cloud.utils.db.TransactionStatus; import com.cloud.utils.net.NetUtils; import com.cloud.vm.UserVmManager; @@ -240,7 +240,7 @@ private VO getEntityInDatabase(Account caller, Str throw new InvalidParameterValueException("Unable to find " + paramName); } - _accountMgr.checkAccess(caller, null, (ControlledEntity)vo); + _accountMgr.checkAccess(caller, null, false, (ControlledEntity)vo); return vo; } @@ -342,7 +342,7 @@ public AutoScaleVmProfile createAutoScaleVmProfile(CreateAutoScaleVmProfileCmd c Account owner = _accountDao.findById(cmd.getAccountId()); Account caller = CallContext.current().getCallingAccount(); - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, true, owner); long zoneId = cmd.getZoneId(); long serviceOfferingId = cmd.getServiceOfferingId(); @@ -461,8 +461,7 @@ public List listAutoScaleVmProfiles(ListAutoScaleV Long zoneId = cmd.getZoneId(); Boolean display = cmd.getDisplay(); - SearchWrapper searchWrapper = new SearchWrapper(_autoScaleVmProfileDao, AutoScaleVmProfileVO.class, cmd, cmd.getId(), - "listAutoScaleVmProfiles"); + SearchWrapper searchWrapper = new SearchWrapper(_autoScaleVmProfileDao, AutoScaleVmProfileVO.class, cmd, cmd.getId()); SearchBuilder sb = searchWrapper.getSearchBuilder(); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); @@ -527,7 +526,7 @@ public AutoScalePolicyVO doInTransaction(TransactionStatus status) { ControlledEntity[] sameOwnerEntities = conditions.toArray(new ControlledEntity[conditions.size() + 1]); sameOwnerEntities[sameOwnerEntities.length - 1] = autoScalePolicyVO; - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, sameOwnerEntities); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, sameOwnerEntities); if (conditionIds.size() != conditions.size()) { // TODO report the condition id which could not be found @@ -621,7 +620,7 @@ public void checkCallerAccess(String accountName, Long domainId) { idList.add(ApiDBUtils.findDomainById(domainId).getUuid()); throw new InvalidParameterValueException("Unable to find account " + accountName + " in domain with specifed domainId"); } - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, false, owner); } private class SearchWrapper { @@ -630,14 +629,11 @@ private class SearchWrapper { SearchCriteria searchCriteria; Long domainId; boolean isRecursive; - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); - ListProjectResourcesCriteria listProjectResourcesCriteria; Filter searchFilter; - public SearchWrapper(GenericDao dao, Class entityClass, BaseListAccountResourcesCmd cmd, Long id, String action) + public SearchWrapper(GenericDao dao, Class entityClass, BaseListAccountResourcesCmd cmd, Long id) { this.dao = dao; this.searchBuilder = dao.createSearchBuilder(); @@ -651,12 +647,12 @@ public SearchWrapper(GenericDao dao, Class entityClass, BaseListAc Ternary domainIdRecursiveListProject = new Ternary(domainId, isRecursive, null); - _accountMgr.buildACLSearchParameters(caller, id, accountName, null, permittedDomains, permittedAccounts, permittedResources, domainIdRecursiveListProject, listAll, - false, action); - //domainId = domainIdRecursiveListProject.first(); + _accountMgr.buildACLSearchParameters(caller, id, accountName, null, permittedAccounts, domainIdRecursiveListProject, + listAll, false); + domainId = domainIdRecursiveListProject.first(); isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); - _accountMgr.buildACLSearchBuilder(searchBuilder, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(searchBuilder, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); searchFilter = new Filter(entityClass, "id", false, startIndex, pageSizeVal); } @@ -666,7 +662,7 @@ public SearchBuilder getSearchBuilder() { public SearchCriteria buildSearchCriteria() { searchCriteria = searchBuilder.create(); - _accountMgr.buildACLSearchCriteria(searchCriteria, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(searchCriteria, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); return searchCriteria; } @@ -677,8 +673,7 @@ public List search() { @Override public List listAutoScalePolicies(ListAutoScalePoliciesCmd cmd) { - SearchWrapper searchWrapper = new SearchWrapper(_autoScalePolicyDao, AutoScalePolicyVO.class, cmd, cmd.getId(), - "listAutoScalePolicies"); + SearchWrapper searchWrapper = new SearchWrapper(_autoScalePolicyDao, AutoScalePolicyVO.class, cmd, cmd.getId()); SearchBuilder sb = searchWrapper.getSearchBuilder(); Long id = cmd.getId(); Long conditionId = cmd.getConditionId(); @@ -884,8 +879,7 @@ public List listAutoScaleVmGroups(ListAutoScaleVmGro Long zoneId = cmd.getZoneId(); Boolean forDisplay = cmd.getDisplay(); - SearchWrapper searchWrapper = new SearchWrapper(_autoScaleVmGroupDao, AutoScaleVmGroupVO.class, cmd, cmd.getId(), - "listAutoScaleVmGroups"); + SearchWrapper searchWrapper = new SearchWrapper(_autoScaleVmGroupDao, AutoScaleVmGroupVO.class, cmd, cmd.getId()); SearchBuilder sb = searchWrapper.getSearchBuilder(); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); @@ -980,7 +974,7 @@ protected AutoScaleVmGroupVO checkValidityAndPersist(final AutoScaleVmGroupVO vm ControlledEntity[] sameOwnerEntities = policies.toArray(new ControlledEntity[policies.size() + 2]); sameOwnerEntities[sameOwnerEntities.length - 2] = loadBalancer; sameOwnerEntities[sameOwnerEntities.length - 1] = profileVO; - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, sameOwnerEntities); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, sameOwnerEntities); return Transaction.execute(new TransactionCallback() { @Override @@ -1176,7 +1170,7 @@ public List listConditions(ListConditionsCmd cmd) { Long id = cmd.getId(); Long counterId = cmd.getCounterId(); Long policyId = cmd.getPolicyId(); - SearchWrapper searchWrapper = new SearchWrapper(_conditionDao, ConditionVO.class, cmd, cmd.getId(), "listConditions"); + SearchWrapper searchWrapper = new SearchWrapper(_conditionDao, ConditionVO.class, cmd, cmd.getId()); SearchBuilder sb = searchWrapper.getSearchBuilder(); if (policyId != null) { SearchBuilder asPolicyConditionSearch = _autoScalePolicyConditionMapDao.createSearchBuilder(); diff --git a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java index 730606816b..4f853b332a 100644 --- a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java +++ b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java @@ -263,26 +263,25 @@ public Pair, Integer> listFirewallRules(ListFirewal Boolean display = cmd.getDisplay(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); if (ipId != null) { IPAddressVO ipAddressVO = _ipAddressDao.findById(ipId); if (ipAddressVO == null || !ipAddressVO.readyToUse()) { throw new InvalidParameterValueException("Ip address id=" + ipId + " not ready for firewall rules yet"); } - _accountMgr.checkAccess(caller, null, ipAddressVO); + _accountMgr.checkAccess(caller, null, true, ipAddressVO); } Ternary domainIdRecursiveListProject = new Ternary(cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, domainIdRecursiveListProject, cmd.listAll(), false, "listFirewallRules"); + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false); + Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter filter = new Filter(FirewallRuleVO.class, "id", false, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchBuilder sb = _firewallDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sb.and("id", sb.entity().getId(), Op.EQ); sb.and("trafficType", sb.entity().getTrafficType(), Op.EQ); @@ -304,7 +303,7 @@ public Pair, Integer> listFirewallRules(ListFirewal } SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); if (id != null) { sc.setParameters("id", id); @@ -464,7 +463,7 @@ public void validateFirewallRule(Account caller, IPAddressVO ipAddress, Integer } // Validate ip address - _accountMgr.checkAccess(caller, null, ipAddress); + _accountMgr.checkAccess(caller, null, true, ipAddress); } //network id either has to be passed explicitly, or implicitly as a part of ipAddress object @@ -476,7 +475,7 @@ public void validateFirewallRule(Account caller, IPAddressVO ipAddress, Integer assert network != null : "Can't create rule as network associated with public ip address is null?"; if (trafficType == FirewallRule.TrafficType.Egress) { - _accountMgr.checkAccess(caller, null, network); + _accountMgr.checkAccess(caller, null, true, network); } // Verify that the network guru supports the protocol specified @@ -639,7 +638,7 @@ public boolean applyFirewallRules(List rules, boolean continueOn } if (caller != null) { - _accountMgr.checkAccess(caller, null, rules.toArray(new FirewallRuleVO[rules.size()])); + _accountMgr.checkAccess(caller, null, true, rules.toArray(new FirewallRuleVO[rules.size()])); } try { @@ -693,7 +692,7 @@ protected boolean revokeFirewallRule(long ruleId, boolean apply, Account caller, throw new InvalidParameterValueException("Only root admin can delete the system wide firewall rule"); } - _accountMgr.checkAccess(caller, null, rule); + _accountMgr.checkAccess(caller, null, true, rule); revokeRule(rule, caller, userId, false); @@ -743,7 +742,7 @@ protected FirewallRule updateFirewallRule(long ruleId, String customId, Account throw new InvalidParameterValueException("Only root admin can update the system wide firewall rule"); } - _accountMgr.checkAccess(caller, null, rule); + _accountMgr.checkAccess(caller, null, true, rule); if (customId != null) { rule.setUuid(customId); @@ -762,7 +761,7 @@ protected FirewallRule updateFirewallRule(long ruleId, String customId, Account @DB public void revokeRule(final FirewallRuleVO rule, Account caller, long userId, final boolean needUsageEvent) { if (caller != null) { - _accountMgr.checkAccess(caller, null, rule); + _accountMgr.checkAccess(caller, null, true, rule); } Transaction.execute(new TransactionCallbackNoReturn() { diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java index 05fb32597e..8225243db4 100755 --- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java +++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java @@ -30,6 +30,11 @@ import javax.ejb.Local; import javax.inject.Inject; +import org.apache.log4j.Logger; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBHealthCheckPolicyCmd; import org.apache.cloudstack.api.command.user.loadbalancer.CreateLBStickinessPolicyCmd; @@ -45,7 +50,6 @@ import org.apache.cloudstack.framework.config.dao.ConfigurationDao; import org.apache.cloudstack.lb.ApplicationLoadBalancerRuleVO; import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao; -import org.apache.log4j.Logger; import com.cloud.agent.api.to.LoadBalancerTO; import com.cloud.configuration.ConfigurationManager; @@ -165,8 +169,6 @@ import com.cloud.vm.dao.NicDao; import com.cloud.vm.dao.NicSecondaryIpDao; import com.cloud.vm.dao.UserVmDao; -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; @Local(value = {LoadBalancingRulesManager.class, LoadBalancingRulesService.class}) public class LoadBalancingRulesManagerImpl extends ManagerBase implements LoadBalancingRulesManager, LoadBalancingRulesService { @@ -527,7 +529,7 @@ public StickinessPolicy createLBStickinessPolicy(CreateLBStickinessPolicyCmd cmd throw new InvalidParameterValueException("Failed: LB rule id: " + cmd.getLbRuleId() + " not present "); } - _accountMgr.checkAccess(caller.getCallingAccount(), null, loadBalancer); + _accountMgr.checkAccess(caller.getCallingAccount(), null, true, loadBalancer); if (loadBalancer.getState() == FirewallRule.State.Revoke) { throw new InvalidParameterValueException("Failed: LB rule id: " + cmd.getLbRuleId() + " is in deleting state: "); } @@ -586,7 +588,7 @@ public HealthCheckPolicy createLBHealthCheckPolicy(CreateLBHealthCheckPolicyCmd throw new InvalidParameterValueException("Failed: LB rule id: " + cmd.getLbRuleId() + " not present "); } - _accountMgr.checkAccess(caller.getCallingAccount(), null, loadBalancer); + _accountMgr.checkAccess(caller.getCallingAccount(), null, true, loadBalancer); if (loadBalancer.getState() == FirewallRule.State.Revoke) { throw new InvalidParameterValueException("Failed: LB rule id: " + cmd.getLbRuleId() + " is in deleting state: "); @@ -748,7 +750,7 @@ public boolean deleteLBStickinessPolicy(long stickinessPolicyId, boolean apply) } long loadBalancerId = loadBalancer.getId(); FirewallRule.State backupState = loadBalancer.getState(); - _accountMgr.checkAccess(caller.getCallingAccount(), null, loadBalancer); + _accountMgr.checkAccess(caller.getCallingAccount(), null, true, loadBalancer); if (apply) { if (loadBalancer.getState() == FirewallRule.State.Active) { @@ -801,7 +803,7 @@ public boolean deleteLBHealthCheckPolicy(long healthCheckPolicyId, boolean apply } final long loadBalancerId = loadBalancer.getId(); FirewallRule.State backupState = loadBalancer.getState(); - _accountMgr.checkAccess(caller.getCallingAccount(), null, loadBalancer); + _accountMgr.checkAccess(caller.getCallingAccount(), null, true, loadBalancer); if (apply) { if (loadBalancer.getState() == FirewallRule.State.Active) { @@ -1193,7 +1195,7 @@ public boolean assignCertToLoadBalancer(long lbRuleId, Long certId) { throw new InvalidParameterException("Invalid certificate id: " + certId); } - _accountMgr.checkAccess(caller.getCallingAccount(), null, loadBalancer); + _accountMgr.checkAccess(caller.getCallingAccount(), null, true, loadBalancer); // check if LB and Cert belong to the same account if (loadBalancer.getAccountId() != certVO.getAccountId()) { @@ -1256,7 +1258,7 @@ public boolean removeCertFromLoadBalancer(long lbRuleId) { throw new InvalidParameterException("No certificate is bound to lb with id: " + lbRuleId); } - _accountMgr.checkAccess(caller.getCallingAccount(), null, loadBalancer); + _accountMgr.checkAccess(caller.getCallingAccount(), null, true, loadBalancer); boolean success = false; FirewallRule.State backupState = loadBalancer.getState(); @@ -1300,7 +1302,7 @@ private boolean removeFromLoadBalancerInternal(long loadBalancerId, List i throw new InvalidParameterException("Invalid load balancer value: " + loadBalancerId); } - _accountMgr.checkAccess(caller.getCallingAccount(), null, loadBalancer); + _accountMgr.checkAccess(caller.getCallingAccount(), null, true, loadBalancer); if (instanceIds == null && vmIdIpMap.isEmpty()) { throw new InvalidParameterValueException("Both instanceids and vmidipmap can't be null"); @@ -1462,7 +1464,7 @@ public boolean deleteLoadBalancerRule(long loadBalancerId, boolean apply) { if (rule == null) { throw new InvalidParameterValueException("Unable to find load balancer rule " + loadBalancerId); } - _accountMgr.checkAccess(caller, null, rule); + _accountMgr.checkAccess(caller, null, true, rule); boolean result = deleteLoadBalancerRule(loadBalancerId, apply, caller, ctx.getCallingUserId(), true); if (!result) { @@ -1686,7 +1688,7 @@ public LoadBalancer createPublicLoadBalancer(final String xId, final String name throw ex; } - _accountMgr.checkAccess(caller.getCallingAccount(), null, ipAddr); + _accountMgr.checkAccess(caller.getCallingAccount(), null, true, ipAddr); final Long networkId = ipAddr.getAssociatedWithNetworkId(); if (networkId == null) { @@ -2060,7 +2062,7 @@ public LoadBalancer updateLoadBalancerRule(UpdateLoadBalancerRuleCmd cmd) { } // check permissions - _accountMgr.checkAccess(caller, null, lb); + _accountMgr.checkAccess(caller, null, true, lb); if (name != null) { lb.setName(name); @@ -2139,7 +2141,7 @@ public Pair, List> listLoadBalancerInstances(List return null; } - _accountMgr.checkAccess(caller, null, loadBalancer); + _accountMgr.checkAccess(caller, null, true, loadBalancer); List loadBalancerInstances = new ArrayList(); List serviceStates = new ArrayList(); @@ -2218,7 +2220,7 @@ public List searchForLBStickinessPolicies(ListLBStickiness return null; } - _accountMgr.checkAccess(caller, null, loadBalancer); + _accountMgr.checkAccess(caller, null, true, loadBalancer); List sDbpolicies = _lb2stickinesspoliciesDao.listByLoadBalancerIdAndDisplayFlag(cmd.getLbRuleId(), forDisplay); @@ -2235,8 +2237,10 @@ public List searchForLBHealthCheckPolicies(ListLBHealthCh if (loadBalancer == null) { return null; } - _accountMgr.checkAccess(caller, null, loadBalancer); + + _accountMgr.checkAccess(caller, null, true, loadBalancer); List hcDbpolicies = _lb2healthcheckDao.listByLoadBalancerIdAndDisplayFlag(cmd.getLbRuleId(), forDisplay); + return hcDbpolicies; } @@ -2253,21 +2257,19 @@ public Pair, Integer> searchForLoadBalancers(ListLo Boolean forDisplay = cmd.getDisplay(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, "listLoadBalancerRules"); - //Long domainId = domainIdRecursiveListProject.first(); + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, + domainIdRecursiveListProject, cmd.listAll(), false); + Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(LoadBalancerVO.class, "id", true, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchBuilder sb = _lbDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE); @@ -2301,7 +2303,7 @@ public Pair, Integer> searchForLoadBalancers(ListLo } SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); if (keyword != null) { SearchCriteria ssc = _lbDao.createSearchCriteria(); @@ -2484,7 +2486,7 @@ public StickinessPolicy updateLBStickinessPolicy(long id, String customId, Boole throw new InvalidParameterException("Invalid Load balancer : " + policy.getLoadBalancerId() + " for Stickiness policy id: " + id); } - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, loadBalancer); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, loadBalancer); if (customId != null) { policy.setUuid(customId); @@ -2511,7 +2513,7 @@ public HealthCheckPolicy updateLBHealthCheckPolicy(long id, String customId, Boo throw new InvalidParameterException("Invalid Load balancer : " + policy.getLoadBalancerId() + " for Stickiness policy id: " + id); } - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, loadBalancer); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, loadBalancer); if (customId != null) { policy.setUuid(customId); diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index be3e849d43..05fbad359e 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -462,7 +462,7 @@ public VirtualRouter destroyRouter(final long routerId, final Account caller, fi return null; } - _accountMgr.checkAccess(caller, null, router); + _accountMgr.checkAccess(caller, null, true, router); _itMgr.expunge(router.getUuid()); _routerDao.remove(router.getId()); @@ -481,7 +481,7 @@ public VirtualRouter upgradeRouter(final UpgradeRouterCmd cmd) { throw new InvalidParameterValueException("Unable to find router with id " + routerId); } - _accountMgr.checkAccess(caller, null, router); + _accountMgr.checkAccess(caller, null, true, router); if (router.getServiceOfferingId() == serviceOfferingId) { s_logger.debug("Router: " + routerId + "already has service offering: " + serviceOfferingId); @@ -596,7 +596,7 @@ public VirtualRouter stopRouter(final long routerId, final boolean forced) throw throw new InvalidParameterValueException("Unable to find router by id " + routerId + "."); } - _accountMgr.checkAccess(account, null, router); + _accountMgr.checkAccess(account, null, true, router); final UserVO user = _userDao.findById(CallContext.current().getCallingUserId()); @@ -655,7 +655,7 @@ public VirtualRouter rebootRouter(final long routerId, final boolean reprogramNe throw new InvalidParameterValueException("Unable to find domain router with id " + routerId + "."); } - _accountMgr.checkAccess(caller, null, router); + _accountMgr.checkAccess(caller, null, true, router); // Can reboot domain router only in Running state if (router == null || router.getState() != State.Running) { @@ -3300,7 +3300,7 @@ public VirtualRouter startRouter(final long routerId, final boolean reprogramNet if (router == null) { throw new InvalidParameterValueException("Unable to find router by id " + routerId + "."); } - _accountMgr.checkAccess(caller, null, router); + _accountMgr.checkAccess(caller, null, true, router); final Account owner = _accountMgr.getAccount(router.getAccountId()); diff --git a/server/src/com/cloud/network/rules/RulesManagerImpl.java b/server/src/com/cloud/network/rules/RulesManagerImpl.java index f6a87bf457..eea12625d7 100755 --- a/server/src/com/cloud/network/rules/RulesManagerImpl.java +++ b/server/src/com/cloud/network/rules/RulesManagerImpl.java @@ -27,7 +27,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.command.user.firewall.ListPortForwardingRulesCmd; import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; @@ -164,7 +163,7 @@ protected void checkIpAndUserVm(IpAddress ipAddress, UserVm userVm, Account call } } - _accountMgr.checkAccess(caller, AccessType.OperateEntry, ipAddress, userVm); + _accountMgr.checkAccess(caller, null, true, ipAddress, userVm); // validate that IP address and userVM belong to the same account if (ipAddress.getAllocatedToAccountId().longValue() != userVm.getAccountId()) { @@ -189,7 +188,7 @@ public void checkRuleAndUserVm(FirewallRule rule, UserVm userVm, Account caller) return; } - _accountMgr.checkAccess(caller, AccessType.OperateEntry, rule, userVm); + _accountMgr.checkAccess(caller, null, true, rule, userVm); if (userVm.getState() == VirtualMachine.State.Destroyed || userVm.getState() == VirtualMachine.State.Expunging) { throw new InvalidParameterValueException("Invalid user vm: " + userVm.getId()); @@ -683,7 +682,7 @@ public boolean revokePortForwardingRule(long ruleId, boolean apply) { throw new InvalidParameterValueException("Unable to find " + ruleId); } - _accountMgr.checkAccess(caller, null, rule); + _accountMgr.checkAccess(caller, null, true, rule); if (!revokePortForwardingRuleInternal(ruleId, caller, ctx.getCallingUserId(), apply)) { throw new CloudRuntimeException("Failed to delete port forwarding rule"); @@ -718,7 +717,7 @@ public boolean revokeStaticNatRule(long ruleId, boolean apply) { throw new InvalidParameterValueException("Unable to find " + ruleId); } - _accountMgr.checkAccess(caller, null, rule); + _accountMgr.checkAccess(caller, null, true, rule); if (!revokeStaticNatRuleInternal(ruleId, caller, ctx.getCallingUserId(), apply)) { throw new CloudRuntimeException("Failed to revoke forwarding rule"); @@ -785,27 +784,25 @@ public Pair, Integer> listPortForwardingRules Boolean display = cmd.getDisplay(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); if (ipId != null) { IPAddressVO ipAddressVO = _ipAddressDao.findById(ipId); if (ipAddressVO == null || !ipAddressVO.readyToUse()) { throw new InvalidParameterValueException("Ip address id=" + ipId + " not ready for port forwarding rules yet"); } - _accountMgr.checkAccess(caller, null, ipAddressVO); + _accountMgr.checkAccess(caller, null, true, ipAddressVO); } Ternary domainIdRecursiveListProject = new Ternary(cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, "listPortForwardingRules"); + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false); + Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter filter = new Filter(PortForwardingRuleVO.class, "id", false, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchBuilder sb = _portForwardingDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sb.and("id", sb.entity().getId(), Op.EQ); sb.and("ip", sb.entity().getSourceIpAddressId(), Op.EQ); @@ -826,7 +823,7 @@ public Pair, Integer> listPortForwardingRules } SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); if (id != null) { sc.setParameters("id", id); @@ -869,7 +866,7 @@ protected boolean applyPortForwardingRules(long ipId, boolean continueOnError, A } if (caller != null) { - _accountMgr.checkAccess(caller, null, rules.toArray(new PortForwardingRuleVO[rules.size()])); + _accountMgr.checkAccess(caller, null, true, rules.toArray(new PortForwardingRuleVO[rules.size()])); } try { @@ -898,7 +895,7 @@ protected boolean applyStaticNatRulesForIp(long sourceIpId, boolean continueOnEr } if (caller != null) { - _accountMgr.checkAccess(caller, null, staticNatRules.toArray(new StaticNatRule[staticNatRules.size()])); + _accountMgr.checkAccess(caller, null, true, staticNatRules.toArray(new StaticNatRule[staticNatRules.size()])); } try { @@ -922,7 +919,7 @@ public boolean applyPortForwardingRulesForNetwork(long networkId, boolean contin } if (caller != null) { - _accountMgr.checkAccess(caller, null, rules.toArray(new PortForwardingRuleVO[rules.size()])); + _accountMgr.checkAccess(caller, null, true, rules.toArray(new PortForwardingRuleVO[rules.size()])); } try { @@ -948,7 +945,7 @@ public boolean applyStaticNatRulesForNetwork(long networkId, boolean continueOnE } if (caller != null) { - _accountMgr.checkAccess(caller, null, rules.toArray(new FirewallRule[rules.size()])); + _accountMgr.checkAccess(caller, null, true, rules.toArray(new FirewallRule[rules.size()])); } for (FirewallRuleVO rule : rules) { @@ -976,7 +973,7 @@ public boolean applyStaticNatsForNetwork(long networkId, boolean continueOnError } if (caller != null) { - _accountMgr.checkAccess(caller, null, ips.toArray(new IPAddressVO[ips.size()])); + _accountMgr.checkAccess(caller, null, true, ips.toArray(new IPAddressVO[ips.size()])); } List staticNats = new ArrayList(); @@ -1003,28 +1000,25 @@ public boolean applyStaticNatsForNetwork(long networkId, boolean continueOnError public Pair, Integer> searchStaticNatRules(Long ipId, Long id, Long vmId, Long start, Long size, String accountName, Long domainId, Long projectId, boolean isRecursive, boolean listAll) { Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); if (ipId != null) { IPAddressVO ipAddressVO = _ipAddressDao.findById(ipId); if (ipAddressVO == null || !ipAddressVO.readyToUse()) { throw new InvalidParameterValueException("Ip address id=" + ipId + " not ready for port forwarding rules yet"); } - _accountMgr.checkAccess(caller, null, ipAddressVO); + _accountMgr.checkAccess(caller, null, true, ipAddressVO); } Ternary domainIdRecursiveListProject = new Ternary(domainId, isRecursive, null); - _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedDomains, permittedAccounts, permittedResources, domainIdRecursiveListProject, listAll, - false, "listIpForwardingRules"); + _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedAccounts, domainIdRecursiveListProject, listAll, false); domainId = domainIdRecursiveListProject.first(); isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter filter = new Filter(PortForwardingRuleVO.class, "id", false, start, size); SearchBuilder sb = _firewallDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sb.and("ip", sb.entity().getSourceIpAddressId(), Op.EQ); sb.and("purpose", sb.entity().getPurpose(), Op.EQ); @@ -1037,7 +1031,7 @@ public Pair, Integer> searchStaticNatRules(Long ipI } SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sc.setParameters("purpose", Purpose.StaticNat); if (id != null) { @@ -1389,7 +1383,7 @@ protected List createStaticNatForIp(IpAddress sourceIp, Account calle } if (caller != null) { - _accountMgr.checkAccess(caller, null, sourceIp); + _accountMgr.checkAccess(caller, null, true, sourceIp); } // create new static nat rule @@ -1508,7 +1502,7 @@ public PortForwardingRule updatePortForwardingRule(long id, String customId, Boo if (rule == null) { throw new InvalidParameterValueException("Unable to find " + id); } - _accountMgr.checkAccess(caller, null, rule); + _accountMgr.checkAccess(caller, null, true, rule); if (customId != null) { rule.setUuid(customId); diff --git a/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java b/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java index a666ecdffc..f60a746e68 100755 --- a/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java +++ b/server/src/com/cloud/network/security/SecurityGroupManagerImpl.java @@ -612,7 +612,7 @@ private List authorizeSecurityGroupRule(final Long security } // Verify permissions - _accountMgr.checkAccess(caller, AccessType.OperateEntry, securityGroup); + _accountMgr.checkAccess(caller, null, true, securityGroup); Long domainId = owner.getDomainId(); if (protocol == null) { @@ -819,7 +819,7 @@ private boolean revokeSecurityGroupRule(final Long id, SecurityRuleType type) { // Check permissions SecurityGroup securityGroup = _securityGroupDao.findById(rule.getSecurityGroupId()); - _accountMgr.checkAccess(caller, AccessType.OperateEntry, securityGroup); + _accountMgr.checkAccess(caller, AccessType.OperateEntry, true, securityGroup); long securityGroupId = rule.getSecurityGroupId(); Boolean result = Transaction.execute(new TransactionCallback() { @@ -1120,7 +1120,7 @@ public boolean deleteSecurityGroup(DeleteSecurityGroupCmd cmd) throws ResourceIn } // check permissions - _accountMgr.checkAccess(caller, AccessType.OperateEntry, group); + _accountMgr.checkAccess(caller, null, true, group); return Transaction.execute(new TransactionCallbackWithException() { @Override @@ -1359,7 +1359,7 @@ public boolean securityGroupRulesForVmSecIp(long nicId, String secondaryIp, bool } // Verify permissions - _accountMgr.checkAccess(caller, null, vm); + _accountMgr.checkAccess(caller, null, false, vm); // Validate parameters List vmSgGrps = getSecurityGroupsForVm(vmId); diff --git a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java index 72996d160c..19a26c1627 100644 --- a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java +++ b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java @@ -103,7 +103,7 @@ public NetworkACL createNetworkACL(String name, String description, long vpcId, if (vpc == null) { throw new InvalidParameterValueException("Unable to find VPC"); } - _accountMgr.checkAccess(caller, null, vpc); + _accountMgr.checkAccess(caller, null, true, vpc); return _networkAclMgr.createNetworkACL(name, description, vpcId, forDisplay); } @@ -161,7 +161,7 @@ public Pair, Integer> listNetworkACLs(ListNetworkACLL if (vpc == null) { throw new InvalidParameterValueException("Unable to find VPC"); } - _accountMgr.checkAccess(caller, null, vpc); + _accountMgr.checkAccess(caller, null, true, vpc); //Include vpcId 0 to list default ACLs sc.setParameters("vpcId", vpcId, 0); } else { @@ -169,26 +169,23 @@ public Pair, Integer> listNetworkACLs(ListNetworkACLL // VpcId is not specified. Find permitted VPCs for the caller // and list ACLs belonging to the permitted VPCs - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); - Long domainId = cmd.getDomainId(); boolean isRecursive = cmd.isRecursive(); String accountName = cmd.getAccountName(); Long projectId = cmd.getProjectId(); boolean listAll = cmd.listAll(); Ternary domainIdRecursiveListProject = new Ternary(domainId, isRecursive, null); - _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedDomains, permittedAccounts, permittedResources, domainIdRecursiveListProject, - listAll, false, "listNetworkACLLists"); - //domainId = domainIdRecursiveListProject.first(); + ListProjectResourcesCriteria>(domainId, isRecursive, null); + _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedAccounts, domainIdRecursiveListProject, + listAll, false); + domainId = domainIdRecursiveListProject.first(); isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); SearchBuilder sbVpc = _vpcDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sbVpc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sbVpc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); SearchCriteria scVpc = sbVpc.create(); - _accountMgr.buildACLSearchCriteria(scVpc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(scVpc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); List vpcs = _vpcDao.search(scVpc, null); List vpcIds = new ArrayList(); for (VpcVO vpc : vpcs) { @@ -225,7 +222,7 @@ public boolean deleteNetworkACL(long id) { if (vpc == null) { throw new InvalidParameterValueException("Unable to find specified VPC associated with the ACL"); } - _accountMgr.checkAccess(caller, null, vpc); + _accountMgr.checkAccess(caller, null, true, vpc); return _networkAclMgr.deleteNetworkACL(acl); } @@ -256,14 +253,14 @@ public boolean replaceNetworkACLonPrivateGw(long aclId, long privateGatewayId) t if (vpc == null) { throw new InvalidParameterValueException("Unable to find Vpc associated with the NetworkACL"); } - _accountMgr.checkAccess(caller, null, vpc); + _accountMgr.checkAccess(caller, null, true, vpc); if (!gateway.getVpcId().equals(acl.getVpcId())) { throw new InvalidParameterValueException("private gateway: " + privateGatewayId + " and ACL: " + aclId + " do not belong to the same VPC"); } } PrivateGateway privateGateway = _vpcSvc.getVpcPrivateGateway(gateway.getId()); - _accountMgr.checkAccess(caller, null, privateGateway); + _accountMgr.checkAccess(caller, null, true, privateGateway); return _networkAclMgr.replaceNetworkACLForPrivateGw(acl, privateGateway); @@ -299,7 +296,7 @@ public boolean replaceNetworkACL(long aclId, long networkId) throws ResourceUnav throw new InvalidParameterValueException("Unable to find Vpc associated with the NetworkACL"); } - _accountMgr.checkAccess(caller, null, vpc); + _accountMgr.checkAccess(caller, null, true, vpc); if (!network.getVpcId().equals(acl.getVpcId())) { throw new InvalidParameterValueException("Network: " + networkId + " and ACL: " + aclId + " do not belong to the same VPC"); } @@ -371,7 +368,7 @@ public NetworkACLItem createNetworkACLItem(CreateNetworkACLCmd aclItemCmd) { if (vpc == null) { throw new InvalidParameterValueException("Unable to find Vpc associated with the NetworkACL"); } - _accountMgr.checkAccess(caller, null, vpc); + _accountMgr.checkAccess(caller, null, true, vpc); //Ensure that number is unique within the ACL if (aclItemCmd.getNumber() != null) { @@ -488,7 +485,6 @@ public Pair, Integer> listNetworkACLItems(ListNet String action = cmd.getAction(); Map tags = cmd.getTags(); Account caller = CallContext.current().getCallingAccount(); - Boolean display = cmd.getDisplay(); Filter filter = new Filter(NetworkACLItemVO.class, "id", false, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchBuilder sb = _networkACLItemDao.createSearchBuilder(); @@ -498,7 +494,6 @@ public Pair, Integer> listNetworkACLItems(ListNet sb.and("trafficType", sb.entity().getTrafficType(), Op.EQ); sb.and("protocol", sb.entity().getProtocol(), Op.EQ); sb.and("action", sb.entity().getAction(), Op.EQ); - sb.and("display", sb.entity().isDisplay(), Op.EQ); if (tags != null && !tags.isEmpty()) { SearchBuilder tagSearch = _resourceTagDao.createSearchBuilder(); @@ -521,10 +516,6 @@ public Pair, Integer> listNetworkACLItems(ListNet SearchCriteria sc = sb.create(); - if (display != null) { - sc.setParameters("display", display); - } - if (id != null) { sc.setParameters("id", id); } @@ -551,33 +542,32 @@ public Pair, Integer> listNetworkACLItems(ListNet if (vpc == null) { throw new InvalidParameterValueException("Unable to find VPC associated with acl"); } - _accountMgr.checkAccess(caller, null, vpc); + _accountMgr.checkAccess(caller, null, true, vpc); } sc.setParameters("aclId", aclId); } else { //ToDo: Add accountId to network_acl_item table for permission check + // aclId is not specified // List permitted VPCs and filter aclItems - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Long domainId = cmd.getDomainId(); boolean isRecursive = cmd.isRecursive(); String accountName = cmd.getAccountName(); Long projectId = cmd.getProjectId(); boolean listAll = cmd.listAll(); Ternary domainIdRecursiveListProject = new Ternary(domainId, isRecursive, null); - _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedDomains, permittedAccounts, permittedResources, domainIdRecursiveListProject, - listAll, false, "listNetworkACLs"); + ListProjectResourcesCriteria>(domainId, isRecursive, null); + _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedAccounts, domainIdRecursiveListProject, + listAll, false); domainId = domainIdRecursiveListProject.first(); isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); SearchBuilder sbVpc = _vpcDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sbVpc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sbVpc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); SearchCriteria scVpc = sbVpc.create(); - _accountMgr.buildACLSearchCriteria(scVpc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(scVpc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); List vpcs = _vpcDao.search(scVpc, null); List vpcIds = new ArrayList(); for (VpcVO vpc : vpcs) { @@ -620,7 +610,7 @@ public boolean revokeNetworkACLItem(long ruleId) { Account caller = CallContext.current().getCallingAccount(); - _accountMgr.checkAccess(caller, null, vpc); + _accountMgr.checkAccess(caller, null, true, vpc); if((aclItem.getAclId() == NetworkACL.DEFAULT_ALLOW) || (aclItem.getAclId() == NetworkACL.DEFAULT_DENY)){ throw new InvalidParameterValueException("ACL Items in default ACL cannot be deleted"); @@ -647,7 +637,7 @@ public NetworkACLItem updateNetworkACLItem(Long id, String protocol, List listVpcs(Long id, String vpcName, String displayText, String accountName, Long domainId, String keyword, Long startIndex, Long pageSizeVal, Long zoneId, Boolean isRecursive, Boolean listAll, Boolean restartRequired, Map tags, Long projectId, Boolean display) { Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); - Ternary domainIdRecursiveListProject = new Ternary(domainId, isRecursive, null); - _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedDomains, permittedAccounts, permittedResources, domainIdRecursiveListProject, listAll, - false, "listVPCs"); + _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedAccounts, domainIdRecursiveListProject, + listAll, false); + domainId = domainIdRecursiveListProject.first(); isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(VpcVO.class, "created", false, startIndex, pageSizeVal); SearchBuilder sb = _vpcDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sb.and("name", sb.entity().getName(), SearchCriteria.Op.LIKE); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); @@ -1034,7 +1032,7 @@ public List listVpcs(Long id, String vpcName, String displayText, // now set the SC criteria... SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); if (keyword != null) { SearchCriteria ssc = _vpcDao.createSearchCriteria(); @@ -1154,7 +1152,7 @@ public boolean startVpc(long vpcId, boolean destroyOnFailure) throws ConcurrentO } //permission check - _accountMgr.checkAccess(caller, null, vpc); + _accountMgr.checkAccess(caller, null, false, vpc); DataCenter dc = _entityMgr.findById(DataCenter.class, vpc.getZoneId()); @@ -1214,7 +1212,7 @@ public boolean shutdownVpc(long vpcId) throws ConcurrentOperationException, Reso } //permission check - _accountMgr.checkAccess(caller, null, vpc); + _accountMgr.checkAccess(caller, null, false, vpc); //shutdown provider s_logger.debug("Shutting down vpc " + vpc); @@ -1480,7 +1478,7 @@ public boolean restartVpc(long vpcId) throws ConcurrentOperationException, Resou throw ex; } - _accountMgr.checkAccess(caller, null, vpc); + _accountMgr.checkAccess(caller, null, false, vpc); s_logger.debug("Restarting VPC " + vpc); boolean restartRequired = false; @@ -1797,23 +1795,21 @@ public Pair, Integer> listPrivateGateway(ListPrivateGateway Long domainId = cmd.getDomainId(); String accountName = cmd.getAccountName(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); String state = cmd.getState(); Long projectId = cmd.getProjectId(); Filter searchFilter = new Filter(VpcGatewayVO.class, "id", false, cmd.getStartIndex(), cmd.getPageSizeVal()); Ternary domainIdRecursiveListProject = new Ternary(domainId, isRecursive, null); - _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedDomains, permittedAccounts, permittedResources, domainIdRecursiveListProject, listAll, - false, "listPrivateGateways"); + _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedAccounts, domainIdRecursiveListProject, + listAll, false); + domainId = domainIdRecursiveListProject.first(); isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); SearchBuilder sb = _vpcGatewayDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); - + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); if (vlan != null) { SearchBuilder ntwkSearch = _ntwkDao.createSearchBuilder(); ntwkSearch.and("vlan", ntwkSearch.entity().getBroadcastUri(), SearchCriteria.Op.EQ); @@ -1821,8 +1817,7 @@ public Pair, Integer> listPrivateGateway(ListPrivateGateway } SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); - + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); if (id != null) { sc.addAnd("id", Op.EQ, id); } @@ -1934,7 +1929,7 @@ public boolean revokeStaticRoute(long routeId) throws ResourceUnavailableExcepti throw new InvalidParameterValueException("Unable to find static route by id"); } - _accountMgr.checkAccess(caller, null, route); + _accountMgr.checkAccess(caller, null, false, route); markStaticRouteForRevoke(route, caller); @@ -1982,7 +1977,7 @@ public StaticRoute createStaticRoute(long gatewayId, final String cidr) throws N if (vpc == null) { throw new InvalidParameterValueException("Can't add static route to VPC that is being deleted"); } - _accountMgr.checkAccess(caller, null, vpc); + _accountMgr.checkAccess(caller, null, false, vpc); if (!NetUtils.isValidCIDR(cidr)) { throw new InvalidParameterValueException("Invalid format for cidr " + cidr); @@ -2050,23 +2045,21 @@ public Pair, Integer> listStaticRoutes(ListStaticRou Boolean listAll = cmd.listAll(); String accountName = cmd.getAccountName(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); - Map tags = cmd.getTags(); Long projectId = cmd.getProjectId(); Ternary domainIdRecursiveListProject = new Ternary(domainId, isRecursive, null); - _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedDomains, permittedAccounts, permittedResources, domainIdRecursiveListProject, listAll, - false, "listStaticRoutes"); + _accountMgr.buildACLSearchParameters(caller, id, accountName, projectId, permittedAccounts, domainIdRecursiveListProject, + listAll, false); + domainId = domainIdRecursiveListProject.first(); isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(StaticRouteVO.class, "created", false, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchBuilder sb = _staticRouteDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); sb.and("vpcId", sb.entity().getVpcId(), SearchCriteria.Op.EQ); @@ -2085,8 +2078,7 @@ public Pair, Integer> listStaticRoutes(ListStaticRou } SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); - + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); if (id != null) { sc.addAnd("id", Op.EQ, id); } @@ -2134,7 +2126,7 @@ protected void detectRoutesConflict(StaticRoute newRoute) throws NetworkRuleConf protected void markStaticRouteForRevoke(StaticRouteVO route, Account caller) { s_logger.debug("Revoking static route " + route); if (caller != null) { - _accountMgr.checkAccess(caller, null, route); + _accountMgr.checkAccess(caller, null, false, route); } if (route.getState() == StaticRoute.State.Staged) { @@ -2193,6 +2185,7 @@ public IpAddress associateIPToVpc(final long ipId, final long vpcId) throws Reso IpAddress ipToAssoc = _ntwkModel.getIp(ipId); if (ipToAssoc != null) { + _accountMgr.checkAccess(caller, null, true, ipToAssoc); owner = _accountMgr.getAccount(ipToAssoc.getAllocatedToAccountId()); } else { s_logger.debug("Unable to find ip address by id: " + ipId); @@ -2205,7 +2198,7 @@ public IpAddress associateIPToVpc(final long ipId, final long vpcId) throws Reso } // check permissions - _accountMgr.checkAccess(caller, AccessType.OperateEntry, ipToAssoc, vpc); + _accountMgr.checkAccess(caller, null, true, owner, vpc); boolean isSourceNat = false; if (getExistingSourceNatInVpc(owner.getId(), vpcId) == null) { @@ -2285,7 +2278,7 @@ public Network createVpcGuestNetwork(long ntwkOffId, String name, String display ex.addProxyObject(String.valueOf(vpcId), "VPC"); throw ex; } - _accountMgr.checkAccess(caller, null, vpc); + _accountMgr.checkAccess(caller, null, false, vpc); if (networkDomain == null) { networkDomain = vpc.getNetworkDomain(); diff --git a/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java b/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java index 9d9118c021..757f618eeb 100755 --- a/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java +++ b/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java @@ -150,7 +150,7 @@ public RemoteAccessVpn createRemoteAccessVpn(final long publicIpId, String ipRan throw new InvalidParameterValueException("Unable to create remote access vpn, invalid public IP address id" + publicIpId); } - _accountMgr.checkAccess(caller, null, ipAddr); + _accountMgr.checkAccess(caller, null, true, ipAddr); if (!ipAddr.readyToUse()) { throw new InvalidParameterValueException("The Ip address is not ready to be used yet: " + ipAddr.getAddress()); @@ -292,7 +292,7 @@ public boolean destroyRemoteAccessVpnForIp(long ipId, Account caller) throws Res return true; } - _accountMgr.checkAccess(caller, AccessType.OperateEntry, vpn); + _accountMgr.checkAccess(caller, AccessType.OperateEntry, true, vpn); RemoteAccessVpn.State prevState = vpn.getState(); vpn.setState(RemoteAccessVpn.State.Removed); @@ -395,7 +395,7 @@ public VpnUser doInTransaction(TransactionStatus status) { if (owner == null) { throw new InvalidParameterValueException("Unable to add vpn user: Another operation active"); } - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, true, owner); //don't allow duplicated user names for the same account VpnUserVO vpnUser = _vpnUsersDao.findByAccountAndUsername(owner.getId(), username); @@ -424,7 +424,7 @@ public boolean removeVpnUser(long vpnOwnerId, String username, Account caller) { if (user == null) { throw new InvalidParameterValueException("Could not find vpn user " + username); } - _accountMgr.checkAccess(caller, null, user); + _accountMgr.checkAccess(caller, null, true, user); Transaction.execute(new TransactionCallbackNoReturn() { @Override @@ -443,7 +443,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { public List listVpnUsers(long vpnOwnerId, String userName) { Account caller = CallContext.current().getCallingAccount(); Account owner = _accountDao.findById(vpnOwnerId); - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, true, owner); return _vpnUsersDao.listByAccount(vpnOwnerId); } @@ -461,7 +461,7 @@ public RemoteAccessVpnVO startRemoteAccessVpn(long ipAddressId, boolean openFire openFirewall = false; } - _accountMgr.checkAccess(caller, null, vpn); + _accountMgr.checkAccess(caller, null, true, vpn); boolean started = false; try { @@ -507,7 +507,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { public boolean applyVpnUsers(long vpnOwnerId, String userName) { Account caller = CallContext.current().getCallingAccount(); Account owner = _accountDao.findById(vpnOwnerId); - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, true, owner); s_logger.debug("Applying vpn users for " + owner); List vpns = _remoteAccessVpnDao.findByAccount(vpnOwnerId); @@ -586,26 +586,24 @@ public Pair, Integer> searchForVpnUsers(ListVpnUsersCmd String username = cmd.getUsername(); Long id = cmd.getId(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary(cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, "listVpnUsers"); - //Long domainId = domainIdRecursiveListProject.first(); + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false); + Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(VpnUserVO.class, "username", true, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchBuilder sb = _vpnUsersDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); + sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); sb.and("username", sb.entity().getUsername(), SearchCriteria.Op.EQ); sb.and("state", sb.entity().getState(), Op.IN); SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); //list only active users sc.setParameters("state", State.Active, State.Add); @@ -627,9 +625,7 @@ public Pair, Integer> searchForRemoteAccessVpns( // do some parameter validation Account caller = CallContext.current().getCallingAccount(); Long ipAddressId = cmd.getPublicIpId(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Long vpnId = cmd.getId(); Long networkId = cmd.getNetworkId(); @@ -644,19 +640,18 @@ public Pair, Integer> searchForRemoteAccessVpns( throw new InvalidParameterValueException("Unable to list remote access vpns, IP address " + ipAddressId + " is not associated with an account."); } } - _accountMgr.checkAccess(caller, null, publicIp); + _accountMgr.checkAccess(caller, null, true, publicIp); } Ternary domainIdRecursiveListProject = new Ternary(cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, null, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, "listRemoteAccessVpns"); - //Long domainId = domainIdRecursiveListProject.first(); + _accountMgr.buildACLSearchParameters(caller, null, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false); + Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter filter = new Filter(RemoteAccessVpnVO.class, "serverAddressId", false, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchBuilder sb = _remoteAccessVpnDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sb.and("serverAddressId", sb.entity().getServerAddressId(), Op.EQ); sb.and("id", sb.entity().getId(), Op.EQ); @@ -665,7 +660,8 @@ public Pair, Integer> searchForRemoteAccessVpns( sb.and("display", sb.entity().isDisplay(), Op.EQ); SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); + sc.setParameters("state", RemoteAccessVpn.State.Running); @@ -755,7 +751,7 @@ public RemoteAccessVpn updateRemoteAccessVpn(long id, String customId, Boolean f throw new InvalidParameterValueException("Can't find remote access vpn by id " + id); } - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, vpn); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, vpn); if (customId != null) { vpn.setUuid(customId); } diff --git a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java index a34aa6c7e8..e6d0b1233f 100644 --- a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java +++ b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java @@ -125,7 +125,7 @@ public Site2SiteVpnGateway createVpnGateway(CreateVpnGatewayCmd cmd) { Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId()); //Verify that caller can perform actions in behalf of vpc owner - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, false, owner); Long vpcId = cmd.getVpcId(); VpcVO vpc = _vpcDao.findById(vpcId); @@ -175,7 +175,7 @@ public Site2SiteCustomerGateway createCustomerGateway(CreateVpnCustomerGatewayCm Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId()); //Verify that caller can perform actions in behalf of vpc owner - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, false, owner); String name = cmd.getName(); String gatewayIp = cmd.getGatewayIp(); @@ -243,21 +243,21 @@ public Site2SiteVpnConnection createVpnConnection(CreateVpnConnectionCmd cmd) th Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId()); //Verify that caller can perform actions in behalf of vpc owner - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, false, owner); Long customerGatewayId = cmd.getCustomerGatewayId(); Site2SiteCustomerGateway customerGateway = _customerGatewayDao.findById(customerGatewayId); if (customerGateway == null) { throw new InvalidParameterValueException("Unable to found specified Site to Site VPN customer gateway " + customerGatewayId + " !"); } - _accountMgr.checkAccess(caller, null, customerGateway); + _accountMgr.checkAccess(caller, null, false, customerGateway); Long vpnGatewayId = cmd.getVpnGatewayId(); Site2SiteVpnGateway vpnGateway = _vpnGatewayDao.findById(vpnGatewayId); if (vpnGateway == null) { throw new InvalidParameterValueException("Unable to found specified Site to Site VPN gateway " + vpnGatewayId + " !"); } - _accountMgr.checkAccess(caller, null, vpnGateway); + _accountMgr.checkAccess(caller, null, false, vpnGateway); if (customerGateway.getAccountId() != vpnGateway.getAccountId() || customerGateway.getDomainId() != vpnGateway.getDomainId()) { throw new InvalidParameterValueException("VPN connection can only be esitablished between same account's VPN gateway and customer gateway!"); @@ -363,7 +363,7 @@ public boolean deleteCustomerGateway(DeleteVpnCustomerGatewayCmd cmd) { if (customerGateway == null) { throw new InvalidParameterValueException("Fail to find customer gateway with " + id + " !"); } - _accountMgr.checkAccess(caller, null, customerGateway); + _accountMgr.checkAccess(caller, null, false, customerGateway); return doDeleteCustomerGateway(customerGateway); } @@ -398,7 +398,7 @@ public boolean deleteVpnGateway(DeleteVpnGatewayCmd cmd) { throw new InvalidParameterValueException("Fail to find vpn gateway with " + id + " !"); } - _accountMgr.checkAccess(caller, null, vpnGateway); + _accountMgr.checkAccess(caller, null, false, vpnGateway); doDeleteVpnGateway(vpnGateway); return true; @@ -415,7 +415,7 @@ public Site2SiteCustomerGateway updateCustomerGateway(UpdateVpnCustomerGatewayCm if (gw == null) { throw new InvalidParameterValueException("Find to find customer gateway with id " + id); } - _accountMgr.checkAccess(caller, null, gw); + _accountMgr.checkAccess(caller, null, false, gw); List conns = _vpnConnectionDao.listByCustomerGatewayId(id); if (conns != null) { @@ -505,7 +505,7 @@ public boolean deleteVpnConnection(DeleteVpnConnectionCmd cmd) throws ResourceUn throw new InvalidParameterValueException("Fail to find site to site VPN connection " + id + " to delete!"); } - _accountMgr.checkAccess(caller, null, conn); + _accountMgr.checkAccess(caller, null, false, conn); if (conn.getState() == State.Connected) { stopVpnConnection(id); @@ -554,7 +554,7 @@ public Site2SiteVpnConnection resetVpnConnection(ResetVpnConnectionCmd cmd) thro if (conn == null) { throw new InvalidParameterValueException("Fail to find site to site VPN connection " + id + " to reset!"); } - _accountMgr.checkAccess(caller, null, conn); + _accountMgr.checkAccess(caller, null, false, conn); if (conn.getState() == State.Pending) { throw new InvalidParameterValueException("VPN connection " + id + " cannot be reseted when state is Pending!"); @@ -578,26 +578,23 @@ public Pair, Integer> searchForCustomer long pageSizeVal = cmd.getPageSizeVal(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary(domainId, isRecursive, null); - _accountMgr.buildACLSearchParameters(caller, id, accountName, null, permittedDomains, permittedAccounts, permittedResources, domainIdRecursiveListProject, listAll, false, - "listVpnCustomerGateways"); - //domainId = domainIdRecursiveListProject.first(); + _accountMgr.buildACLSearchParameters(caller, id, accountName, null, permittedAccounts, domainIdRecursiveListProject, listAll, false); + domainId = domainIdRecursiveListProject.first(); isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(Site2SiteCustomerGatewayVO.class, "id", false, startIndex, pageSizeVal); SearchBuilder sb = _customerGatewayDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); if (id != null) { sc.addAnd("id", SearchCriteria.Op.EQ, id); @@ -621,28 +618,25 @@ public Pair, Integer> searchForVpnGateways(L long pageSizeVal = cmd.getPageSizeVal(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary(domainId, isRecursive, null); - _accountMgr.buildACLSearchParameters(caller, id, accountName, null, permittedDomains, permittedAccounts, permittedResources, domainIdRecursiveListProject, listAll, false, - "listVpnGateways"); - //domainId = domainIdRecursiveListProject.first(); + _accountMgr.buildACLSearchParameters(caller, id, accountName, null, permittedAccounts, domainIdRecursiveListProject, listAll, false); + domainId = domainIdRecursiveListProject.first(); isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(Site2SiteVpnGatewayVO.class, "id", false, startIndex, pageSizeVal); SearchBuilder sb = _vpnGatewayDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); sb.and("vpcId", sb.entity().getVpcId(), SearchCriteria.Op.EQ); sb.and("display", sb.entity().isDisplay(), SearchCriteria.Op.EQ); SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); if (id != null) { sc.addAnd("id", SearchCriteria.Op.EQ, id); @@ -674,21 +668,18 @@ public Pair, Integer> searchForVpnConnect long pageSizeVal = cmd.getPageSizeVal(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary(domainId, isRecursive, null); - _accountMgr.buildACLSearchParameters(caller, id, accountName, null, permittedDomains, permittedAccounts, permittedResources, domainIdRecursiveListProject, listAll, false, - "listVpnConnections"); - //domainId = domainIdRecursiveListProject.first(); + _accountMgr.buildACLSearchParameters(caller, id, accountName, null, permittedAccounts, domainIdRecursiveListProject, listAll, false); + domainId = domainIdRecursiveListProject.first(); isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(Site2SiteVpnConnectionVO.class, "id", false, startIndex, pageSizeVal); SearchBuilder sb = _vpnConnectionDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); sb.and("display", sb.entity().isDisplay(), SearchCriteria.Op.EQ); @@ -700,7 +691,7 @@ public Pair, Integer> searchForVpnConnect } SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); if (display != null) { sc.setParameters("display", display); @@ -818,7 +809,7 @@ public Site2SiteVpnConnection updateVpnConnection(long id, String customId, Bool throw new InvalidParameterValueException("Fail to find site to site VPN connection " + id); } - _accountMgr.checkAccess(caller, null, conn); + _accountMgr.checkAccess(caller, null, false, conn); if (customId != null) { conn.setUuid(customId); } @@ -841,7 +832,7 @@ public Site2SiteVpnGateway updateVpnGateway(Long id, String customId, Boolean fo throw new InvalidParameterValueException("Fail to find vpn gateway with " + id); } - _accountMgr.checkAccess(caller, null, vpnGateway); + _accountMgr.checkAccess(caller, null, false, vpnGateway); if (customId != null) { vpnGateway.setUuid(customId); } diff --git a/server/src/com/cloud/projects/ProjectManagerImpl.java b/server/src/com/cloud/projects/ProjectManagerImpl.java index 6aa5abc0e8..d10c059bd5 100755 --- a/server/src/com/cloud/projects/ProjectManagerImpl.java +++ b/server/src/com/cloud/projects/ProjectManagerImpl.java @@ -244,7 +244,7 @@ public Project enableProject(long projectId) { throw new InvalidParameterValueException("Unable to find project by id " + projectId); } - _accountMgr.checkAccess(caller, AccessType.ModifyProject, _accountMgr.getAccount(project.getProjectAccountId())); + _accountMgr.checkAccess(caller, AccessType.ModifyProject, true, _accountMgr.getAccount(project.getProjectAccountId())); //at this point enabling project doesn't require anything, so just update the state project.setState(State.Active); @@ -264,7 +264,7 @@ public boolean deleteProject(long projectId) { throw new InvalidParameterValueException("Unable to find project by id " + projectId); } - _accountMgr.checkAccess(ctx.getCallingAccount(), AccessType.ModifyProject, _accountMgr.getAccount(project.getProjectAccountId())); + _accountMgr.checkAccess(ctx.getCallingAccount(), AccessType.ModifyProject, true, _accountMgr.getAccount(project.getProjectAccountId())); return deleteProject(ctx.getCallingAccount(), ctx.getCallingUserId(), project); } @@ -463,7 +463,7 @@ public Project updateProject(final long projectId, final String displayText, fin } //verify permissions - _accountMgr.checkAccess(caller, AccessType.ModifyProject, _accountMgr.getAccount(project.getProjectAccountId())); + _accountMgr.checkAccess(caller, AccessType.ModifyProject, true, _accountMgr.getAccount(project.getProjectAccountId())); Transaction.execute(new TransactionCallbackWithExceptionNoReturn() { @Override @@ -550,7 +550,7 @@ public boolean addAccountToProject(long projectId, String accountName, String em } //verify permissions - only project owner can assign - _accountMgr.checkAccess(caller, AccessType.ModifyProject, _accountMgr.getAccount(project.getProjectAccountId())); + _accountMgr.checkAccess(caller, AccessType.ModifyProject, true, _accountMgr.getAccount(project.getProjectAccountId())); //Check if the account already added to the project ProjectAccount projectAccount = _projectAccountDao.findByProjectIdAccountId(projectId, account.getId()); @@ -628,7 +628,7 @@ public boolean deleteAccountFromProject(long projectId, String accountName) { } //verify permissions - _accountMgr.checkAccess(caller, AccessType.ModifyProject, _accountMgr.getAccount(project.getProjectAccountId())); + _accountMgr.checkAccess(caller, AccessType.ModifyProject, true, _accountMgr.getAccount(project.getProjectAccountId())); //Check if the account exists in the project ProjectAccount projectAccount = _projectAccountDao.findByProjectIdAccountId(projectId, account.getId()); @@ -750,7 +750,7 @@ public boolean updateInvitation(final long projectId, String accountName, String } //verify permissions - _accountMgr.checkAccess(caller, null, account); + _accountMgr.checkAccess(caller, null, true, account); accountId = account.getId(); } else { @@ -830,7 +830,7 @@ public Project activateProject(final long projectId) { } //verify permissions - _accountMgr.checkAccess(caller, AccessType.ModifyProject, _accountMgr.getAccount(project.getProjectAccountId())); + _accountMgr.checkAccess(caller, AccessType.ModifyProject, true, _accountMgr.getAccount(project.getProjectAccountId())); //allow project activation only when it's in Suspended state Project.State currentState = project.getState(); @@ -870,7 +870,7 @@ public Project suspendProject(long projectId) throws ConcurrentOperationExceptio throw ex; } - _accountMgr.checkAccess(caller, AccessType.ModifyProject, _accountMgr.getAccount(project.getProjectAccountId())); + _accountMgr.checkAccess(caller, AccessType.ModifyProject, true, _accountMgr.getAccount(project.getProjectAccountId())); if (suspendProject(project)) { s_logger.debug("Successfully suspended project id=" + projectId); @@ -1012,7 +1012,7 @@ public boolean deleteProjectInvitation(long id) { Project project = getProject(invitation.getProjectId()); //check permissions - only project owner can remove the invitations - _accountMgr.checkAccess(caller, AccessType.ModifyProject, _accountMgr.getAccount(project.getProjectAccountId())); + _accountMgr.checkAccess(caller, AccessType.ModifyProject, true, _accountMgr.getAccount(project.getProjectAccountId())); if (_projectInvitationDao.remove(id)) { s_logger.debug("Project Invitation id=" + id + " is removed"); diff --git a/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java b/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java index 0c0c588d96..b6977c2808 100755 --- a/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java +++ b/server/src/com/cloud/resourcelimit/ResourceLimitManagerImpl.java @@ -483,7 +483,7 @@ public List searchForLimits(Long id, Long accountId, Long domai return limits; } - _accountMgr.checkAccess(caller, null, account); + _accountMgr.checkAccess(caller, null, true, account); domainId = null; } } @@ -503,7 +503,7 @@ public List searchForLimits(Long id, Long accountId, Long domai if (id != null) { ResourceLimitVO vo = _resourceLimitDao.findById(id); if (vo.getAccountId() != null) { - _accountMgr.checkAccess(caller, null, _accountDao.findById(vo.getAccountId())); + _accountMgr.checkAccess(caller, null, true, _accountDao.findById(vo.getAccountId())); limits.add(vo); } else if (vo.getDomainId() != null) { _accountMgr.checkAccess(caller, _domainDao.findById(vo.getDomainId())); @@ -656,9 +656,9 @@ public ResourceLimitVO updateResourceLimit(Long accountId, Long domainId, Intege } if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) { - _accountMgr.checkAccess(caller, AccessType.ModifyProject, account); + _accountMgr.checkAccess(caller, AccessType.ModifyProject, true, account); } else { - _accountMgr.checkAccess(caller, null, account); + _accountMgr.checkAccess(caller, null, true, account); } ownerType = ResourceOwnerType.Account; diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index 4a4c74a93c..dd4ce0fc02 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -952,7 +952,7 @@ public boolean archiveEvents(ArchiveEventsCmd cmd) { List events = _eventDao.listToArchiveOrDeleteEvents(ids, cmd.getType(), cmd.getStartDate(), cmd.getEndDate(), permittedAccountIds); ControlledEntity[] sameOwnerEvents = events.toArray(new ControlledEntity[events.size()]); - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, sameOwnerEvents); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, false, sameOwnerEvents); if (ids != null && events.size() < ids.size()) { result = false; @@ -979,7 +979,7 @@ public boolean deleteEvents(DeleteEventsCmd cmd) { List events = _eventDao.listToArchiveOrDeleteEvents(ids, cmd.getType(), cmd.getStartDate(), cmd.getEndDate(), permittedAccountIds); ControlledEntity[] sameOwnerEvents = events.toArray(new ControlledEntity[events.size()]); - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, sameOwnerEvents); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, false, sameOwnerEvents); if (ids != null && events.size() < ids.size()) { result = false; @@ -1768,22 +1768,19 @@ public Pair, Integer> searchForIPAddresses(ListPublicI SearchBuilder sb = _publicIpAddressDao.createSearchBuilder(); Long domainId = null; Boolean isRecursive = null; - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); - ListProjectResourcesCriteria listProjectResourcesCriteria = null; if (isAllocated) { Account caller = CallContext.current().getCallingAccount(); Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, cmd.getId(), cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, "listPublicIpAddresses"); - //domainId = domainIdRecursiveListProject.first(); + _accountMgr.buildACLSearchParameters(caller, cmd.getId(), cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, + domainIdRecursiveListProject, cmd.listAll(), false); + domainId = domainIdRecursiveListProject.first(); isRecursive = domainIdRecursiveListProject.second(); listProjectResourcesCriteria = domainIdRecursiveListProject.third(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); } sb.and("dataCenterId", sb.entity().getDataCenterId(), SearchCriteria.Op.EQ); @@ -1838,7 +1835,7 @@ public Pair, Integer> searchForIPAddresses(ListPublicI SearchCriteria sc = sb.create(); if (isAllocated) { - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); } sc.setJoinParameters("vlanSearch", "vlanType", vlanType); @@ -3315,7 +3312,7 @@ public ArrayList getCloudIdentifierResponse(long userId) { } // check permissions - _accountMgr.checkAccess(caller, null, _accountMgr.getAccount(user.getAccountId())); + _accountMgr.checkAccess(caller, null, true, _accountMgr.getAccount(user.getAccountId())); String cloudIdentifier = _configDao.getValue("cloud.identifier"); if (cloudIdentifier == null) { @@ -3422,7 +3419,7 @@ public InstanceGroupVO updateVmGroup(UpdateVMGroupCmd cmd) { throw ex; } - _accountMgr.checkAccess(caller, null, group); + _accountMgr.checkAccess(caller, null, true, group); // Check if name is already in use by this account (exclude this group) boolean isNameInUse = _vmGroupDao.isNameInUse(group.getAccountId(), groupName); @@ -3581,22 +3578,21 @@ public Pair, Integer> listSSHKeyPairs(ListSSHKeyPairs String fingerPrint = cmd.getFingerprint(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, null, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, "listSSHKeyPairs"); + _accountMgr.buildACLSearchParameters(caller, null, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, + cmd.listAll(), false); + Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); SearchBuilder sb = _sshKeyPairDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); Filter searchFilter = new Filter(SSHKeyPairVO.class, "id", false, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); if (name != null) { sc.addAnd("name", SearchCriteria.Op.EQ, name); @@ -3661,7 +3657,7 @@ public String getVMPassword(GetVMPasswordCmd cmd) { } // make permission check - _accountMgr.checkAccess(caller, null, vm); + _accountMgr.checkAccess(caller, null, true, vm); _userVmDao.loadDetails(vm); String password = vm.getDetail("Encrypted.Password"); @@ -3834,7 +3830,7 @@ private VirtualMachine upgradeStoppedSystemVm(Long systemVmId, Long serviceOffer throw new InvalidParameterValueException("Unable to find SystemVm with id " + systemVmId); } - _accountMgr.checkAccess(caller, null, systemVm); + _accountMgr.checkAccess(caller, null, true, systemVm); // Check that the specified service offering ID is valid ServiceOfferingVO newServiceOffering = _offeringDao.findById(serviceOfferingId); diff --git a/server/src/com/cloud/servlet/ConsoleProxyServlet.java b/server/src/com/cloud/servlet/ConsoleProxyServlet.java index 16d7a3292f..60f32cf4bb 100644 --- a/server/src/com/cloud/servlet/ConsoleProxyServlet.java +++ b/server/src/com/cloud/servlet/ConsoleProxyServlet.java @@ -522,7 +522,7 @@ private boolean checkSessionPermision(HttpServletRequest req, long vmId, Account switch (vm.getType()) { case User: try { - _accountMgr.checkAccess(accountObj, null, vm); + _accountMgr.checkAccess(accountObj, null, true, vm); } catch (PermissionDeniedException ex) { if (_accountMgr.isNormalUser(accountObj.getId())) { if (s_logger.isDebugEnabled()) { diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index 6db3a2d97b..16502405b4 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -28,7 +28,6 @@ import org.apache.log4j.Logger; -import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd; import org.apache.cloudstack.api.command.user.volume.CreateVolumeCmd; import org.apache.cloudstack.api.command.user.volume.DetachVolumeCmd; @@ -273,7 +272,7 @@ public VolumeVO uploadVolume(UploadVolumeCmd cmd) throws ResourceAllocationExcep private boolean validateVolume(Account caller, long ownerId, Long zoneId, String volumeName, String url, String format) throws ResourceAllocationException { // permission check - _accountMgr.checkAccess(caller, null, _accountMgr.getActiveAccountById(ownerId)); + _accountMgr.checkAccess(caller, null, true, _accountMgr.getActiveAccountById(ownerId)); // Check that the resource limit for volumes won't be exceeded _resourceLimitMgr.checkResourceLimit(_accountMgr.getAccount(ownerId), ResourceType.volume); @@ -383,11 +382,10 @@ public VolumeVO allocVolume(CreateVolumeCmd cmd) throws ResourceAllocationExcept Boolean displayVolume = cmd.getDisplayVolume(); // permission check - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, true, _accountMgr.getActiveAccountById(ownerId)); if (displayVolume == null) { displayVolume = true; - } else { if (!_accountMgr.isRootAdmin(caller.getId())) { throw new PermissionDeniedException("Cannot update parameter displayvolume, only admin permitted "); @@ -511,6 +509,9 @@ public VolumeVO allocVolume(CreateVolumeCmd cmd) throws ResourceAllocationExcept size = snapshotCheck.getSize(); // ; disk offering is used for tags // purposes + // check snapshot permissions + _accountMgr.checkAccess(caller, null, true, snapshotCheck); + // one step operation - create volume in VM's cluster and attach it // to the VM Long vmId = cmd.getVirtualMachineId(); @@ -525,6 +526,9 @@ public VolumeVO allocVolume(CreateVolumeCmd cmd) throws ResourceAllocationExcept if (vm.getState() != State.Running && vm.getState() != State.Stopped) { throw new InvalidParameterValueException("Please specify a VM that is either running or stopped."); } + + // permission check + _accountMgr.checkAccess(caller, null, false, vm); } } @@ -771,7 +775,7 @@ public VolumeVO resizeVolume(ResizeVolumeCmd cmd) throws ResourceAllocationExcep } /* does the caller have the authority to act on this volume? */ - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, volume); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, volume); long currentSize = volume.getSize(); @@ -934,7 +938,7 @@ public boolean deleteVolume(long volumeId, Account caller) throws ConcurrentOper throw new InvalidParameterValueException("There are snapshot creating on it, Unable to delete the volume"); } - _accountMgr.checkAccess(caller, null, volume); + _accountMgr.checkAccess(caller, null, true, volume); if (volume.getInstanceId() != null) { throw new InvalidParameterValueException("Please specify a volume that is not attached to any VM."); @@ -1127,8 +1131,7 @@ public Volume attachVolumeToVM(Long vmId, Long volumeId, Long deviceId) { } // permission check - // TODO: remove this if we can annotate volume parameter in createVolumeCmd since this routine is used there as well. - _accountMgr.checkAccess(caller, AccessType.OperateEntry, volume, vm); + _accountMgr.checkAccess(caller, null, true, volume, vm); if (!(Volume.State.Allocated.equals(volume.getState()) || Volume.State.Ready.equals(volume.getState()) || Volume.State.Uploaded.equals(volume.getState()))) { throw new InvalidParameterValueException("Volume state must be in Allocated, Ready or in Uploaded state"); @@ -1342,7 +1345,7 @@ public Volume detachVolumeFromVM(DetachVolumeCmd cmmd) { } // Permissions check - _accountMgr.checkAccess(caller, null, volume); + _accountMgr.checkAccess(caller, null, true, volume); // Check that the volume is a data volume if (volume.getVolumeType() != Volume.Type.DATADISK) { @@ -1787,7 +1790,7 @@ public String extractVolume(ExtractVolumeCmd cmd) { } // perform permission check - _accountMgr.checkAccess(account, null, volume); + _accountMgr.checkAccess(account, null, true, volume); if (_dcDao.findById(zoneId) == null) { throw new InvalidParameterValueException("Please specify a valid zone."); diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index d19a0ed846..44bce1a738 100755 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -286,7 +286,7 @@ public Snapshot createSnapshot(Long volumeId, Long policyId, Long snapshotId, Ac boolean backedUp = false; // does the caller have the authority to act on this volume - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, volume); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, volume); SnapshotInfo snapshot = snapshotFactory.getSnapshot(snapshotId, DataStoreRole.Primary); @@ -391,7 +391,7 @@ public boolean deleteSnapshot(long snapshotId) { throw new InvalidParameterValueException("unable to find a snapshot with id " + snapshotId); } - _accountMgr.checkAccess(caller, null, snapshotCheck); + _accountMgr.checkAccess(caller, null, true, snapshotCheck); SnapshotStrategy snapshotStrategy = _storageStrategyFactory.getSnapshotStrategy(snapshotCheck, SnapshotOperation.DELETE); if (snapshotStrategy == null) { s_logger.error("Unable to find snaphot strategy to handle snapshot with id '" + snapshotId + "'"); @@ -441,28 +441,25 @@ public Pair, Integer> listSnapshots(ListSnapshotsCmd cm Map tags = cmd.getTags(); Long zoneId = cmd.getZoneId(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); - // Verify parameters if (volumeId != null) { VolumeVO volume = _volsDao.findById(volumeId); if (volume != null) { - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, volume); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, volume); } } Ternary domainIdRecursiveListProject = new Ternary(cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, "listSnapshots"); + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, cmd.listAll(), false); + Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(SnapshotVO.class, "created", false, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchBuilder sb = _snapshotDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sb.and("statusNEQ", sb.entity().getState(), SearchCriteria.Op.NEQ); //exclude those Destroyed snapshot, not showing on UI sb.and("volumeId", sb.entity().getVolumeId(), SearchCriteria.Op.EQ); @@ -485,7 +482,7 @@ public Pair, Integer> listSnapshots(ListSnapshotsCmd cm } SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sc.setParameters("statusNEQ", Snapshot.State.Destroyed); @@ -624,7 +621,7 @@ public SnapshotPolicyVO createPolicy(CreateSnapshotPolicyCmd cmd, Account policy throw new InvalidParameterValueException("Failed to create snapshot policy, unable to find a volume with id " + volumeId); } - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, volume); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, volume); if (volume.getState() != Volume.State.Ready) { throw new InvalidParameterValueException("VolumeId: " + volumeId + " is not in " + Volume.State.Ready + " state but " + volume.getState() + @@ -723,7 +720,7 @@ public Pair, Integer> listPoliciesforVolume(ListS if (volume == null) { throw new InvalidParameterValueException("Unable to find a volume with id " + volumeId); } - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, volume); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, volume); Pair, Integer> result = _snapshotPolicyDao.listAndCountByVolumeId(volumeId); return new Pair, Integer>(result.first(), result.second()); } @@ -999,7 +996,7 @@ public boolean deleteSnapshotPolicies(DeleteSnapshotPoliciesCmd cmd) { throw new InvalidParameterValueException("Policy id given: " + policy + " does not belong to a valid volume"); } - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, volume); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, volume); } boolean success = true; @@ -1030,9 +1027,12 @@ public boolean canOperateOnVolume(Volume volume) { @Override public Snapshot allocSnapshot(Long volumeId, Long policyId) throws ResourceAllocationException { + Account caller = CallContext.current().getCallingAccount(); VolumeInfo volume = volFactory.getVolume(volumeId); supportedByHypervisor(volume); + // Verify permissions + _accountMgr.checkAccess(caller, null, true, volume); Type snapshotType = getSnapshotType(policyId); Account owner = _accountMgr.getAccount(volume.getAccountId()); diff --git a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java index cac12c628d..fa7fcb750c 100644 --- a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java +++ b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java @@ -227,7 +227,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { Long domainId = accountDomainPair.second(); Long accountId = accountDomainPair.first(); if (accountId != null) { - _accountMgr.checkAccess(caller, null, _accountMgr.getAccount(accountId)); + _accountMgr.checkAccess(caller, null, false, _accountMgr.getAccount(accountId)); } else if (domainId != null && !_accountMgr.isNormalUser(caller.getId())) { //check permissions; _accountMgr.checkAccess(caller, _domainMgr.getDomain(domainId)); @@ -289,7 +289,7 @@ public boolean deleteTags(List resourceIds, ResourceObjectType resourceT for (ResourceTag resourceTag : resourceTags) { //1) validate the permissions Account owner = _accountMgr.getAccount(resourceTag.getAccountId()); - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, false, owner); //2) Only remove tag if it matches key value pairs if (tags != null && !tags.isEmpty()) { for (String key : tags.keySet()) { diff --git a/server/src/com/cloud/template/TemplateAdapterBase.java b/server/src/com/cloud/template/TemplateAdapterBase.java index cb38075324..fcf15df675 100755 --- a/server/src/com/cloud/template/TemplateAdapterBase.java +++ b/server/src/com/cloud/template/TemplateAdapterBase.java @@ -254,7 +254,7 @@ public TemplateProfile prepare(RegisterTemplateCmd cmd) throws ResourceAllocatio //check if the caller can operate with the template owner Account caller = CallContext.current().getCallingAccount(); Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId()); - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, true, owner); boolean isRouting = (cmd.isRoutingType() == null) ? false : cmd.isRoutingType(); @@ -277,7 +277,7 @@ public TemplateProfile prepare(RegisterIsoCmd cmd) throws ResourceAllocationExce //check if the caller can operate with the template owner Account caller = CallContext.current().getCallingAccount(); Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId()); - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, true, owner); Long zoneId = cmd.getZoneId(); // ignore passed zoneId if we are using region wide image store diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java index 294748ff1a..0cc74388f0 100755 --- a/server/src/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/com/cloud/template/TemplateManagerImpl.java @@ -369,7 +369,7 @@ public VirtualMachineTemplate prepareTemplate(long templateId, long zoneId) { throw new InvalidParameterValueException("Unable to find template id=" + templateId); } - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), AccessType.OperateEntry, vmTemplate); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), AccessType.OperateEntry, true, vmTemplate); prepareTemplateInAllStoragePools(vmTemplate, zoneId); return vmTemplate; @@ -415,7 +415,7 @@ private String extract(Account caller, Long templateId, String url, Long zoneId, throw new InvalidParameterValueException("Unable to extract template id=" + templateId + " as it's not extractable"); } - _accountMgr.checkAccess(caller, AccessType.OperateEntry, template); + _accountMgr.checkAccess(caller, AccessType.OperateEntry, true, template); List ssStores = _dataStoreMgr.getImageStoresByScope(new ZoneScope(zoneId)); @@ -722,7 +722,7 @@ public VirtualMachineTemplate copyTemplate(CopyTemplateCmd cmd) throws StorageUn return template; } - _accountMgr.checkAccess(caller, AccessType.OperateEntry, template); + _accountMgr.checkAccess(caller, AccessType.OperateEntry, true, template); boolean success = copy(userId, template, srcSecStore, dstZone); @@ -911,7 +911,7 @@ public boolean detachIso(long vmId) { throw new InvalidParameterValueException("Please specify a valid VM."); } - _accountMgr.checkAccess(caller, null, userVM); + _accountMgr.checkAccess(caller, null, true, userVM); Long isoId = userVM.getIsoId(); if (isoId == null) { @@ -952,11 +952,12 @@ public boolean attachIso(long isoId, long vmId) { // check permissions // check if caller has access to VM and ISO - // and also check if the VM's owner has access to the ISO. This is a bit different from sameOwner check for attachVolumeToVM, where both volume and VM need - // OperateEntry access type. Here VM needs OperateEntry access type, ISO needs UseEntry access type. - _accountMgr.checkAccess(caller, null, iso, vm); + // and also check if the VM's owner has access to the ISO. + + _accountMgr.checkAccess(caller, null, false, iso, vm); + Account vmOwner = _accountDao.findById(vm.getAccountId()); - _accountMgr.checkAccess(vmOwner, null, iso); + _accountMgr.checkAccess(vmOwner, null, false, iso, vm); State vmState = vm.getState(); if (vmState != State.Running && vmState != State.Stopped) { @@ -1060,7 +1061,7 @@ public boolean deleteTemplate(DeleteTemplateCmd cmd) { throw new InvalidParameterValueException("unable to find template with id " + templateId); } - _accountMgr.checkAccess(caller, AccessType.OperateEntry, template); + _accountMgr.checkAccess(caller, AccessType.OperateEntry, true, template); if (template.getFormat() == ImageFormat.ISO) { throw new InvalidParameterValueException("Please specify a valid template."); @@ -1083,7 +1084,7 @@ public boolean deleteIso(DeleteIsoCmd cmd) { throw new InvalidParameterValueException("unable to find iso with id " + templateId); } - _accountMgr.checkAccess(caller, AccessType.OperateEntry, template); + _accountMgr.checkAccess(caller, AccessType.OperateEntry, true, template); if (template.getFormat() != ImageFormat.ISO) { throw new InvalidParameterValueException("Please specify a valid iso."); @@ -1133,7 +1134,7 @@ public List listTemplatePermissions(BaseListTemplateOrIsoPermissionsCmd } if (!template.isPublicTemplate()) { - _accountMgr.checkAccess(caller, AccessType.ListEntry, template); + _accountMgr.checkAccess(caller, null, true, template); } List accountNames = new ArrayList(); @@ -1206,7 +1207,8 @@ public boolean updateTemplateOrIsoPermissions(BaseUpdateTemplateOrIsoPermissions } } - _accountMgr.checkAccess(caller, AccessType.OperateEntry, template); + //_accountMgr.checkAccess(caller, AccessType.ModifyEntry, true, template); + _accountMgr.checkAccess(caller, AccessType.OperateEntry, true, template); //TODO: should we replace all ModifyEntry as OperateEntry? // If the template is removed throw an error. if (template.getRemoved() != null) { @@ -1487,7 +1489,7 @@ public VMTemplateVO createPrivateTemplateRecord(CreateTemplateCmd cmd, Account t Account caller = CallContext.current().getCallingAccount(); boolean isAdmin = (_accountMgr.isAdmin(caller.getId())); - _accountMgr.checkAccess(caller, null, templateOwner); + _accountMgr.checkAccess(caller, null, true, templateOwner); String name = cmd.getTemplateName(); if ((name == null) || (name.length() > 32)) { @@ -1539,7 +1541,7 @@ public VMTemplateVO createPrivateTemplateRecord(CreateTemplateCmd cmd, Account t throw new InvalidParameterValueException("Failed to create private template record, unable to find volume " + volumeId); } // check permissions - _accountMgr.checkAccess(caller, null, volume); + _accountMgr.checkAccess(caller, null, true, volume); // If private template is created from Volume, check that the volume // will not be active when the private template is @@ -1562,7 +1564,7 @@ public VMTemplateVO createPrivateTemplateRecord(CreateTemplateCmd cmd, Account t volume = _volumeDao.findById(snapshot.getVolumeId()); // check permissions - _accountMgr.checkAccess(caller, null, snapshot); + _accountMgr.checkAccess(caller, null, true, snapshot); if (snapshot.getState() != Snapshot.State.BackedUp) { throw new InvalidParameterValueException("Snapshot id=" + snapshotId + " is not in " + Snapshot.State.BackedUp + @@ -1778,7 +1780,7 @@ private VMTemplateVO updateTemplateOrIso(BaseUpdateTemplateOrIsoCmd cmd) { verifyTemplateId(id); // do a permission check - _accountMgr.checkAccess(account, AccessType.OperateEntry, template); + _accountMgr.checkAccess(account, AccessType.OperateEntry, true, template); if (cmd.isRoutingType() != null) { if (!_accountService.isRootAdmin(account.getId())) { throw new PermissionDeniedException("Parameter isrouting can only be specified by a Root Admin, permission denied"); diff --git a/server/src/com/cloud/user/AccountManager.java b/server/src/com/cloud/user/AccountManager.java index 03bf8421a3..bee7029041 100755 --- a/server/src/com/cloud/user/AccountManager.java +++ b/server/src/com/cloud/user/AccountManager.java @@ -24,6 +24,7 @@ import org.apache.cloudstack.api.command.admin.user.DeleteUserCmd; import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd; +import com.cloud.api.query.vo.ControlledViewEntity; import com.cloud.exception.ConcurrentOperationException; import com.cloud.exception.ResourceUnavailableException; import com.cloud.projects.Project.ListProjectResourcesCriteria; @@ -84,19 +85,35 @@ public interface AccountManager extends AccountService { boolean enableAccount(long accountId); + void buildACLSearchBuilder(SearchBuilder sb, Long domainId, + boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria); + + void buildACLViewSearchBuilder(SearchBuilder sb, Long domainId, + boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria); + + void buildACLViewSearchBuilder(SearchBuilder sb, Long domainId, + boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds); + + void buildACLSearchCriteria(SearchCriteria sc, + Long domainId, boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria); + + void buildACLSearchParameters(Account caller, Long id, + String accountName, Long projectId, List permittedAccounts, Ternary domainIdRecursiveListProject, boolean listAll, + boolean forProjectInvitation); + + void buildACLViewSearchCriteria(SearchCriteria sc, + Long domainId, boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria); + + void buildACLViewSearchCriteria(SearchCriteria sc, + Long domainId, boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, + List revokedIds); + + // new ACL model routine for query api based on db views void buildACLSearchParameters(Account caller, Long id, String accountName, Long projectId, List permittedDomains, List permittedAccounts, List permittedResources, Ternary domainIdRecursiveListProject, boolean listAll, boolean forProjectInvitation, String action); - void buildACLSearchBuilder(SearchBuilder sb, boolean isRecursive, - List permittedDomains, - List permittedAccounts, List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria); - - void buildACLSearchCriteria(SearchCriteria sc, boolean isRecursive, - List permittedDomains, - List permittedAccounts, List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria); - void buildACLViewSearchCriteria(SearchCriteria sc, SearchCriteria aclSc, boolean isRecursive, List permittedDomains, List permittedAccounts, List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria); diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java index 3ff9bd2daa..b6be648dc8 100755 --- a/server/src/com/cloud/user/AccountManagerImpl.java +++ b/server/src/com/cloud/user/AccountManagerImpl.java @@ -48,7 +48,6 @@ import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.affinity.AffinityGroup; import org.apache.cloudstack.affinity.dao.AffinityGroupDao; -import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.api.command.admin.account.UpdateAccountCmd; import org.apache.cloudstack.api.command.admin.user.DeleteUserCmd; import org.apache.cloudstack.api.command.admin.user.RegisterCmd; @@ -61,6 +60,8 @@ import org.apache.cloudstack.managed.context.ManagedContextRunnable; import org.apache.cloudstack.region.gslb.GlobalLoadBalancerRuleDao; +import com.cloud.api.ApiDBUtils; +import com.cloud.api.query.vo.ControlledViewEntity; import com.cloud.configuration.Config; import com.cloud.configuration.ConfigurationManager; import com.cloud.configuration.Resource.ResourceOwnerType; @@ -101,7 +102,6 @@ import com.cloud.network.dao.RemoteAccessVpnDao; import com.cloud.network.dao.RemoteAccessVpnVO; import com.cloud.network.dao.VpnUserDao; -import com.cloud.network.security.SecurityGroup; import com.cloud.network.security.SecurityGroupManager; import com.cloud.network.security.dao.SecurityGroupDao; import com.cloud.network.vpc.Vpc; @@ -110,6 +110,7 @@ import com.cloud.network.vpn.Site2SiteVpnManager; import com.cloud.projects.Project; import com.cloud.projects.Project.ListProjectResourcesCriteria; +import com.cloud.projects.ProjectInvitationVO; import com.cloud.projects.ProjectManager; import com.cloud.projects.ProjectVO; import com.cloud.projects.dao.ProjectAccountDao; @@ -386,8 +387,8 @@ public boolean isRootAdmin(Long accountId) { for (SecurityChecker checker : _securityCheckers) { try { if (checker.checkAccess(acct, null, null, "SystemCapability")) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Root Access granted to " + acct + " by " + checker.getName()); + if (s_logger.isTraceEnabled()) { + s_logger.trace("Root Access granted to " + acct + " by " + checker.getName()); } return true; } @@ -409,8 +410,8 @@ public boolean isDomainAdmin(Long accountId) { for (SecurityChecker checker : _securityCheckers) { try { if (checker.checkAccess(acct, null, null, "DomainCapability")) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("DomainAdmin Access granted to " + acct + " by " + checker.getName()); + if (s_logger.isTraceEnabled()) { + s_logger.trace("DomainAdmin Access granted to " + acct + " by " + checker.getName()); } return true; } @@ -440,8 +441,8 @@ public boolean isResourceDomainAdmin(Long accountId) { for (SecurityChecker checker : _securityCheckers) { try { if (checker.checkAccess(acct, null, null, "DomainResourceCapability")) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("ResourceDomainAdmin Access granted to " + acct + " by " + checker.getName()); + if (s_logger.isTraceEnabled()) { + s_logger.trace("ResourceDomainAdmin Access granted to " + acct + " by " + checker.getName()); } return true; } @@ -481,90 +482,89 @@ public void checkAccess(Account caller, Domain domain) throws PermissionDeniedEx @Override - public void checkAccess(Account caller, AccessType accessType, ControlledEntity... entities) throws PermissionDeniedException { - checkAccess(caller, accessType, null, entities); + public void checkAccess(Account caller, AccessType accessType, boolean sameOwner, ControlledEntity... entities) { + checkAccess(caller, accessType, sameOwner, null, entities); } @Override - public void checkAccess(Account caller, AccessType accessType, String apiName, ControlledEntity... entities) throws PermissionDeniedException { - boolean granted = false; - // construct entities identification string - StringBuffer entityBuf = new StringBuffer("{"); - for (ControlledEntity ent : entities) { - entityBuf.append(ent.toString()); - } - entityBuf.append("}"); - String entityStr = entityBuf.toString(); - - boolean isRootAdmin = isRootAdmin(caller.getAccountId()); - boolean isDomainAdmin = isDomainAdmin(caller.getAccountId()); - boolean isResourceDomainAdmin = isResourceDomainAdmin(caller.getAccountId()); - - if ((isRootAdmin || isDomainAdmin || isResourceDomainAdmin || caller.getId() == Account.ACCOUNT_ID_SYSTEM) - && (accessType == null || accessType == AccessType.UseEntry)) { - + public void checkAccess(Account caller, AccessType accessType, boolean sameOwner, String apiName, ControlledEntity... entities) { + //check for the same owner + Long ownerId = null; + ControlledEntity prevEntity = null; + if (sameOwner) { for (ControlledEntity entity : entities) { - if (entity instanceof VirtualMachineTemplate || (entity instanceof Network && accessType != null && (isDomainAdmin || isResourceDomainAdmin)) - || entity instanceof AffinityGroup || entity instanceof SecurityGroup) { - // Go through IAM (SecurityCheckers) - for (SecurityChecker checker : _securityCheckers) { - if (checker.checkAccess(caller, accessType, apiName, entity)) { - if (s_logger.isDebugEnabled()) { - s_logger.debug("Access to " + entityStr + " granted to " + caller + " by " - + checker.getName()); - } - granted = true; - break; - } - } - } else { - if (isRootAdmin || caller.getId() == Account.ACCOUNT_ID_SYSTEM) { - // no need to make permission checks if the system/root - // admin makes the call - if (s_logger.isTraceEnabled()) { - s_logger.trace("No need to make permission check for System/RootAdmin account, returning true"); - } - granted = true; - } else if (isDomainAdmin || isResourceDomainAdmin) { - Domain entityDomain = getEntityDomain(entity); - if (entityDomain != null) { - try { - checkAccess(caller, entityDomain); - granted = true; - } catch (PermissionDeniedException e) { - List entityList = new ArrayList(); - entityList.add(entity); - e.addDetails(caller, entityList); - throw e; - } - } + if (sameOwner) { + if (ownerId == null) { + ownerId = entity.getAccountId(); + } else if (ownerId.longValue() != entity.getAccountId()) { + throw new PermissionDeniedException("Entity " + entity + " and entity " + prevEntity + " belong to different accounts"); } + prevEntity = entity; } + } + } - if (!granted) { - assert false : "How can all of the security checkers pass on checking this check: " + entityStr; - throw new PermissionDeniedException("There's no way to confirm " + caller + " has access to " - + entityStr); - } + if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || isRootAdmin(caller.getId())) { + // no need to make permission checks if the system/root admin makes the call + if (s_logger.isTraceEnabled()) { + s_logger.trace("No need to make permission check for System/RootAdmin account, returning true"); + } + return; + } + HashMap> domains = new HashMap>(); + + for (ControlledEntity entity : entities) { + long domainId = entity.getDomainId(); + if (entity.getAccountId() != -1 && domainId == -1) { // If account exists domainId should too so calculate + // it. This condition might be hit for templates or entities which miss domainId in their tables + Account account = ApiDBUtils.findAccountById(entity.getAccountId()); + domainId = account != null ? account.getDomainId() : -1; } - } else { - // Go through IAM (SecurityCheckers) + if (entity.getAccountId() != -1 && domainId != -1 && !(entity instanceof VirtualMachineTemplate) && + !(entity instanceof Network && accessType != null && accessType == AccessType.UseEntry) && !(entity instanceof AffinityGroup)) { + List toBeChecked = domains.get(entity.getDomainId()); + // for templates, we don't have to do cross domains check + if (toBeChecked == null) { + toBeChecked = new ArrayList(); + domains.put(domainId, toBeChecked); + } + toBeChecked.add(entity); + } + boolean granted = false; for (SecurityChecker checker : _securityCheckers) { - if (checker.checkAccess(caller, accessType, apiName, entities)) { + if (checker.checkAccess(caller, entity, accessType, apiName)) { if (s_logger.isDebugEnabled()) { - s_logger.debug("Access to " + entityStr + " granted to " + caller + " by " + checker.getName()); + s_logger.debug("Access to " + entity + " granted to " + caller + " by " + checker.getName()); } granted = true; break; } } + + if (!granted) { + assert false : "How can all of the security checkers pass on checking this check: " + entity; + throw new PermissionDeniedException("There's no way to confirm " + caller + " has access to " + entity); + } } - if (!granted) { - assert false : "How can all of the security checkers pass on checking this check: " + entityStr; - throw new PermissionDeniedException("There's no way to confirm " + caller + " has access to " + entityStr); + for (Map.Entry> domain : domains.entrySet()) { + for (SecurityChecker checker : _securityCheckers) { + Domain d = _domainMgr.getDomain(domain.getKey()); + if (d == null || d.getRemoved() != null) { + throw new PermissionDeniedException("Domain is not found.", caller, domain.getValue()); + } + try { + checker.checkAccess(caller, d); + } catch (PermissionDeniedException e) { + e.addDetails(caller, domain.getValue()); + throw e; + } + } } + + // check that resources belong to the same account + } private Domain getEntityDomain(ControlledEntity entity) { @@ -1167,7 +1167,7 @@ public UserAccount updateUser(UpdateUserCmd cmd) { throw new PermissionDeniedException("user id : " + id + " is system account, update is not allowed"); } - checkAccess(CallContext.current().getCallingAccount(), AccessType.OperateEntry, account); + checkAccess(CallContext.current().getCallingAccount(), AccessType.OperateEntry, true, account); if (firstName != null) { if (firstName.isEmpty()) { @@ -1284,7 +1284,7 @@ public UserAccount disableUser(long userId) { throw new InvalidParameterValueException("User id : " + userId + " is a system user, disabling is not allowed"); } - checkAccess(caller, AccessType.OperateEntry, account); + checkAccess(caller, AccessType.OperateEntry, true, account); boolean success = doSetUserStatus(userId, State.disabled); if (success) { @@ -1325,7 +1325,7 @@ public UserAccount enableUser(final long userId) { throw new InvalidParameterValueException("User id : " + userId + " is a system user, enabling is not allowed"); } - checkAccess(caller, AccessType.OperateEntry, account); + checkAccess(caller, AccessType.OperateEntry, true, account); boolean success = Transaction.execute(new TransactionCallback() { @Override @@ -1377,7 +1377,7 @@ public UserAccount lockUser(long userId) { throw new PermissionDeniedException("user id : " + userId + " is a system user, locking is not allowed"); } - checkAccess(caller, AccessType.OperateEntry, account); + checkAccess(caller, AccessType.OperateEntry, true, account); // make sure the account is enabled too // if the user is either locked already or disabled already, don't change state...only lock currently enabled @@ -1441,7 +1441,7 @@ boolean deleteUserAccount(long accountId) { throw new InvalidParameterValueException("The specified account does not exist in the system"); } - checkAccess(caller, null, account); + checkAccess(caller, null, true, account); // don't allow to delete default account (system and admin) if (account.isDefault()) { @@ -1486,7 +1486,7 @@ public AccountVO enableAccount(String accountName, Long domainId, Long accountId // Check if user performing the action is allowed to modify this account Account caller = CallContext.current().getCallingAccount(); - checkAccess(caller, AccessType.OperateEntry, account); + checkAccess(caller, AccessType.OperateEntry, true, account); boolean success = enableAccount(account.getId()); if (success) { @@ -1520,7 +1520,7 @@ public AccountVO lockAccount(String accountName, Long domainId, Long accountId) throw new PermissionDeniedException("Account id : " + accountId + " is a system account, lock is not allowed"); } - checkAccess(caller, AccessType.OperateEntry, account); + checkAccess(caller, AccessType.OperateEntry, true, account); if (lockAccount(account.getId())) { CallContext.current().putContextParameter(Account.class, account.getUuid()); @@ -1550,7 +1550,7 @@ public AccountVO disableAccount(String accountName, Long domainId, Long accountI throw new PermissionDeniedException("Account id : " + accountId + " is a system account, disable is not allowed"); } - checkAccess(caller, AccessType.OperateEntry, account); + checkAccess(caller, AccessType.OperateEntry, true, account); if (disableAccount(account.getId())) { CallContext.current().putContextParameter(Account.class, account.getUuid()); @@ -1669,7 +1669,7 @@ public boolean deleteUser(DeleteUserCmd deleteUserCmd) { throw new InvalidParameterValueException("The user is default and can't be removed"); } - checkAccess(CallContext.current().getCallingAccount(), AccessType.OperateEntry, account); + checkAccess(CallContext.current().getCallingAccount(), AccessType.OperateEntry, true, account); CallContext.current().putContextParameter(User.class, user.getUuid()); return _userDao.remove(id); } @@ -2278,6 +2278,373 @@ private String createUserSecretKey(long userId) { } + + @Override + public void buildACLSearchBuilder(SearchBuilder sb, + Long domainId, boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria) { + + if (sb.entity() instanceof IPAddressVO) { + sb.and("accountIdIN", ((IPAddressVO) sb.entity()).getAllocatedToAccountId(), SearchCriteria.Op.IN); + sb.and("domainId", ((IPAddressVO) sb.entity()).getAllocatedInDomainId(), SearchCriteria.Op.EQ); + } else if (sb.entity() instanceof ProjectInvitationVO) { + sb.and("accountIdIN", ((ProjectInvitationVO) sb.entity()).getForAccountId(), SearchCriteria.Op.IN); + sb.and("domainId", ((ProjectInvitationVO) sb.entity()).getInDomainId(), SearchCriteria.Op.EQ); + } else { + sb.and("accountIdIN", sb.entity().getAccountId(), SearchCriteria.Op.IN); + sb.and("domainId", sb.entity().getDomainId(), SearchCriteria.Op.EQ); + } + + if (((permittedAccounts.isEmpty()) && (domainId != null) && isRecursive)) { + // if accountId isn't specified, we can do a domain match for the admin case if isRecursive is true + SearchBuilder domainSearch = _domainDao.createSearchBuilder(); + domainSearch.and("path", domainSearch.entity().getPath(), SearchCriteria.Op.LIKE); + + if (sb.entity() instanceof IPAddressVO) { + sb.join("domainSearch", domainSearch, ((IPAddressVO) sb.entity()).getAllocatedInDomainId(), domainSearch.entity().getId(), JoinBuilder.JoinType.INNER); + } else if (sb.entity() instanceof ProjectInvitationVO) { + sb.join("domainSearch", domainSearch, ((ProjectInvitationVO) sb.entity()).getInDomainId(), domainSearch.entity().getId(), JoinBuilder.JoinType.INNER); + } else { + sb.join("domainSearch", domainSearch, sb.entity().getDomainId(), domainSearch.entity().getId(), JoinBuilder.JoinType.INNER); + } + + } + if (listProjectResourcesCriteria != null) { + SearchBuilder accountSearch = _accountDao.createSearchBuilder(); + if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.ListProjectResourcesOnly) { + accountSearch.and("type", accountSearch.entity().getType(), SearchCriteria.Op.EQ); + } else if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.SkipProjectResources) { + accountSearch.and("type", accountSearch.entity().getType(), SearchCriteria.Op.NEQ); + } + + if (sb.entity() instanceof IPAddressVO) { + sb.join("accountSearch", accountSearch, ((IPAddressVO) sb.entity()).getAllocatedToAccountId(), accountSearch.entity().getId(), JoinBuilder.JoinType.INNER); + } else if (sb.entity() instanceof ProjectInvitationVO) { + sb.join("accountSearch", accountSearch, ((ProjectInvitationVO) sb.entity()).getForAccountId(), accountSearch.entity().getId(), JoinBuilder.JoinType.INNER); + } else { + sb.join("accountSearch", accountSearch, sb.entity().getAccountId(), accountSearch.entity().getId(), JoinBuilder.JoinType.INNER); + } + } + } + + @Override + public void buildACLSearchCriteria(SearchCriteria sc, + Long domainId, boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria) { + + if (listProjectResourcesCriteria != null) { + sc.setJoinParameters("accountSearch", "type", Account.ACCOUNT_TYPE_PROJECT); + } + + if (!permittedAccounts.isEmpty()) { + sc.setParameters("accountIdIN", permittedAccounts.toArray()); + } else if (domainId != null) { + DomainVO domain = _domainDao.findById(domainId); + if (isRecursive) { + sc.setJoinParameters("domainSearch", "path", domain.getPath() + "%"); + } else { + sc.setParameters("domainId", domainId); + } + } + } + +// @Override +// public void buildACLSearchParameters(Account caller, Long id, String accountName, Long projectId, List +// permittedAccounts, Ternary domainIdRecursiveListProject, +// boolean listAll, boolean forProjectInvitation) { +// Long domainId = domainIdRecursiveListProject.first(); +// if (domainId != null) { +// Domain domain = _domainDao.findById(domainId); +// if (domain == null) { +// throw new InvalidParameterValueException("Unable to find domain by id " + domainId); +// } +// // check permissions +// checkAccess(caller, domain); +// } +// +// if (accountName != null) { +// if (projectId != null) { +// throw new InvalidParameterValueException("Account and projectId can't be specified together"); +// } +// +// Account userAccount = null; +// Domain domain = null; +// if (domainId != null) { +// userAccount = _accountDao.findActiveAccount(accountName, domainId); +// domain = _domainDao.findById(domainId); +// } else { +// userAccount = _accountDao.findActiveAccount(accountName, caller.getDomainId()); +// domain = _domainDao.findById(caller.getDomainId()); +// } +// +// if (userAccount != null) { +// checkAccess(caller, null, false, userAccount); +// //check permissions +// permittedAccounts.add(userAccount.getId()); +// } else { +// throw new InvalidParameterValueException("could not find account " + accountName + " in domain " + domain.getUuid()); +// } +// } +// +// // set project information +// if (projectId != null) { +// if (!forProjectInvitation) { +// if (projectId.longValue() == -1) { +// if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) { +// permittedAccounts.addAll(_projectMgr.listPermittedProjectAccounts(caller.getId())); +// } else { +// domainIdRecursiveListProject.third(Project.ListProjectResourcesCriteria.ListProjectResourcesOnly); +// } +// } else { +// Project project = _projectMgr.getProject(projectId); +// if (project == null) { +// throw new InvalidParameterValueException("Unable to find project by id " + projectId); +// } +// if (!_projectMgr.canAccessProjectAccount(caller, project.getProjectAccountId())) { +// throw new PermissionDeniedException("Account " + caller + " can't access project id=" + projectId); +// } +// permittedAccounts.add(project.getProjectAccountId()); +// } +// } +// } else { +// if (id == null) { +// domainIdRecursiveListProject.third(Project.ListProjectResourcesCriteria.SkipProjectResources); +// } +// if (permittedAccounts.isEmpty() && domainId == null) { +// if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) { +// permittedAccounts.add(caller.getId()); +// } else if (!listAll) { +// if (id == null) { +// permittedAccounts.add(caller.getId()); +// } else if (!isRootAdmin(caller.getId())) { +// domainIdRecursiveListProject.first(caller.getDomainId()); +// domainIdRecursiveListProject.second(true); +// } +// } else if (domainId == null) { +// if (caller.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) { +// domainIdRecursiveListProject.first(caller.getDomainId()); +// domainIdRecursiveListProject.second(true); +// } +// } +// } else if (domainId != null) { +// if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) { +// permittedAccounts.add(caller.getId()); +// } +// } +// +// } +// } + + //TODO: deprecate this to use the new buildACLSearchParameters with permittedDomains, permittedAccounts, and permittedResources as return + @Override + public void buildACLSearchParameters(Account caller, Long id, String accountName, Long projectId, List + permittedAccounts, Ternary domainIdRecursiveListProject, + boolean listAll, boolean forProjectInvitation) { + Long domainId = domainIdRecursiveListProject.first(); + if (domainId != null) { + Domain domain = _domainDao.findById(domainId); + if (domain == null) { + throw new InvalidParameterValueException("Unable to find domain by id " + domainId); + } + // check permissions + checkAccess(caller, domain); + } + + if (accountName != null) { + if (projectId != null) { + throw new InvalidParameterValueException("Account and projectId can't be specified together"); + } + + Account userAccount = null; + Domain domain = null; + if (domainId != null) { + userAccount = _accountDao.findActiveAccount(accountName, domainId); + domain = _domainDao.findById(domainId); + } else { + userAccount = _accountDao.findActiveAccount(accountName, caller.getDomainId()); + domain = _domainDao.findById(caller.getDomainId()); + } + + if (userAccount != null) { + checkAccess(caller, null, false, userAccount); + // check permissions + permittedAccounts.add(userAccount.getId()); + } else { + throw new InvalidParameterValueException("could not find account " + accountName + " in domain " + domain.getUuid()); + } + } + + // set project information + if (projectId != null) { + if (!forProjectInvitation) { + if (projectId.longValue() == -1) { + if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) { + permittedAccounts.addAll(_projectMgr.listPermittedProjectAccounts(caller.getId())); + } else { + domainIdRecursiveListProject.third(Project.ListProjectResourcesCriteria.ListProjectResourcesOnly); + } + } else { + Project project = _projectMgr.getProject(projectId); + if (project == null) { + throw new InvalidParameterValueException("Unable to find project by id " + projectId); + } + if (!_projectMgr.canAccessProjectAccount(caller, project.getProjectAccountId())) { + throw new PermissionDeniedException("Account " + caller + " can't access project id=" + projectId); + } + permittedAccounts.add(project.getProjectAccountId()); + } + } + } else { + if (id == null) { + domainIdRecursiveListProject.third(Project.ListProjectResourcesCriteria.SkipProjectResources); + } + if (permittedAccounts.isEmpty() && domainId == null) { + if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) { + permittedAccounts.add(caller.getId()); + } else if (!listAll) { + if (id == null) { + permittedAccounts.add(caller.getId()); + } else if (caller.getType() != Account.ACCOUNT_TYPE_ADMIN) { + domainIdRecursiveListProject.first(caller.getDomainId()); + domainIdRecursiveListProject.second(true); + } + } else if (domainId == null) { + if (caller.getType() == Account.ACCOUNT_TYPE_DOMAIN_ADMIN) { + domainIdRecursiveListProject.first(caller.getDomainId()); + domainIdRecursiveListProject.second(true); + } + } + } else if (domainId != null) { + if (caller.getType() == Account.ACCOUNT_TYPE_NORMAL) { + permittedAccounts.add(caller.getId()); + } + } + + } + + } + + + @Override + public void buildACLViewSearchBuilder(SearchBuilder sb, Long domainId, + boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria) { + + sb.and("accountIdIN", sb.entity().getAccountId(), SearchCriteria.Op.IN); + sb.and("domainId", sb.entity().getDomainId(), SearchCriteria.Op.EQ); + + if (((permittedAccounts.isEmpty()) && (domainId != null) && isRecursive)) { + // if accountId isn't specified, we can do a domain match for the + // admin case if isRecursive is true + sb.and("domainPath", sb.entity().getDomainPath(), SearchCriteria.Op.LIKE); + } + + if (listProjectResourcesCriteria != null) { + if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.ListProjectResourcesOnly) { + sb.and("accountType", sb.entity().getAccountType(), SearchCriteria.Op.EQ); + } else if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.SkipProjectResources) { + sb.and("accountType", sb.entity().getAccountType(), SearchCriteria.Op.NEQ); + } + } + + } + + @Override + public void buildACLViewSearchBuilder(SearchBuilder sb, Long domainId, boolean isRecursive, List permittedAccounts, + ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds) { + + if (!revokedIds.isEmpty()) { + sb.and("idNIN", sb.entity().getId(), SearchCriteria.Op.NIN); + } + if (permittedAccounts.isEmpty() && domainId == null && listProjectResourcesCriteria == null) { + // caller role authorize him to access everything matching query criteria + return; + + } + boolean hasOp = true; + if (!permittedAccounts.isEmpty()) { + sb.and().op("accountIdIN", sb.entity().getAccountId(), SearchCriteria.Op.IN); + } else if (domainId != null) { + if (isRecursive) { + // if accountId isn't specified, we can do a domain match for the + // admin case if isRecursive is true + sb.and().op("domainPath", sb.entity().getDomainPath(), SearchCriteria.Op.LIKE); + } else { + sb.and().op("domainId", sb.entity().getDomainId(), SearchCriteria.Op.EQ); + } + } else { + hasOp = false; + } + + + if (listProjectResourcesCriteria != null) { + if (hasOp) { + if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.ListProjectResourcesOnly) { + sb.and("accountType", sb.entity().getAccountType(), SearchCriteria.Op.EQ); + } else if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.SkipProjectResources) { + sb.and("accountType", sb.entity().getAccountType(), SearchCriteria.Op.NEQ); + } + } else { + if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.ListProjectResourcesOnly) { + sb.and().op("accountType", sb.entity().getAccountType(), SearchCriteria.Op.EQ); + } else if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.SkipProjectResources) { + sb.and().op("accountType", sb.entity().getAccountType(), SearchCriteria.Op.NEQ); + } + } + } + + if (!grantedIds.isEmpty()) { + sb.or("idIN", sb.entity().getId(), SearchCriteria.Op.IN); + } + sb.cp(); + + + } + + @Override + public void buildACLViewSearchCriteria(SearchCriteria sc, + Long domainId, boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria) { + if (listProjectResourcesCriteria != null) { + sc.setParameters("accountType", Account.ACCOUNT_TYPE_PROJECT); + } + + if (!permittedAccounts.isEmpty()) { + sc.setParameters("accountIdIN", permittedAccounts.toArray()); + } else if (domainId != null) { + DomainVO domain = _domainDao.findById(domainId); + if (isRecursive) { + sc.setParameters("domainPath", domain.getPath() + "%"); + } else { + sc.setParameters("domainId", domainId); + } + } + + } + + @Override + public void buildACLViewSearchCriteria(SearchCriteria sc, Long domainId, boolean isRecursive, List permittedAccounts, + ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds) { + if (!revokedIds.isEmpty()) { + sc.setParameters("idNIN", revokedIds.toArray()); + } + + if (listProjectResourcesCriteria != null) { + sc.setParameters("accountType", Account.ACCOUNT_TYPE_PROJECT); + } + + if (!permittedAccounts.isEmpty()) { + sc.setParameters("accountIdIN", permittedAccounts.toArray()); + } else if (domainId != null) { + DomainVO domain = _domainDao.findById(domainId); + if (isRecursive) { + sc.setParameters("domainPath", domain.getPath() + "%"); + } else { + sc.setParameters("domainId", domainId); + } + } + + if (!grantedIds.isEmpty()) { + sc.setParameters("idIN", grantedIds.toArray()); + } + } + @Override public UserAccount getUserByApiKey(String apiKey) { return _userAccountDao.getUserByApiKey(apiKey); @@ -2321,8 +2688,8 @@ public void buildACLSearchParameters(Account caller, Long id, String accountName if (userAccount != null) { //check permissions - checkAccess(caller, null, userAccount); - accountId = userAccount.getId(); + checkAccess(caller, null, false, userAccount); + permittedAccounts.add(userAccount.getId()); } else { throw new InvalidParameterValueException("could not find account " + accountName + " in domain " + domain.getUuid()); } @@ -2435,120 +2802,6 @@ else if (grantedAccounts.contains(accountId)) { } } - @Override - public void buildACLSearchBuilder(SearchBuilder sb, boolean isRecursive, - List permittedDomains, - List permittedAccounts, List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria) { - - if (listProjectResourcesCriteria != null) { - // add criteria for project or not - SearchBuilder accountSearch = _accountDao.createSearchBuilder(); - if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.ListProjectResourcesOnly) { - accountSearch.and("type", accountSearch.entity().getType(), SearchCriteria.Op.EQ); - } else if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.SkipProjectResources) { - accountSearch.and("type", accountSearch.entity().getType(), SearchCriteria.Op.NEQ); - } - - if (sb.entity() instanceof IPAddressVO) { - sb.join("accountSearch", accountSearch, ((IPAddressVO)sb.entity()).getAllocatedToAccountId(), accountSearch.entity().getId(), JoinBuilder.JoinType.INNER); - } else { - sb.join("accountSearch", accountSearch, sb.entity().getAccountId(), accountSearch.entity().getId(), JoinBuilder.JoinType.INNER); - } - } - if (permittedDomains.isEmpty() && permittedAccounts.isEmpty() && permittedResources.isEmpty()) - // can access everything - return; - - if (!permittedAccounts.isEmpty() || !permittedResources.isEmpty()) { - if (!permittedAccounts.isEmpty()) { - if (sb.entity() instanceof IPAddressVO) { - sb.and().op("accountIdIn", ((IPAddressVO)sb.entity()).getAllocatedToAccountId(), SearchCriteria.Op.IN); - } else { - sb.and().op("accountIdIn", sb.entity().getAccountId(), SearchCriteria.Op.IN); - } - if (!permittedResources.isEmpty()) { - sb.or("idIn", ((InternalIdentity)sb.entity()).getId(), SearchCriteria.Op.IN); - } - } else { - // permittedResources is not empty - sb.and().op("idIn", ((InternalIdentity)sb.entity()).getId(), SearchCriteria.Op.IN); - } - if (!permittedDomains.isEmpty()) { - if (isRecursive) { - SearchBuilder domainSearch = _domainDao.createSearchBuilder(); - for (int i = 0; i < permittedDomains.size(); i++) { - domainSearch.or("path" + i, domainSearch.entity().getPath(), SearchCriteria.Op.LIKE); - } - if (sb.entity() instanceof IPAddressVO) { - sb.join("domainSearch", domainSearch, ((IPAddressVO)sb.entity()).getAllocatedInDomainId(), domainSearch.entity().getId(), JoinBuilder.JoinType.INNER); - } else { - sb.join("domainSearch", domainSearch, sb.entity().getDomainId(), domainSearch.entity().getId(), JoinBuilder.JoinType.INNER); - } - } else { - if (sb.entity() instanceof IPAddressVO) { - sb.or("domainIdIn", ((IPAddressVO)sb.entity()).getAllocatedInDomainId(), SearchCriteria.Op.IN); - } else { - sb.or("domainIdIn", sb.entity().getDomainId(), SearchCriteria.Op.IN); - } - } - } - sb.cp(); - } else { - // permittedDomains is not empty - if (isRecursive) { - SearchBuilder domainSearch = _domainDao.createSearchBuilder(); - domainSearch.and().op("path0", domainSearch.entity().getPath(), SearchCriteria.Op.LIKE); - for (int i = 1; i < permittedDomains.size(); i++) { - domainSearch.or("path" + i, domainSearch.entity().getPath(), SearchCriteria.Op.LIKE); - } - domainSearch.cp(); - if (sb.entity() instanceof IPAddressVO) { - sb.join("domainSearch", domainSearch, ((IPAddressVO)sb.entity()).getAllocatedInDomainId(), domainSearch.entity().getId(), JoinBuilder.JoinType.INNER); - } else { - sb.join("domainSearch", domainSearch, sb.entity().getDomainId(), domainSearch.entity().getId(), JoinBuilder.JoinType.INNER); - } - } else { - if (sb.entity() instanceof IPAddressVO) { - sb.and().op("domainIdIn", ((IPAddressVO)sb.entity()).getAllocatedInDomainId(), SearchCriteria.Op.IN); - } else { - sb.and().op("domainIdIn", sb.entity().getDomainId(), SearchCriteria.Op.IN); - } - sb.cp(); - } - } - } - - @Override - public void buildACLSearchCriteria(SearchCriteria sc, boolean isRecursive, - List permittedDomains, - List permittedAccounts, List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria) { - - if (listProjectResourcesCriteria != null) { - sc.setJoinParameters("accountSearch", "type", Account.ACCOUNT_TYPE_PROJECT); - } - - if (permittedDomains.isEmpty() && permittedAccounts.isEmpty() && permittedResources.isEmpty()) - // can access everything - return; - - if (!permittedAccounts.isEmpty()) { - sc.setParameters("accountIdIn", permittedAccounts.toArray()); - } - if (!permittedResources.isEmpty()) { - sc.setParameters("idIn", permittedResources.toArray()); - } - if (!permittedDomains.isEmpty()) { - if (isRecursive) { - for (int i = 0; i < permittedDomains.size(); i++) { - DomainVO domain = _domainDao.findById(permittedDomains.get(i)); - sc.setJoinParameters("domainSearch", "path" + i, domain.getPath() + "%"); - } - } else { - sc.setParameters("domainIdIn", permittedDomains.toArray()); - } - } - } - @Override public void buildACLViewSearchCriteria(SearchCriteria sc, SearchCriteria aclSc, boolean isRecursive, List permittedDomains, diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index e7db877fdd..58709ecf76 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -35,6 +35,9 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; +import org.apache.commons.codec.binary.Base64; +import org.apache.log4j.Logger; + import org.apache.cloudstack.acl.ControlledEntity.ACLType; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.affinity.AffinityGroupService; @@ -83,8 +86,6 @@ import org.apache.cloudstack.storage.command.DettachCommand; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; -import org.apache.commons.codec.binary.Base64; -import org.apache.log4j.Logger; import com.cloud.agent.AgentManager; import com.cloud.agent.api.Answer; @@ -531,7 +532,7 @@ public UserVm resetVMPassword(ResetVMPasswordCmd cmd, String password) throws Re throw new InvalidParameterValueException("Vm with id " + vmId + " is not in the right state"); } - _accountMgr.checkAccess(caller, null, userVm); + _accountMgr.checkAccess(caller, null, true, userVm); boolean result = resetVMPasswordInternal(vmId, password); @@ -637,7 +638,7 @@ public UserVm resetVMSSHKey(ResetVMSSHKeyCmd cmd) throws ResourceUnavailableExce + " in specified domain id"); } - _accountMgr.checkAccess(caller, null, userVm); + _accountMgr.checkAccess(caller, null, true, userVm); String password = null; String sshPublicKey = s.getPublicKey(); if (template != null && template.getEnablePassword()) { @@ -777,7 +778,7 @@ public UserVm upgradeVirtualMachine(UpgradeVMCmd cmd) throws ResourceAllocationE + "; make sure the virtual machine is stopped"); } - _accountMgr.checkAccess(caller, null, vmInstance); + _accountMgr.checkAccess(caller, null, true, vmInstance); // Check resource limits for CPU and Memory. Map customParameters = cmd.getDetails(); @@ -891,7 +892,7 @@ private UserVm upgradeStoppedVirtualMachine(Long vmId, Long svcOffId, Map allNics = _nicDao.listByVmId(vmInstance.getId()); for (NicVO nic : allNics) { @@ -982,12 +990,18 @@ public UserVm addNicToVirtualMachine(AddNicToVMCmd cmd) throws InvalidParameterV profile = new NicProfile(ipAddress, null); } + // Perform permission check on VM + _accountMgr.checkAccess(caller, null, true, vmInstance); + // Verify that zone is not Basic DataCenterVO dc = _dcDao.findById(vmInstance.getDataCenterId()); if (dc.getNetworkType() == DataCenter.NetworkType.Basic) { throw new CloudRuntimeException("Zone " + vmInstance.getDataCenterId() + ", has a NetworkType of Basic. Can't add a new NIC to a VM on a Basic Network"); } + // Perform account permission check on network + _accountMgr.checkAccess(caller, AccessType.UseEntry, false, network); + //ensure network belongs in zone if (network.getDataCenterId() != vmInstance.getDataCenterId()) { throw new CloudRuntimeException(vmInstance + " is in zone:" + vmInstance.getDataCenterId() + " but " + network + " is in zone:" + network.getDataCenterId()); @@ -1046,7 +1060,7 @@ public UserVm removeNicFromVirtualMachine(RemoveNicFromVMCmd cmd) throws Invalid } // Perform permission check on VM - _accountMgr.checkAccess(caller, null, vmInstance); + _accountMgr.checkAccess(caller, null, true, vmInstance); // Verify that zone is not Basic DataCenterVO dc = _dcDao.findById(vmInstance.getDataCenterId()); @@ -1060,7 +1074,7 @@ public UserVm removeNicFromVirtualMachine(RemoveNicFromVMCmd cmd) throws Invalid } // Perform account permission check on network - _accountMgr.checkAccess(caller, AccessType.UseEntry, network); + _accountMgr.checkAccess(caller, AccessType.UseEntry, false, network); boolean nicremoved = false; @@ -1102,7 +1116,7 @@ public UserVm updateDefaultNicForVirtualMachine(UpdateDefaultNicForVMCmd cmd) th } // Perform permission check on VM - _accountMgr.checkAccess(caller, null, vmInstance); + _accountMgr.checkAccess(caller, null, true, vmInstance); // Verify that zone is not Basic DataCenterVO dc = _dcDao.findById(vmInstance.getDataCenterId()); @@ -1284,7 +1298,7 @@ private boolean upgradeRunningVirtualMachine(Long vmId, Long newServiceOfferingI throw new InvalidParameterValueException("This operation not permitted for this hypervisor of the vm"); } - _accountMgr.checkAccess(caller, null, vmInstance); + _accountMgr.checkAccess(caller, null, true, vmInstance); //Check if its a scale "up" ServiceOfferingVO newServiceOffering = _offeringDao.findById(newServiceOfferingId); @@ -1493,7 +1507,7 @@ public UserVm recoverVirtualMachine(RecoverVMCmd cmd) throws ResourceAllocationE } // check permissions - _accountMgr.checkAccess(caller, null, vm); + _accountMgr.checkAccess(caller, null, true, vm); if (vm.getRemoved() != null) { if (s_logger.isDebugEnabled()) { @@ -1836,7 +1850,7 @@ public UserVm updateVirtualMachine(UpdateVMCmd cmd) throws ResourceUnavailableEx throw new InvalidParameterValueException("unable to find virtual machine with id " + id); } - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, vmInstance); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, vmInstance); //If the flag is specified and is changed if (isDisplayVm != null && isDisplayVm != vmInstance.isDisplayVm()) { @@ -2051,7 +2065,7 @@ public UserVm rebootVirtualMachine(RebootVMCmd cmd) throws InsufficientCapacityE throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId); } - _accountMgr.checkAccess(caller, null, vmInstance); + _accountMgr.checkAccess(caller, null, true, vmInstance); // If the VM is Volatile in nature, on reboot discard the VM's root disk and create a new root disk for it: by calling restoreVM long serviceOfferingId = vmInstance.getServiceOfferingId(); @@ -2149,7 +2163,7 @@ public boolean deleteVmGroup(DeleteVMGroupCmd cmd) { throw new InvalidParameterValueException("unable to find a vm group with id " + groupId); } - _accountMgr.checkAccess(caller, null, group); + _accountMgr.checkAccess(caller, null, true, group); return deleteVmGroup(groupId); } @@ -2283,7 +2297,7 @@ public UserVm createBasicSecurityGroupVirtualMachine(DataCenter zone, ServiceOff List networkList = new ArrayList(); // Verify that caller can perform actions in behalf of vm owner - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, true, owner); // Get default guest network in Basic zone Network defaultNetwork = _networkModel.getExclusiveGuestNetwork(zone.getId()); @@ -2338,7 +2352,7 @@ public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, Service boolean isVmWare = (template.getHypervisorType() == HypervisorType.VMware || (hypervisor != null && hypervisor == HypervisorType.VMware)); // Verify that caller can perform actions in behalf of vm owner - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, true, owner); // If no network is specified, find system security group enabled network if (networkIdList == null || networkIdList.isEmpty()) { @@ -2396,7 +2410,7 @@ public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, Service // Perform account permission check if (network.getAclType() == ACLType.Account) { - _accountMgr.checkAccess(owner, AccessType.UseEntry, network); + _accountMgr.checkAccess(caller, AccessType.UseEntry, false, network); } networkList.add(network); } @@ -2442,7 +2456,7 @@ public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serv List networkList = new ArrayList(); // Verify that caller can perform actions in behalf of vm owner - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, true, owner); List vpcSupportedHTypes = _vpcMgr.getSupportedVpcHypervisors(); if (networkIdList == null || networkIdList.isEmpty()) { @@ -2507,7 +2521,7 @@ public UserVm createAdvancedVirtualMachine(DataCenter zone, ServiceOffering serv } } - _networkModel.checkNetworkPermissions(owner, network, AccessType.UseEntry); + _networkModel.checkNetworkPermissions(owner, network); // don't allow to use system networks NetworkOffering networkOffering = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId()); @@ -2536,7 +2550,7 @@ protected UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOf List affinityGroupIdList, Map customParameters, String customId) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException, StorageUnavailableException, ResourceAllocationException { - _accountMgr.checkAccess(caller, null, owner); + _accountMgr.checkAccess(caller, null, true, owner); if (owner.getState() == Account.State.disabled) { throw new PermissionDeniedException("The owner of vm to deploy is disabled: " + owner); @@ -2612,7 +2626,7 @@ protected UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOf throw new InvalidParameterValueException("Unable to find security group by id " + securityGroupId); } else { // verify permissions - _accountMgr.checkAccess(owner, AccessType.UseEntry, sg); + _accountMgr.checkAccess(caller, null, true, owner, sg); } } } @@ -2628,7 +2642,27 @@ protected UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOf + " , Please try again after removing the affinity group"); } else { // verify permissions - _accountMgr.checkAccess(owner, AccessType.UseEntry, ag); + if (ag.getAclType() == ACLType.Domain) { + _accountMgr.checkAccess(caller, null, false, owner, ag); + // Root admin has access to both VM and AG by default, + // but + // make sure the owner of these entities is same + if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || _accountMgr.isRootAdmin(caller.getId())) { + if (!_affinityGroupService.isAffinityGroupAvailableInDomain(ag.getId(), owner.getDomainId())) { + throw new PermissionDeniedException("Affinity Group " + ag + " does not belong to the VM's domain"); + } + } + } else { + _accountMgr.checkAccess(caller, null, true, owner, ag); + // Root admin has access to both VM and AG by default, + // but + // make sure the owner of these entities is same + if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || _accountMgr.isRootAdmin(caller.getId())) { + if (ag.getAccountId() != owner.getAccountId()) { + throw new PermissionDeniedException("Affinity Group " + ag + " does not belong to the VM's account"); + } + } + } } } } @@ -2654,7 +2688,10 @@ protected UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOf } // Check templates permissions - _accountMgr.checkAccess(owner, AccessType.UseEntry, template); + if (!template.isPublicTemplate()) { + Account templateOwner = _accountMgr.getAccount(template.getAccountId()); + _accountMgr.checkAccess(owner, null, true, templateOwner); + } // check if the user data is correct validateUserData(userData, httpmethod); @@ -2683,8 +2720,13 @@ protected UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOf throw new InvalidParameterValueException("Network id=" + network.getId() + " doesn't belong to zone " + zone.getId()); } - // Perform account permission check on network - _accountMgr.checkAccess(owner, AccessType.UseEntry, network); + //relax the check if the caller is admin account + if (caller.getType() != Account.ACCOUNT_TYPE_ADMIN) { + if (!(network.getGuestType() == Network.GuestType.Shared && network.getAclType() == ACLType.Domain) + && !(network.getAclType() == ACLType.Account && network.getAccountId() == accountId)) { + throw new InvalidParameterValueException("only shared network or isolated network with the same account_id can be added to vm"); + } + } IpAddresses requestedIpPair = null; if (requestedIps != null && !requestedIps.isEmpty()) { @@ -3307,7 +3349,7 @@ public Pair> startVirtualMach throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId); } - _accountMgr.checkAccess(callerAccount, null, vm); + _accountMgr.checkAccess(callerAccount, null, true, vm); Account owner = _accountDao.findById(vm.getAccountId()); @@ -3614,7 +3656,7 @@ public UserVm expungeVm(long vmId) throws ResourceUnavailableException, Concurre throw ex; } - _accountMgr.checkAccess(caller, null, vm); + _accountMgr.checkAccess(caller, null, true, vm); boolean status; @@ -4195,8 +4237,8 @@ public UserVm moveVMToUser(final AssignVMCmd cmd) throws ResourceAllocationExcep } //check caller has access to both the old and new account - _accountMgr.checkAccess(caller, null, oldAccount); - _accountMgr.checkAccess(caller, null, newAccount); + _accountMgr.checkAccess(caller, null, true, oldAccount); + _accountMgr.checkAccess(caller, null, true, newAccount); // make sure the accounts are not same if (oldAccount.getAccountId() == newAccount.getAccountId()) { @@ -4249,7 +4291,7 @@ public UserVm moveVMToUser(final AssignVMCmd cmd) throws ResourceAllocationExcep VirtualMachineTemplate template = _templateDao.findById(vm.getTemplateId()); if (!template.isPublicTemplate()) { Account templateOwner = _accountMgr.getAccount(template.getAccountId()); - _accountMgr.checkAccess(newAccount, null, templateOwner); + _accountMgr.checkAccess(newAccount, null, true, templateOwner); } // VV 5: check the new account can create vm in the domain @@ -4399,7 +4441,7 @@ public void doInTransactionWithoutResult(TransactionStatus status) { throw ex; } - _networkModel.checkNetworkPermissions(newAccount, network, AccessType.UseEntry); + _networkModel.checkNetworkPermissions(newAccount, network); // don't allow to use system networks NetworkOffering networkOffering = _entityMgr.findById(NetworkOffering.class, network.getNetworkOfferingId()); @@ -4506,7 +4548,7 @@ public UserVm restoreVM(RestoreVMCmd cmd) throws InsufficientCapacityException, throw ex; } - _accountMgr.checkAccess(caller, null, vm); + _accountMgr.checkAccess(caller, null, true, vm); return restoreVMInternal(caller, vm, newTemplateId); } @@ -4556,7 +4598,7 @@ public UserVm restoreVMInternal(Account caller, UserVmVO vm, Long newTemplateId) //newTemplateId can be either template or ISO id. In the following snippet based on the vm deployment (from template or ISO) it is handled accordingly if (newTemplateId != null) { template = _templateDao.findById(newTemplateId); - _accountMgr.checkAccess(caller, null, template); + _accountMgr.checkAccess(caller, null, true, template); if (isISO) { if (!template.getFormat().equals(ImageFormat.ISO)) { throw new InvalidParameterValueException("Invalid ISO id provided to restore the VM "); @@ -4737,7 +4779,6 @@ else if (host.getHypervisorType() == HypervisorType.VMware) { // root.getPoolId() should be null if the VM we are detaching the disk from has never been started before DataStore dataStore = root.getPoolId() != null ? _dataStoreMgr.getDataStore(root.getPoolId(), DataStoreRole.Primary) : null; - volumeMgr.disconnectVolumeFromHost(volFactory.getVolume(root.getId()), host, dataStore); } } @@ -4785,7 +4826,7 @@ public String getVmUserData(long vmId) { } //check permissions - _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, vm); + _accountMgr.checkAccess(CallContext.current().getCallingAccount(), null, true, vm); return vm.getUserData(); } diff --git a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java index 8dc2c1862c..f5957ff085 100644 --- a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java +++ b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java @@ -169,9 +169,7 @@ public boolean stop() { @Override public List listVMSnapshots(ListVMSnapshotCmd cmd) { Account caller = getCaller(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); boolean listAll = cmd.listAll(); Long id = cmd.getId(); @@ -184,14 +182,15 @@ public List listVMSnapshots(ListVMSnapshotCmd cmd) { Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, listAll, false, "listVMSnapshot"); + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, domainIdRecursiveListProject, listAll, + false); + Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(VMSnapshotVO.class, "created", false, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchBuilder sb = _vmSnapshotDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sb.and("vm_id", sb.entity().getVmId(), SearchCriteria.Op.EQ); sb.and("domain_id", sb.entity().getDomainId(), SearchCriteria.Op.EQ); @@ -203,7 +202,7 @@ public List listVMSnapshots(ListVMSnapshotCmd cmd) { sb.done(); SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); if (accountName != null && cmd.getDomainId() != null) { Account account = _accountMgr.getActiveAccountByName(accountName, cmd.getDomainId()); @@ -214,8 +213,8 @@ public List listVMSnapshots(ListVMSnapshotCmd cmd) { sc.setParameters("vm_id", vmId); } - if (cmd.getDomainId() != null) { - sc.setParameters("domain_id", cmd.getDomainId()); + if (domainId != null) { + sc.setParameters("domain_id", domainId); } if (state == null) { @@ -297,7 +296,7 @@ public VMSnapshot allocVMSnapshot(Long vmId, String vsDisplayName, String vsDesc } // check access - //_accountMgr.checkAccess(caller, null, userVmVo); + _accountMgr.checkAccess(caller, null, true, userVmVo); // check max snapshot limit for per VM if (_vmSnapshotDao.findByVm(vmId).size() >= _vmSnapshotMax) { @@ -448,7 +447,7 @@ public boolean deleteVMSnapshot(Long vmSnapshotId) { throw new InvalidParameterValueException("unable to find the vm snapshot with id " + vmSnapshotId); } - _accountMgr.checkAccess(caller, null, vmSnapshot); + _accountMgr.checkAccess(caller, null, true, vmSnapshot); // check VM snapshot states, only allow to delete vm snapshots in created and error state if (VMSnapshot.State.Ready != vmSnapshot.getState() && VMSnapshot.State.Expunging != vmSnapshot.getState() && VMSnapshot.State.Error != vmSnapshot.getState()) { @@ -513,7 +512,7 @@ private boolean orchestrateDeleteVMSnapshot(Long vmSnapshotId) { throw new InvalidParameterValueException("unable to find the vm snapshot with id " + vmSnapshotId); } - _accountMgr.checkAccess(caller, null, vmSnapshot); + _accountMgr.checkAccess(caller, null, true, vmSnapshot); // check VM snapshot states, only allow to delete vm snapshots in created and error state if (VMSnapshot.State.Ready != vmSnapshot.getState() && VMSnapshot.State.Expunging != vmSnapshot.getState() && VMSnapshot.State.Error != vmSnapshot.getState()) { @@ -564,7 +563,7 @@ public UserVm revertToSnapshot(Long vmSnapshotId) throws InsufficientCapacityExc } Account caller = getCaller(); - _accountMgr.checkAccess(caller, null, vmSnapshotVo); + _accountMgr.checkAccess(caller, null, true, vmSnapshotVo); // VM should be in running or stopped states if (userVm.getState() != VirtualMachine.State.Running @@ -646,7 +645,7 @@ private UserVm orchestrateRevertToVMSnapshot(Long vmSnapshotId) throws Insuffici } Account caller = getCaller(); - _accountMgr.checkAccess(caller, null, vmSnapshotVo); + _accountMgr.checkAccess(caller, null, true, vmSnapshotVo); // VM should be in running or stopped states if (userVm.getState() != VirtualMachine.State.Running && userVm.getState() != VirtualMachine.State.Stopped) { diff --git a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java index ef636920cd..8e606ca058 100644 --- a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java +++ b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java @@ -262,7 +262,7 @@ public boolean deleteAffinityGroup(Long affinityGroupId, String account, Long do affinityGroupId = group.getId(); } // check permissions - _accountMgr.checkAccess(caller, AccessType.OperateEntry, group); + _accountMgr.checkAccess(caller, AccessType.OperateEntry, true, group); final Long affinityGroupIdFinal = affinityGroupId; Transaction.execute(new TransactionCallbackNoReturn() { @@ -353,7 +353,7 @@ public Pair, Integer> listAffinityGroups(Long affi if (userVM == null) { throw new InvalidParameterValueException("Unable to list affinity groups for virtual machine instance " + vmId + "; instance not found."); } - _accountMgr.checkAccess(caller, null, userVM); + _accountMgr.checkAccess(caller, null, true, userVM); // add join to affinity_groups_vm_map groupSearch.join("vmInstanceSearch", vmInstanceSearch, groupSearch.entity().getId(), vmInstanceSearch.entity().getAffinityGroupId(), JoinBuilder.JoinType.INNER); @@ -477,7 +477,14 @@ public UserVm updateVMAffinityGroups(Long vmId, List affinityGroupIds) { throw new InvalidParameterValueException("Unable to find affinity group by id " + affinityGroupId); } else { // verify permissions - _accountMgr.checkAccess(owner, AccessType.UseEntry, ag); + _accountMgr.checkAccess(caller, null, true, owner, ag); + // Root admin has access to both VM and AG by default, but make sure the + // owner of these entities is same + if (caller.getId() == Account.ACCOUNT_ID_SYSTEM || _accountMgr.isRootAdmin(caller.getId())) { + if (ag.getAccountId() != owner.getAccountId()) { + throw new PermissionDeniedException("Affinity Group " + ag + " does not belong to the VM's account"); + } + } } } _affinityGroupVMMapDao.updateMap(vmId, affinityGroupIds); diff --git a/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java b/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java index ad1a2c4ec8..6854347ba6 100644 --- a/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java +++ b/server/src/org/apache/cloudstack/network/lb/ApplicationLoadBalancerManagerImpl.java @@ -115,7 +115,7 @@ public ApplicationLoadBalancerRule createApplicationLoadBalancer(String name, St } Account caller = CallContext.current().getCallingAccount(); - _accountMgr.checkAccess(caller, AccessType.UseEntry, guestNtwk); + _accountMgr.checkAccess(caller, AccessType.UseEntry, false, guestNtwk); Network sourceIpNtwk = _networkModel.getNetwork(sourceIpNetworkId); if (sourceIpNtwk == null) { @@ -389,20 +389,19 @@ public Pair, Integer> listApplicatio Map tags = cmd.getTags(); Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, "listLoadBalancers"); + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, + domainIdRecursiveListProject, cmd.listAll(), false); + Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(ApplicationLoadBalancerRuleVO.class, "id", true, cmd.getStartIndex(), cmd.getPageSizeVal()); SearchBuilder sb = _lbDao.createSearchBuilder(); - _accountMgr.buildACLSearchBuilder(sb, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchBuilder(sb, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); sb.and("name", sb.entity().getName(), SearchCriteria.Op.EQ); @@ -429,7 +428,7 @@ public Pair, Integer> listApplicatio } SearchCriteria sc = sb.create(); - _accountMgr.buildACLSearchCriteria(sc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLSearchCriteria(sc, domainId, isRecursive, permittedAccounts, listProjectResourcesCriteria); if (keyword != null) { SearchCriteria ssc = _lbDao.createSearchCriteria(); @@ -547,7 +546,7 @@ public ApplicationLoadBalancerRule updateApplicationLoadBalancer(Long id, String if (rule == null) { throw new InvalidParameterValueException("Unable to find load balancer " + id); } - _accountMgr.checkAccess(caller, null, rule); + _accountMgr.checkAccess(caller, null, true, rule); if (customId != null) { rule.setUuid(customId); diff --git a/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java b/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java index 67f2c02e0c..ba71d631a9 100644 --- a/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java +++ b/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java @@ -147,7 +147,7 @@ public void deleteSslCert(DeleteSslCertCmd deleteSslCertCmd) { if (certVO == null) { throw new InvalidParameterValueException("Invalid certificate id: " + certId); } - _accountMgr.checkAccess(caller, SecurityChecker.AccessType.OperateEntry, certVO); + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.OperateEntry, true, certVO); List lbCertRule = _lbCertDao.listByCertId(certId); @@ -191,7 +191,7 @@ public List listSslCerts(ListSslCertsCmd listSslCertCmd) { throw new InvalidParameterValueException("Invalid certificate id: " + certId); } - _accountMgr.checkAccess(caller, SecurityChecker.AccessType.UseEntry, certVO); + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.UseEntry, true, certVO); certLbMap = _lbCertDao.listByCertId(certId); @@ -206,7 +206,7 @@ public List listSslCerts(ListSslCertsCmd listSslCertCmd) { throw new InvalidParameterValueException("found no loadbalancer wth id: " + lbRuleId); } - _accountMgr.checkAccess(caller, SecurityChecker.AccessType.UseEntry, lb); + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.UseEntry, true, lb); // get the cert id LoadBalancerCertMapVO lbCertMapRule; @@ -229,7 +229,7 @@ public List listSslCerts(ListSslCertsCmd listSslCertCmd) { List certVOList = _sslCertDao.listByAccountId(accountId); if (certVOList == null || certVOList.isEmpty()) return certResponseList; - _accountMgr.checkAccess(caller, SecurityChecker.AccessType.UseEntry, certVOList.get(0)); + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.UseEntry, true, certVOList.get(0)); for (SslCertVO cert : certVOList) { certLbMap = _lbCertDao.listByCertId(cert.getId()); diff --git a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java index 516b3ab521..c84fea29d5 100644 --- a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java +++ b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java @@ -183,7 +183,7 @@ public boolean assignToGlobalLoadBalancerRule(AssignToGlobalLoadBalancerRuleCmd throw new InvalidParameterValueException("Invalid global load balancer rule id: " + gslbRuleId); } - _accountMgr.checkAccess(caller, SecurityChecker.AccessType.OperateEntry, gslbRule); + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.OperateEntry, true, gslbRule); if (gslbRule.getState() == GlobalLoadBalancerRule.State.Revoke) { throw new InvalidParameterValueException("global load balancer rule id: " + gslbRule.getUuid() + " is in revoked state"); @@ -224,7 +224,7 @@ public boolean assignToGlobalLoadBalancerRule(AssignToGlobalLoadBalancerRuleCmd throw new InvalidParameterValueException("Specified load balancer rule ID does not exist."); } - _accountMgr.checkAccess(caller, null, loadBalancer); + _accountMgr.checkAccess(caller, null, true, loadBalancer); if (gslbRule.getAccountId() != loadBalancer.getAccountId()) { throw new InvalidParameterValueException("GSLB rule and load balancer rule does not belong to same account"); @@ -319,7 +319,7 @@ public boolean removeFromGlobalLoadBalancerRule(RemoveFromGlobalLoadBalancerRule throw new InvalidParameterValueException("Invalid global load balancer rule id: " + gslbRuleId); } - _accountMgr.checkAccess(caller, SecurityChecker.AccessType.OperateEntry, gslbRule); + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.OperateEntry, true, gslbRule); if (gslbRule.getState() == GlobalLoadBalancerRule.State.Revoke) { throw new InvalidParameterValueException("global load balancer rule id: " + gslbRuleId + " is already in revoked state"); @@ -346,7 +346,7 @@ public boolean removeFromGlobalLoadBalancerRule(RemoveFromGlobalLoadBalancerRule throw new InvalidParameterValueException("Specified load balancer rule ID does not exist."); } - _accountMgr.checkAccess(caller, null, loadBalancer); + _accountMgr.checkAccess(caller, null, true, loadBalancer); } for (GlobalLoadBalancerLbRuleMapVO gslbLbMapVo : gslbLbMapVos) { @@ -445,7 +445,7 @@ private void revokeGslbRule(final long gslbRuleId, Account caller) { throw new InvalidParameterValueException("Invalid global load balancer rule id: " + gslbRuleId); } - _accountMgr.checkAccess(caller, SecurityChecker.AccessType.OperateEntry, gslbRule); + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.OperateEntry, true, gslbRule); if (gslbRule.getState() == com.cloud.region.ha.GlobalLoadBalancerRule.State.Staged) { if (s_logger.isDebugEnabled()) { @@ -523,7 +523,7 @@ public GlobalLoadBalancerRule updateGlobalLoadBalancerRule(UpdateGlobalLoadBalan CallContext ctx = CallContext.current(); Account caller = ctx.getCallingAccount(); - _accountMgr.checkAccess(caller, SecurityChecker.AccessType.OperateEntry, gslbRule); + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.OperateEntry, true, gslbRule); if (algorithm != null && !GlobalLoadBalancerRule.Algorithm.isValidAlgorithm(algorithm)) { throw new InvalidParameterValueException("Invalid Algorithm: " + algorithm); @@ -583,7 +583,7 @@ public List listGlobalLoadBalancerRule(ListGlobalLoadBal if (gslbRule == null) { throw new InvalidParameterValueException("Invalid gslb rule id specified"); } - _accountMgr.checkAccess(caller, org.apache.cloudstack.acl.SecurityChecker.AccessType.UseEntry, gslbRule); + _accountMgr.checkAccess(caller, org.apache.cloudstack.acl.SecurityChecker.AccessType.UseEntry, false, gslbRule); response.add(gslbRule); return response; diff --git a/server/test/com/cloud/event/EventControlsUnitTest.java b/server/test/com/cloud/event/EventControlsUnitTest.java index 0dc57427c5..91dc921d26 100644 --- a/server/test/com/cloud/event/EventControlsUnitTest.java +++ b/server/test/com/cloud/event/EventControlsUnitTest.java @@ -60,7 +60,7 @@ protected void setUp() { MockitoAnnotations.initMocks(this); _mgmtServer._eventDao = _eventDao; _mgmtServer._accountMgr = _accountMgr; - doNothing().when(_accountMgr).checkAccess(any(Account.class), any(AccessType.class), any(ControlledEntity.class)); + doNothing().when(_accountMgr).checkAccess(any(Account.class), any(AccessType.class), any(Boolean.class), any(ControlledEntity.class)); when(_eventDao.listToArchiveOrDeleteEvents(anyList(), anyString(), any(Date.class), any(Date.class), anyList())).thenReturn(_events); } diff --git a/server/test/com/cloud/network/MockNetworkModelImpl.java b/server/test/com/cloud/network/MockNetworkModelImpl.java index 33387fae64..6c9e597b9f 100644 --- a/server/test/com/cloud/network/MockNetworkModelImpl.java +++ b/server/test/com/cloud/network/MockNetworkModelImpl.java @@ -25,8 +25,6 @@ import javax.ejb.Local; import javax.naming.ConfigurationException; -import org.apache.cloudstack.acl.SecurityChecker.AccessType; - import com.cloud.dc.Vlan; import com.cloud.exception.InsufficientAddressCapacityException; import com.cloud.exception.InvalidParameterValueException; @@ -880,10 +878,4 @@ public boolean isNetworkReadyForGc(long networkId) { public boolean getNetworkEgressDefaultPolicy(Long networkId) { return false; //To change body of implemented methods use File | Settings | File Templates. } - - @Override - public void checkNetworkPermissions(Account owner, Network network, AccessType accessType) { - // TODO Auto-generated method stub - - } } diff --git a/server/test/com/cloud/user/MockAccountManagerImpl.java b/server/test/com/cloud/user/MockAccountManagerImpl.java index a2b8a8559f..cc8fbacfb7 100644 --- a/server/test/com/cloud/user/MockAccountManagerImpl.java +++ b/server/test/com/cloud/user/MockAccountManagerImpl.java @@ -32,6 +32,7 @@ import org.apache.cloudstack.api.command.admin.user.RegisterCmd; import org.apache.cloudstack.api.command.admin.user.UpdateUserCmd; +import com.cloud.api.query.vo.ControlledViewEntity; import com.cloud.domain.Domain; import com.cloud.exception.ConcurrentOperationException; import com.cloud.exception.PermissionDeniedException; @@ -218,6 +219,10 @@ public String getName() { return null; } + @Override + public void checkAccess(Account account, AccessType accessType, boolean sameOwner, ControlledEntity... entities) throws PermissionDeniedException { + // TODO Auto-generated method stub + } @Override @@ -252,6 +257,50 @@ public boolean enableAccount(long accountId) { return false; } + @Override + public void buildACLSearchBuilder(SearchBuilder sb, Long domainId, boolean isRecursive, List permittedAccounts, + ListProjectResourcesCriteria listProjectResourcesCriteria) { + // TODO Auto-generated method stub + + } + + @Override + public void buildACLSearchCriteria(SearchCriteria sc, Long domainId, boolean isRecursive, List permittedAccounts, + ListProjectResourcesCriteria listProjectResourcesCriteria) { + // TODO Auto-generated method stub + + } + + @Override + public void buildACLSearchParameters(Account caller, Long id, String accountName, Long projectId, List permittedAccounts, Ternary domainIdRecursiveListProject, boolean listAll, boolean forProjectInvitation) { + // TODO Auto-generated method stub + } + + @Override + public void buildACLViewSearchBuilder(SearchBuilder sb, Long domainId, + boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria) { + // TODO Auto-generated method stub + } + + @Override + public void buildACLViewSearchBuilder(SearchBuilder sb, Long domainId, boolean isRecursive, List permittedAccounts, + ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds) { + // TODO Auto-generated method stub + + } + + @Override + public void buildACLViewSearchCriteria(SearchCriteria sc, Long domainId, + boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria) { + // TODO Auto-generated method stub + } + + @Override + public void buildACLViewSearchCriteria(SearchCriteria sc, Long domainId, boolean isRecursive, List permittedAccounts, + ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds) { + // TODO Auto-generated method stub + + } /* (non-Javadoc) * @see com.cloud.user.AccountService#getUserByApiKey(java.lang.String) @@ -320,19 +369,6 @@ public void buildACLViewSearchCriteria(SearchCriteria sb, boolean isRecursive, List permittedDomains, List permittedAccounts, - List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria) { - // TODO Auto-generated method stub - - } - - @Override - public void buildACLSearchCriteria(SearchCriteria sc, boolean isRecursive, List permittedDomains, List permittedAccounts, - List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria) { - // TODO Auto-generated method stub - - } @Override public List listAclGroupsByAccount(Long accountId) { @@ -340,22 +376,17 @@ public List listAclGroupsByAccount(Long accountId) { return null; } - @Override - public Long finalyzeAccountId(String accountName, Long domainId, Long projectId, boolean enabledOnly) { + public void checkAccess(Account account, AccessType accessType, boolean sameOwner, String apiName, + ControlledEntity... entities) throws PermissionDeniedException { // TODO Auto-generated method stub - return null; } @Override - public void checkAccess(Account account, AccessType accessType, ControlledEntity... entities) throws PermissionDeniedException { + public Long finalyzeAccountId(String accountName, Long domainId, Long projectId, boolean enabledOnly) { // TODO Auto-generated method stub + return null; } - @Override - public void checkAccess(Account account, AccessType accessType, String apiName, ControlledEntity... entities) throws PermissionDeniedException { - // TODO Auto-generated method stub - - } } diff --git a/server/test/com/cloud/vm/UserVmManagerTest.java b/server/test/com/cloud/vm/UserVmManagerTest.java index 927d5e33b5..b67c164144 100755 --- a/server/test/com/cloud/vm/UserVmManagerTest.java +++ b/server/test/com/cloud/vm/UserVmManagerTest.java @@ -283,7 +283,7 @@ public void testRestoreVMF4() throws ResourceUnavailableException, InsufficientC doReturn(3L).when(_volumeMock).getTemplateId(); doReturn(ImageFormat.VHD).when(_templateMock).getFormat(); when(_templateDao.findById(anyLong())).thenReturn(_templateMock); - doNothing().when(_accountMgr).checkAccess(_account, null, _templateMock); + doNothing().when(_accountMgr).checkAccess(_account, null, true, _templateMock); when(_storageMgr.allocateDuplicateVolume(_volumeMock, 14L)).thenReturn(_volumeMock); when(_templateMock.getGuestOSId()).thenReturn(5L); doNothing().when(_vmMock).setGuestOSId(anyLong()); @@ -327,7 +327,7 @@ public void testRestoreVMF5() throws ResourceUnavailableException, InsufficientC doReturn(3L).when(_vmMock).getIsoId(); doReturn(ImageFormat.ISO).when(_templateMock).getFormat(); when(_templateDao.findById(anyLong())).thenReturn(_templateMock); - doNothing().when(_accountMgr).checkAccess(_account, null, _templateMock); + doNothing().when(_accountMgr).checkAccess(_account, null, true, _templateMock); when(_storageMgr.allocateDuplicateVolume(_volumeMock, null)).thenReturn(_volumeMock); doNothing().when(_vmMock).setIsoId(14L); when(_templateMock.getGuestOSId()).thenReturn(5L); @@ -413,7 +413,7 @@ public void testScaleVMF2() throws Exception { doReturn(VirtualMachine.State.Running).when(_vmInstance).getState(); - doNothing().when(_accountMgr).checkAccess(_account, null, _templateMock); + doNothing().when(_accountMgr).checkAccess(_account, null, true, _templateMock); doNothing().when(_itMgr).checkIfCanUpgrade(_vmMock, _offeringVo); @@ -606,7 +606,7 @@ public void testMoveVmToUser2() throws Exception { when(_accountService.getActiveAccountByName(anyString(), anyLong())).thenReturn(newAccount); - doThrow(new PermissionDeniedException("Access check failed")).when(_accountMgr).checkAccess(any(Account.class), any(AccessType.class), + doThrow(new PermissionDeniedException("Access check failed")).when(_accountMgr).checkAccess(any(Account.class), any(AccessType.class), any(Boolean.class), any(ControlledEntity.class)); CallContext.register(user, caller); diff --git a/server/test/com/cloud/vm/snapshot/VMSnapshotManagerTest.java b/server/test/com/cloud/vm/snapshot/VMSnapshotManagerTest.java index 03afdbd580..9d5c2b42ea 100644 --- a/server/test/com/cloud/vm/snapshot/VMSnapshotManagerTest.java +++ b/server/test/com/cloud/vm/snapshot/VMSnapshotManagerTest.java @@ -125,7 +125,7 @@ public void setup() { _vmSnapshotMgr._guestOSDao = _guestOSDao; _vmSnapshotMgr._hypervisorCapabilitiesDao = _hypervisorCapabilitiesDao; - doNothing().when(_accountMgr).checkAccess(any(Account.class), any(AccessType.class), any(ControlledEntity.class)); + doNothing().when(_accountMgr).checkAccess(any(Account.class), any(AccessType.class), any(Boolean.class), any(ControlledEntity.class)); _vmSnapshotMgr._vmSnapshotMax = _vmSnapshotMax; diff --git a/server/test/com/cloud/vpc/MockNetworkModelImpl.java b/server/test/com/cloud/vpc/MockNetworkModelImpl.java index c93584dbe3..67ab8e875c 100644 --- a/server/test/com/cloud/vpc/MockNetworkModelImpl.java +++ b/server/test/com/cloud/vpc/MockNetworkModelImpl.java @@ -26,8 +26,6 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; -import org.apache.cloudstack.acl.SecurityChecker.AccessType; - import com.cloud.dc.Vlan; import com.cloud.exception.InsufficientAddressCapacityException; import com.cloud.exception.InvalidParameterValueException; @@ -895,10 +893,4 @@ public boolean isNetworkReadyForGc(long networkId) { public boolean getNetworkEgressDefaultPolicy(Long networkId) { return false; //To change body of implemented methods use File | Settings | File Templates. } - - @Override - public void checkNetworkPermissions(Account owner, Network network, AccessType accessType) { - // TODO Auto-generated method stub - - } } diff --git a/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java b/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java index 7b3d967ffd..bb471c037e 100644 --- a/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java +++ b/services/iam/plugin/src/org/apache/cloudstack/iam/RoleBasedEntityAccessChecker.java @@ -27,6 +27,7 @@ import org.apache.cloudstack.acl.ControlledEntity; import org.apache.cloudstack.acl.PermissionScope; import org.apache.cloudstack.acl.SecurityChecker; +import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.iam.api.IAMGroup; import org.apache.cloudstack.iam.api.IAMPolicy; @@ -204,15 +205,13 @@ public boolean checkAccess(Account caller, AccessType accessType, String action, boolean otherEntitiesAccess = true; for (ControlledEntity otherEntity : entities) { - if (otherEntity != entity) { - if (otherEntity.getAccountId() == caller.getAccountId() - || (checkAccess(caller, otherEntity, accessType, action) && otherEntity.getAccountId() == entity - .getAccountId())) { - continue; - } else { - otherEntitiesAccess = false; - break; - } + if (otherEntity.getAccountId() == caller.getAccountId() + || (checkAccess(caller, otherEntity, accessType, action) && otherEntity.getAccountId() == entity + .getAccountId())) { + continue; + } else { + otherEntitiesAccess = false; + break; } } @@ -263,8 +262,6 @@ private boolean checkPermissionScope(Account caller, String scope, Long scopeId, if (_domainDao.isChildDomain(caller.getDomainId(), entity.getDomainId())) { return true; } - } else if (scope.equals(PermissionScope.ALL.name())) { - return true; } } return false; diff --git a/services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java b/services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java index 796ae43624..fa37cf621e 100644 --- a/services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java +++ b/services/iam/server/src/org/apache/cloudstack/iam/server/IAMServiceImpl.java @@ -1,905 +1,906 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package org.apache.cloudstack.iam.server; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import javax.ejb.Local; -import javax.inject.Inject; -import javax.naming.ConfigurationException; - -import net.sf.ehcache.Cache; -import net.sf.ehcache.CacheManager; -import net.sf.ehcache.Element; - -import org.apache.log4j.Logger; - -import org.apache.cloudstack.acl.PermissionScope; -import org.apache.cloudstack.iam.api.IAMGroup; -import org.apache.cloudstack.iam.api.IAMPolicy; -import org.apache.cloudstack.iam.api.IAMPolicyPermission; -import org.apache.cloudstack.iam.api.IAMPolicyPermission.Permission; -import org.apache.cloudstack.iam.api.IAMService; -import org.apache.cloudstack.iam.server.dao.IAMAccountPolicyMapDao; -import org.apache.cloudstack.iam.server.dao.IAMGroupAccountMapDao; -import org.apache.cloudstack.iam.server.dao.IAMGroupDao; -import org.apache.cloudstack.iam.server.dao.IAMGroupPolicyMapDao; -import org.apache.cloudstack.iam.server.dao.IAMPolicyDao; -import org.apache.cloudstack.iam.server.dao.IAMPolicyPermissionDao; - -import com.cloud.exception.InvalidParameterValueException; -import com.cloud.utils.NumbersUtil; -import com.cloud.utils.Pair; -import com.cloud.utils.component.Manager; -import com.cloud.utils.component.ManagerBase; -import com.cloud.utils.db.DB; -import com.cloud.utils.db.EntityManager; -import com.cloud.utils.db.Filter; -import com.cloud.utils.db.GenericSearchBuilder; -import com.cloud.utils.db.JoinBuilder; -import com.cloud.utils.db.JoinBuilder.JoinType; -import com.cloud.utils.db.SearchBuilder; -import com.cloud.utils.db.SearchCriteria; -import com.cloud.utils.db.SearchCriteria.Op; -import com.cloud.utils.db.Transaction; -import com.cloud.utils.db.TransactionCallback; -import com.cloud.utils.db.TransactionCallbackNoReturn; -import com.cloud.utils.db.TransactionStatus; - -@Local(value = {IAMService.class}) -public class IAMServiceImpl extends ManagerBase implements IAMService, Manager { - - public static final Logger s_logger = Logger.getLogger(IAMServiceImpl.class); - private String _name; - - @Inject - IAMPolicyDao _aclPolicyDao; - - @Inject - IAMGroupDao _aclGroupDao; - - @Inject - EntityManager _entityMgr; - - @Inject - IAMGroupPolicyMapDao _aclGroupPolicyMapDao; - - @Inject - IAMAccountPolicyMapDao _aclAccountPolicyMapDao; - - @Inject - IAMGroupAccountMapDao _aclGroupAccountMapDao; - - @Inject - IAMPolicyPermissionDao _policyPermissionDao; - - private Cache _iamCache; - - private void createIAMCache(final Map params) { - final String value = (String)params.get("cache.size"); - - if (value != null) { - final CacheManager cm = CacheManager.create(); - final int maxElements = NumbersUtil.parseInt(value, 0); - final int live = NumbersUtil.parseInt((String)params.get("cache.time.to.live"), 300); - final int idle = NumbersUtil.parseInt((String)params.get("cache.time.to.idle"), 300); - _iamCache = new Cache(getName(), maxElements, false, live == -1, live == -1 ? Integer.MAX_VALUE : live, idle); - cm.addCache(_iamCache); - s_logger.info("IAM Cache created: " + _iamCache.toString()); - } else { - _iamCache = null; - } - } - - @Override - public void addToIAMCache(Object accessKey, Object allowDeny) { - if (_iamCache != null) { - try { - s_logger.debug("Put IAM access check for " + accessKey + " in cache"); - _iamCache.put(new Element(accessKey, allowDeny)); - } catch (final Exception e) { - s_logger.debug("Can't put " + accessKey + " to IAM cache", e); - } - } - } - - @Override - public void invalidateIAMCache() { - //This may need to use event bus to publish to other MS, but event bus now is missing this functionality to handle PublishScope.GLOBAL - if (_iamCache != null) { - s_logger.debug("Invalidate IAM cache"); - _iamCache.removeAll(); - } - } - - @Override - public Object getFromIAMCache(Object accessKey) { - if (_iamCache != null) { - final Element element = _iamCache.get(accessKey); - return element == null ? null : element.getObjectValue(); - } - return null; - } - - @Override - public boolean configure(final String name, final Map params) throws ConfigurationException { - boolean result = super.configure(name, params); - // create IAM cache - createIAMCache(params); - return result; - } - - @DB - @Override - public IAMGroup createIAMGroup(String iamGroupName, String description, String path) { - // check if the group is already existing - IAMGroup grp = _aclGroupDao.findByName(path, iamGroupName); - if (grp != null) { - throw new InvalidParameterValueException( - "Unable to create acl group with name " + iamGroupName - + " already exisits for path " + path); - } - IAMGroupVO rvo = new IAMGroupVO(iamGroupName, description); - rvo.setPath(path); - - return _aclGroupDao.persist(rvo); - } - - @DB - @Override - public boolean deleteIAMGroup(final Long iamGroupId) { - // get the Acl Group entity - final IAMGroup grp = _aclGroupDao.findById(iamGroupId); - if (grp == null) { - throw new InvalidParameterValueException("Unable to find acl group: " + iamGroupId - + "; failed to delete acl group."); - } - - Transaction.execute(new TransactionCallbackNoReturn() { - @Override - public void doInTransactionWithoutResult(TransactionStatus status) { - // remove this group related entry in acl_group_policy_map - List groupPolicyMap = _aclGroupPolicyMapDao.listByGroupId(grp.getId()); - if (groupPolicyMap != null) { - for (IAMGroupPolicyMapVO gr : groupPolicyMap) { - _aclGroupPolicyMapDao.remove(gr.getId()); - } - } - - // remove this group related entry in acl_group_account table - List groupAcctMap = _aclGroupAccountMapDao.listByGroupId(grp.getId()); - if (groupAcctMap != null) { - for (IAMGroupAccountMapVO grpAcct : groupAcctMap) { - _aclGroupAccountMapDao.remove(grpAcct.getId()); - } - } - - // remove this group from acl_group table - _aclGroupDao.remove(iamGroupId); - } - }); - - invalidateIAMCache(); - return true; - } - - @SuppressWarnings("unchecked") - @Override - public List listIAMGroups(long accountId) { - - GenericSearchBuilder groupSB = _aclGroupAccountMapDao.createSearchBuilder(Long.class); - groupSB.selectFields(groupSB.entity().getAclGroupId()); - groupSB.and("account", groupSB.entity().getAccountId(), Op.EQ); - SearchCriteria groupSc = groupSB.create(); - groupSc.setParameters("account", accountId); - - List groupIds = _aclGroupAccountMapDao.customSearch(groupSc, null); - - if (groupIds == null || groupIds.isEmpty()) { - return new ArrayList(); - } - SearchBuilder sb = _aclGroupDao.createSearchBuilder(); - sb.and("ids", sb.entity().getId(), Op.IN); - SearchCriteria sc = sb.create(); - sc.setParameters("ids", groupIds.toArray(new Object[groupIds.size()])); - @SuppressWarnings("rawtypes") - List groups = _aclGroupDao.search(sc, null); - return groups; - } - - @DB - @Override - public IAMGroup addAccountsToGroup(final List acctIds, final Long groupId) { - // get the Acl Group entity - IAMGroup group = _aclGroupDao.findById(groupId); - if (group == null) { - throw new InvalidParameterValueException("Unable to find acl group: " + groupId - + "; failed to add accounts to acl group."); - } - - Transaction.execute(new TransactionCallbackNoReturn() { - @Override - public void doInTransactionWithoutResult(TransactionStatus status) { - // add entries in acl_group_account_map table - for (Long acctId : acctIds) { - // check account permissions - IAMGroupAccountMapVO grMap = _aclGroupAccountMapDao.findByGroupAndAccount(groupId, acctId); - if (grMap == null) { - // not there already - grMap = new IAMGroupAccountMapVO(groupId, acctId); - _aclGroupAccountMapDao.persist(grMap); - } - } - } - }); - - invalidateIAMCache(); - return group; - } - - @DB - @Override - public IAMGroup removeAccountsFromGroup(final List acctIds, final Long groupId) { - // get the Acl Group entity - IAMGroup group = _aclGroupDao.findById(groupId); - if (group == null) { - throw new InvalidParameterValueException("Unable to find acl group: " + groupId - + "; failed to remove accounts from acl group."); - } - - Transaction.execute(new TransactionCallbackNoReturn() { - @Override - public void doInTransactionWithoutResult(TransactionStatus status) { - // remove entries from acl_group_account_map table - for (Long acctId : acctIds) { - IAMGroupAccountMapVO grMap = _aclGroupAccountMapDao.findByGroupAndAccount(groupId, acctId); - if (grMap != null) { - // not removed yet - _aclGroupAccountMapDao.remove(grMap.getId()); - } - } - } - }); - - invalidateIAMCache(); - return group; - } - - @Override - public List listAccountsByGroup(long groupId) { - List grpAcctMap = _aclGroupAccountMapDao.listByGroupId(groupId); - if (grpAcctMap == null || grpAcctMap.size() == 0) { - return new ArrayList(); - } - - List accts = new ArrayList(); - for (IAMGroupAccountMapVO grpAcct : grpAcctMap) { - accts.add(grpAcct.getAccountId()); - } - return accts; - } - - @Override - public Pair, Integer> listIAMGroups(Long iamGroupId, String iamGroupName, String path, Long startIndex, Long pageSize) { - if (iamGroupId != null) { - IAMGroup group = _aclGroupDao.findById(iamGroupId); - if (group == null) { - throw new InvalidParameterValueException("Unable to find acl group by id " + iamGroupId); - } - } - - Filter searchFilter = new Filter(IAMGroupVO.class, "id", true, startIndex, pageSize); - - SearchBuilder sb = _aclGroupDao.createSearchBuilder(); - sb.and("name", sb.entity().getName(), SearchCriteria.Op.EQ); - sb.and("path", sb.entity().getPath(), SearchCriteria.Op.LIKE); - sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); - - SearchCriteria sc = sb.create(); - - if (iamGroupName != null) { - sc.setParameters("name", iamGroupName); - } - - if (iamGroupId != null) { - sc.setParameters("id", iamGroupId); - } - - sc.setParameters("path", path + "%"); - - Pair, Integer> groups = _aclGroupDao.searchAndCount(sc, searchFilter); - return new Pair, Integer>(new ArrayList(groups.first()), groups.second()); - } - - @Override - public List listParentIAMGroups(long groupId) { - IAMGroup group = _aclGroupDao.findById(groupId); - if (group == null) { - throw new InvalidParameterValueException("Unable to find acl group by id " + groupId); - } - - String path = group.getPath(); - List pathList = new ArrayList(); - - String[] parts = path.split("/"); - - for (String part : parts) { - int start = path.indexOf(part); - if (start > 0) { - String subPath = path.substring(0, start); - pathList.add(subPath); - } - } - - if (pathList.isEmpty()) { - return new ArrayList(); - } - - SearchBuilder sb = _aclGroupDao.createSearchBuilder(); - sb.and("paths", sb.entity().getPath(), SearchCriteria.Op.IN); - - SearchCriteria sc = sb.create(); - sc.setParameters("paths", pathList.toArray()); - - List groups = _aclGroupDao.search(sc, null); - - return new ArrayList(groups); - - } - - @DB - @Override - public IAMPolicy createIAMPolicy(final String iamPolicyName, final String description, final Long parentPolicyId, final String path) { - - // check if the policy is already existing - IAMPolicy ro = _aclPolicyDao.findByName(iamPolicyName); - if (ro != null) { - throw new InvalidParameterValueException( - "Unable to create acl policy with name " + iamPolicyName - + " already exisits"); - } - - IAMPolicy role = Transaction.execute(new TransactionCallback() { - @Override - public IAMPolicy doInTransaction(TransactionStatus status) { - IAMPolicyVO rvo = new IAMPolicyVO(iamPolicyName, description); - rvo.setPath(path); - - IAMPolicy role = _aclPolicyDao.persist(rvo); - if (parentPolicyId != null) { - // copy parent role permissions - List perms = _policyPermissionDao.listByPolicy(parentPolicyId); - if (perms != null) { - for (IAMPolicyPermissionVO perm : perms) { - perm.setAclPolicyId(role.getId()); - _policyPermissionDao.persist(perm); - } - } - } - return role; - } - }); - - - return role; - } - - @DB - @Override - public boolean deleteIAMPolicy(final long iamPolicyId) { - // get the Acl Policy entity - final IAMPolicy policy = _aclPolicyDao.findById(iamPolicyId); - if (policy == null) { - throw new InvalidParameterValueException("Unable to find acl policy: " + iamPolicyId - + "; failed to delete acl policy."); - } - - Transaction.execute(new TransactionCallbackNoReturn() { - @Override - public void doInTransactionWithoutResult(TransactionStatus status) { - // remove this policy related entry in acl_group_policy_map - List groupPolicyMap = _aclGroupPolicyMapDao.listByPolicyId(policy.getId()); - if (groupPolicyMap != null) { - for (IAMGroupPolicyMapVO gr : groupPolicyMap) { - _aclGroupPolicyMapDao.remove(gr.getId()); - } - } - - // remove this policy related entry in acl_account_policy_map table - List policyAcctMap = _aclAccountPolicyMapDao.listByPolicyId(policy.getId()); - if (policyAcctMap != null) { - for (IAMAccountPolicyMapVO policyAcct : policyAcctMap) { - _aclAccountPolicyMapDao.remove(policyAcct.getId()); - } - } - - // remove this policy related entry in acl_policy_permission table - List policyPermMap = _policyPermissionDao.listByPolicy(policy.getId()); - if (policyPermMap != null) { - for (IAMPolicyPermissionVO policyPerm : policyPermMap) { - _policyPermissionDao.remove(policyPerm.getId()); - } - } - - // remove this role from acl_role table - _aclPolicyDao.remove(iamPolicyId); - } - }); - - invalidateIAMCache(); - - return true; - } - - - @SuppressWarnings("unchecked") - @Override - public List listIAMPolicies(long accountId) { - - // static policies of the account - SearchBuilder groupSB = _aclGroupAccountMapDao.createSearchBuilder(); - groupSB.and("account", groupSB.entity().getAccountId(), Op.EQ); - - GenericSearchBuilder policySB = _aclGroupPolicyMapDao.createSearchBuilder(Long.class); - policySB.selectFields(policySB.entity().getAclPolicyId()); - policySB.join("accountgroupjoin", groupSB, groupSB.entity().getAclGroupId(), policySB.entity().getAclGroupId(), - JoinType.INNER); - policySB.done(); - SearchCriteria policySc = policySB.create(); - policySc.setJoinParameters("accountgroupjoin", "account", accountId); - - List policyIds = _aclGroupPolicyMapDao.customSearch(policySc, null); - // add policies directly attached to the account - List acctPolicies = _aclAccountPolicyMapDao.listByAccountId(accountId); - for (IAMAccountPolicyMapVO p : acctPolicies) { - policyIds.add(p.getIamPolicyId()); - } - if (policyIds.size() == 0) { - return new ArrayList(); - } - SearchBuilder sb = _aclPolicyDao.createSearchBuilder(); - sb.and("ids", sb.entity().getId(), Op.IN); - SearchCriteria sc = sb.create(); - sc.setParameters("ids", policyIds.toArray(new Object[policyIds.size()])); - @SuppressWarnings("rawtypes") - List policies = _aclPolicyDao.customSearch(sc, null); - - return policies; - - } - - @SuppressWarnings("unchecked") - @Override - public List listIAMPoliciesByGroup(long groupId) { - List policyGrpMap = _aclGroupPolicyMapDao.listByGroupId(groupId); - if (policyGrpMap == null || policyGrpMap.size() == 0) { - return new ArrayList(); - } - - List policyIds = new ArrayList(); - for (IAMGroupPolicyMapVO pg : policyGrpMap) { - policyIds.add(pg.getAclPolicyId()); - } - - SearchBuilder sb = _aclPolicyDao.createSearchBuilder(); - sb.and("ids", sb.entity().getId(), Op.IN); - SearchCriteria sc = sb.create(); - sc.setParameters("ids", policyIds.toArray(new Object[policyIds.size()])); - @SuppressWarnings("rawtypes") - List policies = _aclPolicyDao.customSearch(sc, null); - - return policies; - } - - @SuppressWarnings("unchecked") - @Override - public List listRecursiveIAMPoliciesByGroup(long groupId) { - List policyGrpMap = _aclGroupPolicyMapDao.listByGroupId(groupId); - if (policyGrpMap == null || policyGrpMap.size() == 0) { - return new ArrayList(); - } - - List policyIds = new ArrayList(); - for (IAMGroupPolicyMapVO pg : policyGrpMap) { - policyIds.add(pg.getAclPolicyId()); - } - - SearchBuilder permSb = _policyPermissionDao.createSearchBuilder(); - permSb.and("isRecursive", permSb.entity().isRecursive(), Op.EQ); - - SearchBuilder sb = _aclPolicyDao.createSearchBuilder(); - sb.and("ids", sb.entity().getId(), Op.IN); - sb.join("recursivePerm", permSb, sb.entity().getId(), permSb.entity().getAclPolicyId(), - JoinBuilder.JoinType.INNER); - - SearchCriteria sc = sb.create(); - sc.setParameters("ids", policyIds.toArray(new Object[policyIds.size()])); - sc.setJoinParameters("recursivePerm", "isRecursive", true); - - @SuppressWarnings("rawtypes") - List policies = _aclPolicyDao.customSearch(sc, null); - - return policies; - } - - - @SuppressWarnings("unchecked") - @Override - public Pair, Integer> listIAMPolicies(Long iamPolicyId, String iamPolicyName, String path, Long startIndex, Long pageSize) { - - if (iamPolicyId != null) { - IAMPolicy policy = _aclPolicyDao.findById(iamPolicyId); - if (policy == null) { - throw new InvalidParameterValueException("Unable to find acl policy by id " + iamPolicyId); - } - } - - Filter searchFilter = new Filter(IAMPolicyVO.class, "id", true, startIndex, pageSize); - - SearchBuilder sb = _aclPolicyDao.createSearchBuilder(); - sb.and("name", sb.entity().getName(), SearchCriteria.Op.EQ); - sb.and("path", sb.entity().getPath(), SearchCriteria.Op.LIKE); - sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); - - SearchCriteria sc = sb.create(); - - if (iamPolicyName != null) { - sc.setParameters("name", iamPolicyName); - } - - if (iamPolicyId != null) { - sc.setParameters("id", iamPolicyId); - } - - sc.setParameters("path", path + "%"); - - Pair, Integer> policies = _aclPolicyDao.searchAndCount(sc, searchFilter); - @SuppressWarnings("rawtypes") - List policyList = policies.first(); - return new Pair, Integer>(policyList, policies.second()); - } - - @DB - @Override - public IAMGroup attachIAMPoliciesToGroup(final List policyIds, final Long groupId) { - // get the Acl Group entity - IAMGroup group = _aclGroupDao.findById(groupId); - if (group == null) { - throw new InvalidParameterValueException("Unable to find acl group: " + groupId - + "; failed to add roles to acl group."); - } - - Transaction.execute(new TransactionCallbackNoReturn() { - @Override - public void doInTransactionWithoutResult(TransactionStatus status) { - // add entries in acl_group_policy_map table - for (Long policyId : policyIds) { - IAMPolicy policy = _aclPolicyDao.findById(policyId); - if (policy == null) { - throw new InvalidParameterValueException("Unable to find acl policy: " + policyId - + "; failed to add policies to acl group."); - } - - IAMGroupPolicyMapVO grMap = _aclGroupPolicyMapDao.findByGroupAndPolicy(groupId, policyId); - if (grMap == null) { - // not there already - grMap = new IAMGroupPolicyMapVO(groupId, policyId); - _aclGroupPolicyMapDao.persist(grMap); - } - } - } - }); - - invalidateIAMCache(); - return group; - } - - @DB - @Override - public IAMGroup removeIAMPoliciesFromGroup(final List policyIds, final Long groupId) { - // get the Acl Group entity - IAMGroup group = _aclGroupDao.findById(groupId); - if (group == null) { - throw new InvalidParameterValueException("Unable to find acl group: " + groupId - + "; failed to remove roles from acl group."); - } - - Transaction.execute(new TransactionCallbackNoReturn() { - @Override - public void doInTransactionWithoutResult(TransactionStatus status) { - // add entries in acl_group_role_map table - for (Long policyId : policyIds) { - IAMPolicy policy = _aclPolicyDao.findById(policyId); - if (policy == null) { - throw new InvalidParameterValueException("Unable to find acl policy: " + policyId - + "; failed to add policies to acl group."); - } - - IAMGroupPolicyMapVO grMap = _aclGroupPolicyMapDao.findByGroupAndPolicy(groupId, policyId); - if (grMap != null) { - // not removed yet - _aclGroupPolicyMapDao.remove(grMap.getId()); - } - } - } - }); - - invalidateIAMCache(); - return group; - } - - - @Override - public void attachIAMPolicyToAccounts(final Long policyId, final List acctIds) { - IAMPolicy policy = _aclPolicyDao.findById(policyId); - if (policy == null) { - throw new InvalidParameterValueException("Unable to find acl policy: " + policyId - + "; failed to add policy to account."); - } - - Transaction.execute(new TransactionCallbackNoReturn() { - @Override - public void doInTransactionWithoutResult(TransactionStatus status) { - // add entries in acl_group_policy_map table - for (Long acctId : acctIds) { - IAMAccountPolicyMapVO acctMap = _aclAccountPolicyMapDao.findByAccountAndPolicy(acctId, policyId); - if (acctMap == null) { - // not there already - acctMap = new IAMAccountPolicyMapVO(acctId, policyId); - _aclAccountPolicyMapDao.persist(acctMap); - } - } - } - }); - - invalidateIAMCache(); - } - - @Override - public void removeIAMPolicyFromAccounts(final Long policyId, final List acctIds) { - IAMPolicy policy = _aclPolicyDao.findById(policyId); - if (policy == null) { - throw new InvalidParameterValueException("Unable to find acl policy: " + policyId - + "; failed to add policy to account."); - } - - Transaction.execute(new TransactionCallbackNoReturn() { - @Override - public void doInTransactionWithoutResult(TransactionStatus status) { - // add entries in acl_group_policy_map table - for (Long acctId : acctIds) { - IAMAccountPolicyMapVO acctMap = _aclAccountPolicyMapDao.findByAccountAndPolicy(acctId, policyId); - if (acctMap != null) { - // exists - _aclAccountPolicyMapDao.remove(acctMap.getId()); - } - } - } - }); - - invalidateIAMCache(); - } - - @DB - @Override - public IAMPolicy addIAMPermissionToIAMPolicy(long iamPolicyId, String entityType, String scope, Long scopeId, - String action, String accessType, Permission perm, Boolean recursive) { - // get the Acl Policy entity - IAMPolicy policy = _aclPolicyDao.findById(iamPolicyId); - if (policy == null) { - throw new InvalidParameterValueException("Unable to find acl policy: " + iamPolicyId - + "; failed to add permission to policy."); - } - - // add entry in acl_policy_permission table - IAMPolicyPermissionVO permit = _policyPermissionDao.findByPolicyAndEntity(iamPolicyId, entityType, scope, - scopeId, action, perm, accessType); - if (permit == null) { - // not there already - permit = new IAMPolicyPermissionVO(iamPolicyId, action, entityType, accessType, scope, scopeId, perm, - recursive); - _policyPermissionDao.persist(permit); - } - - invalidateIAMCache(); - return policy; - - } - - @DB - @Override - public IAMPolicy removeIAMPermissionFromIAMPolicy(long iamPolicyId, String entityType, String scope, Long scopeId, - String action) { - // get the Acl Policy entity - IAMPolicy policy = _aclPolicyDao.findById(iamPolicyId); - if (policy == null) { - throw new InvalidParameterValueException("Unable to find acl policy: " + iamPolicyId - + "; failed to revoke permission from policy."); - } - // remove entry from acl_entity_permission table - IAMPolicyPermissionVO permit = _policyPermissionDao.findByPolicyAndEntity(iamPolicyId, entityType, scope, - scopeId, action, Permission.Allow, null); - if (permit != null) { - // not removed yet - _policyPermissionDao.remove(permit.getId()); - } - - invalidateIAMCache(); - return policy; - } - - @DB - @Override - public void removeIAMPermissionForEntity(final String entityType, final Long entityId) { - Transaction.execute(new TransactionCallbackNoReturn() { - @Override - public void doInTransactionWithoutResult(TransactionStatus status) { - // remove entry from acl_entity_permission table - List permitList = _policyPermissionDao.listByEntity(entityType, entityId); - for (IAMPolicyPermissionVO permit : permitList) { - long policyId = permit.getAclPolicyId(); - _policyPermissionDao.remove(permit.getId()); - - // remove the policy if there are no other permissions - if ((_policyPermissionDao.listByPolicy(policyId)).isEmpty()) { - deleteIAMPolicy(policyId); - } - } - } - }); - - invalidateIAMCache(); - } - - @DB - @Override - public IAMPolicy resetIAMPolicy(long iamPolicyId) { - // get the Acl Policy entity - IAMPolicy policy = _aclPolicyDao.findById(iamPolicyId); - if (policy == null) { - throw new InvalidParameterValueException("Unable to find acl policy: " + iamPolicyId - + "; failed to reset the policy."); - } - - SearchBuilder sb = _policyPermissionDao.createSearchBuilder(); - sb.and("policyId", sb.entity().getAclPolicyId(), SearchCriteria.Op.EQ); - sb.and("scope", sb.entity().getScope(), SearchCriteria.Op.EQ); - sb.done(); - SearchCriteria permissionSC = sb.create(); - permissionSC.setParameters("policyId", iamPolicyId); - _policyPermissionDao.expunge(permissionSC); - - invalidateIAMCache(); - return policy; - } - - @Override - public boolean isActionAllowedForPolicies(String action, List policies) { - - boolean allowed = false; - - if (policies == null || policies.size() == 0) { - return allowed; - } - - List policyIds = new ArrayList(); - for (IAMPolicy policy : policies) { - policyIds.add(policy.getId()); - } - - SearchBuilder sb = _policyPermissionDao.createSearchBuilder(); - sb.and("action", sb.entity().getAction(), Op.EQ); - sb.and("policyId", sb.entity().getAclPolicyId(), Op.IN); - - SearchCriteria sc = sb.create(); - sc.setParameters("policyId", policyIds.toArray(new Object[policyIds.size()])); - sc.setParameters("action", action); - - List permissions = _policyPermissionDao.customSearch(sc, null); - - if (permissions != null && !permissions.isEmpty()) { - allowed = true; - } - - return allowed; - } - - - @Override - public List getGrantedEntities(long accountId, String action, String scope) { - // Get the static Policies of the Caller - List policies = listIAMPolicies(accountId); - // for each policy, find granted permission within the given scope - List entityIds = new ArrayList(); - for (IAMPolicy policy : policies) { - List pp = _policyPermissionDao.listByPolicyActionAndScope(policy.getId(), action, - scope, null); - if (pp != null) { - for (IAMPolicyPermissionVO p : pp) { - if (p.getScopeId() != null) { - entityIds.add(p.getScopeId()); - } - } - } - } - return entityIds; - } - - @Override - @SuppressWarnings("unchecked") - public List listPolicyPermissions(long policyId) { - @SuppressWarnings("rawtypes") - List pp = _policyPermissionDao.listByPolicy(policyId); - return pp; - } - - @SuppressWarnings("unchecked") - @Override - public List listPolicyPermissionsByScope(long policyId, String action, String scope, - String accessType) { - @SuppressWarnings("rawtypes") - List pp = _policyPermissionDao.listByPolicyActionAndScope(policyId, action, scope, accessType); - return pp; - } - - @SuppressWarnings("unchecked") - @Override - public List listPolicyPermissionByActionAndEntity(long policyId, String action, - String entityType) { - @SuppressWarnings("rawtypes") - List pp = _policyPermissionDao.listByPolicyActionAndEntity(policyId, action, entityType); - return pp; - } - - @SuppressWarnings("unchecked") - @Override - public List listPolicyPermissionByAccessAndEntity(long policyId, String accessType, - String entityType) { - @SuppressWarnings("rawtypes") - List pp = _policyPermissionDao.listByPolicyAccessAndEntity(policyId, accessType, entityType); - return pp; - } - - @Override - public IAMPolicy getResourceOwnerPolicy() { - return _aclPolicyDao.findByName("RESOURCE_OWNER"); - } - - // search for policy with only one resource grant permission - @Override - public IAMPolicy getResourceGrantPolicy(String entityType, Long entityId, String accessType, String action) { - List policyList = _aclPolicyDao.listAll(); - for (IAMPolicyVO policy : policyList){ - List pp = listPolicyPermissions(policy.getId()); - if ( pp != null && pp.size() == 1){ - // resource grant policy should only have one ACL permission assigned - IAMPolicyPermission permit = pp.get(0); - if ( permit.getEntityType().equals(entityType) && permit.getScope().equals(PermissionScope.RESOURCE.toString()) && permit.getScopeId().longValue() == entityId.longValue()){ - if (accessType != null && permit.getAccessType().equals(accessType)){ - return policy; - } else if (action != null && permit.getAction().equals(action)) { - return policy; - } - } - } - } - return null; - } - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.iam.server; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import javax.ejb.Local; +import javax.inject.Inject; +import javax.naming.ConfigurationException; + +import net.sf.ehcache.Cache; +import net.sf.ehcache.CacheManager; +import net.sf.ehcache.Element; + +import org.apache.log4j.Logger; + +import org.apache.cloudstack.acl.PermissionScope; +import org.apache.cloudstack.iam.api.IAMGroup; +import org.apache.cloudstack.iam.api.IAMPolicy; +import org.apache.cloudstack.iam.api.IAMPolicyPermission; +import org.apache.cloudstack.iam.api.IAMPolicyPermission.Permission; +import org.apache.cloudstack.iam.api.IAMService; +import org.apache.cloudstack.iam.server.dao.IAMAccountPolicyMapDao; +import org.apache.cloudstack.iam.server.dao.IAMGroupAccountMapDao; +import org.apache.cloudstack.iam.server.dao.IAMGroupDao; +import org.apache.cloudstack.iam.server.dao.IAMGroupPolicyMapDao; +import org.apache.cloudstack.iam.server.dao.IAMPolicyDao; +import org.apache.cloudstack.iam.server.dao.IAMPolicyPermissionDao; + +import com.cloud.exception.InvalidParameterValueException; +import com.cloud.utils.NumbersUtil; +import com.cloud.utils.Pair; +import com.cloud.utils.component.Manager; +import com.cloud.utils.component.ManagerBase; +import com.cloud.utils.db.DB; +import com.cloud.utils.db.EntityManager; +import com.cloud.utils.db.Filter; +import com.cloud.utils.db.GenericSearchBuilder; +import com.cloud.utils.db.JoinBuilder; +import com.cloud.utils.db.JoinBuilder.JoinType; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import com.cloud.utils.db.SearchCriteria.Op; +import com.cloud.utils.db.Transaction; +import com.cloud.utils.db.TransactionCallback; +import com.cloud.utils.db.TransactionCallbackNoReturn; +import com.cloud.utils.db.TransactionStatus; + +@Local(value = {IAMService.class}) +public class IAMServiceImpl extends ManagerBase implements IAMService, Manager { + + public static final Logger s_logger = Logger.getLogger(IAMServiceImpl.class); + private String _name; + + @Inject + IAMPolicyDao _aclPolicyDao; + + @Inject + IAMGroupDao _aclGroupDao; + + @Inject + EntityManager _entityMgr; + + @Inject + IAMGroupPolicyMapDao _aclGroupPolicyMapDao; + + @Inject + IAMAccountPolicyMapDao _aclAccountPolicyMapDao; + + @Inject + IAMGroupAccountMapDao _aclGroupAccountMapDao; + + @Inject + IAMPolicyPermissionDao _policyPermissionDao; + + private Cache _iamCache; + + private void createIAMCache(final Map params) { + final String value = (String)params.get("cache.size"); + + if (value != null) { + final CacheManager cm = CacheManager.create(); + final int maxElements = NumbersUtil.parseInt(value, 0); + final int live = NumbersUtil.parseInt((String)params.get("cache.time.to.live"), 300); + final int idle = NumbersUtil.parseInt((String)params.get("cache.time.to.idle"), 300); + _iamCache = new Cache(getName(), maxElements, false, live == -1, live == -1 ? Integer.MAX_VALUE : live, idle); + cm.addCache(_iamCache); + s_logger.info("IAM Cache created: " + _iamCache.toString()); + } else { + _iamCache = null; + } + } + + @Override + public void addToIAMCache(Object accessKey, Object allowDeny) { + if (_iamCache != null) { + try { + s_logger.debug("Put IAM access check for " + accessKey + " in cache"); + _iamCache.put(new Element(accessKey, allowDeny)); + } catch (final Exception e) { + s_logger.debug("Can't put " + accessKey + " to IAM cache", e); + } + } + } + + @Override + public void invalidateIAMCache() { + //This may need to use event bus to publish to other MS, but event bus now is missing this functionality to handle PublishScope.GLOBAL + if (_iamCache != null) { + s_logger.debug("Invalidate IAM cache"); + _iamCache.removeAll(); + } + } + + @Override + public Object getFromIAMCache(Object accessKey) { + if (_iamCache != null) { + final Element element = _iamCache.get(accessKey); + return element == null ? null : element.getObjectValue(); + } + return null; + } + + @Override + public boolean configure(final String name, final Map params) throws ConfigurationException { + boolean result = super.configure(name, params); + // create IAM cache + createIAMCache(params); + return result; + } + + @DB + @Override + public IAMGroup createIAMGroup(String iamGroupName, String description, String path) { + // check if the group is already existing + IAMGroup grp = _aclGroupDao.findByName(path, iamGroupName); + if (grp != null) { + throw new InvalidParameterValueException( + "Unable to create acl group with name " + iamGroupName + + " already exisits for path " + path); + } + IAMGroupVO rvo = new IAMGroupVO(iamGroupName, description); + rvo.setPath(path); + + return _aclGroupDao.persist(rvo); + } + + @DB + @Override + public boolean deleteIAMGroup(final Long iamGroupId) { + // get the Acl Group entity + final IAMGroup grp = _aclGroupDao.findById(iamGroupId); + if (grp == null) { + throw new InvalidParameterValueException("Unable to find acl group: " + iamGroupId + + "; failed to delete acl group."); + } + + Transaction.execute(new TransactionCallbackNoReturn() { + @Override + public void doInTransactionWithoutResult(TransactionStatus status) { + // remove this group related entry in acl_group_policy_map + List groupPolicyMap = _aclGroupPolicyMapDao.listByGroupId(grp.getId()); + if (groupPolicyMap != null) { + for (IAMGroupPolicyMapVO gr : groupPolicyMap) { + _aclGroupPolicyMapDao.remove(gr.getId()); + } + } + + // remove this group related entry in acl_group_account table + List groupAcctMap = _aclGroupAccountMapDao.listByGroupId(grp.getId()); + if (groupAcctMap != null) { + for (IAMGroupAccountMapVO grpAcct : groupAcctMap) { + _aclGroupAccountMapDao.remove(grpAcct.getId()); + } + } + + // remove this group from acl_group table + _aclGroupDao.remove(iamGroupId); + } + }); + + invalidateIAMCache(); + return true; + } + + @SuppressWarnings("unchecked") + @Override + public List listIAMGroups(long accountId) { + + GenericSearchBuilder groupSB = _aclGroupAccountMapDao.createSearchBuilder(Long.class); + groupSB.selectFields(groupSB.entity().getAclGroupId()); + groupSB.and("account", groupSB.entity().getAccountId(), Op.EQ); + SearchCriteria groupSc = groupSB.create(); + groupSc.setParameters("account", accountId); + + List groupIds = _aclGroupAccountMapDao.customSearch(groupSc, null); + + if (groupIds == null || groupIds.isEmpty()) { + return new ArrayList(); + } + SearchBuilder sb = _aclGroupDao.createSearchBuilder(); + sb.and("ids", sb.entity().getId(), Op.IN); + SearchCriteria sc = sb.create(); + sc.setParameters("ids", groupIds.toArray(new Object[groupIds.size()])); + @SuppressWarnings("rawtypes") + List groups = _aclGroupDao.search(sc, null); + return groups; + } + + @DB + @Override + public IAMGroup addAccountsToGroup(final List acctIds, final Long groupId) { + // get the Acl Group entity + IAMGroup group = _aclGroupDao.findById(groupId); + if (group == null) { + throw new InvalidParameterValueException("Unable to find acl group: " + groupId + + "; failed to add accounts to acl group."); + } + + Transaction.execute(new TransactionCallbackNoReturn() { + @Override + public void doInTransactionWithoutResult(TransactionStatus status) { + // add entries in acl_group_account_map table + for (Long acctId : acctIds) { + // check account permissions + IAMGroupAccountMapVO grMap = _aclGroupAccountMapDao.findByGroupAndAccount(groupId, acctId); + if (grMap == null) { + // not there already + grMap = new IAMGroupAccountMapVO(groupId, acctId); + _aclGroupAccountMapDao.persist(grMap); + } + } + } + }); + + invalidateIAMCache(); + return group; + } + + @DB + @Override + public IAMGroup removeAccountsFromGroup(final List acctIds, final Long groupId) { + // get the Acl Group entity + IAMGroup group = _aclGroupDao.findById(groupId); + if (group == null) { + throw new InvalidParameterValueException("Unable to find acl group: " + groupId + + "; failed to remove accounts from acl group."); + } + + Transaction.execute(new TransactionCallbackNoReturn() { + @Override + public void doInTransactionWithoutResult(TransactionStatus status) { + // remove entries from acl_group_account_map table + for (Long acctId : acctIds) { + IAMGroupAccountMapVO grMap = _aclGroupAccountMapDao.findByGroupAndAccount(groupId, acctId); + if (grMap != null) { + // not removed yet + _aclGroupAccountMapDao.remove(grMap.getId()); + } + } + } + }); + + invalidateIAMCache(); + return group; + } + + @Override + public List listAccountsByGroup(long groupId) { + List grpAcctMap = _aclGroupAccountMapDao.listByGroupId(groupId); + if (grpAcctMap == null || grpAcctMap.size() == 0) { + return new ArrayList(); + } + + List accts = new ArrayList(); + for (IAMGroupAccountMapVO grpAcct : grpAcctMap) { + accts.add(grpAcct.getAccountId()); + } + return accts; + } + + @Override + public Pair, Integer> listIAMGroups(Long iamGroupId, String iamGroupName, String path, Long startIndex, Long pageSize) { + if (iamGroupId != null) { + IAMGroup group = _aclGroupDao.findById(iamGroupId); + if (group == null) { + throw new InvalidParameterValueException("Unable to find acl group by id " + iamGroupId); + } + } + + Filter searchFilter = new Filter(IAMGroupVO.class, "id", true, startIndex, pageSize); + + SearchBuilder sb = _aclGroupDao.createSearchBuilder(); + sb.and("name", sb.entity().getName(), SearchCriteria.Op.EQ); + sb.and("path", sb.entity().getPath(), SearchCriteria.Op.LIKE); + sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); + + SearchCriteria sc = sb.create(); + + if (iamGroupName != null) { + sc.setParameters("name", iamGroupName); + } + + if (iamGroupId != null) { + sc.setParameters("id", iamGroupId); + } + + sc.setParameters("path", path + "%"); + + Pair, Integer> groups = _aclGroupDao.searchAndCount(sc, searchFilter); + return new Pair, Integer>(new ArrayList(groups.first()), groups.second()); + } + + @Override + public List listParentIAMGroups(long groupId) { + IAMGroup group = _aclGroupDao.findById(groupId); + if (group == null) { + throw new InvalidParameterValueException("Unable to find acl group by id " + groupId); + } + + String path = group.getPath(); + List pathList = new ArrayList(); + + String[] parts = path.split("/"); + + for (String part : parts) { + int start = path.indexOf(part); + if (start > 0) { + String subPath = path.substring(0, start); + pathList.add(subPath); + } + } + + if (pathList.isEmpty()) { + return new ArrayList(); + } + + SearchBuilder sb = _aclGroupDao.createSearchBuilder(); + sb.and("paths", sb.entity().getPath(), SearchCriteria.Op.IN); + + SearchCriteria sc = sb.create(); + sc.setParameters("paths", pathList.toArray()); + + List groups = _aclGroupDao.search(sc, null); + + return new ArrayList(groups); + + } + + @DB + @Override + public IAMPolicy createIAMPolicy(final String iamPolicyName, final String description, final Long parentPolicyId, final String path) { + + // check if the policy is already existing + IAMPolicy ro = _aclPolicyDao.findByName(iamPolicyName); + if (ro != null) { + throw new InvalidParameterValueException( + "Unable to create acl policy with name " + iamPolicyName + + " already exisits"); + } + + IAMPolicy role = Transaction.execute(new TransactionCallback() { + @Override + public IAMPolicy doInTransaction(TransactionStatus status) { + IAMPolicyVO rvo = new IAMPolicyVO(iamPolicyName, description); + rvo.setPath(path); + + IAMPolicy role = _aclPolicyDao.persist(rvo); + if (parentPolicyId != null) { + // copy parent role permissions + List perms = _policyPermissionDao.listByPolicy(parentPolicyId); + if (perms != null) { + for (IAMPolicyPermissionVO perm : perms) { + perm.setAclPolicyId(role.getId()); + _policyPermissionDao.persist(perm); + } + } + } + return role; + } + }); + + + return role; + } + + @DB + @Override + public boolean deleteIAMPolicy(final long iamPolicyId) { + // get the Acl Policy entity + final IAMPolicy policy = _aclPolicyDao.findById(iamPolicyId); + if (policy == null) { + throw new InvalidParameterValueException("Unable to find acl policy: " + iamPolicyId + + "; failed to delete acl policy."); + } + + Transaction.execute(new TransactionCallbackNoReturn() { + @Override + public void doInTransactionWithoutResult(TransactionStatus status) { + // remove this policy related entry in acl_group_policy_map + List groupPolicyMap = _aclGroupPolicyMapDao.listByPolicyId(policy.getId()); + if (groupPolicyMap != null) { + for (IAMGroupPolicyMapVO gr : groupPolicyMap) { + _aclGroupPolicyMapDao.remove(gr.getId()); + } + } + + // remove this policy related entry in acl_account_policy_map table + List policyAcctMap = _aclAccountPolicyMapDao.listByPolicyId(policy.getId()); + if (policyAcctMap != null) { + for (IAMAccountPolicyMapVO policyAcct : policyAcctMap) { + _aclAccountPolicyMapDao.remove(policyAcct.getId()); + } + } + + // remove this policy related entry in acl_policy_permission table + List policyPermMap = _policyPermissionDao.listByPolicy(policy.getId()); + if (policyPermMap != null) { + for (IAMPolicyPermissionVO policyPerm : policyPermMap) { + _policyPermissionDao.remove(policyPerm.getId()); + } + } + + // remove this role from acl_role table + _aclPolicyDao.remove(iamPolicyId); + } + }); + + invalidateIAMCache(); + + return true; + } + + + @SuppressWarnings("unchecked") + @Override + public List listIAMPolicies(long accountId) { + + // static policies of the account + SearchBuilder groupSB = _aclGroupAccountMapDao.createSearchBuilder(); + groupSB.and("account", groupSB.entity().getAccountId(), Op.EQ); + + GenericSearchBuilder policySB = _aclGroupPolicyMapDao.createSearchBuilder(Long.class); + policySB.selectFields(policySB.entity().getAclPolicyId()); + policySB.join("accountgroupjoin", groupSB, groupSB.entity().getAclGroupId(), policySB.entity().getAclGroupId(), + JoinType.INNER); + policySB.done(); + SearchCriteria policySc = policySB.create(); + policySc.setJoinParameters("accountgroupjoin", "account", accountId); + + List policyIds = _aclGroupPolicyMapDao.customSearch(policySc, null); + // add policies directly attached to the account + List acctPolicies = _aclAccountPolicyMapDao.listByAccountId(accountId); + for (IAMAccountPolicyMapVO p : acctPolicies) { + policyIds.add(p.getIamPolicyId()); + } + if (policyIds.size() == 0) { + return new ArrayList(); + } + SearchBuilder sb = _aclPolicyDao.createSearchBuilder(); + sb.and("ids", sb.entity().getId(), Op.IN); + SearchCriteria sc = sb.create(); + sc.setParameters("ids", policyIds.toArray(new Object[policyIds.size()])); + @SuppressWarnings("rawtypes") + List policies = _aclPolicyDao.customSearch(sc, null); + + return policies; + + } + + @SuppressWarnings("unchecked") + @Override + public List listIAMPoliciesByGroup(long groupId) { + List policyGrpMap = _aclGroupPolicyMapDao.listByGroupId(groupId); + if (policyGrpMap == null || policyGrpMap.size() == 0) { + return new ArrayList(); + } + + List policyIds = new ArrayList(); + for (IAMGroupPolicyMapVO pg : policyGrpMap) { + policyIds.add(pg.getAclPolicyId()); + } + + SearchBuilder sb = _aclPolicyDao.createSearchBuilder(); + sb.and("ids", sb.entity().getId(), Op.IN); + SearchCriteria sc = sb.create(); + sc.setParameters("ids", policyIds.toArray(new Object[policyIds.size()])); + @SuppressWarnings("rawtypes") + List policies = _aclPolicyDao.customSearch(sc, null); + + return policies; + } + + @SuppressWarnings("unchecked") + @Override + public List listRecursiveIAMPoliciesByGroup(long groupId) { + List policyGrpMap = _aclGroupPolicyMapDao.listByGroupId(groupId); + if (policyGrpMap == null || policyGrpMap.size() == 0) { + return new ArrayList(); + } + + List policyIds = new ArrayList(); + for (IAMGroupPolicyMapVO pg : policyGrpMap) { + policyIds.add(pg.getAclPolicyId()); + } + + SearchBuilder permSb = _policyPermissionDao.createSearchBuilder(); + permSb.and("isRecursive", permSb.entity().isRecursive(), Op.EQ); + + SearchBuilder sb = _aclPolicyDao.createSearchBuilder(); + sb.and("ids", sb.entity().getId(), Op.IN); + sb.join("recursivePerm", permSb, sb.entity().getId(), permSb.entity().getAclPolicyId(), + JoinBuilder.JoinType.INNER); + + SearchCriteria sc = sb.create(); + sc.setParameters("ids", policyIds.toArray(new Object[policyIds.size()])); + sc.setJoinParameters("recursivePerm", "isRecursive", true); + + @SuppressWarnings("rawtypes") + List policies = _aclPolicyDao.customSearch(sc, null); + + return policies; + } + + + @SuppressWarnings("unchecked") + @Override + public Pair, Integer> listIAMPolicies(Long iamPolicyId, String iamPolicyName, String path, Long startIndex, Long pageSize) { + + if (iamPolicyId != null) { + IAMPolicy policy = _aclPolicyDao.findById(iamPolicyId); + if (policy == null) { + throw new InvalidParameterValueException("Unable to find acl policy by id " + iamPolicyId); + } + } + + Filter searchFilter = new Filter(IAMPolicyVO.class, "id", true, startIndex, pageSize); + + SearchBuilder sb = _aclPolicyDao.createSearchBuilder(); + sb.and("name", sb.entity().getName(), SearchCriteria.Op.EQ); + sb.and("path", sb.entity().getPath(), SearchCriteria.Op.LIKE); + sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); + + SearchCriteria sc = sb.create(); + + if (iamPolicyName != null) { + sc.setParameters("name", iamPolicyName); + } + + if (iamPolicyId != null) { + sc.setParameters("id", iamPolicyId); + } + + sc.setParameters("path", path + "%"); + + Pair, Integer> policies = _aclPolicyDao.searchAndCount(sc, searchFilter); + @SuppressWarnings("rawtypes") + List policyList = policies.first(); + return new Pair, Integer>(policyList, policies.second()); + } + + @DB + @Override + public IAMGroup attachIAMPoliciesToGroup(final List policyIds, final Long groupId) { + // get the Acl Group entity + IAMGroup group = _aclGroupDao.findById(groupId); + if (group == null) { + throw new InvalidParameterValueException("Unable to find acl group: " + groupId + + "; failed to add roles to acl group."); + } + + Transaction.execute(new TransactionCallbackNoReturn() { + @Override + public void doInTransactionWithoutResult(TransactionStatus status) { + // add entries in acl_group_policy_map table + for (Long policyId : policyIds) { + IAMPolicy policy = _aclPolicyDao.findById(policyId); + if (policy == null) { + throw new InvalidParameterValueException("Unable to find acl policy: " + policyId + + "; failed to add policies to acl group."); + } + + IAMGroupPolicyMapVO grMap = _aclGroupPolicyMapDao.findByGroupAndPolicy(groupId, policyId); + if (grMap == null) { + // not there already + grMap = new IAMGroupPolicyMapVO(groupId, policyId); + _aclGroupPolicyMapDao.persist(grMap); + } + } + } + }); + + invalidateIAMCache(); + return group; + } + + @DB + @Override + public IAMGroup removeIAMPoliciesFromGroup(final List policyIds, final Long groupId) { + // get the Acl Group entity + IAMGroup group = _aclGroupDao.findById(groupId); + if (group == null) { + throw new InvalidParameterValueException("Unable to find acl group: " + groupId + + "; failed to remove roles from acl group."); + } + + Transaction.execute(new TransactionCallbackNoReturn() { + @Override + public void doInTransactionWithoutResult(TransactionStatus status) { + // add entries in acl_group_role_map table + for (Long policyId : policyIds) { + IAMPolicy policy = _aclPolicyDao.findById(policyId); + if (policy == null) { + throw new InvalidParameterValueException("Unable to find acl policy: " + policyId + + "; failed to add policies to acl group."); + } + + IAMGroupPolicyMapVO grMap = _aclGroupPolicyMapDao.findByGroupAndPolicy(groupId, policyId); + if (grMap != null) { + // not removed yet + _aclGroupPolicyMapDao.remove(grMap.getId()); + } + } + } + }); + + invalidateIAMCache(); + return group; + } + + + @Override + public void attachIAMPolicyToAccounts(final Long policyId, final List acctIds) { + IAMPolicy policy = _aclPolicyDao.findById(policyId); + if (policy == null) { + throw new InvalidParameterValueException("Unable to find acl policy: " + policyId + + "; failed to add policy to account."); + } + + Transaction.execute(new TransactionCallbackNoReturn() { + @Override + public void doInTransactionWithoutResult(TransactionStatus status) { + // add entries in acl_group_policy_map table + for (Long acctId : acctIds) { + IAMAccountPolicyMapVO acctMap = _aclAccountPolicyMapDao.findByAccountAndPolicy(acctId, policyId); + if (acctMap == null) { + // not there already + acctMap = new IAMAccountPolicyMapVO(acctId, policyId); + _aclAccountPolicyMapDao.persist(acctMap); + } + } + } + }); + + invalidateIAMCache(); + } + + @Override + public void removeIAMPolicyFromAccounts(final Long policyId, final List acctIds) { + IAMPolicy policy = _aclPolicyDao.findById(policyId); + if (policy == null) { + throw new InvalidParameterValueException("Unable to find acl policy: " + policyId + + "; failed to add policy to account."); + } + + Transaction.execute(new TransactionCallbackNoReturn() { + @Override + public void doInTransactionWithoutResult(TransactionStatus status) { + // add entries in acl_group_policy_map table + for (Long acctId : acctIds) { + IAMAccountPolicyMapVO acctMap = _aclAccountPolicyMapDao.findByAccountAndPolicy(acctId, policyId); + if (acctMap != null) { + // exists + _aclAccountPolicyMapDao.remove(acctMap.getId()); + } + } + } + }); + + invalidateIAMCache(); + } + + @DB + @Override + public IAMPolicy addIAMPermissionToIAMPolicy(long iamPolicyId, String entityType, String scope, Long scopeId, + String action, String accessType, Permission perm, Boolean recursive) { + // get the Acl Policy entity + IAMPolicy policy = _aclPolicyDao.findById(iamPolicyId); + if (policy == null) { + throw new InvalidParameterValueException("Unable to find acl policy: " + iamPolicyId + + "; failed to add permission to policy."); + } + + // add entry in acl_policy_permission table + IAMPolicyPermissionVO permit = _policyPermissionDao.findByPolicyAndEntity(iamPolicyId, entityType, scope, + scopeId, action, perm, accessType); + if (permit == null) { + // not there already + permit = new IAMPolicyPermissionVO(iamPolicyId, action, entityType, accessType, scope, scopeId, perm, + recursive); + _policyPermissionDao.persist(permit); + } + + invalidateIAMCache(); + return policy; + + } + + @DB + @Override + public IAMPolicy removeIAMPermissionFromIAMPolicy(long iamPolicyId, String entityType, String scope, Long scopeId, + String action) { + // get the Acl Policy entity + IAMPolicy policy = _aclPolicyDao.findById(iamPolicyId); + if (policy == null) { + throw new InvalidParameterValueException("Unable to find acl policy: " + iamPolicyId + + "; failed to revoke permission from policy."); + } + // remove entry from acl_entity_permission table + IAMPolicyPermissionVO permit = _policyPermissionDao.findByPolicyAndEntity(iamPolicyId, entityType, scope, + scopeId, action, Permission.Allow, null); + if (permit != null) { + // not removed yet + _policyPermissionDao.remove(permit.getId()); + } + + invalidateIAMCache(); + return policy; + } + + @DB + @Override + public void removeIAMPermissionForEntity(final String entityType, final Long entityId) { + Transaction.execute(new TransactionCallbackNoReturn() { + @Override + public void doInTransactionWithoutResult(TransactionStatus status) { + // remove entry from acl_entity_permission table + List permitList = _policyPermissionDao.listByEntity(entityType, entityId); + for (IAMPolicyPermissionVO permit : permitList) { + long policyId = permit.getAclPolicyId(); + _policyPermissionDao.remove(permit.getId()); + + // remove the policy if there are no other permissions + if ((_policyPermissionDao.listByPolicy(policyId)).isEmpty()) { + deleteIAMPolicy(policyId); + } + } + } + }); + + invalidateIAMCache(); + } + + @DB + @Override + public IAMPolicy resetIAMPolicy(long iamPolicyId) { + // get the Acl Policy entity + IAMPolicy policy = _aclPolicyDao.findById(iamPolicyId); + if (policy == null) { + throw new InvalidParameterValueException("Unable to find acl policy: " + iamPolicyId + + "; failed to reset the policy."); + } + + SearchBuilder sb = _policyPermissionDao.createSearchBuilder(); + sb.and("policyId", sb.entity().getAclPolicyId(), SearchCriteria.Op.EQ); + sb.and("scope", sb.entity().getScope(), SearchCriteria.Op.EQ); + sb.done(); + SearchCriteria permissionSC = sb.create(); + permissionSC.setParameters("policyId", iamPolicyId); + _policyPermissionDao.expunge(permissionSC); + + invalidateIAMCache(); + return policy; + } + + @Override + public boolean isActionAllowedForPolicies(String action, List policies) { + + boolean allowed = false; + + if (policies == null || policies.size() == 0) { + return allowed; + } + + List policyIds = new ArrayList(); + for (IAMPolicy policy : policies) { + policyIds.add(policy.getId()); + } + + SearchBuilder sb = _policyPermissionDao.createSearchBuilder(); + sb.and("action", sb.entity().getAction(), Op.EQ); + sb.and("policyId", sb.entity().getAclPolicyId(), Op.IN); + + SearchCriteria sc = sb.create(); + sc.setParameters("policyId", policyIds.toArray(new Object[policyIds.size()])); + sc.setParameters("action", action); + + List permissions = _policyPermissionDao.customSearch(sc, null); + + if (permissions != null && !permissions.isEmpty()) { + allowed = true; + } + + return allowed; + } + + + @Override + public List getGrantedEntities(long accountId, String action, String scope) { + // Get the static Policies of the Caller + List policies = listIAMPolicies(accountId); + // for each policy, find granted permission within the given scope + List entityIds = new ArrayList(); + for (IAMPolicy policy : policies) { + List pp = _policyPermissionDao.listByPolicyActionAndScope(policy.getId(), action, + scope, null); + if (pp != null) { + for (IAMPolicyPermissionVO p : pp) { + if (p.getScopeId() != null) { + entityIds.add(p.getScopeId()); + } + } + } + } + return entityIds; + } + + @Override + @SuppressWarnings("unchecked") + public List listPolicyPermissions(long policyId) { + @SuppressWarnings("rawtypes") + List pp = _policyPermissionDao.listByPolicy(policyId); + return pp; + } + + @SuppressWarnings("unchecked") + @Override + public List listPolicyPermissionsByScope(long policyId, String action, String scope, + String accessType) { + @SuppressWarnings("rawtypes") + List pp = _policyPermissionDao.listByPolicyActionAndScope(policyId, action, scope, accessType); + return pp; + } + + @SuppressWarnings("unchecked") + @Override + public List listPolicyPermissionByActionAndEntity(long policyId, String action, + String entityType) { + @SuppressWarnings("rawtypes") + List pp = _policyPermissionDao.listByPolicyActionAndEntity(policyId, action, entityType); + return pp; + } + + @SuppressWarnings("unchecked") + @Override + public List listPolicyPermissionByAccessAndEntity(long policyId, String accessType, + String entityType) { + @SuppressWarnings("rawtypes") + List pp = _policyPermissionDao.listByPolicyAccessAndEntity(policyId, accessType, entityType); + return pp; + } + + @Override + public IAMPolicy getResourceOwnerPolicy() { + return _aclPolicyDao.findByName("RESOURCE_OWNER"); + } + + // search for policy with only one resource grant permission + @Override + public IAMPolicy getResourceGrantPolicy(String entityType, Long entityId, String accessType, String action) { + List policyList = _aclPolicyDao.listAll(); + for (IAMPolicyVO policy : policyList) { + List pp = listPolicyPermissions(policy.getId()); + if (pp != null && pp.size() == 1) { + // resource grant policy should only have one ACL permission assigned + IAMPolicyPermission permit = pp.get(0); + if (permit.getEntityType().equals(entityType) && permit.getScope().equals(PermissionScope.RESOURCE.toString()) + && permit.getScopeId().longValue() == entityId.longValue()) { + if (accessType != null && permit.getAccessType().equals(accessType)) { + return policy; + } else if (action != null && permit.getAction().equals(action)) { + return policy; + } + } + } + } + return null; + } + +} diff --git a/services/pom.xml b/services/pom.xml index a12a7b5fe4..def30271f9 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -47,6 +47,5 @@ console-proxy console-proxy-rdp/rdpconsole secondary-storage - iam diff --git a/test/integration/smoke/test_vm_iam.py b/test/integration/smoke/test_vm_iam.py deleted file mode 100644 index be75a79737..0000000000 --- a/test/integration/smoke/test_vm_iam.py +++ /dev/null @@ -1,719 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. -""" BVT tests for Virtual Machine IAM effect -""" -#Import Local Modules -import marvin -from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * -from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -from marvin.codes import FAILED -from nose.plugins.attrib import attr -#Import System modules -import time - -_multiprocess_shared_ = True -class Services: - """Test VM Life Cycle Services - """ - - def __init__(self): - self.services = { - #data for domains and accounts - "domain1": { - "name": "Domain1", - }, - "account1A": { - "email": "test1A@test.com", - "firstname": "test1A", - "lastname": "User", - "username": "test1A", - "password": "password", - }, - "account1B": { - "email": "test1B@test.com", - "firstname": "test1B", - "lastname": "User", - "username": "test1B", - "password": "password", - }, - "domain2": { - "name": "Domain2", - }, - "account2A": { - "email": "test2A@test.com", - "firstname": "test2A", - "lastname": "User", - "username": "test2A", - "password": "password", - }, - #data reqd for virtual machine creation - "virtual_machine1A" : { - "name" : "test1Avm", - "displayname" : "Test1A VM", - }, - "virtual_machine1B" : { - "name" : "test1Bvm", - "displayname" : "Test1B VM", - }, - "virtual_machine2A" : { - "name" : "test2Avm", - "displayname" : "Test2A VM", - }, - #small service offering - "service_offering": { - "small": { - "name": "Small Instance", - "displaytext": "Small Instance", - "cpunumber": 1, - "cpuspeed": 100, - "memory": 128, - }, - }, - "ostype": 'CentOS 5.6 (64-bit)', - # iam group and policy information - "service_desk_iam_grp" : { - "name" : "Service Desk", - "description" : "Service Desk IAM Group" - }, - "vm_readonly_iam_policy" : { - "name" : "VM Read Only Access", - "description" : "VM read only access iam policy" - }, - } - - - -class TestVMIam(cloudstackTestCase): - - @classmethod - def setUpClass(self): - testClient = super(TestVMIam, self).getClsTestClient() - self.apiclient = testClient.getApiClient() - self.services = Services().services - - # backup default apikey and secretkey - self.default_apikey = self.apiclient.connection.apiKey - self.default_secretkey = self.apiclient.connection.securityKey - - # Create domains and accounts etc - self.domain_1 = Domain.create( - self.apiclient, - self.services["domain1"] - ) - self.domain_2 = Domain.create( - self.apiclient, - self.services["domain2"] - ) - # Create two accounts for doamin_1 - self.account_1A = Account.create( - self.apiclient, - self.services["account1A"], - admin=False, - domainid=self.domain_1.id - ) - - self.account_1B = Account.create( - self.apiclient, - self.services["account1B"], - admin=False, - domainid=self.domain_1.id - ) - - # Create an account for domain_2 - self.account_2A = Account.create( - self.apiclient, - self.services["account2A"], - admin=False, - domainid=self.domain_2.id - ) - - # Fetch user details to register apiKey for them - self.user_1A = User.list( - self.apiclient, - account=self.account_1A.name, - domainid=self.account_1A.domainid - )[0] - - user_1A_key = User.registerUserKeys( - self.apiclient, - self.user_1A.id - ) - self.user_1A_apikey = user_1A_key.apikey - self.user_1A_secretkey = user_1A_key.secretkey - - - self.user_1B = User.list( - self.apiclient, - account=self.account_1B.name, - domainid=self.account_1B.domainid - )[0] - - user_1B_key = User.registerUserKeys( - self.apiclient, - self.user_1B.id - ) - - self.user_1B_apikey = user_1B_key.apikey - self.user_1B_secretkey = user_1B_key.secretkey - - - self.user_2A = User.list( - self.apiclient, - account=self.account_2A.name, - domainid=self.account_2A.domainid - )[0] - - user_2A_key = User.registerUserKeys( - self.apiclient, - self.user_2A.id - ) - self.user_2A_apikey = user_2A_key.apikey - self.user_2A_secretkey = user_2A_key.secretkey - - # create service offering - self.service_offering = ServiceOffering.create( - self.apiclient, - self.services["service_offering"]["small"] - ) - - self.zone = get_zone(self.apiclient, testClient.getZoneForTests()) - self.services['mode'] = self.zone.networktype - self.template = get_template(self.apiclient, self.zone.id, self.services["ostype"]) - - # deploy 3 VMs for three accounts - self.virtual_machine_1A = VirtualMachine.create( - self.apiclient, - self.services["virtual_machine1A"], - accountid=self.account_1A.name, - zoneid=self.zone.id, - domainid=self.account_1A.domainid, - serviceofferingid=self.service_offering.id, - templateid=self.template.id - ) - - self.virtual_machine_1B = VirtualMachine.create( - self.apiclient, - self.services["virtual_machine1B"], - accountid=self.account_1B.name, - zoneid=self.zone.id, - domainid=self.account_1B.domainid, - serviceofferingid=self.service_offering.id, - templateid=self.template.id - ) - - self.virtual_machine_2A = VirtualMachine.create( - self.apiclient, - self.services["virtual_machine2A"], - accountid=self.account_2A.name, - zoneid=self.zone.id, - domainid=self.account_2A.domainid, - serviceofferingid=self.service_offering.id, - templateid=self.template.id - ) - - self.srv_desk_grp = IAMGroup.create( - self.apiclient, - self.services["service_desk_iam_grp"] - ) - - self.vm_read_policy = IAMPolicy.create( - self.apiclient, - self.services["vm_readonly_iam_policy"] - ) - - self.srv_desk_grp.attachPolicy( - self.apiclient, [self.vm_read_policy] - ) - - vm_grant_policy_params = {} - vm_grant_policy_params['name'] = "policyGrantVirtualMachine" + self.virtual_machine_1A.id - vm_grant_policy_params['description'] = "Policy to grant permission to VirtualMachine " + self.virtual_machine_1A.id - self.vm_grant_policy = IAMPolicy.create( - self.apiclient, - vm_grant_policy_params - ) - - self._cleanup = [ - self.account_1A, - self.account_1B, - self.domain_1, - self.account_2A, - self.domain_2, - self.service_offering, - self.vm_read_policy, - self.srv_desk_grp, - self.vm_grant_policy - ] - - @classmethod - def tearDownClass(self): - self.apiclient = super(TestVMIam, self).getClsTestClient().getApiClient() - cleanup_resources(self.apiclient, self._cleanup) - return - - def setUp(self): - self.apiclient = self.testClient.getApiClient() - self.dbclient = self.testClient.getDbConnection() - self.cleanup = [] - - def tearDown(self): - # restore back default apikey and secretkey - self.apiclient.connection.apiKey = self.default_apikey - self.apiclient.connection.securityKey = self.default_secretkey - cleanup_resources(self.apiclient, self.cleanup) - return - - - - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) - def test_01_list_own_vm(self): - # listVM command should return owne's VM - - self.debug("Listing VM for account: %s" % self.account_1A.name) - - self.apiclient.connection.apiKey = self.user_1A_apikey - self.apiclient.connection.securityKey = self.user_1A_secretkey - list_vm_response = list_virtual_machines( - self.apiclient - ) - self.assertEqual( - isinstance(list_vm_response, list), - True, - "Check list response returns a valid list" - ) - self.assertEqual( - len(list_vm_response), - 1, - "Check VM available in List Virtual Machines" - ) - - self.assertEqual( - list_vm_response[0].name, - self.virtual_machine_1A.name, - "Virtual Machine names do not match" - ) - - self.debug("Listing VM for account: %s" % self.account_1B.name) - self.apiclient.connection.apiKey = self.user_1B_apikey - self.apiclient.connection.securityKey = self.user_1B_secretkey - list_vm_response = list_virtual_machines( - self.apiclient - ) - self.assertEqual( - isinstance(list_vm_response, list), - True, - "Check list response returns a valid list" - ) - self.assertEqual( - len(list_vm_response), - 1, - "Check VM available in List Virtual Machines" - ) - - self.assertEqual( - list_vm_response[0].name, - self.virtual_machine_1B.name, - "Virtual Machine names do not match" - ) - - self.debug("Listing VM for account: %s" % self.account_2A.name) - - self.apiclient.connection.apiKey = self.user_2A_apikey - self.apiclient.connection.securityKey = self.user_2A_secretkey - list_vm_response = list_virtual_machines( - self.apiclient - ) - self.assertEqual( - isinstance(list_vm_response, list), - True, - "Check list response returns a valid list" - ) - self.assertEqual( - len(list_vm_response), - 1, - "Check VM available in List Virtual Machines" - ) - - self.assertEqual( - list_vm_response[0].name, - self.virtual_machine_2A.name, - "Virtual Machine names do not match" - ) - - return - - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) - def test_02_grant_domain_vm(self): - - # Validate the following - # 1. Grant domain2 VM access to account_1B - # 2. listVM command should return account_1B and domain_2 VMs. - - self.debug("Granting Domain %s VM read only access to account: %s" % (self.domain_2.name, self.account_1B.name)) - - self.srv_desk_grp.addAccount(self.apiclient, [self.account_1B]) - domain_permission = {} - domain_permission['action'] = "listVirtualMachines" - domain_permission['entitytype'] = "VirtualMachine" - domain_permission['scope'] = "DOMAIN" - domain_permission['scopeid'] = self.domain_2.id - self.vm_read_policy.addPermission(self.apiclient, domain_permission) - - self.debug("Listing VM for account: %s" % self.account_1B.name) - self.apiclient.connection.apiKey = self.user_1B_apikey - self.apiclient.connection.securityKey = self.user_1B_secretkey - list_vm_response = list_virtual_machines( - self.apiclient - ) - self.assertEqual( - isinstance(list_vm_response, list), - True, - "Check list response returns a valid list" - ) - self.assertEqual( - len(list_vm_response), - 2, - "Check VM available in List Virtual Machines" - ) - - list_vm_names = [list_vm_response[0].name, list_vm_response[1].name] - - self.assertEqual( self.virtual_machine_1B.name in list_vm_names, - True, - "Accessible Virtual Machine names do not match" - ) - - self.assertEqual( self.virtual_machine_2A.name in list_vm_names, - True, - "Accessible Virtual Machine names do not match" - ) - - return - - - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) - def test_03_grant_account_vm(self): - - # Validate the following - # 1. Grant account_1A VM access to account_1B - # 2. listVM command should return account_1A and account_1B VMs. - - self.debug("Granting Account %s VM read only access to account: %s" % (self.account_1A.name, self.account_1B.name)) - - account_permission = {} - account_permission['action'] = "listVirtualMachines" - account_permission['entitytype'] = "VirtualMachine" - account_permission['scope'] = "ACCOUNT" - account_permission['scopeid'] = self.account_1A.id - self.vm_read_policy.addPermission(self.apiclient, account_permission) - - self.debug("Listing VM for account: %s" % self.account_1B.name) - self.apiclient.connection.apiKey = self.user_1B_apikey - self.apiclient.connection.securityKey = self.user_1B_secretkey - list_vm_response = list_virtual_machines( - self.apiclient - ) - self.assertEqual( - isinstance(list_vm_response, list), - True, - "Check list response returns a valid list" - ) - self.assertEqual( - len(list_vm_response), - 3, - "Check VM available in List Virtual Machines" - ) - - list_vm_names = [list_vm_response[0].name, list_vm_response[1].name, list_vm_response[2].name] - - self.assertEqual( self.virtual_machine_1B.name in list_vm_names, - True, - "Accessible Virtual Machine names do not match" - ) - - self.assertEqual( self.virtual_machine_1A.name in list_vm_names, - True, - "Accessible Virtual Machine names do not match" - ) - - self.assertEqual( self.virtual_machine_2A.name in list_vm_names, - True, - "Accessible Virtual Machine names do not match" - ) - - return - - - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) - def test_04_revoke_account_vm(self): - - # Validate the following - # 1. Revoke account_1A VM access from account_1B - # 2. listVM command should not return account_1A VMs. - - self.debug("Revoking Account %s VM read only access from account: %s" % (self.account_1A.name, self.account_1B.name)) - - account_permission = {} - account_permission['action'] = "listVirtualMachines" - account_permission['entitytype'] = "VirtualMachine" - account_permission['scope'] = "ACCOUNT" - account_permission['scopeid'] = self.account_1A.id - self.vm_read_policy.removePermission(self.apiclient, account_permission) - - self.debug("Listing VM for account: %s" % self.account_1B.name) - self.apiclient.connection.apiKey = self.user_1B_apikey - self.apiclient.connection.securityKey = self.user_1B_secretkey - list_vm_response = list_virtual_machines( - self.apiclient - ) - self.assertEqual( - isinstance(list_vm_response, list), - True, - "Check list response returns a valid list" - ) - self.assertEqual( - len(list_vm_response), - 2, - "Check VM available in List Virtual Machines" - ) - - list_vm_names = [list_vm_response[0].name, list_vm_response[1].name] - - - self.assertEqual( self.virtual_machine_1A.name in list_vm_names, - False, - "Accessible Virtual Machine names do not match" - ) - return - - - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) - def test_05_revoke_domain_vm(self): - - # Validate the following - # 1. Revoke account_1A VM access from account_1B - # 2. listVM command should not return account_1A VMs. - - self.debug("Revoking Domain %s VM read only access from account: %s" % (self.domain_1.name, self.account_1B.name)) - - domain_permission = {} - domain_permission['action'] = "listVirtualMachines" - domain_permission['entitytype'] = "VirtualMachine" - domain_permission['scope'] = "DOMAIN" - domain_permission['scopeid'] = self.domain_2.id - self.vm_read_policy.removePermission(self.apiclient, domain_permission) - - self.debug("Listing VM for account: %s" % self.account_1B.name) - self.apiclient.connection.apiKey = self.user_1B_apikey - self.apiclient.connection.securityKey = self.user_1B_secretkey - list_vm_response = list_virtual_machines( - self.apiclient - ) - self.assertEqual( - isinstance(list_vm_response, list), - True, - "Check list response returns a valid list" - ) - self.assertEqual( - len(list_vm_response), - 1, - "Check VM available in List Virtual Machines" - ) - - self.assertEqual( - list_vm_response[0].name, - self.virtual_machine_1B.name, - "Virtual Machine names do not match" - ) - - return - - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) - def test_06_grant_resource_vm(self): - - # Validate the following - # 1. Grant a particular vm access to account_1B - # 2. listVM command should return account_1B VMs and granted VM. - - self.debug("Granting VM %s read only access to account: %s" % (self.virtual_machine_1A.name, self.account_1B.name)) - - res_permission = {} - res_permission['action'] = "listVirtualMachines" - res_permission['entitytype'] = "VirtualMachine" - res_permission['scope'] = "RESOURCE" - res_permission['scopeid'] = self.virtual_machine_1A.id - self.vm_read_policy.addPermission(self.apiclient, res_permission) - - self.debug("Listing VM for account: %s" % self.account_1B.name) - self.apiclient.connection.apiKey = self.user_1B_apikey - self.apiclient.connection.securityKey = self.user_1B_secretkey - list_vm_response = list_virtual_machines( - self.apiclient - ) - self.assertEqual( - isinstance(list_vm_response, list), - True, - "Check list response returns a valid list" - ) - self.assertEqual( - len(list_vm_response), - 2, - "Check VM available in List Virtual Machines" - ) - - list_vm_names = [list_vm_response[0].name, list_vm_response[1].name] - - self.assertEqual( self.virtual_machine_1B.name in list_vm_names, - True, - "Accessible Virtual Machine names do not match" - ) - - self.assertEqual( self.virtual_machine_1A.name in list_vm_names, - True, - "Accessible Virtual Machine names do not match" - ) - - return - - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) - def test_07_revoke_resource_vm(self): - - # Validate the following - # 1. Grant a particular vm access to account_1B - # 2. listVM command should return account_1B VMs and granted VM. - - self.debug("Revoking VM %s read only access from account: %s" % (self.virtual_machine_1A.name, self.account_1B.name)) - - res_permission = {} - res_permission['action'] = "listVirtualMachines" - res_permission['entitytype'] = "VirtualMachine" - res_permission['scope'] = "RESOURCE" - res_permission['scopeid'] = self.virtual_machine_1A.id - self.vm_read_policy.removePermission(self.apiclient, res_permission) - - self.debug("Listing VM for account: %s" % self.account_1B.id) - self.apiclient.connection.apiKey = self.user_1B_apikey - self.apiclient.connection.securityKey = self.user_1B_secretkey - list_vm_response = list_virtual_machines( - self.apiclient - ) - self.assertEqual( - isinstance(list_vm_response, list), - True, - "Check list response returns a valid list" - ) - self.assertEqual( - len(list_vm_response), - 1, - "Check VM available in List Virtual Machines" - ) - - self.assertEqual( - list_vm_response[0].name, - self.virtual_machine_1B.name, - "Virtual Machine names do not match" - ) - - return - - - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) - def test_08_policy_attach_account(self): - - # Validate the following - # 1. Grant a particular vm access to account_1B by directly attaching policy to account - # 2. listVM command should return account_1B VMs and granted VM. - - self.debug("Granting VM %s read only access to account: %s by attaching policy to account" % (self.virtual_machine_1A.name, self.account_1B.name)) - - res_permission = {} - res_permission['action'] = "listVirtualMachines" - res_permission['entitytype'] = "VirtualMachine" - res_permission['scope'] = "RESOURCE" - res_permission['scopeid'] = self.virtual_machine_1A.id - self.vm_grant_policy.addPermission(self.apiclient, res_permission) - self.vm_grant_policy.attachAccount(self.apiclient, [self.account_1B]) - - self.debug("Listing VM for account: %s" % self.account_1B.id) - self.apiclient.connection.apiKey = self.user_1B_apikey - self.apiclient.connection.securityKey = self.user_1B_secretkey - list_vm_response = list_virtual_machines( - self.apiclient - ) - self.assertEqual( - isinstance(list_vm_response, list), - True, - "Check list response returns a valid list" - ) - self.assertEqual( - len(list_vm_response), - 2, - "Check VM available in List Virtual Machines" - ) - - list_vm_names = [list_vm_response[0].name, list_vm_response[1].name] - - self.assertEqual( self.virtual_machine_1B.name in list_vm_names, - True, - "Accessible Virtual Machine names do not match" - ) - - self.assertEqual( self.virtual_machine_1A.name in list_vm_names, - True, - "Accessible Virtual Machine names do not match" - ) - - return - - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) - def test_09_policy_detach_account(self): - - # Validate the following - # 1. Revoking a particular vm access from account_1B by detaching policy from account - # 2. listVM command should return account_1B VMs. - - self.debug("Revoking VM %s read only access from account: %s by detaching policy from account" % (self.virtual_machine_1A.name, self.account_1B.name)) - - self.vm_grant_policy.detachAccount(self.apiclient, [self.account_1B]) - - self.debug("Listing VM for account: %s" % self.account_1B.id) - self.apiclient.connection.apiKey = self.user_1B_apikey - self.apiclient.connection.securityKey = self.user_1B_secretkey - list_vm_response = list_virtual_machines( - self.apiclient - ) - self.assertEqual( - isinstance(list_vm_response, list), - True, - "Check list response returns a valid list" - ) - self.assertEqual( - len(list_vm_response), - 1, - "Check VM available in List Virtual Machines" - ) - - self.assertEqual( - list_vm_response[0].name, - self.virtual_machine_1B.name, - "Virtual Machine names do not match" - ) - - return \ No newline at end of file From 497f5e53725c30442040805a3ad42a81ee926f50 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Tue, 20 May 2014 10:21:01 +0530 Subject: [PATCH 466/683] CLOUDSTACK-6712: NPE in findJobInstanceUuid() in ApiDBUtils --- server/src/com/cloud/api/ApiDBUtils.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java index a953cd645e..153d99811e 100755 --- a/server/src/com/cloud/api/ApiDBUtils.java +++ b/server/src/com/cloud/api/ApiDBUtils.java @@ -1442,6 +1442,12 @@ public static String findJobInstanceUuid(AsyncJob job) { String jobInstanceId = null; ApiCommandJobType jobInstanceType = EnumUtils.fromString(ApiCommandJobType.class, job.getInstanceType(), ApiCommandJobType.None); + if (job.getInstanceId() == null) { + // when assert is hit, implement 'getInstanceId' of BaseAsyncCmd and return appropriate instance id + assert (false); + return null; + } + if (jobInstanceType == ApiCommandJobType.Volume) { VolumeVO volume = ApiDBUtils.findVolumeById(job.getInstanceId()); if (volume != null) { From 45f6bac727bf6631153ac8e17dd7b074759052eb Mon Sep 17 00:00:00 2001 From: Jayapal Date: Tue, 20 May 2014 11:11:15 +0530 Subject: [PATCH 467/683] CLOUDSTACK-6714: monitor script echo service command is added with quotes --- systemvm/patches/debian/config/opt/cloud/bin/monitor_service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/monitor_service.sh b/systemvm/patches/debian/config/opt/cloud/bin/monitor_service.sh index a5e704d4db..dfc6463bab 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/monitor_service.sh +++ b/systemvm/patches/debian/config/opt/cloud/bin/monitor_service.sh @@ -45,7 +45,7 @@ processname=$(echo $s | cut -d: -f2); service_name=$(echo $s | cut -d: -f3); pidfile=$(echo $s | cut -d: -f4); -echo $service >> $configFile; +echo "$service" >> $configFile; echo $processname >> $configFile echo $service_name >> $configFile echo $pidfile >> $configFile From f278c537d527aa0a9cf0e20cf80dd48e1d85ec82 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Mon, 19 May 2014 21:48:17 -0700 Subject: [PATCH 468/683] Removing tests related to sparse and fat volume provisioning from 4.4-forward. This feature is not part of 4.4 release. --- test/integration/smoke/test_disk_offerings.py | 81 ------------------- test/integration/smoke/test_volumes.py | 16 ---- 2 files changed, 97 deletions(-) diff --git a/test/integration/smoke/test_disk_offerings.py b/test/integration/smoke/test_disk_offerings.py index 780c154270..45f438fb0c 100644 --- a/test/integration/smoke/test_disk_offerings.py +++ b/test/integration/smoke/test_disk_offerings.py @@ -89,87 +89,6 @@ def test_01_create_disk_offering(self): ) return - @attr(hypervisor="kvm") - @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke"]) - def test_02_create_sparse_type_disk_offering(self): - """Test to create a sparse type disk offering""" - - # Validate the following: - # 1. createDiskOfferings should return valid info for new offering - # 2. The Cloud Database contains the valid information - - disk_offering = DiskOffering.create( - self.apiclient, - self.services["sparse"] - ) - self.cleanup.append(disk_offering) - - self.debug("Created Disk offering with ID: %s" % disk_offering.id) - - list_disk_response = list_disk_offering( - self.apiclient, - id=disk_offering.id - ) - self.assertEqual( - isinstance(list_disk_response, list), - True, - "Check list response returns a valid list" - ) - self.assertNotEqual( - len(list_disk_response), - 0, - "Check Disk offering is created" - ) - disk_response = list_disk_response[0] - - self.assertEqual( - disk_response.provisioningtype, - self.services["sparse"]["provisioningtype"], - "Check provisionig type in createServiceOffering" - ) - return - - - @attr(hypervisor="kvm") - @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke"]) - def test_04_create_fat_type_disk_offering(self): - """Test to create a sparse type disk offering""" - - # Validate the following: - # 1. createDiskOfferings should return valid info for new offering - # 2. The Cloud Database contains the valid information - - disk_offering = DiskOffering.create( - self.apiclient, - self.services["fat"] - ) - self.cleanup.append(disk_offering) - - self.debug("Created Disk offering with ID: %s" % disk_offering.id) - - list_disk_response = list_disk_offering( - self.apiclient, - id=disk_offering.id - ) - self.assertEqual( - isinstance(list_disk_response, list), - True, - "Check list response returns a valid list" - ) - self.assertNotEqual( - len(list_disk_response), - 0, - "Check Disk offering is created" - ) - disk_response = list_disk_response[0] - - self.assertEqual( - disk_response.provisioningtype, - self.services["fat"]["provisioningtype"], - "Check provisionig type in createServiceOffering" - ) - return - class TestDiskOfferings(cloudstackTestCase): def setUp(self): diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index a151df9435..c8fc26b515 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -58,10 +58,6 @@ def setUpClass(cls): cls.apiclient, cls.services["disk_offering"] ) - cls.sparse_disk_offering = DiskOffering.create( - cls.apiclient, - cls.services["sparse_disk_offering"] - ) cls.custom_disk_offering = DiskOffering.create( cls.apiclient, cls.services["disk_offering"], @@ -133,18 +129,6 @@ def test_01_create_volume(self): self.debug("Created a volume with ID: %s" % volume.id) self.volumes.append(volume) - if self.virtual_machine.hypervisor == "KVM": - sparse_volume = Volume.create( - self.apiClient, - self.services, - zoneid=self.zone.id, - account=self.account.name, - domainid=self.account.domainid, - diskofferingid=self.sparse_disk_offering.id - ) - self.debug("Created a sparse volume: %s" % sparse_volume.id) - self.volumes.append(sparse_volume) - volume = Volume.create_custom_disk( self.apiClient, self.services, From 6fa5b3b8fde5e57b17a0894a3b479042baf425a4 Mon Sep 17 00:00:00 2001 From: Joris van Lieshout Date: Tue, 20 May 2014 11:02:14 +0200 Subject: [PATCH 469/683] A slightly more reliable way of extracting the device name. Thanks John. Signed-off-by: Daan Hoogland --- systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh b/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh index c1046c6dda..a07f40d1fd 100755 --- a/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh +++ b/systemvm/patches/debian/config/opt/cloud/bin/edithosts.sh @@ -99,7 +99,7 @@ if [ $dnsmasq_managed_lease ] then #release previous dhcp lease if present logger -t cloud "edithosts: releasing $ipv4" - dhcp_release $(ip route get "$ipv4/32" | tr " " "\n" | grep eth) $ipv4 $(grep "$ipv4 " $DHCP_LEASES | awk '{print $2}') > /dev/null 2>&1 + dhcp_release $(ip route get "$ipv4/32" | grep " dev " | sed -e "s/^.* dev \([^ ]*\) .*$/\1/g") $ipv4 $(grep "$ipv4 " $DHCP_LEASES | awk '{print $2}') > /dev/null 2>&1 logger -t cloud "edithosts: released $ipv4" fi From a1892842b9ab6f697e6e541f9800eda148d504de Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Tue, 20 May 2014 16:49:51 +0530 Subject: [PATCH 470/683] CLOUDSTACK-6720: Async job events are not published on event bus fix ensures publishOnEventBus() is called on submit, update, complete phase of job procesing --- .../framework/jobs/impl/AsyncJobManagerImpl.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java index 24abcbe868..c6dd73274f 100644 --- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java +++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java @@ -172,6 +172,7 @@ public long submitAsyncJob(AsyncJob job, boolean scheduleJobExecutionInContext) job.setSyncSource(null); // no sync source originally dao.persist(job); + publishOnEventBus(job, "submit"); scheduleExecution(job, scheduleJobExecutionInContext); if (s_logger.isDebugEnabled()) { s_logger.debug("submit async job-" + job.getId() + ", details: " + job.toString()); @@ -193,6 +194,7 @@ public Long doInTransaction(TransactionStatus status) { job.setInitMsid(getMsid()); dao.persist(job); + publishOnEventBus(job, "submit"); syncAsyncJobExecution(job, syncObjType, syncObjId, 1); return job.getId(); @@ -230,6 +232,7 @@ public void completeAsyncJob(final long jobId, final Status jobStatus, final int return; } + publishOnEventBus(job, "complete"); // publish before the instance type and ID are wiped out List wakeupList = Transaction.execute(new TransactionCallback>() { @Override public List doInTransaction(TransactionStatus status) { @@ -287,6 +290,7 @@ public void updateAsyncJobStatus(final long jobId, final int processStatus, fina return; } + publishOnEventBus(job, "update"); Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) { @@ -307,6 +311,9 @@ public void updateAsyncJobAttachment(final long jobId, final String instanceType s_logger.debug("Update async-job attachment, job-" + jobId + ", instanceType: " + instanceType + ", instanceId: " + instanceId); } + final AsyncJobVO job = _jobDao.findById(jobId); + publishOnEventBus(job, "update"); + Transaction.execute(new TransactionCallbackNoReturn() { @Override public void doInTransactionWithoutResult(TransactionStatus status) { From c5d48c05307c0bceb17cae78976595f814b3aba3 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Tue, 20 May 2014 16:56:03 +0530 Subject: [PATCH 471/683] CLOUDSTACK-6721: VolumeApiServiceImpl is sending wrong type for updateAsyncJobAttachment fix sends 'Volume' instead of 'volume' --- server/src/com/cloud/storage/VolumeApiServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index 16502405b4..152531571b 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -1211,7 +1211,7 @@ public Volume attachVolumeToVM(Long vmId, Long volumeId, Long deviceId) { s_logger.info("Trying to attaching volume " + volumeId + " to vm instance:" + vm.getId() + ", update async job-" + job.getId() + " progress status"); } - _asyncMgr.updateAsyncJobAttachment(job.getId(), "volume", volumeId); + _asyncMgr.updateAsyncJobAttachment(job.getId(), "Volume", volumeId); } VolumeVO newVol = _volumeDao.findById(volumeOnPrimaryStorage.getId()); @@ -1377,7 +1377,7 @@ public Volume detachVolumeFromVM(DetachVolumeCmd cmmd) { s_logger.info("Trying to attaching volume " + volumeId + "to vm instance:" + vm.getId() + ", update async job-" + job.getId() + " progress status"); } - _asyncMgr.updateAsyncJobAttachment(job.getId(), "volume", volumeId); + _asyncMgr.updateAsyncJobAttachment(job.getId(), "Volume", volumeId); } AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext(); From 02f769c4d564ef8540e3fd5e704879adc7c9a845 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Tue, 20 May 2014 20:30:48 +0530 Subject: [PATCH 472/683] Fixing issues in regression test suite test_accounts.py --- test/integration/component/test_accounts.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index 98a1aa10c3..9b9ae75372 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -476,7 +476,8 @@ def test_01_non_root_admin_Privileges(self): accounts_response = list_accounts( self.apiclient, - domainid=self.domain.id + domainid=self.domain.id, + listall=True ) self.assertEqual( @@ -1681,15 +1682,13 @@ def test_forceDeleteDomain(self): %s" % (ERROR_CODE_530, str(response))) self.debug("Checking if the resources in domain are deleted") - response = Account.list( + with self.assertRaises(Exception): + response = Account.list( self.apiclient, name=self.account_1.name, domainid=self.account_1.domainid, listall=True ) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) return @attr(tags=["domains", "advanced", "advancedns", "simulator", "selfservice"]) From c7f5077ab18031e5601eb04f1ff7010b214861fe Mon Sep 17 00:00:00 2001 From: santhosh Date: Wed, 21 May 2014 00:22:17 +1000 Subject: [PATCH 473/683] Fixed Regression issues mentioned under CLOUDSTACK-6708 Signed-off-by: santhosh --- test/integration/smoke/test_deploy_vm.py | 5 +-- test/integration/smoke/test_hosts.py | 25 ++++++----- test/integration/smoke/test_network.py | 26 +++++------ test/integration/smoke/test_routers.py | 46 ++++++++------------ test/integration/smoke/test_vm_life_cycle.py | 8 ++-- 5 files changed, 47 insertions(+), 63 deletions(-) diff --git a/test/integration/smoke/test_deploy_vm.py b/test/integration/smoke/test_deploy_vm.py index 473b020280..db269805c5 100644 --- a/test/integration/smoke/test_deploy_vm.py +++ b/test/integration/smoke/test_deploy_vm.py @@ -42,7 +42,6 @@ def setUp(self): self.apiclient = self.testClient.getApiClient() self.testdata = self.testClient.getParsedTestDataConfig() - # Get Zone, Domain and Default Built-in template self.domain = get_domain(self.apiclient) self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests()) @@ -116,7 +115,7 @@ def test_deploy_vm_multiple(self): """Test Multiple Deploy Virtual Machine # Validate the following: - # 1. deploy 2 virtual machines + # 1. deploy 2 virtual machines # 2. listVirtualMachines using 'ids' parameter returns accurate information """ self.virtual_machine = VirtualMachine.create( @@ -206,7 +205,7 @@ def setUp(self): self.mock_volume_failure ] - @attr(tags = ['selfservice']) + @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6708") def test_deploy_vm_volume_creation_failure(self): """Test Deploy Virtual Machine - volume creation failure and retry diff --git a/test/integration/smoke/test_hosts.py b/test/integration/smoke/test_hosts.py index 52827aa7fe..7798c8eb3d 100644 --- a/test/integration/smoke/test_hosts.py +++ b/test/integration/smoke/test_hosts.py @@ -5,9 +5,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -23,6 +23,7 @@ from marvin.lib.utils import * from marvin.lib.base import * from marvin.lib.common import * +from marvin.lib.utils import (random_gen) from nose.plugins.attrib import attr #Import System modules @@ -66,21 +67,22 @@ def test_01_clusters(self): #Create clusters with Hypervisor type Simulator/XEN/KVM/VWare """ for k, v in self.services["clusters"].items(): + v["clustername"] = v["clustername"] + "-" + random_gen() cluster = Cluster.create( self.apiclient, v, zoneid=self.zone.id, podid=self.pod.id, - hypervisor=self.hypervisor + hypervisor=v["hypervisor"].lower() ) self.debug( "Created Cluster for hypervisor type %s & ID: %s" %( v["hypervisor"], - cluster.id + cluster.id )) self.assertEqual( - cluster.hypervisortype, - v["hypervisor"], + cluster.hypervisortype.lower(), + v["hypervisor"].lower(), "Check hypervisor type is " + v["hypervisor"] + " or not" ) self.assertEqual( @@ -103,7 +105,7 @@ def test_01_clusters(self): self.services["hosts"][hypervisor_type], zoneid=self.zone.id, podid=self.pod.id, - hypervisor=self.hypervisor + hypervisor=v["hypervisor"].lower() ) if host == FAILED: self.fail("Host Creation Failed") @@ -112,9 +114,8 @@ def test_01_clusters(self): host.id, cluster.id )) - - #Cleanup Host & Cluster - self.cleanup.append(host) + #Cleanup Host & Cluster + self.cleanup.append(host) self.cleanup.append(cluster) list_hosts_response = list_hosts( @@ -162,8 +163,8 @@ def test_01_clusters(self): "Check cluster ID with list clusters response" ) self.assertEqual( - cluster_response.hypervisortype, - cluster.hypervisortype, + cluster_response.hypervisortype.lower(), + cluster.hypervisortype.lower(), "Check hypervisor type with is " + v["hypervisor"] + " or not" ) return diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index b82501c695..7cd3973b00 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -5,9 +5,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -160,16 +160,10 @@ def test_public_ip_admin_account(self): self.apiclient, id=ip_address.ipaddress.id ) - self.assertEqual( - isinstance(list_pub_ip_addr_resp, list), - True, - "Check list response returns a valid list" - ) - self.assertEqual( - len(list_pub_ip_addr_resp), - 0, - "Check if the list public ip api response is not zero" - ) + if list_pub_ip_addr_resp is None: + return + if (list_pub_ip_addr_resp) and (isinstance(list_pub_ip_addr_resp, list)) and (len(list_pub_ip_addr_resp) > 0): + self.fail("list public ip response is not empty") return @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"]) @@ -328,7 +322,7 @@ def test_01_port_fwd_on_src_nat(self): 'Running', "VM state should be Running before creating a NAT rule." ) - # Open up firewall port for SSH + # Open up firewall port for SSH fw_rule = FireWallRule.create( self.apiclient, ipaddressid=src_nat_ip_addr.id, @@ -381,7 +375,7 @@ def test_01_port_fwd_on_src_nat(self): ) if vm_response[0].state != 'Running': self.fail("State of VM : %s is not found to be Running" % str(self.virtual_machine.ipaddress)) - + except Exception as e: self.fail( "SSH Access failed for %s: %s" % \ @@ -452,7 +446,7 @@ def test_02_port_fwd_on_non_src_nat(self): 'Running', "VM state should be Running before creating a NAT rule." ) - # Open up firewall port for SSH + # Open up firewall port for SSH fw_rule = FireWallRule.create( self.apiclient, ipaddressid=ip_address.ipaddress.id, @@ -789,7 +783,7 @@ def test_releaseIP(self): self.ip_address.delete(self.apiclient) - # Sleep to ensure that deleted state is reflected in other calls + # Sleep to ensure that deleted state is reflected in other calls time.sleep(self.services["sleep"]) # ListPublicIpAddresses should not list deleted Public IP address diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py index f77a051c03..d503af1896 100644 --- a/test/integration/smoke/test_routers.py +++ b/test/integration/smoke/test_routers.py @@ -5,9 +5,9 @@ # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -184,9 +184,6 @@ def test_01_router_internal_basic(self): return - - - @attr(tags = ["advanced", "smoke", "provisioning"]) def test_02_router_internal_adv(self): """Test router internal advanced zone @@ -208,7 +205,6 @@ def test_02_router_internal_adv(self): True, "Check list response returns a valid list" ) - router = list_router_response[0] hosts = list_hosts( @@ -257,7 +253,6 @@ def test_02_router_internal_adv(self): self.skipTest("Marvin configuration has no host credentials to check router services") res = str(result) self.debug("Dnsmasq process status: %s" % res) - self.assertEqual( res.count("running"), 1, @@ -469,7 +464,6 @@ def test_04_restart_network_wo_cleanup(self): ) except KeyError: self.skipTest("Marvin configuration has no host credentials to check router services") - # res = 12:37:14 up 1 min, 0 users, load average: 0.61, 0.22, 0.08 # Split result to check the uptime result = res[0].split() @@ -664,7 +658,6 @@ def test_07_stop_router(self): "Check list response returns a valid list" ) router = list_router_response[0] - self.debug("Stopping the router with ID: %s" % router.id) #Stop the router cmd = stopRouter.stopRouterCmd() @@ -737,6 +730,13 @@ def test_08_start_router(self): ) return + def verifyRouterResponse(self,router_response,ip): + if (router_response) and (isinstance(router_response, list)) and \ + (router_response[0].state == "Running") and \ + (router_response[0].publicip == ip): + return True + return False + @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"]) def test_09_reboot_router(self): """Test reboot router @@ -761,33 +761,23 @@ def test_09_reboot_router(self): public_ip = router.publicip self.debug("Rebooting the router with ID: %s" % router.id) - #Reboot the router cmd = rebootRouter.rebootRouterCmd() cmd.id = router.id self.apiclient.rebootRouter(cmd) #List routers to check state of router - router_response = list_routers( + retries_cnt = 6 + while retries_cnt >= 0: + router_response = list_routers( self.apiclient, id=router.id, listall=True ) - self.assertEqual( - isinstance(router_response, list), - True, - "Check list response returns a valid list" - ) - #List router should have router in running state and same public IP - self.assertEqual( - router_response[0].state, - 'Running', - "Check list router response for router state" - ) - - self.assertEqual( - router_response[0].publicip, - public_ip, - "Check list router response for router public IP" - ) + if self.verifyRouterResponse(router_response,public_ip): + self.debug("Router is running successfully after reboot") + return + time.sleep(10) + retries_cnt = retries_cnt - 1 + self.fail("Router response after reboot is either is invalid or in stopped state") return diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py index fea3ddebc0..85033c5e66 100644 --- a/test/integration/smoke/test_vm_life_cycle.py +++ b/test/integration/smoke/test_vm_life_cycle.py @@ -498,14 +498,14 @@ def test_08_migrate_vm(self): # For XenServer and VMware, migration is possible between hosts belonging to different clusters # with the help of XenMotion and Vmotion respectively. - if hypervisor == "kvm": + if hypervisor.lower() in ["kvm","simulator"]: #identify suitable host clusters = [h.clusterid for h in hosts] #find hosts withe same clusterid clusters = [cluster for index, cluster in enumerate(clusters) if clusters.count(cluster) > 1] if len(clusters) <= 1: - self.skipTest("In KVM, Live Migration needs two hosts within same cluster") + self.skipTest("In " + hypervisor.lower() + " Live Migration needs two hosts within same cluster") suitable_hosts = [host for host in hosts if host.clusterid == clusters[0]] else: @@ -558,7 +558,7 @@ def test_08_migrate_vm(self): @attr(configuration = "expunge.interval") @attr(configuration = "expunge.delay") - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"],BugId="CLOUDSTACK-6708") def test_09_expunge_vm(self): """Test destroy(expunge) Virtual Machine """ @@ -586,7 +586,7 @@ def test_09_expunge_vm(self): name='expunge.interval' ) expunge_cycle = int(config[0].value) - wait_time = expunge_cycle * 2 + wait_time = expunge_cycle * 4 while wait_time >= 0: list_vm_response = VirtualMachine.list( self.apiclient, From 22f503aa2b0b866bd10c41b8f886984451730c40 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 20 May 2014 15:50:27 -0700 Subject: [PATCH 474/683] CLOUDSTACK-6729: UI - create compute offering/create disk offering - determine whether to pass certain data to API comamnd upon isCustomized checkbox/isPublic checkbox's value. --- ui/scripts/configuration.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index 53cd0c3257..3823109134 100644 --- a/ui/scripts/configuration.js +++ b/ui/scripts/configuration.js @@ -507,21 +507,17 @@ }; //custom fields (begin) - if (args.$form.find('.form-item[rel=cpuNumber]').css("display") != "none") { + if (args.data.isCustomized != "on") { $.extend(data, { cpuNumber: args.data.cpuNumber }); - } - if (args.$form.find('.form-item[rel=cpuSpeed]').css("display") != "none") { $.extend(data, { cpuSpeed: args.data.cpuSpeed }); - } - if (args.$form.find('.form-item[rel=memory]').css("display") != "none") { $.extend(data, { memory: args.data.memory }); - } + } //custom fields (end) if (args.data.deploymentPlanner != null && args.data.deploymentPlanner.length > 0) { @@ -628,7 +624,7 @@ isvolatile: (args.data.isVolatile == "on") }); - if (args.$form.find('.form-item[rel=domainId]').css("display") != "none") { + if (args.data.isPublic != "on") { $.extend(data, { domainid: args.data.domainId }); @@ -1173,7 +1169,7 @@ limitcpuuse: (args.data.cpuCap == "on") }); - if (args.$form.find('.form-item[rel=domainId]').css("display") != "none") { + if (args.data.isPublic != "on") { $.extend(data, { domainid: args.data.domainId }); @@ -1732,7 +1728,7 @@ customized: (args.data.isCustomized == "on") }; - if (args.$form.find('.form-item[rel=disksize]').css("display") != "none") { + if (args.data.isCustomized != "on") { $.extend(data, { disksize: args.data.disksize }); @@ -1796,7 +1792,7 @@ }); } - if (args.$form.find('.form-item[rel=domainId]').css("display") != "none") { + if (args.data.isPublic != "on") { $.extend(data, { domainid: args.data.domainId }); From e5de1cb7c2ad98307edf4983ffe7b23be5f12d3b Mon Sep 17 00:00:00 2001 From: santhosh Date: Wed, 21 May 2014 19:59:44 +1000 Subject: [PATCH 475/683] CLOUDSTACK-6736: Added version informatoin, fixed data corruption, regression issues. Signed-off-by: Jayapal --- test/integration/smoke/test_deploy_vm.py | 3 +- .../smoke/test_guest_vlan_range.py | 8 +-- test/integration/smoke/test_hosts.py | 2 +- test/integration/smoke/test_vm_life_cycle.py | 52 +++++++------------ tools/marvin/marvin/cloudstackTestClient.py | 4 +- tools/marvin/setup.py | 8 +-- 6 files changed, 30 insertions(+), 47 deletions(-) diff --git a/test/integration/smoke/test_deploy_vm.py b/test/integration/smoke/test_deploy_vm.py index db269805c5..a8e406d322 100644 --- a/test/integration/smoke/test_deploy_vm.py +++ b/test/integration/smoke/test_deploy_vm.py @@ -85,7 +85,8 @@ def test_deploy_vm(self): serviceofferingid=self.service_offering.id, templateid=self.template.id ) - + if not self.virtual_machine: + self.fail("Deploying a Virtual Machine Failed") list_vms = VirtualMachine.list(self.apiclient, id=self.virtual_machine.id) self.debug( "Verify listVirtualMachines response for virtual machine: %s"\ diff --git a/test/integration/smoke/test_guest_vlan_range.py b/test/integration/smoke/test_guest_vlan_range.py index bfef4a8e65..f5bcdf4c6e 100644 --- a/test/integration/smoke/test_guest_vlan_range.py +++ b/test/integration/smoke/test_guest_vlan_range.py @@ -31,7 +31,7 @@ class TestDedicateGuestVlanRange(cloudstackTestCase): @classmethod def setUpClass(cls): testClient = super(TestDedicateGuestVlanRange, cls).getClsTestClient() - cls.apiclient = testClient.getApiClient() + cls.apiclient = testClient.getApiClient() cls.services = testClient.getParsedTestDataConfig() # Get Zone, Domain @@ -78,7 +78,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags=["simulator", "advanced", "guestvlanrange", "dedicate", "release", "selfservice"]) + @attr(tags=["simulator", "advanced", "guestvlanrange", "dedicate", "release", "selfservice"],BugId="CLOUDSTACK-6738") def test_dedicateGuestVlanRange(self): """Test guest vlan range dedication """ @@ -97,11 +97,7 @@ def test_dedicateGuestVlanRange(self): """ self.debug("Adding guest vlan range") - - print "existing vlna = %s" %self.physical_network.vlan - print "free vlan = %s" %self.free_vlan new_vlan = self.physical_network.vlan + "," + self.free_vlan["partial_range"][0] - print "new vlan = %s" % new_vlan #new_vlan = self.free_vlan["partial_range"][0] addGuestVlanRangeResponse = self.physical_network.update(self.apiclient, id=self.physical_network.id, vlan=new_vlan) diff --git a/test/integration/smoke/test_hosts.py b/test/integration/smoke/test_hosts.py index 7798c8eb3d..952f160094 100644 --- a/test/integration/smoke/test_hosts.py +++ b/test/integration/smoke/test_hosts.py @@ -53,7 +53,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags=["selfservice"]) + #@attr(tags=["selfservice"]) def test_01_clusters(self): """Test Add clusters & hosts - simulator diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py index 85033c5e66..1e565718a0 100644 --- a/test/integration/smoke/test_vm_life_cycle.py +++ b/test/integration/smoke/test_vm_life_cycle.py @@ -531,34 +531,24 @@ def test_08_migrate_vm(self): self.vm_to_migrate.migrate(self.apiclient, migrate_host.id) - list_vm_response = VirtualMachine.list( - self.apiclient, - id=self.vm_to_migrate.id - ) - self.assertNotEqual( - list_vm_response, - None, - "Check virtual machine is listed" - ) - - vm_response = list_vm_response[0] - - self.assertEqual( - vm_response.id, - self.vm_to_migrate.id, - "Check virtual machine ID of migrated VM" - ) - - self.assertEqual( - vm_response.hostid, - migrate_host.id, - "Check destination hostID of migrated VM" - ) + retries_cnt = 3 + while retries_cnt >=0: + list_vm_response = VirtualMachine.list(self.apiclient, + id=self.vm_to_migrate.id) + self.assertNotEqual( + list_vm_response, + None, + "Check virtual machine is listed" + ) + vm_response = list_vm_response[0] + self.assertEqual(vm_response.id,self.vm_to_migrate.id,"Check virtual machine ID of migrated VM") + self.assertEqual(vm_response.hostid,migrate_host.id,"Check destination hostID of migrated VM") + retries_cnt = retries_cnt - 1 return @attr(configuration = "expunge.interval") @attr(configuration = "expunge.delay") - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"],BugId="CLOUDSTACK-6708") + @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"],BugId="CLOUDSTACK-6738") def test_09_expunge_vm(self): """Test destroy(expunge) Virtual Machine """ @@ -592,19 +582,15 @@ def test_09_expunge_vm(self): self.apiclient, id=self.small_virtual_machine.id ) - if list_vm_response: - time.sleep(expunge_cycle) - wait_time = wait_time - expunge_cycle - else: + if not list_vm_response: break + self.debug("Waiting for VM to expunge") + time.sleep(expunge_cycle) + wait_time = wait_time - expunge_cycle self.debug("listVirtualMachines response: %s" % list_vm_response) - self.assertEqual( - list_vm_response, - None, - "Check Expunged virtual machine is in listVirtualMachines response" - ) + self.assertEqual(list_vm_response,None,"Check Expunged virtual machine is in listVirtualMachines response") return @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "provisioning"]) diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py index 86b0a4bbd5..807ca5de9e 100644 --- a/tools/marvin/marvin/cloudstackTestClient.py +++ b/tools/marvin/marvin/cloudstackTestClient.py @@ -25,6 +25,7 @@ from marvin.cloudstackException import GetDetailExceptionInfo from marvin.lib.utils import (random_gen, validateList) from marvin.cloudstackAPI.cloudstackAPIClient import CloudStackAPIClient +import copy class CSTestClient(object): @@ -83,8 +84,7 @@ def getParsedTestDataConfig(self): Tests are to Run @Output : Returns the Parsed Test Data Dictionary ''' - out = self.__parsedTestDataConfig - return out + return copy.deepcopy(self.__parsedTestDataConfig) def getZoneForTests(self): ''' diff --git a/tools/marvin/setup.py b/tools/marvin/setup.py index 4c775ad614..b7a927e081 100644 --- a/tools/marvin/setup.py +++ b/tools/marvin/setup.py @@ -52,10 +52,10 @@ def read(fname): "marvin.sandbox.basic"], license="LICENSE.txt", install_requires=[ - "mysql-connector-python", - "requests", - "paramiko", - "nose", + "mysql-connector-python >= 1.1.6", + "requests >= 2.2.1", + "paramiko >= 1.13.0", + "nose >= 1.3.3", "ddt >= 0.4.0" ], py_modules=['marvin.marvinPlugin'], From 751f0ac5185c832b30e65d271af8d08469202329 Mon Sep 17 00:00:00 2001 From: Doug Clark Date: Wed, 21 May 2014 11:36:11 +0000 Subject: [PATCH 476/683] Fix for Marvin utils.py:checkVolumeSize Fix for test_01_create_volume to use the correct volume name for XenServer Signed-off-by: SrikanteswaraRao Talluri --- test/integration/smoke/test_volumes.py | 13 +++++++++++-- tools/marvin/marvin/lib/utils.py | 5 ++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index c8fc26b515..cc76e49059 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -33,7 +33,7 @@ get_zone, get_template) from marvin.lib.utils import checkVolumeSize -from marvin.codes import SUCCESS, FAILED, ERROR_CODE_530 +from marvin.codes import SUCCESS, FAILED, ERROR_CODE_530, XEN_SERVER from nose.plugins.attrib import attr #Import System modules import os @@ -197,7 +197,16 @@ def test_01_create_volume(self): ssh = self.virtual_machine.get_ssh_client( reconnect=True ) - ret = checkVolumeSize(ssh_handle=ssh,size_to_verify=vol_sz) + # Get the updated volume information + list_volume_response = Volume.list( + self.apiClient, + id=volume.id) + if list_volume_response[0].hypervisor.lower() == XEN_SERVER.lower(): + volume_name = "/dev/xvd" + chr(ord('a') + int(list_volume_response[0].deviceid)) + self.debug(" Using XenServer volume_name: %s" % (volume_name)) + ret = checkVolumeSize(ssh_handle=ssh,volume_name=volume_name,size_to_verify=vol_sz) + else: + ret = checkVolumeSize(ssh_handle=ssh,size_to_verify=vol_sz) self.debug(" Volume Size Expected %s Actual :%s" %(vol_sz,ret[1])) self.virtual_machine.detach_volume(self.apiClient, volume) self.assertEqual(ret[0],SUCCESS,"Check if promised disk size actually available") diff --git a/tools/marvin/marvin/lib/utils.py b/tools/marvin/marvin/lib/utils.py index 4194e32da3..60a15ea9a9 100644 --- a/tools/marvin/marvin/lib/utils.py +++ b/tools/marvin/marvin/lib/utils.py @@ -502,10 +502,9 @@ def checkVolumeSize(ssh_handle=None, fdisk_output = ssh_handle.runCommand(cmd_inp) if fdisk_output["status"] != SUCCESS: return FAILED - temp_out = fdisk_output["stdout"] - for line in temp_out.split("\n"): + for line in fdisk_output["stdout"]: if volume_name in line: - parts = line.split() + parts = line.strip().split() if str(parts[-2]) == str(size_to_verify): return [SUCCESS, str(parts[-2])] return [FAILED, "Volume Not Found"] From 7bbad0491f7ec087f693814caadbe6d648d2edf2 Mon Sep 17 00:00:00 2001 From: Amogh Vasekar Date: Wed, 21 May 2014 08:26:15 -0700 Subject: [PATCH 477/683] CLOUDSTACK-6671: Fixing NPE when a mapping is missing Adding missing KVM mappings Testing Done: Local testing with removing CentOS mapping and launch a VM. Signed-off-by: Nitin Mehta --- .../com/cloud/hypervisor/XenServerGuru.java | 6 ++++- server/src/com/cloud/hypervisor/KVMGuru.java | 6 ++++- setup/db/db/schema-430to440.sql | 22 ++++++++++++++++++- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java index 620d7113f4..c10f4a0ba1 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java @@ -93,7 +93,11 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) { to.setOs(guestOS.getDisplayName()); HostVO host = hostDao.findById(vm.getVirtualMachine().getHostId()); GuestOSHypervisorVO guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), getHypervisorType().toString(), host.getHypervisorVersion()); - to.setPlatformEmulator(guestOsMapping.getGuestOsName()); + if (guestOsMapping == null) { + to.setPlatformEmulator(null); + } else { + to.setPlatformEmulator(guestOsMapping.getGuestOsName()); + } return to; } diff --git a/server/src/com/cloud/hypervisor/KVMGuru.java b/server/src/com/cloud/hypervisor/KVMGuru.java index 4225232064..287b0d2f1e 100644 --- a/server/src/com/cloud/hypervisor/KVMGuru.java +++ b/server/src/com/cloud/hypervisor/KVMGuru.java @@ -61,7 +61,11 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) { to.setOs(guestOS.getDisplayName()); HostVO host = _hostDao.findById(vm.getVirtualMachine().getHostId()); GuestOSHypervisorVO guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), getHypervisorType().toString(), host.getHypervisorVersion()); - to.setPlatformEmulator(guestOsMapping.getGuestOsName()); + if (guestOsMapping == null) { + to.setPlatformEmulator(null); + } else { + to.setPlatformEmulator(guestOsMapping.getGuestOsName()); + } return to; } diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index 89db04a2e9..7fa93e78d9 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -1674,4 +1674,24 @@ CREATE TABLE `cloud`.`network_acl_item_cidrs` ( ALTER TABLE `cloud`.`load_balancer_healthcheck_policies` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the policy can be displayed to the end user'; ALTER TABLE `cloud`.`load_balancer_stickiness_policies` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the policy can be displayed to the end user'; - +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'CentOS 5 (64-bit)', 140, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Red Hat Enterprise Linux 6.0', 136, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Red Hat Enterprise Linux 6.0', 137, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Ubuntu 12.04', 164, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Ubuntu 10.10', 156, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Ubuntu 10.10', 157, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Debian GNU/Linux 5', 72, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Debian GNU/Linux 5', 15, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Debian GNU/Linux 6', 133, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Debian GNU/Linux 6', 132, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Other Linux', 69, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Other Linux', 70, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Windows Server 2008', 54, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Windows 2000', 105, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Windows NT', 64, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Windows 3.1', 65, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Other PV', 160, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'FreeBSD 10', 225, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'FreeBSD 10', 226, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Other PV', 139, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Other PV', 140, now(), 0); From 8c5a9ec4de2745aae551938dbf37ca459ec0297f Mon Sep 17 00:00:00 2001 From: Anthony Xu Date: Wed, 21 May 2014 14:33:52 -0700 Subject: [PATCH 478/683] if networkID is not specified, get one network with free ips. --- api/src/com/cloud/network/NetworkModel.java | 4 ++- .../com/cloud/network/NetworkModelImpl.java | 25 +++++++++++++++++++ .../src/com/cloud/vm/UserVmManagerImpl.java | 2 +- .../cloud/network/MockNetworkModelImpl.java | 9 +++++++ .../com/cloud/vpc/MockNetworkModelImpl.java | 9 +++++++ 5 files changed, 47 insertions(+), 2 deletions(-) diff --git a/api/src/com/cloud/network/NetworkModel.java b/api/src/com/cloud/network/NetworkModel.java index f6555db565..574160d2c6 100644 --- a/api/src/com/cloud/network/NetworkModel.java +++ b/api/src/com/cloud/network/NetworkModel.java @@ -90,6 +90,8 @@ public interface NetworkModel { boolean areServicesSupportedByNetworkOffering(long networkOfferingId, Service... services); + Network getNetworkWithSGWithFreeIPs(Long zoneId); + Network getNetworkWithSecurityGroupEnabled(Long zoneId); String getIpOfNetworkElementInVirtualNetwork(long accountId, long dataCenterId); @@ -273,4 +275,4 @@ public interface NetworkModel { boolean isNetworkReadyForGc(long networkId); boolean getNetworkEgressDefaultPolicy(Long networkId); -} \ No newline at end of file +} diff --git a/server/src/com/cloud/network/NetworkModelImpl.java b/server/src/com/cloud/network/NetworkModelImpl.java index 7b4b2bebdb..3d2b1333ef 100755 --- a/server/src/com/cloud/network/NetworkModelImpl.java +++ b/server/src/com/cloud/network/NetworkModelImpl.java @@ -736,6 +736,31 @@ public NetworkVO getSystemNetworkByZoneAndTrafficType(long zoneId, TrafficType t return networks.get(0); } + @Override + public NetworkVO getNetworkWithSGWithFreeIPs(Long zoneId) { + List networks = _networksDao.listByZoneSecurityGroup(zoneId); + if (networks == null || networks.isEmpty()) { + return null; + } + NetworkVO ret_network = null; + for (NetworkVO nw : networks) { + List vlans = _vlanDao.listVlansByNetworkId(nw.getId()); + for (VlanVO vlan : vlans) { + if (_ipAddressDao.countFreeIpsInVlan(vlan.getId()) > 0) { + ret_network = nw; + break; + } + } + if (ret_network != null) { + break; + } + } + if (ret_network == null) { + s_logger.debug("Can not find network with security group enabled with free IPs"); + } + return ret_network; + } + @Override public NetworkVO getNetworkWithSecurityGroupEnabled(Long zoneId) { List networks = _networksDao.listByZoneSecurityGroup(zoneId); diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 58709ecf76..cf04270b80 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -2356,7 +2356,7 @@ public UserVm createAdvancedSecurityGroupVirtualMachine(DataCenter zone, Service // If no network is specified, find system security group enabled network if (networkIdList == null || networkIdList.isEmpty()) { - Network networkWithSecurityGroup = _networkModel.getNetworkWithSecurityGroupEnabled(zone.getId()); + Network networkWithSecurityGroup = _networkModel.getNetworkWithSGWithFreeIPs(zone.getId()); if (networkWithSecurityGroup == null) { throw new InvalidParameterValueException("No network with security enabled is found in zone id=" + zone.getId()); } diff --git a/server/test/com/cloud/network/MockNetworkModelImpl.java b/server/test/com/cloud/network/MockNetworkModelImpl.java index 6c9e597b9f..14c42f302e 100644 --- a/server/test/com/cloud/network/MockNetworkModelImpl.java +++ b/server/test/com/cloud/network/MockNetworkModelImpl.java @@ -227,6 +227,15 @@ public boolean areServicesSupportedByNetworkOffering(long networkOfferingId, Ser return false; } + /* (non-Javadoc) + * @see com.cloud.network.NetworkModel#getNetworkWithSGWithFreeIPs(java.lang.Long) + */ + @Override + public NetworkVO getNetworkWithSGWithFreeIPs(Long zoneId) { + // TODO Auto-generated method stub + return null; + } + /* (non-Javadoc) * @see com.cloud.network.NetworkModel#getNetworkWithSecurityGroupEnabled(java.lang.Long) */ diff --git a/server/test/com/cloud/vpc/MockNetworkModelImpl.java b/server/test/com/cloud/vpc/MockNetworkModelImpl.java index 67ab8e875c..1364644628 100644 --- a/server/test/com/cloud/vpc/MockNetworkModelImpl.java +++ b/server/test/com/cloud/vpc/MockNetworkModelImpl.java @@ -238,6 +238,15 @@ public boolean areServicesSupportedByNetworkOffering(long networkOfferingId, Ser return (_ntwkOfferingSrvcDao.areServicesSupportedByNetworkOffering(networkOfferingId, services)); } + /* (non-Javadoc) + * @see com.cloud.network.NetworkModel#getNetworkWithSGWithFreeIPs(java.lang.Long) + */ + @Override + public NetworkVO getNetworkWithSGWithFreeIPs(Long zoneId) { + // TODO Auto-generated method stub + return null; + } + /* (non-Javadoc) * @see com.cloud.network.NetworkModel#getNetworkWithSecurityGroupEnabled(java.lang.Long) */ From e3bb8b98bd9055115004da2ec67b29271a3974c5 Mon Sep 17 00:00:00 2001 From: Kelven Yang Date: Wed, 21 May 2014 16:14:14 -0700 Subject: [PATCH 479/683] CLOUDSTACK-5485: Use edge-triggering in MessageDetector to handle bogus wakeup gracefully. Level triggering plus bogus wakeup can cause a tight loop to spin --- .../cloudstack/context/CallContext.java | 15 +- .../framework/messagebus/MessageDetector.java | 33 +++-- .../cloudstack/messagebus/TestMessageBus.java | 7 +- framework/jobs/pom.xml | 17 ++- .../framework/jobs/AsyncJobManagerTest.java | 129 ++++++++++++++++++ .../AsyncJobManagerTestConfiguration.java | 54 ++++++++ .../framework/jobs/AsyncJobTestDashboard.java | 47 +++++++ .../jobs/AsyncJobTestDispatcher.java | 62 +++++++++ .../resources/AsyncJobManagerTestContext.xml | 38 ++++++ .../jobs/test/resources/commonContext.xml | 37 +++++ framework/jobs/test/resources/db.properties | 66 +++++++++ .../jobs/test/resources/log4j.properties | 35 +++++ 12 files changed, 522 insertions(+), 18 deletions(-) create mode 100644 framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobManagerTest.java create mode 100644 framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobManagerTestConfiguration.java create mode 100644 framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobTestDashboard.java create mode 100644 framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobTestDispatcher.java create mode 100644 framework/jobs/test/resources/AsyncJobManagerTestContext.xml create mode 100644 framework/jobs/test/resources/commonContext.xml create mode 100644 framework/jobs/test/resources/db.properties create mode 100644 framework/jobs/test/resources/log4j.properties diff --git a/api/src/org/apache/cloudstack/context/CallContext.java b/api/src/org/apache/cloudstack/context/CallContext.java index 7305d14ba9..bf4818b37c 100644 --- a/api/src/org/apache/cloudstack/context/CallContext.java +++ b/api/src/org/apache/cloudstack/context/CallContext.java @@ -114,7 +114,20 @@ public Account getCallingAccount() { } public static CallContext current() { - return s_currentContext.get(); + CallContext context = s_currentContext.get(); + + // TODO other than async job and api dispatches, there are many system background running threads + // that do not setup CallContext at all, however, many places in code that are touched by these background tasks + // assume not-null CallContext. Following is a fix to address therefore caused NPE problems + // + // There are security implications with this. It assumes that all system background running threads are + // indeed have no problem in running under system context. + // + if (context == null) { + context = registerSystemCallContextOnceOnly(); + } + + return context; } /** diff --git a/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageDetector.java b/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageDetector.java index fae9bf3120..1dcd6bd268 100644 --- a/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageDetector.java +++ b/framework/ipc/src/org/apache/cloudstack/framework/messagebus/MessageDetector.java @@ -18,29 +18,31 @@ */ package org.apache.cloudstack.framework.messagebus; +import org.apache.log4j.Logger; + public class MessageDetector implements MessageSubscriber { + private static final Logger s_logger = Logger.getLogger(MessageDetector.class); private MessageBus _messageBus; private String[] _subjects; - private volatile boolean _signalled = false; - public MessageDetector() { _messageBus = null; _subjects = null; } - public boolean waitAny(long timeoutInMiliseconds) { - synchronized (this) { - if (_signalled) - return true; + public void waitAny(long timeoutInMiliseconds) { + if (timeoutInMiliseconds < 100) { + s_logger.warn("waitAny is passed with a too short time-out interval. " + timeoutInMiliseconds + "ms"); + timeoutInMiliseconds = 100; + } + synchronized (this) { try { wait(timeoutInMiliseconds); } catch (InterruptedException e) { } } - return _signalled; } public void open(MessageBus messageBus, String[] subjects) { @@ -69,9 +71,20 @@ public void close() { @Override public void onPublishMessage(String senderAddress, String subject, Object args) { - synchronized (this) { - _signalled = true; - notifyAll(); + if (subjectMatched(subject)) { + synchronized (this) { + notifyAll(); + } + } + } + + private boolean subjectMatched(String subject) { + if (_subjects != null) { + for (String sub : _subjects) { + if (sub.equals(subject)) + return true; + } } + return false; } } diff --git a/framework/ipc/test/org/apache/cloudstack/messagebus/TestMessageBus.java b/framework/ipc/test/org/apache/cloudstack/messagebus/TestMessageBus.java index c81d8aa994..cfa552ca2b 100644 --- a/framework/ipc/test/org/apache/cloudstack/messagebus/TestMessageBus.java +++ b/framework/ipc/test/org/apache/cloudstack/messagebus/TestMessageBus.java @@ -138,12 +138,7 @@ public void run() { try { int count = 0; while (count < 2) { - if (detector.waitAny(1000)) { - System.out.println("Detected signal on bus"); - count++; - } else { - System.out.println("Waiting timed out"); - } + detector.waitAny(1000); } } finally { detector.close(); diff --git a/framework/jobs/pom.xml b/framework/jobs/pom.xml index 529eebc876..3ecee56d2b 100644 --- a/framework/jobs/pom.xml +++ b/framework/jobs/pom.xml @@ -56,6 +56,21 @@ org.apache.cloudstack cloud-framework-config ${project.version} - + + + org.apache.cloudstack + cloud-framework-events + ${project.version} + + + org.apache.cloudstack + cloud-engine-schema + ${project.version} + + + commons-io + commons-io + test + diff --git a/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobManagerTest.java b/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobManagerTest.java new file mode 100644 index 0000000000..62a8d81ced --- /dev/null +++ b/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobManagerTest.java @@ -0,0 +1,129 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.framework.jobs; + +/* + * This integration test requires real DB setup, it is not meant to run at per-build + * basis, it can only be opened in developer's run + * + * + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(locations = "classpath:/AsyncJobManagerTestContext.xml") +public class AsyncJobManagerTest extends TestCase { + private static final Logger s_logger = + Logger.getLogger(AsyncJobManagerTest.class); + + @Inject + AsyncJobManager _jobMgr; + + @Inject + AsyncJobTestDashboard _testDashboard; + + @Override + @Before + public void setUp() throws Exception { + try { + ComponentContext.initComponentsLifeCycle(); + } catch (Exception ex) { + ex.printStackTrace(); + s_logger.error(ex.getMessage()); + } + } + + @Override + @After + public void tearDown() throws Exception { + } + + public void testWaitBehave() { + + final Object me = this; + new Thread(new Runnable() { + + @Override + public void run() { + s_logger.info("Sleeping..."); + try { + Thread.sleep(3000); + } catch (InterruptedException e) { + } + + s_logger.info("wakeup"); + synchronized (me) { + me.notifyAll(); + } + } + + }).start(); + + s_logger.info("First wait"); + synchronized (me) { + try { + wait(5000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + s_logger.info("First wait done"); + + s_logger.info("Second wait"); + synchronized (me) { + try { + wait(5000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + s_logger.info("Second wait done"); + } + + @Test + public void test() { + final int TOTAL_JOBS_PER_QUEUE = 5; + final int TOTAL_QUEUES = 100; + + for (int i = 0; i < TOTAL_QUEUES; i++) { + for (int j = 0; j < TOTAL_JOBS_PER_QUEUE; j++) { + AsyncJobVO job = new AsyncJobVO(); + job.setCmd("TestCmd"); + job.setDispatcher("TestJobDispatcher"); + job.setCmdInfo("TestCmd info"); + + _jobMgr.submitAsyncJob(job, "fakequeue", i); + + s_logger.info("Job submitted. job " + job.getId() + ", queue: " + i); + } + } + + while (true) { + if (_testDashboard.getCompletedJobCount() == TOTAL_JOBS_PER_QUEUE * TOTAL_QUEUES) + break; + + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + } + } + + s_logger.info("Test done with " + _testDashboard.getCompletedJobCount() + " job executed"); + } +} + +*/ diff --git a/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobManagerTestConfiguration.java b/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobManagerTestConfiguration.java new file mode 100644 index 0000000000..a70913cd98 --- /dev/null +++ b/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobManagerTestConfiguration.java @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cloudstack.framework.jobs; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import org.apache.cloudstack.framework.config.ConfigDepot; +import org.apache.cloudstack.framework.config.ScopedConfigStorage; +import org.apache.cloudstack.framework.config.dao.ConfigurationDao; +import org.apache.cloudstack.framework.config.dao.ConfigurationDaoImpl; +import org.apache.cloudstack.framework.config.impl.ConfigDepotImpl; + +import com.cloud.storage.dao.StoragePoolDetailsDaoImpl; + +@Configuration +public class AsyncJobManagerTestConfiguration { + + @Bean + public ConfigDepot configDepot() { + return new ConfigDepotImpl(); + } + + @Bean + public ConfigurationDao configDao() { + return new ConfigurationDaoImpl(); + } + + @Bean + public ScopedConfigStorage scopedConfigStorage() { + return new StoragePoolDetailsDaoImpl(); + } + + @Bean + public AsyncJobTestDashboard testDashboard() { + return new AsyncJobTestDashboard(); + } +} diff --git a/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobTestDashboard.java b/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobTestDashboard.java new file mode 100644 index 0000000000..728138d2b4 --- /dev/null +++ b/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobTestDashboard.java @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cloudstack.framework.jobs; + +public class AsyncJobTestDashboard { + int _completedJobCount = 0; + int _concurrencyCount = 0; + + public AsyncJobTestDashboard() { + } + + public synchronized int getCompletedJobCount() { + return _completedJobCount; + } + + public synchronized void jobCompleted() { + _completedJobCount++; + } + + public synchronized int getConcurrencyCount() { + return _concurrencyCount; + } + + public synchronized void increaseConcurrency() { + _concurrencyCount++; + } + + public synchronized void decreaseConcurrency() { + _concurrencyCount--; + } +} diff --git a/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobTestDispatcher.java b/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobTestDispatcher.java new file mode 100644 index 0000000000..34351a6c93 --- /dev/null +++ b/framework/jobs/test/org/apache/cloudstack/framework/jobs/AsyncJobTestDispatcher.java @@ -0,0 +1,62 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.framework.jobs; + +import java.util.Random; + +import javax.inject.Inject; + +import org.apache.log4j.Logger; + +import org.apache.cloudstack.jobs.JobInfo.Status; + +import com.cloud.utils.component.AdapterBase; + +public class AsyncJobTestDispatcher extends AdapterBase implements AsyncJobDispatcher { + private static final Logger s_logger = + Logger.getLogger(AsyncJobTestDispatcher.class); + + @Inject + private AsyncJobManager _asyncJobMgr; + + @Inject + private AsyncJobTestDashboard _testDashboard; + + Random _random = new Random(); + + public AsyncJobTestDispatcher() { + } + + @Override + public void runJob(final AsyncJob job) { + _testDashboard.increaseConcurrency(); + + s_logger.info("Execute job " + job.getId() + ", current concurrency " + _testDashboard.getConcurrencyCount()); + + int interval = 3000; + + try { + Thread.sleep(interval); + } catch (InterruptedException e) { + } + + _asyncJobMgr.completeAsyncJob(job.getId(), Status.SUCCEEDED, 0, null); + + _testDashboard.decreaseConcurrency(); + _testDashboard.jobCompleted(); + } +} diff --git a/framework/jobs/test/resources/AsyncJobManagerTestContext.xml b/framework/jobs/test/resources/AsyncJobManagerTestContext.xml new file mode 100644 index 0000000000..fd5db304c2 --- /dev/null +++ b/framework/jobs/test/resources/AsyncJobManagerTestContext.xml @@ -0,0 +1,38 @@ + + + + + + + + + + diff --git a/framework/jobs/test/resources/commonContext.xml b/framework/jobs/test/resources/commonContext.xml new file mode 100644 index 0000000000..6c3ca75b45 --- /dev/null +++ b/framework/jobs/test/resources/commonContext.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + diff --git a/framework/jobs/test/resources/db.properties b/framework/jobs/test/resources/db.properties new file mode 100644 index 0000000000..e07d80c112 --- /dev/null +++ b/framework/jobs/test/resources/db.properties @@ -0,0 +1,66 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +cluster.servlet.port=9090 + +# CloudStack database settings +db.cloud.username=cloud +db.cloud.password=cloud +db.root.password= +db.cloud.host=localhost +db.cloud.port=3306 +db.cloud.name=cloud + +# CloudStack database tuning parameters +db.cloud.maxActive=250 +db.cloud.maxIdle=30 +db.cloud.maxWait=10000 +db.cloud.autoReconnect=true +db.cloud.validationQuery=SELECT 1 +db.cloud.testOnBorrow=true +db.cloud.testWhileIdle=true +db.cloud.timeBetweenEvictionRunsMillis=40000 +db.cloud.minEvictableIdleTimeMillis=240000 +db.cloud.poolPreparedStatements=false +db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLimit=4096 + +# usage database settings +db.usage.username=cloud +db.usage.password=cloud +db.usage.host=localhost +db.usage.port=3306 +db.usage.name=cloud_usage + +# usage database tuning parameters +db.usage.maxActive=100 +db.usage.maxIdle=30 +db.usage.maxWait=10000 +db.usage.autoReconnect=true + +# awsapi database settings +db.awsapi.name=cloudbridge + +# Simulator database settings +db.simulator.username=cloud +db.simulator.password=cloud +db.simulator.host=localhost +db.simulator.port=3306 +db.simulator.name=simulator +db.simulator.maxActive=250 +db.simulator.maxIdle=30 +db.simulator.maxWait=10000 +db.simulator.autoReconnect=true diff --git a/framework/jobs/test/resources/log4j.properties b/framework/jobs/test/resources/log4j.properties new file mode 100644 index 0000000000..1119ecbba0 --- /dev/null +++ b/framework/jobs/test/resources/log4j.properties @@ -0,0 +1,35 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +log4j.appender.stdout=org.apache.log4j.ConsoleAppender +log4j.appender.stdout.Target=System.out +log4j.appender.stdout.layout=org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n +log4j.appender.stdout.threshold=DEBUG +log4j.rootLogger=INFO, rolling +log4j.appender.rolling=org.apache.log4j.DailyRollingFileAppender +log4j.appender.rolling.layout=org.apache.log4j.PatternLayout +log4j.appender.rolling.layout.ConversionPattern=%d %-5p [%c{3}] (%t:%x) %m%n +log4j.appender.rolling.file.threshold=DEBUG +log4j.appender.rolling.File_testDashboard=./logs/testclient.log +log4j.appender.rolling.DatePattern='.'yyy-MM-dd +log4j.appender.rolling.file.append=false +log4j.category.org.apache=DEBUG, rolling, stdout +#log4j.category.com.cloud.utils.db.Transaction=ALL +log4j.category.org.apache.cloudstack.network.contrail=ALL +log4j.category.com.cloud.network=ALL + From 356f6121a78d147d72136044c90472234f667730 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Wed, 21 May 2014 16:25:27 -0700 Subject: [PATCH 480/683] CLOUDSTACK-6742: listVolumes - As regularuser , able to list Vms and volumes of other users. --- .../management/MockAccountManager.java | 31 -- .../com/cloud/api/query/QueryManagerImpl.java | 36 ++- server/src/com/cloud/user/AccountManager.java | 17 -- .../com/cloud/user/AccountManagerImpl.java | 267 ------------------ .../cloud/user/MockAccountManagerImpl.java | 30 -- 5 files changed, 17 insertions(+), 364 deletions(-) diff --git a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/MockAccountManager.java b/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/MockAccountManager.java index 1a29f9c529..4136b5ccc6 100644 --- a/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/MockAccountManager.java +++ b/plugins/network-elements/juniper-contrail/test/org/apache/cloudstack/network/contrail/management/MockAccountManager.java @@ -199,24 +199,6 @@ public boolean isNormalUser(long accountId) { return false; } - - @Override - public void buildACLSearchParameters(Account caller, Long id, String accountName, Long projectId, List permittedDomains, List permittedAccounts, - List permittedResources, Ternary domainIdRecursiveListProject, boolean listAll, boolean forProjectInvitation, - String action) { - // TODO Auto-generated method stub - - } - - - - @Override - public void buildACLViewSearchCriteria(SearchCriteria sc, SearchCriteria aclSc, boolean isRecursive, - List permittedDomains, List permittedAccounts, List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria) { - // TODO Auto-generated method stub - - } - @Override public List listAclGroupsByAccount(Long accountId) { // TODO Auto-generated method stub @@ -273,12 +255,6 @@ public void buildACLViewSearchBuilder(SearchBuilder sb, Long domainId, boolean isRecursive, List permittedAccounts, - ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds) { - // TODO Auto-generated method stub - } - @Override public void buildACLViewSearchCriteria(SearchCriteria sc, Long domainId, boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria) { @@ -286,13 +262,6 @@ public void buildACLViewSearchCriteria(SearchCriteria sc, Long domainId, boolean isRecursive, List permittedAccounts, - ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds) { - // TODO Auto-generated method stub - - } - @Override public Long checkAccessAndSpecifyAuthority(Account arg0, Long arg1) { // TODO Auto-generated method stub diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java index e675e83b9b..3ce2b66664 100644 --- a/server/src/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/com/cloud/api/query/QueryManagerImpl.java @@ -734,9 +734,7 @@ public ListResponse searchForUserVMs(ListVMsCmd cmd) { private Pair, Integer> searchForUserVMsInternal(ListVMsCmd cmd) { Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); boolean listAll = cmd.listAll(); Long id = cmd.getId(); @@ -744,9 +742,9 @@ private Pair, Integer> searchForUserVMsInternal(ListVMsCmd cm Boolean display = cmd.getDisplay(); Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, listAll, false, "listVirtualMachines"); - //Long domainId = domainIdRecursiveListProject.first(); + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, + domainIdRecursiveListProject, listAll, false); + Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); @@ -768,6 +766,9 @@ private Pair, Integer> searchForUserVMsInternal(ListVMsCmd cm SearchBuilder sb = _userVmJoinDao.createSearchBuilder(); sb.select(null, Func.DISTINCT, sb.entity().getId()); // select distinct ids + _accountMgr.buildACLViewSearchBuilder(sb, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); + String hypervisor = cmd.getHypervisor(); Object name = cmd.getName(); Object state = cmd.getState(); @@ -849,11 +850,10 @@ private Pair, Integer> searchForUserVMsInternal(ListVMsCmd cm // populate the search criteria with the values passed in SearchCriteria sc = sb.create(); - SearchCriteria aclSc = _userVmJoinDao.createSearchCriteria(); - - // building ACL search criteria - _accountMgr.buildACLViewSearchCriteria(sc, aclSc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + // building ACL condition + _accountMgr.buildACLViewSearchCriteria(sc, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); if (tags != null && !tags.isEmpty()) { SearchCriteria tagSc = _userVmJoinDao.createSearchCriteria(); @@ -1663,9 +1663,7 @@ public ListResponse searchForVolumes(ListVolumesCmd cmd) { private Pair, Integer> searchForVolumesInternal(ListVolumesCmd cmd) { Account caller = CallContext.current().getCallingAccount(); - List permittedDomains = new ArrayList(); List permittedAccounts = new ArrayList(); - List permittedResources = new ArrayList(); Long id = cmd.getId(); Long vmInstanceId = cmd.getVirtualMachineId(); @@ -1682,9 +1680,9 @@ private Pair, Integer> searchForVolumesInternal(ListVolumesCm Ternary domainIdRecursiveListProject = new Ternary( cmd.getDomainId(), cmd.isRecursive(), null); - _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedDomains, permittedAccounts, permittedResources, - domainIdRecursiveListProject, cmd.listAll(), false, "listVolumes"); -// Long domainId = domainIdRecursiveListProject.first(); + _accountMgr.buildACLSearchParameters(caller, id, cmd.getAccountName(), cmd.getProjectId(), permittedAccounts, + domainIdRecursiveListProject, cmd.listAll(), false); + Long domainId = domainIdRecursiveListProject.first(); Boolean isRecursive = domainIdRecursiveListProject.second(); ListProjectResourcesCriteria listProjectResourcesCriteria = domainIdRecursiveListProject.third(); Filter searchFilter = new Filter(VolumeJoinVO.class, "created", false, cmd.getStartIndex(), cmd.getPageSizeVal()); @@ -1698,6 +1696,8 @@ private Pair, Integer> searchForVolumesInternal(ListVolumesCm // number of // records with // pagination + _accountMgr.buildACLViewSearchBuilder(sb, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); sb.and("name", sb.entity().getName(), SearchCriteria.Op.EQ); sb.and("id", sb.entity().getId(), SearchCriteria.Op.EQ); @@ -1721,10 +1721,8 @@ private Pair, Integer> searchForVolumesInternal(ListVolumesCm // now set the SC criteria... SearchCriteria sc = sb.create(); - SearchCriteria aclSc = _volumeJoinDao.createSearchCriteria(); - - // building ACL search criteria - _accountMgr.buildACLViewSearchCriteria(sc, aclSc, isRecursive, permittedDomains, permittedAccounts, permittedResources, listProjectResourcesCriteria); + _accountMgr.buildACLViewSearchCriteria(sc, domainId, isRecursive, permittedAccounts, + listProjectResourcesCriteria); if (keyword != null) { SearchCriteria ssc = _volumeJoinDao.createSearchCriteria(); @@ -1739,7 +1737,7 @@ private Pair, Integer> searchForVolumesInternal(ListVolumesCm } if (display != null) { - sc.setParameters("display", display); + sc.setParameters("displayVolume", display); } sc.setParameters("systemUse", 1); diff --git a/server/src/com/cloud/user/AccountManager.java b/server/src/com/cloud/user/AccountManager.java index bee7029041..194c5d212f 100755 --- a/server/src/com/cloud/user/AccountManager.java +++ b/server/src/com/cloud/user/AccountManager.java @@ -91,9 +91,6 @@ void buildACLSearchBuilder(SearchBuilder sb, Long do void buildACLViewSearchBuilder(SearchBuilder sb, Long domainId, boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria); - void buildACLViewSearchBuilder(SearchBuilder sb, Long domainId, - boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds); - void buildACLSearchCriteria(SearchCriteria sc, Long domainId, boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria); @@ -104,20 +101,6 @@ void buildACLSearchParameters(Account caller, Long id, void buildACLViewSearchCriteria(SearchCriteria sc, Long domainId, boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria); - void buildACLViewSearchCriteria(SearchCriteria sc, - Long domainId, boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, - List revokedIds); - - - // new ACL model routine for query api based on db views - void buildACLSearchParameters(Account caller, Long id, - String accountName, Long projectId, List permittedDomains, List permittedAccounts, List permittedResources, - Ternary domainIdRecursiveListProject, boolean listAll, boolean forProjectInvitation, String action); - - void buildACLViewSearchCriteria(SearchCriteria sc, SearchCriteria aclSc, boolean isRecursive, - List permittedDomains, List permittedAccounts, - List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria); - /** * Deletes a user by userId diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java index b6be648dc8..decbedfeea 100755 --- a/server/src/com/cloud/user/AccountManagerImpl.java +++ b/server/src/com/cloud/user/AccountManagerImpl.java @@ -2546,57 +2546,6 @@ public void buildACLViewSearchBuilder(SearchBuilder sb, Long domainId, boolean isRecursive, List permittedAccounts, - ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds) { - - if (!revokedIds.isEmpty()) { - sb.and("idNIN", sb.entity().getId(), SearchCriteria.Op.NIN); - } - if (permittedAccounts.isEmpty() && domainId == null && listProjectResourcesCriteria == null) { - // caller role authorize him to access everything matching query criteria - return; - - } - boolean hasOp = true; - if (!permittedAccounts.isEmpty()) { - sb.and().op("accountIdIN", sb.entity().getAccountId(), SearchCriteria.Op.IN); - } else if (domainId != null) { - if (isRecursive) { - // if accountId isn't specified, we can do a domain match for the - // admin case if isRecursive is true - sb.and().op("domainPath", sb.entity().getDomainPath(), SearchCriteria.Op.LIKE); - } else { - sb.and().op("domainId", sb.entity().getDomainId(), SearchCriteria.Op.EQ); - } - } else { - hasOp = false; - } - - - if (listProjectResourcesCriteria != null) { - if (hasOp) { - if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.ListProjectResourcesOnly) { - sb.and("accountType", sb.entity().getAccountType(), SearchCriteria.Op.EQ); - } else if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.SkipProjectResources) { - sb.and("accountType", sb.entity().getAccountType(), SearchCriteria.Op.NEQ); - } - } else { - if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.ListProjectResourcesOnly) { - sb.and().op("accountType", sb.entity().getAccountType(), SearchCriteria.Op.EQ); - } else if (listProjectResourcesCriteria == Project.ListProjectResourcesCriteria.SkipProjectResources) { - sb.and().op("accountType", sb.entity().getAccountType(), SearchCriteria.Op.NEQ); - } - } - } - - if (!grantedIds.isEmpty()) { - sb.or("idIN", sb.entity().getId(), SearchCriteria.Op.IN); - } - sb.cp(); - - - } @Override public void buildACLViewSearchCriteria(SearchCriteria sc, @@ -2618,32 +2567,6 @@ public void buildACLViewSearchCriteria(SearchCriteria sc, Long domainId, boolean isRecursive, List permittedAccounts, - ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds) { - if (!revokedIds.isEmpty()) { - sc.setParameters("idNIN", revokedIds.toArray()); - } - - if (listProjectResourcesCriteria != null) { - sc.setParameters("accountType", Account.ACCOUNT_TYPE_PROJECT); - } - - if (!permittedAccounts.isEmpty()) { - sc.setParameters("accountIdIN", permittedAccounts.toArray()); - } else if (domainId != null) { - DomainVO domain = _domainDao.findById(domainId); - if (isRecursive) { - sc.setParameters("domainPath", domain.getPath() + "%"); - } else { - sc.setParameters("domainId", domainId); - } - } - - if (!grantedIds.isEmpty()) { - sc.setParameters("idIN", grantedIds.toArray()); - } - } @Override public UserAccount getUserByApiKey(String apiKey) { @@ -2651,196 +2574,6 @@ public UserAccount getUserByApiKey(String apiKey) { } - @Override - public void buildACLSearchParameters(Account caller, Long id, String accountName, Long projectId, List permittedDomains, List permittedAccounts, - List permittedResources, Ternary domainIdRecursiveListProject, boolean listAll, boolean forProjectInvitation, - String action) { - - Long domainId = domainIdRecursiveListProject.first(); - Long accountId = null; - if (id == null) { - // if id is specified, it will ignore all other parameters - if (domainId != null) { - // look for entity in the given domain - Domain domain = _domainDao.findById(domainId); - if (domain == null) { - throw new InvalidParameterValueException("Unable to find domain by id " + domainId); - } - // check permissions - checkAccess(caller, domain); - } - - // specific account is specified, we need to filter contents to only show contents owned by that account. - if (accountName != null) { - if (projectId != null) { - throw new InvalidParameterValueException("Account and projectId can't be specified together"); - } - - Account userAccount = null; - Domain domain = null; - if (domainId != null) { - userAccount = _accountDao.findActiveAccount(accountName, domainId); - domain = _domainDao.findById(domainId); - } else { - userAccount = _accountDao.findActiveAccount(accountName, caller.getDomainId()); - domain = _domainDao.findById(caller.getDomainId()); - } - - if (userAccount != null) { - //check permissions - checkAccess(caller, null, false, userAccount); - permittedAccounts.add(userAccount.getId()); - } else { - throw new InvalidParameterValueException("could not find account " + accountName + " in domain " + domain.getUuid()); - } - } - } - - // set project information - if (projectId != null) { - if (!forProjectInvitation) { - if (projectId.longValue() == -1) { - if (isNormalUser(caller.getId())) { - permittedAccounts.addAll(_projectMgr.listPermittedProjectAccounts(caller.getId())); - } else { - domainIdRecursiveListProject.third(Project.ListProjectResourcesCriteria.ListProjectResourcesOnly); - } - } else { - Project project = _projectMgr.getProject(projectId); - if (project == null) { - throw new InvalidParameterValueException("Unable to find project by id " + projectId); - } - if (!_projectMgr.canAccessProjectAccount(caller, project.getProjectAccountId())) { - throw new PermissionDeniedException("Account " + caller + " can't access project id=" + projectId); - } - permittedAccounts.add(project.getProjectAccountId()); - } - } - } else { - AccessType accessType = AccessType.UseEntry; - if (listAll || id != null) { - // listAll = true or id given should show all resources that owner has ListEntry access type. - accessType = AccessType.ListEntry; - } - domainIdRecursiveListProject.third(Project.ListProjectResourcesCriteria.SkipProjectResources); - - // search for policy permissions associated with caller to get all his authorized domains, accounts, and resources - // Assumption: if a domain is in grantedDomains, then all the accounts under this domain will not be returned in "grantedAccounts". Similarly, if an account - // is in grantedAccounts, then all the resources owned by this account will not be returned in "grantedResources". - // assume that there is only one query selector adapter - if (_querySelectors == null || _querySelectors.size() == 0) - return; // no futher filtering - - QuerySelector qs = _querySelectors.get(0); - boolean grantedAll = qs.isGrantedAll(caller, action, accessType); - - if ( grantedAll ){ - if (accountId != null) { - permittedAccounts.add(accountId); - domainIdRecursiveListProject.second(false); // isRecursive is only valid if only domainId is passed. - } else if (domainId != null) { - permittedDomains.add(domainId); - } else { - domainIdRecursiveListProject.second(false); // isRecursive is only valid if only domainId is passed. - } - } - else { - List grantedDomains = qs.getAuthorizedDomains(caller, action, accessType); - List grantedAccounts = qs.getAuthorizedAccounts(caller, action, accessType); - List grantedResources = qs.getAuthorizedResources(caller, action, accessType); - - if (accountId != null) { - // specific account filter is specified - if (grantedDomains.contains(domainId)) { - // the account domain is granted to the caller - permittedAccounts.add(accountId); - } - else if (grantedAccounts.contains(accountId)) { - permittedAccounts.add(accountId); - } else { - //TODO: we should also filter granted resources based on accountId passed. - // potential bug, if accountId is passed, it may show some granted resources that may not be owned by that account. - // to fix this, we need to change the interface to also pass ControlledEntity class to use EntityManager to find - // ControlledEntity instance to check accountId. But this has some issues for those non controlled entities, - // like NetworkACLItem - permittedResources.addAll(grantedResources); - } - domainIdRecursiveListProject.second(false); // isRecursive is only valid if only domainId is passed. - } else if (domainId != null) { - // specific domain and no account is specified - if (grantedDomains.contains(domainId)) { - permittedDomains.add(domainId); - } else { - for (Long acctId : grantedAccounts) { - Account acct = _accountDao.findById(acctId); - if (acct != null && acct.getDomainId() == domainId) { - permittedAccounts.add(acctId); - } - } - //TODO: we should also filter granted resources based on domainId passed. - // potential bug, if domainId is passed, it may show some granted resources that may not be in that domain. - // to fix this, we need to change the interface to also pass ControlledEntity class to use EntityManager to find - // ControlledEntity instance to check domainId. But this has some issues for those non controlled entities, - // like NetworkACLItem - permittedResources.addAll(grantedResources); - } - } else { - // neither domain nor account is not specified - permittedDomains.addAll(grantedDomains); - permittedAccounts.addAll(grantedAccounts); - permittedResources.addAll(grantedResources); - domainIdRecursiveListProject.second(false); // isRecursive is only valid if only domainId is passed. - } - - if (permittedDomains.isEmpty() && permittedAccounts.isEmpty() && permittedResources.isEmpty()) { - // if at this point, all permitted arrays are empty, that means that caller cannot see anything, we put -1 in permittedAccounts - // to distinguish this case from the case that caller can see everything - permittedAccounts.add(-1L); - - } - } - } - } - - @Override - public void buildACLViewSearchCriteria(SearchCriteria sc, SearchCriteria aclSc, boolean isRecursive, - List permittedDomains, - List permittedAccounts, List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria) { - - if (listProjectResourcesCriteria != null) { - // add criteria for project or not - if (listProjectResourcesCriteria == ListProjectResourcesCriteria.SkipProjectResources) { - sc.addAnd("accountType", SearchCriteria.Op.NEQ, Account.ACCOUNT_TYPE_PROJECT); - } else if (listProjectResourcesCriteria == ListProjectResourcesCriteria.ListProjectResourcesOnly) { - sc.addAnd("accountType", SearchCriteria.Op.EQ, Account.ACCOUNT_TYPE_PROJECT); - } - } - - if (permittedDomains.isEmpty() && permittedAccounts.isEmpty() && permittedResources.isEmpty()) - // can access everything - return; - - // Note that this may have limitations on number of permitted domains, accounts, or resource ids are allowed due to sql package size limitation - if (!permittedDomains.isEmpty()) { - if (isRecursive) { - for (int i = 0; i < permittedDomains.size(); i++) { - Domain domain = _domainDao.findById(permittedDomains.get(i)); - aclSc.addOr("domainPath", SearchCriteria.Op.LIKE, domain.getPath() + "%"); - } - } else { - aclSc.addOr("domainId", SearchCriteria.Op.IN, permittedDomains.toArray()); - } - } - if (!permittedAccounts.isEmpty()) { - aclSc.addOr("accountId", SearchCriteria.Op.IN, permittedAccounts.toArray()); - } - if (!permittedResources.isEmpty()) { - aclSc.addOr("id", SearchCriteria.Op.IN, permittedResources.toArray()); - } - - sc.addAnd("accountId", SearchCriteria.Op.SC, aclSc); - } - @Override public List listAclGroupsByAccount(Long accountId) { if (_querySelectors == null || _querySelectors.size() == 0) diff --git a/server/test/com/cloud/user/MockAccountManagerImpl.java b/server/test/com/cloud/user/MockAccountManagerImpl.java index cc8fbacfb7..746fa1b062 100644 --- a/server/test/com/cloud/user/MockAccountManagerImpl.java +++ b/server/test/com/cloud/user/MockAccountManagerImpl.java @@ -282,26 +282,12 @@ public void buildACLViewSearchBuilder(SearchBuilder sb, Long domainId, boolean isRecursive, List permittedAccounts, - ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds) { - // TODO Auto-generated method stub - - } - @Override public void buildACLViewSearchCriteria(SearchCriteria sc, Long domainId, boolean isRecursive, List permittedAccounts, ListProjectResourcesCriteria listProjectResourcesCriteria) { // TODO Auto-generated method stub } - @Override - public void buildACLViewSearchCriteria(SearchCriteria sc, Long domainId, boolean isRecursive, List permittedAccounts, - ListProjectResourcesCriteria listProjectResourcesCriteria, List grantedIds, List revokedIds) { - // TODO Auto-generated method stub - - } - /* (non-Javadoc) * @see com.cloud.user.AccountService#getUserByApiKey(java.lang.String) */ @@ -354,22 +340,6 @@ public boolean isNormalUser(long accountId) { return false; } - @Override - public void buildACLSearchParameters(Account caller, Long id, String accountName, Long projectId, List permittedDomains, List permittedAccounts, - List permittedResources, Ternary domainIdRecursiveListProject, boolean listAll, boolean forProjectInvitation, - String action) { - // TODO Auto-generated method stub - - } - - @Override - public void buildACLViewSearchCriteria(SearchCriteria sc, SearchCriteria aclSc, boolean isRecursive, - List permittedDomains, List permittedAccounts, List permittedResources, ListProjectResourcesCriteria listProjectResourcesCriteria) { - // TODO Auto-generated method stub - - } - - @Override public List listAclGroupsByAccount(Long accountId) { // TODO Auto-generated method stub From 65bb733a4237242e7f800956840c1a09be18fbb5 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 21 May 2014 17:17:20 -0700 Subject: [PATCH 481/683] CLOUDSTACK-6744 > UI > zone wizard > baremetal hypervisor > support EIP ELB feature. --- ui/scripts/zoneWizard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index 0a84bdb9bc..a6321cf809 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -574,7 +574,7 @@ }); if (thisNetworkOffering.havingEIP == true && thisNetworkOffering.havingELB == true) { //EIP ELB - if (args.hypervisor == "VMware" || args.hypervisor == "BareMetal") { //VMware, BareMetal don't support EIP ELB + if (args.hypervisor == "VMware") { //VMware does not support EIP ELB return true; //move to next item in $.each() loop } if (args.context.zones[0]["network-model"] == "Advanced" && args.context.zones[0]["zone-advanced-sg-enabled"] == "on") { // Advanced SG-enabled zone doesn't support EIP ELB From b4457d92f4ceec83f09b4514a0164c7ec3775e4d Mon Sep 17 00:00:00 2001 From: ynojima Date: Wed, 21 May 2014 18:23:29 -0600 Subject: [PATCH 482/683] bugfix: systemvm template build failed since newer vboxmanage generates $appliance-$branch-vmware-disk3.vmdk --- tools/appliance/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh index 6d2bd8fec2..a228e26608 100644 --- a/tools/appliance/build.sh +++ b/tools/appliance/build.sh @@ -105,8 +105,8 @@ echo "$appliance exported for VMWare: dist/$appliance-$branch-vmware.vmdk.bz2" vboxmanage export $machine_uuid --output $appliance-$branch-vmware.ovf mv $appliance-$branch-vmware.ovf $appliance-$branch-vmware.ovf-orig java -cp convert Convert convert_ovf_vbox_to_esx.xslt $appliance-$branch-vmware.ovf-orig $appliance-$branch-vmware.ovf -tar -cf $appliance-$branch-vmware.ova $appliance-$branch-vmware.ovf $appliance-$branch-vmware-disk1.vmdk -rm -f $appliance-$branch-vmware.ovf $appliance-$branch-vmware.ovf-orig $appliance-$branch-vmware-disk1.vmdk +tar -cf $appliance-$branch-vmware.ova $appliance-$branch-vmware.ovf $appliance-$branch-vmware-disk[0-9].vmdk +rm -f $appliance-$branch-vmware.ovf $appliance-$branch-vmware.ovf-orig $appliance-$branch-vmware-disk[0-9].vmdk echo "$appliance exported for VMWare: dist/$appliance-$branch-vmware.ova" # Export for HyperV From 0d243ec7f2e1a0e3508d385f7b793b103c56ca07 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Wed, 21 May 2014 21:57:29 -0700 Subject: [PATCH 483/683] CLOUDSTACK-6745:DomainAdmin is not able to deploy Vm for users in his domain/subdomain. --- .../org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java index 0adc57be64..43983bd56a 100755 --- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java @@ -27,7 +27,6 @@ import org.apache.log4j.Logger; import org.apache.cloudstack.acl.RoleType; -import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.affinity.AffinityGroupResponse; import org.apache.cloudstack.api.ACL; import org.apache.cloudstack.api.APICommand; @@ -105,7 +104,7 @@ public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd { private Long domainId; //Network information - @ACL(accessType = AccessType.UseEntry) + //@ACL(accessType = AccessType.UseEntry) @Parameter(name = ApiConstants.NETWORK_IDS, type = CommandType.LIST, collectionType = CommandType.UUID, entityType = NetworkResponse.class, description = "list of network ids used by virtual machine. Can't be specified with ipToNetworkList parameter") private List networkIds; From 120da605b06e6cd5dc04c6d1eab9e10005bd6807 Mon Sep 17 00:00:00 2001 From: Koushik Das Date: Thu, 22 May 2014 14:07:13 +0530 Subject: [PATCH 484/683] CLOUDSTACK-6740: Direct agent command throttling improvements List of changes: 1. Created a separate thread pool for handling cron and ping tasks. The size of the pool is based on direct.agent.pool.size. The existing direct agent pool will run all commands other than cron and ping. 2. For normal tasks (generated as part of user/admin API calls), if throttle limit is reached then tasks get queued up for subsequent execution once threads are available. 3. For cron and ping tasks (internally generated by MS like ping, VM sync etc.), if throttle limit is reached then these gets rejected. Since these are internally generated these can be rejected without any issues. --- .../com/cloud/agent/manager/AgentAttache.java | 3 - .../cloud/agent/manager/AgentManagerImpl.java | 8 ++ .../agent/manager/DirectAgentAttache.java | 107 +++++++++++++++--- 3 files changed, 100 insertions(+), 18 deletions(-) diff --git a/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java b/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java index fd1531e25a..24a6fe71f8 100755 --- a/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java +++ b/engine/orchestration/src/com/cloud/agent/manager/AgentAttache.java @@ -30,7 +30,6 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicInteger; import org.apache.cloudstack.managed.context.ManagedContextRunnable; import org.apache.log4j.Logger; @@ -107,7 +106,6 @@ public int compare(final Object o1, final Object o2) { protected Status _status = Status.Connecting; protected boolean _maintenance; protected long _nextSequence; - protected AtomicInteger _outstandingTaskCount; protected AgentManagerImpl _agentMgr; @@ -130,7 +128,6 @@ protected AgentAttache(final AgentManagerImpl agentMgr, final long id, final Str _requests = new LinkedList(); _agentMgr = agentMgr; _nextSequence = new Long(s_rand.nextInt(Short.MAX_VALUE)) << 48; - _outstandingTaskCount = new AtomicInteger(0); } public synchronized long getNextSequence() { diff --git a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java index f43086fab9..2d0be24fcf 100755 --- a/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java +++ b/engine/orchestration/src/com/cloud/agent/manager/AgentManagerImpl.java @@ -162,6 +162,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl protected ExecutorService _executor; protected ThreadPoolExecutor _connectExecutor; protected ScheduledExecutorService _directAgentExecutor; + protected ScheduledExecutorService _cronJobExecutor; protected ScheduledExecutorService _monitorExecutor; private int _directAgentThreadCap; @@ -219,7 +220,10 @@ public boolean configure(final String name, final Map params) th _connection = new NioServer("AgentManager", Port.value(), Workers.value() + 10, this); s_logger.info("Listening on " + Port.value() + " with " + Workers.value() + " workers"); + // executes all agent commands other than cron and ping _directAgentExecutor = new ScheduledThreadPoolExecutor(DirectAgentPoolSize.value(), new NamedThreadFactory("DirectAgent")); + // executes cron and ping agent commands + _cronJobExecutor = new ScheduledThreadPoolExecutor(DirectAgentPoolSize.value(), new NamedThreadFactory("DirectAgentCronJob")); s_logger.debug("Created DirectAgentAttache pool with size: " + DirectAgentPoolSize.value()); _directAgentThreadCap = Math.round(DirectAgentPoolSize.value() * DirectAgentThreadCap.value()) + 1; // add 1 to always make the value > 0 @@ -1451,6 +1455,10 @@ public ScheduledExecutorService getDirectAgentPool() { return _directAgentExecutor; } + public ScheduledExecutorService getCronJobPool() { + return _cronJobExecutor; + } + public int getDirectAgentThreadCap() { return _directAgentThreadCap; } diff --git a/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java b/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java index 9874ee4193..7ca6929686 100755 --- a/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java +++ b/engine/orchestration/src/com/cloud/agent/manager/DirectAgentAttache.java @@ -17,12 +17,13 @@ package com.cloud.agent.manager; import java.util.ArrayList; +import java.util.LinkedList; import java.util.List; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; import org.apache.log4j.Logger; - import org.apache.cloudstack.managed.context.ManagedContextRunnable; import com.cloud.agent.api.Answer; @@ -43,11 +44,16 @@ public class DirectAgentAttache extends AgentAttache { List> _futures = new ArrayList>(); AgentManagerImpl _mgr; long _seq = 0; + LinkedList tasks = new LinkedList(); + AtomicInteger _outstandingTaskCount; + AtomicInteger _outstandingCronTaskCount; public DirectAgentAttache(AgentManagerImpl agentMgr, long id, String name, ServerResource resource, boolean maintenance, AgentManagerImpl mgr) { super(agentMgr, id, name, maintenance); _resource = resource; _mgr = mgr; + _outstandingTaskCount = new AtomicInteger(0); + _outstandingCronTaskCount = new AtomicInteger(0); } @Override @@ -90,15 +96,16 @@ public void send(Request req) throws AgentUnavailableException { if (answers != null && answers[0] instanceof StartupAnswer) { StartupAnswer startup = (StartupAnswer)answers[0]; int interval = startup.getPingInterval(); - _futures.add(_agentMgr.getDirectAgentPool().scheduleAtFixedRate(new PingTask(), interval, interval, TimeUnit.SECONDS)); + _futures.add(_agentMgr.getCronJobPool().scheduleAtFixedRate(new PingTask(), interval, interval, TimeUnit.SECONDS)); } } else { Command[] cmds = req.getCommands(); if (cmds.length > 0 && !(cmds[0] instanceof CronCommand)) { - _agentMgr.getDirectAgentPool().execute(new Task(req)); + queueTask(new Task(req)); + scheduleFromQueue(); } else { CronCommand cmd = (CronCommand)cmds[0]; - _futures.add(_agentMgr.getDirectAgentPool().scheduleAtFixedRate(new Task(req), cmd.getInterval(), cmd.getInterval(), TimeUnit.SECONDS)); + _futures.add(_agentMgr.getCronJobPool().scheduleAtFixedRate(new CronTask(req), cmd.getInterval(), cmd.getInterval(), TimeUnit.SECONDS)); } } } @@ -109,7 +116,7 @@ public void process(Answer[] answers) { StartupAnswer startup = (StartupAnswer)answers[0]; int interval = startup.getPingInterval(); s_logger.info("StartupAnswer received " + startup.getHostId() + " Interval = " + interval); - _futures.add(_agentMgr.getDirectAgentPool().scheduleAtFixedRate(new PingTask(), interval, interval, TimeUnit.SECONDS)); + _futures.add(_agentMgr.getCronJobPool().scheduleAtFixedRate(new PingTask(), interval, interval, TimeUnit.SECONDS)); } } @@ -128,13 +135,26 @@ protected void finalize() throws Throwable { } } + private synchronized void queueTask(Task task) { + tasks.add(task); + } + + private synchronized void scheduleFromQueue() { + if (s_logger.isTraceEnabled()) { + s_logger.trace("Agent attache=" + _id + ", task queue size=" + tasks.size() + ", outstanding tasks=" + _outstandingTaskCount.get()); + } + while (!tasks.isEmpty() && _outstandingTaskCount.get() < _agentMgr.getDirectAgentThreadCap()) { + _outstandingTaskCount.incrementAndGet(); + _agentMgr.getDirectAgentPool().execute(tasks.remove()); + } + } + protected class PingTask extends ManagedContextRunnable { @Override protected synchronized void runInContext() { try { - if (_outstandingTaskCount.incrementAndGet() > _agentMgr.getDirectAgentThreadCap()) { - s_logger.warn("Task execution for direct attache(" + _id + ") has reached maximum outstanding limit(" + _agentMgr.getDirectAgentThreadCap() + - "), bailing out"); + if (_outstandingCronTaskCount.incrementAndGet() >= _agentMgr.getDirectAgentThreadCap()) { + s_logger.warn("PingTask execution for direct attache(" + _id + ") has reached maximum outstanding limit(" + _agentMgr.getDirectAgentThreadCap() + "), bailing out"); return; } @@ -162,15 +182,15 @@ protected synchronized void runInContext() { } catch (Exception e) { s_logger.warn("Unable to complete the ping task", e); } finally { - _outstandingTaskCount.decrementAndGet(); + _outstandingCronTaskCount.decrementAndGet(); } } } - protected class Task extends ManagedContextRunnable { + protected class CronTask extends ManagedContextRunnable { Request _req; - public Task(Request req) { + public CronTask(Request req) { _req = req; } @@ -194,9 +214,8 @@ private void bailout() { protected void runInContext() { long seq = _req.getSequence(); try { - if (_outstandingTaskCount.incrementAndGet() > _agentMgr.getDirectAgentThreadCap()) { - s_logger.warn("Task execution for direct attache(" + _id + ") has reached maximum outstanding limit(" + _agentMgr.getDirectAgentThreadCap() + - "), bailing out"); + if (_outstandingCronTaskCount.incrementAndGet() >= _agentMgr.getDirectAgentThreadCap()) { + s_logger.warn("CronTask execution for direct attache(" + _id + ") has reached maximum outstanding limit(" + _agentMgr.getDirectAgentThreadCap() + "), bailing out"); bailout(); return; } @@ -243,9 +262,67 @@ protected void runInContext() { } catch (Exception e) { s_logger.warn(log(seq, "Exception caught "), e); } finally { - _outstandingTaskCount.decrementAndGet(); + _outstandingCronTaskCount.decrementAndGet(); } } } + protected class Task extends ManagedContextRunnable { + Request _req; + + public Task(Request req) { + _req = req; + } + + @Override + protected void runInContext() { + long seq = _req.getSequence(); + try { + ServerResource resource = _resource; + Command[] cmds = _req.getCommands(); + boolean stopOnError = _req.stopOnError(); + + if (s_logger.isDebugEnabled()) { + s_logger.debug(log(seq, "Executing request")); + } + ArrayList answers = new ArrayList(cmds.length); + for (int i = 0; i < cmds.length; i++) { + Answer answer = null; + try { + if (resource != null) { + answer = resource.executeRequest(cmds[i]); + if (answer == null) { + s_logger.warn("Resource returned null answer!"); + answer = new Answer(cmds[i], false, "Resource returned null answer"); + } + } else { + answer = new Answer(cmds[i], false, "Agent is disconnected"); + } + } catch (Exception e) { + s_logger.warn(log(seq, "Exception Caught while executing command"), e); + answer = new Answer(cmds[i], false, e.toString()); + } + answers.add(answer); + if (!answer.getResult() && stopOnError) { + if (i < cmds.length - 1 && s_logger.isDebugEnabled()) { + s_logger.debug(log(seq, "Cancelling because one of the answers is false and it is stop on error.")); + } + break; + } + } + + Response resp = new Response(_req, answers.toArray(new Answer[answers.size()])); + if (s_logger.isDebugEnabled()) { + s_logger.debug(log(seq, "Response Received: ")); + } + + processAnswers(seq, resp); + } catch (Exception e) { + s_logger.warn(log(seq, "Exception caught "), e); + } finally { + _outstandingTaskCount.decrementAndGet(); + scheduleFromQueue(); + } + } + } } From 40207929f711d63f6b04fc18f77fd520a4975871 Mon Sep 17 00:00:00 2001 From: Anthony Xu Date: Thu, 22 May 2014 15:46:48 -0700 Subject: [PATCH 485/683] fixed a typo --- .../network/router/VpcVirtualNetworkApplianceManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java index 82964602d4..c06843c8ca 100644 --- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java @@ -1265,7 +1265,7 @@ protected NicProfile createPrivateNicProfileForGateway(VpcGateway privateGateway NicProfile privateNicProfile = new NicProfile(); if (privateNic != null) { - VirtualMachine vm = _vmDao.findById(privateNic.getId()); + VirtualMachine vm = _vmDao.findById(privateNic.getInstanceId()); privateNicProfile = new NicProfile(privateNic, privateNetwork, privateNic.getBroadcastUri(), privateNic.getIsolationUri(), _networkModel.getNetworkRate( privateNetwork.getId(), vm.getId()), _networkModel.isSecurityGroupSupportedInNetwork(privateNetwork), _networkModel.getNetworkTag( From da5ad74d5f4388c4aa1df2f2e5f9053bfb70d83d Mon Sep 17 00:00:00 2001 From: Min Chen Date: Thu, 22 May 2014 16:56:36 -0700 Subject: [PATCH 486/683] CLOUDSTACK-6752: IAM command class separation caused ApiDoc warning of duplicated cmd class for the same api name. --- .../src/com/cloud/api/doc/ApiXmlDocWriter.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/api/doc/ApiXmlDocWriter.java b/server/src/com/cloud/api/doc/ApiXmlDocWriter.java index c19f7af8c3..0194f07c2c 100644 --- a/server/src/com/cloud/api/doc/ApiXmlDocWriter.java +++ b/server/src/com/cloud/api/doc/ApiXmlDocWriter.java @@ -105,10 +105,21 @@ public static void main(String[] args) { for (Class cmdClass : cmdClasses) { String apiName = cmdClass.getAnnotation(APICommand.class).name(); if (s_apiNameCmdClassMap.containsKey(apiName)) { - System.out.println("Warning, API Cmd class " + cmdClass.getName() + " has non-unique apiname" + apiName); - continue; + // handle API cmd separation into admin cmd and user cmd with the common api name + Class curCmd = s_apiNameCmdClassMap.get(apiName); + if (curCmd.isAssignableFrom(cmdClass)) { + // api_cmd map always keep the admin cmd class to get full response and parameters + s_apiNameCmdClassMap.put(apiName, cmdClass); + } else if (cmdClass.isAssignableFrom(curCmd)) { + // just skip this one without warning + continue; + } else { + System.out.println("Warning, API Cmd class " + cmdClass.getName() + " has non-unique apiname " + apiName); + continue; + } + } else { + s_apiNameCmdClassMap.put(apiName, cmdClass); } - s_apiNameCmdClassMap.put(apiName, cmdClass); } LinkedProperties preProcessedCommands = new LinkedProperties(); From 12e552b06dfac5f19737f79aa0a8424b01b3197e Mon Sep 17 00:00:00 2001 From: Ian Duffy Date: Thu, 15 May 2014 07:08:01 +0100 Subject: [PATCH 487/683] Resolve issue with build script for systemvm hanging due to libssl waiting on a input prompt caused by apt-get update --- tools/appliance/build.sh | 0 tools/appliance/definitions/systemvm64template/base.sh | 8 ++++++-- .../appliance/definitions/systemvm64template/preseed.cfg | 5 +++++ tools/appliance/definitions/systemvmtemplate/base.sh | 8 ++++++-- tools/appliance/definitions/systemvmtemplate/preseed.cfg | 6 ++++++ 5 files changed, 23 insertions(+), 4 deletions(-) mode change 100644 => 100755 tools/appliance/build.sh diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh old mode 100644 new mode 100755 diff --git a/tools/appliance/definitions/systemvm64template/base.sh b/tools/appliance/definitions/systemvm64template/base.sh index bc03ffe9ac..8166081cdc 100644 --- a/tools/appliance/definitions/systemvm64template/base.sh +++ b/tools/appliance/definitions/systemvm64template/base.sh @@ -1,6 +1,10 @@ # Update the box -apt-get -y update -apt-get -y install curl unzip + +export DEBIAN_FRONTEND=noninteractive +export DEBIAN_PRIORITY=critical + +apt-get -q -y --force-yes update +apt-get -q -y --force-yes install curl unzip apt-get clean # Set up sudo, TODO: Check security concerns diff --git a/tools/appliance/definitions/systemvm64template/preseed.cfg b/tools/appliance/definitions/systemvm64template/preseed.cfg index 6996565aaa..635432a6c5 100644 --- a/tools/appliance/definitions/systemvm64template/preseed.cfg +++ b/tools/appliance/definitions/systemvm64template/preseed.cfg @@ -334,6 +334,11 @@ d-i finish-install/reboot_in_progress note # debconf-get-selections --installer > file # debconf-get-selections >> file +libssl1.0.0 libssl1.0.0/restart-services string +libssl1.0.0:amd64 libssl1.0.0/restart-services string + +libssl1.0.0 libssl1.0.0/restart-failed error +libssl1.0.0:amd64 libssl1.0.0/restart-failed error #### Advanced options ### Running custom commands during the installation diff --git a/tools/appliance/definitions/systemvmtemplate/base.sh b/tools/appliance/definitions/systemvmtemplate/base.sh index bc03ffe9ac..8166081cdc 100644 --- a/tools/appliance/definitions/systemvmtemplate/base.sh +++ b/tools/appliance/definitions/systemvmtemplate/base.sh @@ -1,6 +1,10 @@ # Update the box -apt-get -y update -apt-get -y install curl unzip + +export DEBIAN_FRONTEND=noninteractive +export DEBIAN_PRIORITY=critical + +apt-get -q -y --force-yes update +apt-get -q -y --force-yes install curl unzip apt-get clean # Set up sudo, TODO: Check security concerns diff --git a/tools/appliance/definitions/systemvmtemplate/preseed.cfg b/tools/appliance/definitions/systemvmtemplate/preseed.cfg index 6996565aaa..deb2f94d49 100644 --- a/tools/appliance/definitions/systemvmtemplate/preseed.cfg +++ b/tools/appliance/definitions/systemvmtemplate/preseed.cfg @@ -335,6 +335,12 @@ d-i finish-install/reboot_in_progress note # debconf-get-selections >> file +libssl1.0.0 libssl1.0.0/restart-services string +libssl1.0.0:i386 libssl1.0.0/restart-services string + +libssl1.0.0 libssl1.0.0/restart-failed error +libssl1.0.0:i386 libssl1.0.0/restart-failed error + #### Advanced options ### Running custom commands during the installation # d-i preseeding is inherently not secure. Nothing in the installer checks From 960b4d1896119c94dcba6670de92cd8791320891 Mon Sep 17 00:00:00 2001 From: Doug Clark Date: Thu, 22 May 2014 15:13:49 +0000 Subject: [PATCH 488/683] Add the shrinkok flag to allow volume shrinking in resize tests Signed-off-by: SrikanteswaraRao Talluri --- test/integration/smoke/test_volumes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index cc76e49059..6d55f1223a 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -672,6 +672,7 @@ def test_08_resize_volume(self): cmd = resizeVolume.resizeVolumeCmd() cmd.id = rootvolume.id cmd.size = 10 + cmd.shrinkok = "true" self.apiClient.resizeVolume(cmd) From 917d7b8b72a391d99350d7a2956737484e60e7f6 Mon Sep 17 00:00:00 2001 From: Koushik Das Date: Fri, 23 May 2014 15:30:54 +0530 Subject: [PATCH 489/683] CLOUDSTACK-6708: [Automation]: Few suites were failing on simulator run Disabled test_deploy_vm_start_failure test case which is failing. This is based on the new simulator changes and would need to be executed sequentially. --- test/integration/smoke/test_deploy_vm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/smoke/test_deploy_vm.py b/test/integration/smoke/test_deploy_vm.py index a8e406d322..3f7505810f 100644 --- a/test/integration/smoke/test_deploy_vm.py +++ b/test/integration/smoke/test_deploy_vm.py @@ -317,7 +317,7 @@ def setUp(self): self.mock_start_failure ] - @attr(tags = ['selfservice']) + @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6708") def test_deploy_vm_start_failure(self): """Test Deploy Virtual Machine - start operation failure and retry From 3f1dc2534fc57376c596e616ca3e8e76754b209d Mon Sep 17 00:00:00 2001 From: Gabor Apati-Nagy Date: Thu, 22 May 2014 17:44:45 +0100 Subject: [PATCH 490/683] CLOUDSTACK-6565: [UI] New Zones tab for Templates and ISOs --- ui/css/cloudstack3.css | 4 + ui/dictionary.jsp | 1 + ui/scripts/templates.js | 970 +++++++++++++++++++++++++++++----------- 3 files changed, 707 insertions(+), 268 deletions(-) diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index cb9fa3521f..17441c49a1 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -1317,6 +1317,10 @@ div.panel div.list-view div.fixed-header { background: #FFFFFF; } +.detail-view div#details-tab-zones div.fixed-header { + left: 25px !important; +} + .detail-view div.list-view div.fixed-header table { width: 100% !important; } diff --git a/ui/dictionary.jsp b/ui/dictionary.jsp index 9cc030ad95..29be3db75c 100644 --- a/ui/dictionary.jsp +++ b/ui/dictionary.jsp @@ -1236,6 +1236,7 @@ dictionary = { 'label.yes': '', 'label.zone.details': '', 'label.zone': '', +'label.zones': '', 'label.zone.id': '', 'label.zone.name': '', 'label.zone.step.1.title': '', diff --git a/ui/scripts/templates.js b/ui/scripts/templates.js index 67cc2fb99e..e5b8bd6569 100644 --- a/ui/scripts/templates.js +++ b/ui/scripts/templates.js @@ -53,9 +53,6 @@ name: { label: 'label.name' }, - zonename: { - label: 'label.zone' - }, hypervisor: { label: 'label.hypervisor' } @@ -601,9 +598,32 @@ data: data, success: function(json) { var items = json.listtemplatesresponse.template; + var itemsView = []; + + $(items).each(function(index, item) { + var existing = $.grep(itemsView, function(it){ + return it != null && it.id !=null && it.id == item.id; + }); + + if (existing.length == 0) { + itemsView.push({ + id: item.id, + name: item.name, + description: item.description, + hypervisor: item.hypervisor, + zones: item.zonename, + zoneids: [item.zoneid] + }); + } + else { + existing[0].zones = 'label.multiplezones'; + existing[0].zoneids.push(item.zoneid); + } + }); + args.response.success({ actionFilter: templateActionfilter, - data: items + data: itemsView }); } }); @@ -749,91 +769,6 @@ } }, - copyTemplate: { - label: 'label.action.copy.template', - messages: { - confirm: function(args) { - return 'message.copy.template.confirm'; - }, - success: function(args) { - return 'message.template.copying'; - }, - notification: function(args) { - return 'label.action.copy.template'; - } - }, - createForm: { - title: 'label.action.copy.template', - desc: '', - fields: { - destinationZoneId: { - label: 'label.destination.zone', - docID: 'helpCopyTemplateDestination', - validation: { - required: true - }, - select: function(args) { - $.ajax({ - url: createURL("listZones&available=true"), - dataType: "json", - async: true, - success: function(json) { - var zoneObjs = []; - var items = json.listzonesresponse.zone; - if (items != null) { - for (var i = 0; i < items.length; i++) { - if (items[i].id != args.context.templates[0].zoneid) { //destination zone must be different from source zone - zoneObjs.push({ - id: items[i].id, - description: items[i].name - }); - } - } - } - args.response.success({ - data: zoneObjs - }); - } - }); - } - } - } - }, - action: function(args) { - var data = { - id: args.context.templates[0].id, - destzoneid: args.data.destinationZoneId - }; - if (args.context.templates[0].zoneid != undefined) { - $.extend(data, { - sourcezoneid: args.context.templates[0].zoneid - }); - } - - $.ajax({ - url: createURL('copyTemplate'), - data: data, - success: function(json) { - var jid = json.copytemplateresponse.jobid; - args.response.success({ - _custom: { - jobId: jid, - getUpdatedItem: function(json) { - return {}; //nothing in this template needs to be updated - }, - getActionFilter: function() { - return templateActionfilter; - } - } - }); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - }, - downloadTemplate: { label: 'label.action.download.template', messages: { @@ -880,40 +815,6 @@ } }, - remove: { - label: 'label.action.delete.template', - messages: { - confirm: function(args) { - return 'message.action.delete.template'; - }, - notification: function(args) { - return 'label.action.delete.template'; - } - }, - action: function(args) { - var array1 = []; - if (args.context.templates[0].zoneid != null) - array1.push("&zoneid=" + args.context.templates[0].zoneid); - - $.ajax({ - url: createURL("deleteTemplate&id=" + args.context.templates[0].id + array1.join("")), - dataType: "json", - async: true, - success: function(json) { - var jid = json.deletetemplateresponse.jobid; - args.response.success({ - _custom: { - jobId: jid - } - }); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - } - }, tabs: { details: { @@ -943,14 +844,6 @@ } } }, { - isready: { - label: 'state.ready', - converter: cloudStack.converters.toBooleanText - }, - status: { - label: 'label.status' - }, - hypervisor: { label: 'label.hypervisor' }, @@ -1050,9 +943,6 @@ } }, - zonename: { - label: 'label.zone.name' - }, crossZones: { label: 'label.cross.zones', converter: cloudStack.converters.toBooleanText @@ -1082,9 +972,6 @@ id: { label: 'label.id' - }, - zoneid: { - label: 'label.zone.id' } }], @@ -1120,6 +1007,367 @@ } }); } + }, + + zones: { + title: 'label.zones', + listView: { + id: 'zones', + fields: { + zonename: { + label: 'label.name' + }, + status: { + label: 'label.status' + }, + isready: { + label: 'state.ready', + converter: cloudStack.converters.toBooleanText + } + }, + hideSearchBar: true, + + + dataProvider: function(args) { + var jsonObj = args.context.templates[0]; + var apiCmd = "listTemplates&templatefilter=self&id=" + jsonObj.id; + + $.ajax({ + url: createURL(apiCmd), + dataType: "json", + success: function(json) { + var templates = json.listtemplatesresponse.template; + var zones = []; + zones = templates; + + args.response.success({ + actionFilter: templateActionfilter, + data: zones + }); + } + }); + }, + + detailView: { + actions: { + remove: { + label: 'label.action.delete.template', + messages: { + confirm: function(args) { + return 'message.action.delete.template'; + }, + notification: function(args) { + return 'label.action.delete.template'; + } + }, + action: function(args) { + $.ajax({ + url: createURL("deleteTemplate&id=" + args.context.templates[0].id + "&zoneid=" + args.context.zones[0].zoneid), + dataType: "json", + async: true, + success: function(json) { + var jid = json.deletetemplateresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + copyTemplate: { + label: 'label.action.copy.template', + messages: { + confirm: function(args) { + return 'message.copy.template.confirm'; + }, + success: function(args) { + return 'message.template.copying'; + }, + notification: function(args) { + return 'label.action.copy.template'; + } + }, + createForm: { + title: 'label.action.copy.template', + desc: '', + fields: { + destinationZoneId: { + label: 'label.destination.zone', + docID: 'helpCopyTemplateDestination', + validation: { + required: true + }, + select: function(args) { + $.ajax({ + url: createURL("listZones&available=true"), + dataType: "json", + async: true, + success: function(json) { + var zoneObjs = []; + var items = json.listzonesresponse.zone; + if (items != null) { + for (var i = 0; i < items.length; i++) { + if (args.context.zones[0].zoneid != items[i].id) { + zoneObjs.push({ + id: items[i].id, + description: items[i].name + }); + } + } + } + args.response.success({ + data: zoneObjs + }); + } + }); + } + } + } + }, + action: function(args) { + var data = { + id: args.context.templates[0].id, + destzoneid: args.data.destinationZoneId + }; + $.extend(data, { + sourcezoneid: args.context.zones[0].zoneid + }); + + $.ajax({ + url: createURL('copyTemplate'), + data: data, + success: function(json) { + var jid = json.copytemplateresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + return {}; //nothing in this template needs to be updated + }, + getActionFilter: function() { + return templateActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + + tabs: { + details: { + title: 'label.details', + preFilter: function(args) { + var hiddenFields; + if (isAdmin()) { + hiddenFields = []; + } else { + hiddenFields = ["hypervisor", 'xenserverToolsVersion61plus']; + } + + if ('templates' in args.context && args.context.templates[0].hypervisor != 'XenServer') { + hiddenFields.push('xenserverToolsVersion61plus'); + } + + return hiddenFields; + }, + + fields: [{ + name: { + label: 'label.name', + isEditable: true, + validation: { + required: true + } + } + }, { + id: { + label: 'label.id' + }, + zonename: { + label: 'label.zone.name' + }, + zoneid: { + label: 'label.zone.id' + }, + isready: { + label: 'state.ready', + converter: cloudStack.converters.toBooleanText + }, + status: { + label: 'label.status' + } + }, { + hypervisor: { + label: 'label.hypervisor' + }, + xenserverToolsVersion61plus: { + label: 'label.xenserver.tools.version.61.plus', + isBoolean: true, + isEditable: function () { + if (isAdmin()) + return true; + else + return false; + }, + converter: cloudStack.converters.toBooleanText + }, + + size: { + label: 'label.size', + converter: function(args) { + if (args == null || args == 0) + return ""; + else + return cloudStack.converters.convertBytes(args); + } + }, + isextractable: { + label: 'extractable', + isBoolean: true, + isEditable: function() { + if (isAdmin()) + return true; + else + return false; + }, + converter: cloudStack.converters.toBooleanText + }, + passwordenabled: { + label: 'label.password.enabled', + isBoolean: true, + isEditable: true, + converter: cloudStack.converters.toBooleanText + }, + isdynamicallyscalable: { + label: 'Dynamically Scalable', + isBoolean: true, + isEditable: true, + converter: cloudStack.converters.toBooleanText + }, + ispublic: { + label: 'label.public', + isBoolean: true, + isEditable: function() { + if (isAdmin()) { + return true; + } else { + if (g_userPublicTemplateEnabled == "true") + return true; + else + return false; + } + }, + converter: cloudStack.converters.toBooleanText + }, + isfeatured: { + label: 'label.featured', + isBoolean: true, + isEditable: function() { + if (isAdmin()) + return true; + else + return false; + }, + converter: cloudStack.converters.toBooleanText + }, + + ostypeid: { + label: 'label.os.type', + isEditable: true, + select: function(args) { + $.ajax({ + url: createURL("listOsTypes"), + dataType: "json", + async: true, + success: function(json) { + var ostypes = json.listostypesresponse.ostype; + var items = []; + $(ostypes).each(function() { + items.push({ + id: this.id, + description: this.description + }); + }); + args.response.success({ + data: items + }); + } + }); + } + }, + + + displaytext: { + label: 'label.description', + isEditable: true, + validation: { + required: true + } + }, + + domain: { + label: 'label.domain' + }, + account: { + label: 'label.account' + }, + created: { + label: 'label.created', + converter: cloudStack.converters.toLocalDate + }, + + templatetype: { + label: 'label.type' + }, + + + }], + + tags: cloudStack.api.tags({ + resourceType: 'Template', + contextId: 'templates' + }), + + + dataProvider: function(args) { + var jsonObj = args.context.templates[0]; + var apiCmd = "listTemplates&templatefilter=self&id=" + jsonObj.id; + if (jsonObj.zoneid != null) + apiCmd = apiCmd + "&zoneid=" + jsonObj.zoneid; + + $.ajax({ + url: createURL(apiCmd), + dataType: "json", + success: function(json) { + var jsonObj = json.listtemplatesresponse.template[0]; + + if ('details' in jsonObj && 'hypervisortoolsversion' in jsonObj.details) { + if (jsonObj.details.hypervisortoolsversion == 'xenserver61') + jsonObj.xenserverToolsVersion61plus = true; + else + jsonObj.xenserverToolsVersion61plus = false; + } + + args.response.success({ + actionFilter: templateActionfilter, + data: jsonObj + }); + } + }); + } + } + }} + } } } } @@ -1153,9 +1401,6 @@ fields: { name: { label: 'label.name' - }, - zonename: { - label: 'label.zone' } }, @@ -1434,9 +1679,30 @@ data: data, success: function(json) { var items = json.listisosresponse.iso; + + var itemsView = []; + $(items).each(function(index, item) { + var existing = $.grep(itemsView, function(it){ + return it != null && it.id !=null && it.id == item.id; + }); + if (existing.length == 0) { + itemsView.push({ + id: item.id, + name: item.name, + description: item.description, + zones: item.zonename, + zoneids: [item.zoneid] + }); + } + else { + existing[0].zones = 'Multiple Zones'; + existing[0].zoneids.push(item.zoneid); + } + } +); args.response.success({ actionFilter: isoActionfilter, - data: items + data: itemsView }); } }); @@ -1531,85 +1797,6 @@ }); } }, - - copyISO: { - label: 'label.action.copy.ISO', - messages: { - notification: function(args) { - return 'Copying ISO'; - } - }, - createForm: { - title: 'label.action.copy.ISO', - desc: 'label.action.copy.ISO', - fields: { - destinationZoneId: { - label: 'label.destination.zone', - validation: { - required: true - }, - select: function(args) { - $.ajax({ - url: createURL("listZones&available=true"), - dataType: "json", - async: true, - success: function(json) { - var zoneObjs = []; - var items = json.listzonesresponse.zone; - if (items != null) { - for (var i = 0; i < items.length; i++) { - if (items[i].id != args.context.isos[0].zoneid) { //destination zone must be different from source zone - zoneObjs.push({ - id: items[i].id, - description: items[i].name - }); - } - } - } - args.response.success({ - data: zoneObjs - }); - } - }); - } - } - } - }, - action: function(args) { - var data = { - id: args.context.isos[0].id, - destzoneid: args.data.destinationZoneId - }; - if (args.context.isos[0].zoneid != undefined) { - $.extend(data, { - sourcezoneid: args.context.isos[0].zoneid - }); - } - - $.ajax({ - url: createURL('copyIso'), - data: data, - success: function(json) { - var jid = json.copytemplateresponse.jobid; - args.response.success({ - _custom: { - jobId: jid, - getUpdatedItem: function(json) { - return {}; //nothing in this ISO needs to be updated - }, - getActionFilter: function() { - return isoActionfilter; - } - } - }); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } - }, - downloadISO: { label: 'label.action.download.ISO', messages: { @@ -1654,42 +1841,7 @@ notification: { poll: pollAsyncJobResult } - }, - - remove: { - label: 'label.action.delete.ISO', - messages: { - confirm: function(args) { - return 'message.action.delete.ISO'; - }, - notification: function(args) { - return 'label.action.delete.ISO'; - } - }, - action: function(args) { - var array1 = []; - if (args.context.isos[0].zoneid != null) - array1.push("&zoneid=" + args.context.isos[0].zoneid); - - $.ajax({ - url: createURL("deleteIso&id=" + args.context.isos[0].id + array1.join("")), - dataType: "json", - async: true, - success: function(json) { - var jid = json.deleteisosresponse.jobid; - args.response.success({ - _custom: { - jobId: jid - } - }); - } - }); - }, - notification: { - poll: pollAsyncJobResult - } } - }, tabs: { @@ -1708,12 +1860,6 @@ id: { label: 'ID' }, - zonename: { - label: 'label.zone.name' - }, - zoneid: { - label: 'label.zone.id' - }, displaytext: { label: 'label.description', isEditable: true, @@ -1721,13 +1867,6 @@ required: true } }, - isready: { - label: 'state.Ready', - converter: cloudStack.converters.toBooleanText - }, - status: { - label: 'label.status' - }, size: { label: 'label.size', converter: function(args) { @@ -1834,6 +1973,301 @@ }); } + }, + zones: { + title: 'label.zones', + listView: { + id: 'zones', + fields: { + zonename: { + label: 'label.name' + }, + status: { + label: 'label.status' + }, + isready: { + label: 'state.ready', + converter: cloudStack.converters.toBooleanText + } + }, + hideSearchBar: true, + + dataProvider: function(args) { + var jsonObj = args.context.isos[0]; + var apiCmd = "listIsos&isofilter=self&id=" + jsonObj.id; + + $.ajax({ + url: createURL(apiCmd), + dataType: "json", + success: function(json) { + var isos = json.listisosresponse.iso; + var zones = []; + zones = isos; + + args.response.success({ + actionFilter: isoActionfilter, + data: zones + }); + } + }); + }, + + detailView: { + actions: { + copyISO: { + label: 'label.action.copy.ISO', + messages: { + notification: function(args) { + return 'Copying ISO'; + } + }, + createForm: { + title: 'label.action.copy.ISO', + desc: 'label.action.copy.ISO', + fields: { + destinationZoneId: { + label: 'label.destination.zone', + validation: { + required: true + }, + select: function(args) { + $.ajax({ + url: createURL("listZones&available=true"), + dataType: "json", + async: true, + success: function(json) { + var zoneObjs = []; + var items = json.listzonesresponse.zone; + if (items != null) { + for (var i = 0; i < items.length; i++) { + if (items[i].id != args.context.zones[0].zoneid) { + zoneObjs.push({ + id: items[i].id, + description: items[i].name + }); + } + } + } + args.response.success({ + data: zoneObjs + }); + } + }); + } + } + } + }, + action: function(args) { + var data = { + id: args.context.isos[0].id, + destzoneid: args.data.destinationZoneId + }; + if (args.context.zones[0].zoneid != undefined) { + $.extend(data, { + sourcezoneid: args.context.zones[0].zoneid + }); + } + + $.ajax({ + url: createURL('copyIso'), + data: data, + success: function(json) { + var jid = json.copytemplateresponse.jobid; + args.response.success({ + _custom: { + jobId: jid, + getUpdatedItem: function(json) { + return {}; //nothing in this ISO needs to be updated + }, + getActionFilter: function() { + return isoActionfilter; + } + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + }, + + remove: { + label: 'label.action.delete.ISO', + messages: { + confirm: function(args) { + return 'message.action.delete.ISO'; + }, + notification: function(args) { + return 'label.action.delete.ISO'; + } + }, + action: function(args) { + var array1 = []; + if (args.context.zones[0].zoneid != null) + array1.push("&zoneid=" + args.context.zones[0].zoneid); + + $.ajax({ + url: createURL("deleteIso&id=" + args.context.isos[0].id + "&zoneid=" + args.context.zones[0].zoneid), + dataType: "json", + async: true, + success: function(json) { + var jid = json.deleteisosresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + tabs: { + details: { + title: 'label.details', + + fields: [{ + name: { + label: 'label.name', + isEditable: true, + validation: { + required: true + } + } + }, { + id: { + label: 'ID' + }, + zonename: { + label: 'label.zone.name' + }, + zoneid: { + label: 'label.zone.id' + }, + isready: { + label: 'state.Ready', + converter: cloudStack.converters.toBooleanText + }, + status: { + label: 'label.status' + } + },{ + displaytext: { + label: 'label.description', + isEditable: true, + validation: { + required: true + } + }, + size: { + label: 'label.size', + converter: function(args) { + if (args == null || args == 0) + return ""; + else + return cloudStack.converters.convertBytes(args); + } + }, + isextractable: { + label: 'extractable', + isBoolean: true, + isEditable: function() { + if (isAdmin()) + return true; + else + return false; + }, + converter: cloudStack.converters.toBooleanText + }, + bootable: { + label: 'label.bootable', + converter: cloudStack.converters.toBooleanText + }, + ispublic: { + label: 'label.public', + isBoolean: true, + isEditable: true, + converter: cloudStack.converters.toBooleanText + }, + isfeatured: { + label: 'label.featured', + isBoolean: true, + isEditable: function() { + if (isAdmin()) + return true; + else + return false; + }, + converter: cloudStack.converters.toBooleanText + }, + + ostypeid: { + label: 'label.os.type', + isEditable: true, + select: function(args) { + $.ajax({ + url: createURL("listOsTypes"), + dataType: "json", + async: true, + success: function(json) { + var ostypes = json.listostypesresponse.ostype; + var items = []; + $(ostypes).each(function() { + items.push({ + id: this.id, + description: this.description + }); + }); + args.response.success({ + data: items + }); + } + }); + } + }, + + domain: { + label: 'label.domain' + }, + account: { + label: 'label.account' + }, + created: { + label: 'label.created', + converter: cloudStack.converters.toLocalDate + } + }], + + tags: cloudStack.api.tags({ + resourceType: 'ISO', + contextId: 'isos' + }), + + dataProvider: function(args) { + var jsonObj = args.context.isos[0]; + var apiCmd = "listIsos&isofilter=self&id=" + jsonObj.id; + if (jsonObj.zoneid != null) + apiCmd = apiCmd + "&zoneid=" + args.context.zones[0].zoneid; + + $.ajax({ + url: createURL(apiCmd), + dataType: "json", + success: function(json) { + args.response.success({ + actionFilter: isoActionfilter, + data: json.listisosresponse.iso[0] + }); + } + }); + + } + } + } + }} } } } From d5fbcafc2ff04e665c2ec8079c759fe4cabf9d1a Mon Sep 17 00:00:00 2001 From: Min Chen Date: Fri, 23 May 2014 14:46:41 -0700 Subject: [PATCH 491/683] Convert windows line ending to unix forIAMService.java. --- .../apache/cloudstack/iam/api/IAMService.java | 198 +++++++++--------- 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/services/iam/server/src/org/apache/cloudstack/iam/api/IAMService.java b/services/iam/server/src/org/apache/cloudstack/iam/api/IAMService.java index 3a470ee677..29e7c972b7 100644 --- a/services/iam/server/src/org/apache/cloudstack/iam/api/IAMService.java +++ b/services/iam/server/src/org/apache/cloudstack/iam/api/IAMService.java @@ -1,99 +1,99 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package org.apache.cloudstack.iam.api; - -import java.util.List; - -import org.apache.cloudstack.iam.api.IAMPolicyPermission.Permission; - -import com.cloud.utils.Pair; - -public interface IAMService { - - /* IAM group related interfaces */ - IAMGroup createIAMGroup(String iamGroupName, String description, String path); - - boolean deleteIAMGroup(Long iamGroupId); - - List listIAMGroups(long accountId); - - IAMGroup addAccountsToGroup(List acctIds, Long groupId); - - IAMGroup removeAccountsFromGroup(List acctIds, Long groupId); - - List listAccountsByGroup(long groupId); - - Pair, Integer> listIAMGroups(Long iamGroupId, String iamGroupName, String path, Long startIndex, Long pageSize); - - /* IAM Policy related interfaces */ - IAMPolicy createIAMPolicy(String iamPolicyName, String description, Long parentPolicyId, String path); - - boolean deleteIAMPolicy(long iamPolicyId); - - List listIAMPolicies(long accountId); - - List listIAMPoliciesByGroup(long groupId); - - Pair, Integer> listIAMPolicies(Long iamPolicyId, String iamPolicyName, String path, Long startIndex, Long pageSize); - - IAMGroup attachIAMPoliciesToGroup(List policyIds, Long groupId); - - IAMGroup removeIAMPoliciesFromGroup(List policyIds, Long groupId); - - void attachIAMPolicyToAccounts(Long policyId, List acctIds); - - void removeIAMPolicyFromAccounts(Long policyId, List acctIds); - - IAMPolicy addIAMPermissionToIAMPolicy(long iamPolicyId, String entityType, String scope, Long scopeId, - String action, String accessType, Permission perm, Boolean recursive); - - IAMPolicy removeIAMPermissionFromIAMPolicy(long iamPolicyId, String entityType, String scope, Long scopeId, - String action); - - void removeIAMPermissionForEntity(final String entityType, final Long entityId); - - IAMPolicy getResourceGrantPolicy(String entityType, Long entityId, String accessType, String action); - - IAMPolicy getResourceOwnerPolicy(); - - List listPolicyPermissions(long policyId); - - List listPolicyPermissionsByScope(long policyId, String action, String scope, String accessType); - - List listPolicyPermissionByActionAndEntity(long policyId, String action, String entityType); - - boolean isActionAllowedForPolicies(String action, List policies); - - List getGrantedEntities(long accountId, String action, String scope); - - IAMPolicy resetIAMPolicy(long iamPolicyId); - - List listPolicyPermissionByAccessAndEntity(long policyId, String accessType, - String entityType); - - List listParentIAMGroups(long groupId); - - List listRecursiveIAMPoliciesByGroup(long groupId); - - /* Interface used for cache IAM checkAccess result */ - void addToIAMCache(Object accessKey, Object allowDeny); - - Object getFromIAMCache(Object accessKey); - - void invalidateIAMCache(); - -} +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.iam.api; + +import java.util.List; + +import org.apache.cloudstack.iam.api.IAMPolicyPermission.Permission; + +import com.cloud.utils.Pair; + +public interface IAMService { + + /* IAM group related interfaces */ + IAMGroup createIAMGroup(String iamGroupName, String description, String path); + + boolean deleteIAMGroup(Long iamGroupId); + + List listIAMGroups(long accountId); + + IAMGroup addAccountsToGroup(List acctIds, Long groupId); + + IAMGroup removeAccountsFromGroup(List acctIds, Long groupId); + + List listAccountsByGroup(long groupId); + + Pair, Integer> listIAMGroups(Long iamGroupId, String iamGroupName, String path, Long startIndex, Long pageSize); + + /* IAM Policy related interfaces */ + IAMPolicy createIAMPolicy(String iamPolicyName, String description, Long parentPolicyId, String path); + + boolean deleteIAMPolicy(long iamPolicyId); + + List listIAMPolicies(long accountId); + + List listIAMPoliciesByGroup(long groupId); + + Pair, Integer> listIAMPolicies(Long iamPolicyId, String iamPolicyName, String path, Long startIndex, Long pageSize); + + IAMGroup attachIAMPoliciesToGroup(List policyIds, Long groupId); + + IAMGroup removeIAMPoliciesFromGroup(List policyIds, Long groupId); + + void attachIAMPolicyToAccounts(Long policyId, List acctIds); + + void removeIAMPolicyFromAccounts(Long policyId, List acctIds); + + IAMPolicy addIAMPermissionToIAMPolicy(long iamPolicyId, String entityType, String scope, Long scopeId, + String action, String accessType, Permission perm, Boolean recursive); + + IAMPolicy removeIAMPermissionFromIAMPolicy(long iamPolicyId, String entityType, String scope, Long scopeId, + String action); + + void removeIAMPermissionForEntity(final String entityType, final Long entityId); + + IAMPolicy getResourceGrantPolicy(String entityType, Long entityId, String accessType, String action); + + IAMPolicy getResourceOwnerPolicy(); + + List listPolicyPermissions(long policyId); + + List listPolicyPermissionsByScope(long policyId, String action, String scope, String accessType); + + List listPolicyPermissionByActionAndEntity(long policyId, String action, String entityType); + + boolean isActionAllowedForPolicies(String action, List policies); + + List getGrantedEntities(long accountId, String action, String scope); + + IAMPolicy resetIAMPolicy(long iamPolicyId); + + List listPolicyPermissionByAccessAndEntity(long policyId, String accessType, + String entityType); + + List listParentIAMGroups(long groupId); + + List listRecursiveIAMPoliciesByGroup(long groupId); + + /* Interface used for cache IAM checkAccess result */ + void addToIAMCache(Object accessKey, Object allowDeny); + + Object getFromIAMCache(Object accessKey); + + void invalidateIAMCache(); + +} From 6f3ff068270f48e00531c462de4f7d76395658ff Mon Sep 17 00:00:00 2001 From: santhosh Date: Fri, 23 May 2014 22:35:58 +1000 Subject: [PATCH 492/683] Added fix for CLOUDSTACK-6529 Fixed to continue adding all hosts, even if any addition fails and remove unused args from host class. Signed-off-by: santhosh Signed-off-by: Abhinandan Prateek --- tools/marvin/marvin/configGenerator.py | 5 +--- tools/marvin/marvin/deployDataCenter.py | 34 +++++++++++++++---------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/tools/marvin/marvin/configGenerator.py b/tools/marvin/marvin/configGenerator.py index 66609da751..191f08e070 100644 --- a/tools/marvin/marvin/configGenerator.py +++ b/tools/marvin/marvin/configGenerator.py @@ -154,11 +154,8 @@ def __init__(self): self.podid = None self.clusterid = None self.clustername = None - self.cpunumber = None - self.cpuspeed = None - self.hostmac = None self.hosttags = None - self.memory = None + self.allocationstate = None class physicalNetwork(object): diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py index 4d8be5826c..22b78abc86 100644 --- a/tools/marvin/marvin/deployDataCenter.py +++ b/tools/marvin/marvin/deployDataCenter.py @@ -117,18 +117,16 @@ def __addToCleanUp(self, type, id): self.__cleanUp["order"].append(type) def addHosts(self, hosts, zoneId, podId, clusterId, hypervisor): - try: - if hosts is None: - return - for host in hosts: + if hosts is None: + print "\n === Invalid Hosts Information ====" + return + failed_cnt = 0 + for host in hosts: + try: hostcmd = addHost.addHostCmd() hostcmd.clusterid = clusterId - hostcmd.cpunumber = host.cpunumer - hostcmd.cpuspeed = host.cpuspeed - hostcmd.hostmac = host.hostmac hostcmd.hosttags = host.hosttags hostcmd.hypervisor = host.hypervisor - hostcmd.memory = host.memory hostcmd.password = host.password hostcmd.podid = podId hostcmd.url = host.url @@ -139,10 +137,15 @@ def addHosts(self, hosts, zoneId, podId, clusterId, hypervisor): if ret: self.__tcRunLogger.debug("=== Add Host Successful ===") self.__addToCleanUp("Host", ret[0].id) - except Exception as e: - print "Exception Occurred %s" % GetDetailExceptionInfo(e) - self.__tcRunLogger.exception("=== Adding Host Failed ===") - self.__cleanAndExit() + except Exception as e: + failed_cnt = failed_cnt + 1 + print "Exception Occurred :%s" % GetDetailExceptionInfo(e) + self.__tcRunLogger.exception( + "=== Adding Host Failed :%s===" % str( + host.url)) + if failed_cnt == len(hosts): + self.__cleanAndExit() + continue def addVmWareDataCenter(self, vmwareDc): try: @@ -516,7 +519,8 @@ def configureProviders(self, phynetwrk, providers): self.enableProvider(pnetprovres[0].id) elif provider.name == 'SecurityGroupProvider': self.enableProvider(pnetprovres[0].id) - elif provider.name in ['JuniperContrailRouter', 'JuniperContrailVpcRouter']: + elif provider.name in ['JuniperContrailRouter', + 'JuniperContrailVpcRouter']: netprov = addNetworkServiceProvider.\ addNetworkServiceProviderCmd() netprov.name = provider.name @@ -1073,6 +1077,10 @@ def removeDataCenter(self): ''' Step1: Create the Logger ''' + if (options.input) and not (os.path.isfile(options.input)): + print "\n=== Invalid Input Config File Path, Please Check ===" + exit(1) + log_obj = MarvinLog("CSLog") cfg = configGenerator.getSetupConfig(options.input) log = cfg.logger From d9066f8d2931acc44ae66fc33f9eaa87b572de6a Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Fri, 23 May 2014 04:29:18 -0700 Subject: [PATCH 493/683] CLOUDSTACK-6758: [Marvin] Detect failed job and throw exception Signed-off-by: Abhinandan Prateek --- test/integration/component/test_accounts.py | 19 +++++------- .../component/test_add_remove_network.py | 15 ++++----- .../component/test_affinity_groups.py | 8 ++--- test/integration/component/test_assign_vm.py | 19 ++---------- .../component/test_ip_reservation.py | 20 +++++------- .../component/test_non_contiguous_vlan.py | 12 +++---- test/integration/component/test_projects.py | 21 +++++++------ test/integration/component/test_volumes.py | 10 +++--- test/integration/component/test_vpc.py | 7 ++--- .../integration/component/test_vpc_network.py | 8 ++--- .../component/test_vpc_network_lbrules.py | 7 ++--- .../component/test_vpc_vms_deployment.py | 15 +++------ test/integration/smoke/test_network.py | 13 +++----- test/integration/smoke/test_nic.py | 31 +++++++++---------- .../integration/smoke/test_primary_storage.py | 16 +++++----- test/integration/smoke/test_volumes.py | 25 ++++++++------- tools/marvin/marvin/cloudstackConnection.py | 17 +++------- tools/marvin/marvin/codes.py | 1 - 18 files changed, 105 insertions(+), 159 deletions(-) diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index 9b9ae75372..f71dea523d 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -18,6 +18,7 @@ """ #Import Local Modules from marvin.cloudstackTestCase import cloudstackTestCase +#from marvin.cloudstackAPI import * from marvin.lib.utils import (random_gen, cleanup_resources) from marvin.lib.base import (Domain, @@ -40,7 +41,7 @@ get_builtin_template_info, wait_for_cleanup) from nose.plugins.attrib import attr -from marvin.codes import ERROR_CODE_530 +from marvin.cloudstackException import CloudstackAPIException import time class Services: @@ -1672,18 +1673,16 @@ def test_forceDeleteDomain(self): " to cleanup any remaining resouces") # Sleep 3*account.gc to ensure that all resources are deleted wait_for_cleanup(self.apiclient, ["account.cleanup.interval"]*3) - response = Domain.list( + with self.assertRaises(CloudstackAPIException): + Domain.list( self.apiclient, id=domain.id, listall=True ) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) self.debug("Checking if the resources in domain are deleted") - with self.assertRaises(Exception): - response = Account.list( + with self.assertRaises(CloudstackAPIException): + Account.list( self.apiclient, name=self.account_1.name, domainid=self.account_1.domainid, @@ -1833,8 +1832,6 @@ def test_DeleteDomain(self): ) self.debug("Deleting domain without force option") - response = domain.delete(self.apiclient, cleanup=False) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + with self.assertRaises(Exception): + domain.delete(self.apiclient, cleanup=False) return diff --git a/test/integration/component/test_add_remove_network.py b/test/integration/component/test_add_remove_network.py index 969d94ca10..c17293d17a 100644 --- a/test/integration/component/test_add_remove_network.py +++ b/test/integration/component/test_add_remove_network.py @@ -58,7 +58,7 @@ removeNicFromVirtualMachine, updateDefaultNicForVirtualMachine) -from marvin.codes import PASS, ERROR_CODE_530 +from marvin.codes import PASS import random import time @@ -466,10 +466,8 @@ def test_05_add_vpc_nw_stopped_vm(self, value): self.cleanup.append(vpc) self.cleanup.append(vpc_off) self.debug("Trying to add VPC to vm belonging to isolated network, this should fail") - response = self.virtual_machine.add_nic(self.apiclient, vpc.id) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + with self.assertRaises(Exception): + self.virtual_machine.add_nic(self.apiclient, vpc.id) self.debug("Starting virtual machine") self.virtual_machine.start(self.apiclient) self.debug("Disabling vpc offering: %s" % vpc_off.id) @@ -827,10 +825,9 @@ def test_08_remove_default_nic(self): self.assertEqual(len(vm_list[0].nic), 1, "There should only be default nic present in the vm") self.debug("Trying to remove the default nic of vm : %s, this should fail" % self.virtual_machine.id) - response = self.virtual_machine.remove_nic(self.apiclient, vm_list[0].nic[0].id) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + with self.assertRaises(Exception): + self.virtual_machine.remove_nic(self.apiclient, vm_list[0].nic[0].id) + self.debug("Removing default nic of vm failed") return @attr(tags = ["advanced"]) diff --git a/test/integration/component/test_affinity_groups.py b/test/integration/component/test_affinity_groups.py index d31746afe5..d0fa2f7a3d 100644 --- a/test/integration/component/test_affinity_groups.py +++ b/test/integration/component/test_affinity_groups.py @@ -29,7 +29,6 @@ get_template, list_virtual_machines, wait_for_cleanup) -from marvin.codes import ERROR_CODE_530 from nose.plugins.attrib import attr class Services: @@ -1087,10 +1086,9 @@ def test_05_update_aff_grp_on_running_vm(self): vm1, hostid1 = self.create_vm_in_aff_grps([self.aff_grp[0].name], account_name=self.account.name, domain_id=self.domain.id) aff_grps = [self.aff_grp[0], self.aff_grp[1]] - response = vm1.update_affinity_group(self.api_client, affinitygroupnames=[]) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + with self.assertRaises(Exception): + vm1.update_affinity_group(self.api_client, affinitygroupnames=[]) + vm1.delete(self.api_client) #Wait for expunge interval to cleanup VM wait_for_cleanup(self.apiclient, ["expunge.delay", "expunge.interval"]) diff --git a/test/integration/component/test_assign_vm.py b/test/integration/component/test_assign_vm.py index 0b07e9f877..24b63a62f1 100644 --- a/test/integration/component/test_assign_vm.py +++ b/test/integration/component/test_assign_vm.py @@ -38,7 +38,6 @@ list_snapshots, list_virtual_machines) from marvin.lib.utils import cleanup_resources -from marvin.codes import ERROR_CODE_530 def log_test_exceptions(func): def test_wrap_exception_log(self, *args, **kwargs): @@ -370,14 +369,7 @@ def test_10_move_across_subdomain_vm_running(self): # 1. deploy VM in sub subdomain1 # 3. assignVirtualMachine to subdomain2 self.create_vm(self.sdomain_account_user1['account'], self.sdomain_account_user1['domain'],isRunning=True) - response = self.virtual_machine.assign_virtual_machine( - self.apiclient, - self.sdomain_account_user2['account'].name, - self.sdomain_account_user2['domain'].id) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) - return + self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, self.apiclient, self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id) @attr(tags = ["advanced"]) @log_test_exceptions @@ -388,14 +380,7 @@ def test_11_move_across_subdomain_vm_pfrule(self): # 1. deploy VM in sub subdomain1 with PF rule set. # 3. assignVirtualMachine to subdomain2 self.create_vm(self.sdomain_account_user1['account'], self.sdomain_account_user1['domain'],pfrule=True) - response = self.virtual_machine.assign_virtual_machine( - self.apiclient, - self.sdomain_account_user2['account'].name, - self.sdomain_account_user2['domain'].id) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) - return + self.assertRaises(Exception, self.virtual_machine.assign_virtual_machine, self.apiclient, self.sdomain_account_user2['account'].name ,self.sdomain_account_user2['domain'].id) @attr(tags = ["advanced"]) @log_test_exceptions diff --git a/test/integration/component/test_ip_reservation.py b/test/integration/component/test_ip_reservation.py index eb193d1494..8b91f37060 100644 --- a/test/integration/component/test_ip_reservation.py +++ b/test/integration/component/test_ip_reservation.py @@ -38,7 +38,7 @@ createNetworkRulesForVM, verifyNetworkState) from marvin.codes import (PASS, FAIL, FAILED, UNKNOWN, FAULT, MASTER, - NAT_RULE, STATIC_NAT_RULE, ERROR_CODE_530) + NAT_RULE, STATIC_NAT_RULE) import netaddr import random @@ -270,10 +270,8 @@ def test_update_cidr_multiple_vms_not_all_inclusive(self): except Exception as e: self.fail("VM creation failed: %s" % e) - response = isolated_network.update(self.apiclient, guestvmcidr=guest_vm_cidr) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + with self.assertRaises(Exception): + isolated_network.update(self.apiclient, guestvmcidr=guest_vm_cidr) return @attr(tags=["advanced"]) @@ -302,10 +300,8 @@ def test_update_cidr_single_vm_not_inclusive(self): except Exception as e: self.fail("VM creation failed: %s" % e) - response = isolated_network.update(self.apiclient, guestvmcidr=guest_vm_cidr) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + with self.assertRaises(Exception): + isolated_network.update(self.apiclient, guestvmcidr=guest_vm_cidr) return @data(NAT_RULE, STATIC_NAT_RULE) @@ -1087,10 +1083,8 @@ def test_network_not_implemented(self): else: isolated_network = resultSet[1] - response = isolated_network.update(self.apiclient, guestvmcidr="10.1.1.0/26") - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + with self.assertRaises(Exception): + response = isolated_network.update(self.apiclient, guestvmcidr="10.1.1.0/26") return @attr(tags=["advanced", "selfservice"]) diff --git a/test/integration/component/test_non_contiguous_vlan.py b/test/integration/component/test_non_contiguous_vlan.py index 1f74252a02..4609af95f1 100644 --- a/test/integration/component/test_non_contiguous_vlan.py +++ b/test/integration/component/test_non_contiguous_vlan.py @@ -27,7 +27,7 @@ #Import local modules -from marvin.cloudstackTestCase import (cloudstackTestCase) +from marvin.cloudstackTestCase import (cloudstackTestCase,unittest) from marvin.lib.base import (Account, ServiceOffering, PhysicalNetwork, @@ -40,7 +40,6 @@ setNonContiguousVlanIds) from marvin.lib.utils import (cleanup_resources, xsplit) -from marvin.codes import ERROR_CODE_530 from nose.plugins.attrib import attr @@ -318,11 +317,12 @@ def test_05_remove_used_range(self): self.debug("Deployed instance in account: %s" % account.name) self.debug("Trying to remove vlan range : %s , This should fail" % self.vlan["partial_range"][0]) - response = self.physicalnetwork.update(self.apiClient, id = self.physicalnetworkid, vlan = self.vlan["partial_range"][0]) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + with self.assertRaises(Exception) as e: + self.physicalnetwork.update(self.apiClient, id = self.physicalnetworkid, vlan = self.vlan["partial_range"][0]) + + self.debug("operation failed with exception: %s" % e.exception) account.delete(self.apiclient) + except Exception as e: self.fail("Exception in test case: %s" % e) diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py index cf6cec8c42..c593fb6d9e 100644 --- a/test/integration/component/test_projects.py +++ b/test/integration/component/test_projects.py @@ -17,13 +17,15 @@ """ P1 tests for Project """ #Import Local Modules +import marvin from nose.plugins.attrib import attr from marvin.cloudstackTestCase import * from marvin.cloudstackAPI import * from marvin.lib.utils import * from marvin.lib.base import * from marvin.lib.common import * -from marvin.codes import ERROR_CODE_530 +from marvin.sshClient import SshClient +import datetime class Services: @@ -428,14 +430,13 @@ def test_02_cross_domain_account_add(self): self.user.domainid, project.id )) - # Add user to the project from different domain - response = project.addAccount( + with self.assertRaises(Exception): + # Add user to the project from different domain + project.addAccount( self.apiclient, self.user.name ) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + self.debug("User add to project failed!") return @@ -541,10 +542,10 @@ def test_03_delete_account_with_project(self): "Check project name from list response" ) # Deleting account who is owner of the project - response = self.account.delete(self.apiclient) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + with self.assertRaises(Exception): + self.account.delete(self.apiclient) + self.debug("Deleting account %s failed!" % + self.account.name) return diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py index 4a91e5dff1..b5b08e2d5c 100644 --- a/test/integration/component/test_volumes.py +++ b/test/integration/component/test_volumes.py @@ -36,7 +36,6 @@ get_zone, get_template, get_pod) -from marvin.codes import ERROR_CODE_530 #Import System modules import time @@ -342,17 +341,16 @@ def test_02_volume_attach_max(self): True, "Check list volumes response for valid list" ) - self.debug("Trying to Attach volume: %s to VM: %s" % ( + # Attach volume to VM + with self.assertRaises(Exception): + self.debug("Trying to Attach volume: %s to VM: %s" % ( volume.id, self.virtual_machine.id )) - response = self.virtual_machine.attach_volume( + self.virtual_machine.attach_volume( self.apiclient, volume ) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) return class TestAttachDetachVolume(cloudstackTestCase): diff --git a/test/integration/component/test_vpc.py b/test/integration/component/test_vpc.py index 31b421c0fd..e9d396e8b8 100644 --- a/test/integration/component/test_vpc.py +++ b/test/integration/component/test_vpc.py @@ -25,7 +25,6 @@ from marvin.lib.utils import * from marvin.lib.base import * from marvin.lib.common import * -from marvin.codes import ERROR_CODE_530 class Services: @@ -700,10 +699,8 @@ def test_05_delete_vpc_with_networks(self): self.debug("Created network with ID: %s" % network_2.id) self.debug("Deleting the VPC with no network") - response = vpc.delete(self.apiclient) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + with self.assertRaises(Exception): + vpc.delete(self.apiclient) self.debug("Delete VPC failed as there are still networks in VPC") self.debug("Deleting the networks in the VPC") diff --git a/test/integration/component/test_vpc_network.py b/test/integration/component/test_vpc_network.py index 8d12ec6498..a449948c91 100644 --- a/test/integration/component/test_vpc_network.py +++ b/test/integration/component/test_vpc_network.py @@ -44,7 +44,7 @@ # For more info on ddt refer to http://ddt.readthedocs.org/en/latest/api.html#module-ddt from ddt import ddt, data import time -from marvin.codes import PASS, ERROR_CODE_530 +from marvin.codes import PASS class Services: """Test VPC network services @@ -2107,14 +2107,12 @@ def test_02_network_vpcvr2vr_upgrade(self): self.fail("Failed to stop VMs, %s" % e) self.debug("Upgrading network offering to support PF services") - response = network_1.update( + with self.assertRaises(Exception): + network_1.update( self.apiclient, networkofferingid=nw_off_vr.id, changecidr=True ) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) return class TestVPCNetworkGc(cloudstackTestCase): diff --git a/test/integration/component/test_vpc_network_lbrules.py b/test/integration/component/test_vpc_network_lbrules.py index 47bdce53a9..a5625e7216 100644 --- a/test/integration/component/test_vpc_network_lbrules.py +++ b/test/integration/component/test_vpc_network_lbrules.py @@ -39,7 +39,6 @@ get_template, list_routers) from marvin.lib.utils import cleanup_resources -from marvin.codes import ERROR_CODE_530 import socket import time @@ -641,10 +640,8 @@ def test_04_VPC_CreateLBRuleInMultipleNetworksVRStoppedState(self): lb_rule = self.create_LB_Rule(public_ip_1, network_1, [vm_1, vm_2], self.services["lbrule_http"]) # In a VPC, the load balancing service is supported only on a single tier. # http://cloudstack.apache.org/docs/en-US/Apache_CloudStack/4.0.2/html/Installation_Guide/configure-vpc.html - response = lb_rule.assign(self.apiclient, [vm_3]) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + with self.assertRaises(Exception): + lb_rule.assign(self.apiclient, [vm_3]) self.check_wget_from_vm(vm_1, public_ip_1, testnegative=False) return diff --git a/test/integration/component/test_vpc_vms_deployment.py b/test/integration/component/test_vpc_vms_deployment.py index 19aa448792..1c1f93d37e 100644 --- a/test/integration/component/test_vpc_vms_deployment.py +++ b/test/integration/component/test_vpc_vms_deployment.py @@ -19,7 +19,7 @@ """ #Import Local Modules from nose.plugins.attrib import attr -from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackTestCase import cloudstackTestCase, unittest from marvin.lib.base import (VirtualMachine, NetworkOffering, VpcOffering, @@ -43,7 +43,6 @@ get_free_vlan) from marvin.lib.utils import cleanup_resources -from marvin.codes import ERROR_CODE_530 from marvin.cloudstackAPI import rebootRouter @@ -1623,10 +1622,8 @@ def test_06_delete_network_vm_running(self): "Vm state should be running for each VM deployed" ) self.debug("Trying to delete network: %s" % network_1.name) - response = network_1.delete(self.apiclient) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + with self.assertRaises(Exception): + network_1.delete(self.apiclient) self.debug("Delete netwpork failed as there are running instances") self.debug("Destroying all the instances in network1: %s" % @@ -2164,10 +2161,8 @@ def test_07_delete_network_with_rules(self): ) self.debug("Trying to delete network: %s" % network_1.name) - response = network_1.delete(self.apiclient) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + with self.assertRaises(Exception): + network_1.delete(self.apiclient) self.debug("Delete network failed as there are running instances") self.debug("Destroying all the instances in network1: %s" % diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index 7cd3973b00..f81e95f827 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -27,7 +27,6 @@ from marvin.lib.base import * from marvin.lib.common import * from nose.plugins.attrib import attr -from marvin.codes import ERROR_CODE_530 #Import System modules import time @@ -384,14 +383,12 @@ def test_01_port_fwd_on_src_nat(self): try: nat_rule.delete(self.apiclient) + list_nat_rule_response = list_nat_rules( + self.apiclient, + id=nat_rule.id + ) except CloudstackAPIException: - self.fail("Nat Rule deletion failed: %s" % e) - - response = list_nat_rules(self.apiclient, - id=nat_rule.id) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + self.fail("Nat Rule Deletion or Listing Failed") # Check if the Public SSH port is inaccessible with self.assertRaises(Exception): diff --git a/test/integration/smoke/test_nic.py b/test/integration/smoke/test_nic.py index a76e858226..592a8391a0 100644 --- a/test/integration/smoke/test_nic.py +++ b/test/integration/smoke/test_nic.py @@ -15,17 +15,14 @@ # specific language governing permissions and limitations # under the License. """ NIC tests for VM """ -from marvin.codes import ERROR_CODE_530 -from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.lib.base import(Account, - ServiceOffering, - Network, - VirtualMachine, - NetworkOffering) -from marvin.lib.common import (get_zone, - get_domain, - get_template, - list_virtual_machines) +import marvin +from marvin.codes import FAILED +from marvin.cloudstackTestCase import * +from marvin.cloudstackAPI import * +from marvin.sshClient import SshClient +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * from nose.plugins.attrib import attr import signal @@ -189,7 +186,7 @@ def test_01_nic(self): existing_nic_id = vm_response.nic[0].id # 1. add a nic - self.virtual_machine.add_nic(self.apiclient, self.test_network2.id) + add_response = self.virtual_machine.add_nic(self.apiclient, self.test_network2.id) time.sleep(5) # now go get the vm list? @@ -234,11 +231,13 @@ def test_01_nic(self): "Verify second adapter is set to default" ) - response = self.virtual_machine.remove_nic(self.apiclient, new_nic_id) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + sawException = False + try: + self.virtual_machine.remove_nic(self.apiclient, new_nic_id) + except Exception as ex: + sawException = True + self.assertEqual(sawException, True, "Make sure we cannot delete the default NIC") self.virtual_machine.update_default_nic(self.apiclient, existing_nic_id) time.sleep(5) self.virtual_machine.remove_nic(self.apiclient, new_nic_id) diff --git a/test/integration/smoke/test_primary_storage.py b/test/integration/smoke/test_primary_storage.py index 5b24b6490f..3147d86645 100644 --- a/test/integration/smoke/test_primary_storage.py +++ b/test/integration/smoke/test_primary_storage.py @@ -17,18 +17,16 @@ """ BVT tests for Primary Storage """ #Import Local Modules -from marvin.cloudstackTestCase import cloudstackTestCase -#from marvin.cloudstackAPI import * -from marvin.lib.utils import cleanup_resources -from marvin.lib.base import StoragePool -from marvin.lib.common import (get_zone, - get_pod, - list_clusters, - list_hosts, - list_storage_pools) +import marvin +from marvin.cloudstackTestCase import * +from marvin.cloudstackAPI import * +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * from nose.plugins.attrib import attr #Import System modules +import time _multiprocess_shared_ = True class TestPrimaryStorageServices(cloudstackTestCase): diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index 6d55f1223a..e938e20098 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -18,9 +18,11 @@ """ #Import Local Modules from marvin.cloudstackTestCase import cloudstackTestCase +#from marvin.cloudstackException import * from marvin.cloudstackAPI import (deleteVolume, extractVolume, resizeVolume) +#from marvin.sshClient import SshClient from marvin.lib.utils import (cleanup_resources, format_volume_to_ext3) from marvin.lib.base import (ServiceOffering, @@ -33,7 +35,7 @@ get_zone, get_template) from marvin.lib.utils import checkVolumeSize -from marvin.codes import SUCCESS, FAILED, ERROR_CODE_530, XEN_SERVER +from marvin.codes import SUCCESS, FAILED, XEN_SERVER from nose.plugins.attrib import attr #Import System modules import os @@ -386,11 +388,8 @@ def test_03_download_attached_volume(self): cmd.zoneid = self.services["zoneid"] # A proper exception should be raised; # downloading attach VM is not allowed - response = self.apiClient.extractVolume(cmd) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) - return + with self.assertRaises(Exception): + self.apiClient.extractVolume(cmd) @attr(tags = ["advanced", "advancedns", "smoke", "basic", "selfservice"]) def test_04_delete_attached_volume(self): @@ -542,11 +541,15 @@ def test_07_resize_fail(self): cmd.id = rootvolume.id cmd.diskofferingid = self.services['diskofferingid'] success = False - - response = self.apiClient.resizeVolume(cmd) - self.assertEqual(response.errorcode, ERROR_CODE_530, "Job should \ - have failed with error code %s, instead got response \ - %s" % (ERROR_CODE_530, str(response))) + try: + self.apiClient.resizeVolume(cmd) + except Exception as ex: + if "Can only resize Data volumes" in str(ex): + success = True + self.assertEqual( + success, + True, + "ResizeVolume - verify root disks cannot be resized by disk offering id") # Ok, now let's try and resize a volume that is not custom. cmd.id = self.volume.id diff --git a/tools/marvin/marvin/cloudstackConnection.py b/tools/marvin/marvin/cloudstackConnection.py index 8044da7ec6..c49edf3a40 100644 --- a/tools/marvin/marvin/cloudstackConnection.py +++ b/tools/marvin/marvin/cloudstackConnection.py @@ -21,23 +21,14 @@ import hmac import hashlib import time -from cloudstackAPI import * +from cloudstackAPI import queryAsyncJobResult import jsonHelper from marvin.codes import ( FAILED, - INVALID_RESPONSE, - INVALID_INPUT, JOB_FAILED, - JOB_INPROGRESS, JOB_CANCELLED, JOB_SUCCEEDED ) -from requests import ( - ConnectionError, - HTTPError, - Timeout, - RequestException -) from marvin.cloudstackException import ( InvalidParameterException, GetDetailExceptionInfo) @@ -106,10 +97,12 @@ def __poll(self, jobid, response_cmd): marvinRequest(cmd, response_type=response_cmd) if async_response != FAILED: job_status = async_response.jobstatus - if job_status in [JOB_FAILED, - JOB_CANCELLED, + if job_status in [JOB_CANCELLED, JOB_SUCCEEDED]: break + elif job_status == JOB_FAILED: + raise Exception("Job failed: %s"\ + % async_response) time.sleep(5) timeout -= 5 self.logger.debug("=== JobId:%s is Still Processing, " diff --git a/tools/marvin/marvin/codes.py b/tools/marvin/marvin/codes.py index c72a6bde8f..ef49c0c3c8 100644 --- a/tools/marvin/marvin/codes.py +++ b/tools/marvin/marvin/codes.py @@ -60,7 +60,6 @@ JOB_SUCCEEDED = 1 JOB_FAILED = 2 JOB_CANCELLED = 3 -ERROR_CODE_530 = 530 ''' User Related Codes ''' From 7dc0fca2e90822014d3d6e3a01d2592e7caae5d2 Mon Sep 17 00:00:00 2001 From: vinayvarmav Date: Fri, 23 May 2014 16:21:04 +0530 Subject: [PATCH 494/683] CLOUDSTACK-6282-Added Automated testes for Networks and VPC API's Signed-off-by: Abhinandan Prateek --- .../component/test_escalations_networks.py | 2602 +++++++++++++++++ tools/marvin/marvin/config/test_data.py | 53 + tools/marvin/marvin/lib/base.py | 57 +- 3 files changed, 2711 insertions(+), 1 deletion(-) create mode 100644 test/integration/component/test_escalations_networks.py diff --git a/test/integration/component/test_escalations_networks.py b/test/integration/component/test_escalations_networks.py new file mode 100644 index 0000000000..6f9266bd0d --- /dev/null +++ b/test/integration/component/test_escalations_networks.py @@ -0,0 +1,2602 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# Import Local Modules +from marvin.cloudstackTestCase import * +from marvin.cloudstackException import * +from marvin.cloudstackAPI import * +from marvin.sshClient import SshClient +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * +from marvin.lib.utils import checkVolumeSize +from marvin.codes import SUCCESS +from nose.plugins.attrib import attr +from time import sleep + +class TestNetworks_1(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestNetworks_1, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + if cls.zone.localstorageenabled: + cls.storagetype = 'local' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' + else: + cls.storagetype = 'shared' + cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' + + cls.services['mode'] = cls.zone.networktype + cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.services["network_without_acl"]["zoneid"] = cls.zone.id + # Create Network offering + cls.network_offering = NetworkOffering.create( + cls.api_client, + cls.services["network_offering_vlan"], + ) + # Enable Network offering + cls.network_offering.update(cls.api_client, state='Enabled') + cls.services["network_without_acl"]["networkoffering"] = cls.network_offering.id + cls.service_offering = ServiceOffering.create( + cls.api_client, + cls.services["service_offerings"]["tiny"] + ) + # Creating Disk offering, Service Offering and Account + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls.account_network = Network.create( + cls.userapiclient, + cls.services["network_without_acl"], + cls.account.name, + cls.account.domainid + ) + cls._cleanup.append(cls.account_network) + cls._cleanup.append(cls.account) + cls._cleanup.append(cls.service_offering) + cls._cleanup.append(cls.network_offering) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + # Clean up, terminate the created volumes + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + def __verify_values(self, expected_vals, actual_vals): + """ + @summary: Function to verify expected and actual values + Step1: Initializing return flag to True + Step2: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step3: Listing all the keys from expected dictionary + Step4: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step5: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced"]) + def test_01_list_networks_pagination(self): + """ + @Desc: Test List Networks pagination + @Steps + Step1 : Listing the networks for a user + Step2 : Verifying listed networks for account created at class level + Step3 : If number of networks is less than (pagesize + 1), then creating them + Step4 : Listing the networks again + Step5 : Verifying for the length of the networks that it is (pagesize + 1) + Step6 : Listing and verifying all the networks in page1 + Step7 : Listing and verifying all the networks in page2 + Step8 : Verifying that on page 2 only 1 network is present and the network on page 2 is not present in page1 + """ + list_zones = Zone.list( + self.userapiclient, + id=self.zone.id + ) + status = validateList(list_zones) + self.assertEquals(PASS, status[0], "No Zones found for a given id") + self.services["network_without_acl"]["zoneid"] = list_zones[0].id + # Listing the networks for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying listed networks for account created at class level + if list_networks_before is None: + self.assertEqual( + len(list_networks_before), + 0, + "Network create failed at class level" + ) + # If number of networks is less than (pagesize + 1), then creating network + elif len(list_networks_before) == 1: + for i in range(0, (self.services["pagesize"])): + network_created = Network.create( + self.userapiclient, + self.services["network_without_acl"], + ) + self.cleanup.append(network_created) + self.assertIsNotNone( + network_created, + "Network is not created" + ) + # Creating expected and actual values dictionaries + expected_dict = { + "id":list_zones[0].id, + "name":self.services["network_without_acl"]["name"], + } + actual_dict = { + "id":network_created.zoneid, + "name":network_created.name, + } + network_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + network_status, + "Listed network details are not as expected" + ) + else: + self.assertEqual( + len(list_networks_before), + 1, + "more than 1 network created at class level" + ) + # Listing the networks + list_networks_after = Network.list(self.userapiclient, listall=self.services["listall"]) + status = validateList(list_networks_after) + self.assertEquals(PASS, status[0], "No networks found using list call") + # Asserting for the length of the networks + self.assertEqual( + len(list_networks_after), + (self.services["pagesize"] + 1), + "Number of networks created is not matching expected" + ) + # Listing all the networks in page1 + list_networks_page1 = Network.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_networks_page1) + self.assertEquals(PASS, status[0], "No networks found at page 1") + self.assertEqual( + len(list_networks_page1), + self.services["pagesize"], + "List network response is not matching with the page size length for page 1" + ) + # Listing all the networks in page2 + list_networks_page2 = Network.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_networks_page2) + self.assertEquals(PASS, status[0], "No networks found at page 2") + self.assertEqual( + len(list_networks_page2), + 1, + "List network response is not matching with the page size length for page 2" + ) + network_page2 = list_networks_page2[0] + for i in range(0, len(list_networks_page1)): + network_page1 = list_networks_page1[i] + self.assertNotEquals( + network_page2.id, + network_page1.id, + "Network listed in page 2 is also listed in page 1" + ) + return + + @attr(tags=["advanced"]) + def test_02_create_network_without_sourcenat(self): + """ + @Desc: Test create network if supported services doesn't have sourcenat + @Steps + Step1 : Create Network Offering without sourcenat + Step2 : Enable network offering + Step3 : Create network with sourcenat diasbled network offering + Step4 : Verifying that it raises an exception + """ + # Create Network offering specifically sourcenat disabled + network_offering_without_sourcenat = NetworkOffering.create( + self.apiClient, + self.services["network_offering_without_sourcenat"], + ) + if network_offering_without_sourcenat is None: + self.fail("Creation of network offering without sourcenat failed") + self.cleanup.append(network_offering_without_sourcenat) + + # Enable network offering + network_offering_without_sourcenat.update(self.apiClient, state='Enabled') + self.services["network_without_acl"]["networkoffering"] = network_offering_without_sourcenat.id + + # Network create call raise an exception + with self.assertRaises(Exception): + network_created = Network.create( + self.userapiclient, + self.services["network_without_acl"], + ) + if network_created is not None: + self.cleanup.append(network_created) + self.services["network_without_acl"]["networkoffering"] = self.network_offering.id + return + + @attr(tags=["advanced"]) + def test_03_list_vpc_pagination(self): + """ + @Desc: Test create vpc with network domain as parameter + @Steps + Step1 : List VPC Offering + Step2 : List VPCs for newly created user + Step3 : Create VPCs without network domain based on page size + Step4 : Verify count of VPCs created + Step5 : Listing all the VPCs in page1 + Step6 : Listing all the VPCs in page2 + Step7 : Verifying that on page 2 only 1 vpc is present and the vpc on page 2 is not present in page1 + Step8 : Deleting a single vpc and verifying that vpc does not exists on page 2 + """ + # List VPC Offering + vpc_offs_list = VpcOffering.list(self.userapiclient, isdefault="true") + if vpc_offs_list is None: + self.fail("Default VPC offerings not found") + else: + vpc_offs = vpc_offs_list[0] + # List VPCs + vpc_list = VPC.list( + self.userapiclient, + listall=self.services["listall"] + ) + # verify no vpc is present for newly created user + status = validateList(vpc_list) + self.assertEquals(FAIL, status[0], "VPCs found for newly created user") + vpc_count_before = 0 + for i in range(0, (self.services["pagesize"] + 1)): + vpc_1 = VPC.create( + self.userapiclient, + self.services["vpc"], + vpcofferingid=vpc_offs.id, + zoneid=self.zone.id, + ) + if(i < (self.services["pagesize"])): + self.cleanup.append(vpc_1) + # verify vpc is created and not none + self.assertIsNotNone(vpc_1, "VPC is not created") + # Verify VPC name with test data + self.assertNotEquals( + -1, + vpc_1.name.find(self.services["vpc"]["name"]), + "VPC name not matched" + ) + # verify zone with test data + self.assertEquals( + self.zone.id, + vpc_1.zoneid, + "Zone is not matching in the vpc created" + ) + # Asserting for the length of the VPCs + vpc_count_after = VPC.list(self.userapiclient, listall=self.services["listall"]) + status = validateList(vpc_count_after) + self.assertEquals(PASS, status[0], "VPC list count is null") + self.assertEqual( + len(vpc_count_after), + (self.services["pagesize"] + 1), + "Number of VPCs created is not matching expected" + ) + # Listing all the VPCs in page1 + list_vpcs_page1 = VPC.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vpcs_page1) + self.assertEquals(PASS, status[0], "No vpcs found in Page 1") + self.assertEqual( + len(list_vpcs_page1), + self.services["pagesize"], + "List vpc response is not matching with the page size length for page 1" + ) + # Listing all the vpcs in page2 + list_vpcs_page2 = VPC.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + status = validateList(list_vpcs_page2) + self.assertEquals(PASS, status[0], "No vpc found in Page 2") + self.assertEqual( + 1, + len(list_vpcs_page2), + "List VPCs response is not matching with the page size length for page 2" + ) + vpc_page2 = list_vpcs_page2[0] + # Verifying that on page 2 only 1 vpc is present and the vpc on page 2 is not present in page1 + for i in range(0, len(list_vpcs_page1)): + vpc_page1 = list_vpcs_page1[i] + self.assertNotEquals( + vpc_page2.id, + vpc_page1.id, + "VPC listed in page 2 is also listed in page 1" + ) + # Deleting a single vpc and verifying that vpc does not exists on page 2 + VPC.delete(vpc_1, self.userapiclient) + list_vpc_response = VPC.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"] + ) + self.assertEqual( + list_vpc_response, + None, + "vpc was not deleted" + ) + return + + @attr(tags=["advanced"]) + def test_04_create_vpc_with_networkdomain(self): + """ + @Desc: Test create vpc with network domain as parameter + @Steps + Step1 : List VPC Offering + Step2 : List VPCs for newly created user + Step3 : Create VPC + Step4 : List VPC and verify that count is increased by 1 + """ + # List VPC Offering + vpc_offs_list = VpcOffering.list(self.userapiclient, isdefault="true") + if vpc_offs_list is None: + self.fail("Default VPC offerings not found") + else: + vpc_offs = vpc_offs_list[0] + # List VPCs for newly created user + vpc_list = VPC.list( + self.userapiclient, + listall=self.services["listall"] + ) + # No VPCs should be present for newly created user + status = validateList(vpc_list) + self.assertEquals(FAIL, status[0], "VPCs found for newly created user") + vpc_count_before = 0 + vpc_1 = VPC.create( + self.userapiclient, + self.services["vpc_network_domain"], + vpcofferingid=vpc_offs.id, + zoneid=self.zone.id, + ) + self.assertIsNotNone(vpc_1, "VPC is not created") + self.cleanup.append(vpc_1) + # List VPCs + vpc_list = VPC.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(vpc_list) + self.assertEquals(PASS, status[0], "VPC is not created") + self.assertEquals( + vpc_count_before + 1, + len(vpc_list), + "VPC is not created" + ) + return + + @attr(tags=["advanced"]) + def test_05_list_network_offerings_with_and_without_vpc(self): + """ + @Desc: Test list network offerings for vpc true and false parameters + @Steps + Step1 : List network offering + Step2 : Create network offering with default setting of vpc = false + Step3 : List network offering + Step4 : Verify that count is incremented by 1 + Step5 : List network offering with additional parameter of vpc = true + Step6 : Verify that its count is same as step 1 + Step7 : List network offering with additional parameter of vpc = false + Step8 : Verify that its count is same as step 3 + """ + # List all network offering + network_offering_before_count = NetworkOffering.list(self.userapiclient) + status = validateList(network_offering_before_count) + self.assertEquals(PASS, status[0], "Default network offering not present") + # List network offering for vpc = true + network_offering_vpc_true_before_count = NetworkOffering.list( + self.userapiclient, + forvpc="true", + zoneid=self.zone.id, + guestiptype=self.services["network_offering_vlan"]["guestiptype"], + supportedServices="SourceNat", + specifyvlan=self.services["network_offering_vlan"]["specifyvlan"], + state="Enabled" + ) + status = validateList(network_offering_vpc_true_before_count) + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true") + # List network offering + network_offering_vpc_false_before_count = NetworkOffering.list( + self.userapiclient, + forvpc="false", + zoneid=self.zone.id, + guestiptype=self.services["network_offering_vlan"]["guestiptype"], + supportedServices="SourceNat", + specifyvlan=self.services["network_offering_vlan"]["specifyvlan"], + state="Enabled" + ) + status = validateList(network_offering_vpc_false_before_count) + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = false") + # Create network Offering + network_offering = NetworkOffering.create( + self.apiClient, + self.services["network_offering_vlan"], + ) + self.assertIsNotNone(network_offering, "Network offering is not created") + # Enable Network offering + network_offering.update(self.apiClient, state='Enabled') + self.cleanup.append(network_offering) + # List network offering + network_offering_after_count = NetworkOffering.list(self.userapiclient) + status = validateList(network_offering_after_count) + self.assertEquals(PASS, status[0], "Network Offering list results in null") + # Verify that count is incremented by 1 + self.assertEquals( + len(network_offering_before_count) + 1, + len(network_offering_after_count), + "Network offering is not created" + ) + # List network offering with additional parameter of vpc = true + network_offering_vpc_true_after_count = NetworkOffering.list( + self.userapiclient, + forvpc="true", + zoneid=self.zone.id, + guestiptype=self.services["network_offering_vlan"]["guestiptype"], + supportedServices="SourceNat", + specifyvlan=self.services["network_offering_vlan"]["specifyvlan"], + state="Enabled" + ) + status = validateList(network_offering_vpc_true_after_count) + self.assertEquals(PASS, status[0], "Network Offering list results in null") + # Verify that its count is same as step 1 + self.assertEquals( + len(network_offering_vpc_true_before_count), + len(network_offering_vpc_true_after_count), + "Default Network offering is created with vpc as true" + ) + # List network offering with additional parameter of vpc = false + network_offering_vpc_false_after_count = NetworkOffering.list( + self.userapiclient, + forvpc="false", + zoneid=self.zone.id, + guestiptype=self.services["network_offering_vlan"]["guestiptype"], + supportedServices="SourceNat", + specifyvlan=self.services["network_offering_vlan"]["specifyvlan"], + state="Enabled" + ) + status = validateList(network_offering_vpc_false_after_count) + self.assertEquals(PASS, status[0], "Network Offering list results in null") + # Verify that its count is same as step 3 + self.assertEquals( + len(network_offering_vpc_false_before_count) + 1, + len(network_offering_vpc_false_after_count), + "Default Network offering is not created with vpc as false" + ) + return + + @attr(tags=["advanced"]) + def test_06_create_network_in_vpc(self): + """ + @Desc: Test create network in vpc and verify VPC name + @Steps + Step1 : List VPC Offering + Step2 : List VPCs for newly created user + Step3 : Create VPC + Step4 : List VPC and verify that count is increased by 1 + Step5 : Create network + Step6 : List VPCs for specific network created in vpc + Step7 : Verify vpc name matches for newly created vpc name and name from vpc list + """ + # List VPC Offering + vpc_offs_list = VpcOffering.list(self.userapiclient, + isdefault="true", + ) + if vpc_offs_list is None: + self.fail("Default VPC offerings not found") + else: + vpc_offs = vpc_offs_list[0] + # List VPCs for newly created user + vpc_list = VPC.list( + self.userapiclient, + listall=self.services["listall"] + ) + # No VPCs should be present for newly created user + status = validateList(vpc_list) + self.assertEquals(FAIL, status[0], "VPCs found for newly created user") + vpc_count_before = 0 + vpc_1 = VPC.create( + self.userapiclient, + self.services["vpc"], + vpcofferingid=vpc_offs.id, + zoneid=self.zone.id, + ) + self.assertIsNotNone(vpc_1, "VPC is not created") + # List VPCs + vpc_list = VPC.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(vpc_list) + self.assertEquals(PASS, status[0], "VPC is not created") + self.assertEquals( + vpc_count_before + 1, + len(vpc_list), + "VPC is not created" + ) + # Listing the networks for a user + list_networks_before = Network.list(self.userapiclient, listall=self.services["listall"]) + # Verifying listed networks for account created at class level + self.assertIsNotNone(list_networks_before, "Network create failed at class level") + # List network offering for vpc = true + network_offering_vpc_true_list = NetworkOffering.list( + self.userapiclient, + forvpc="true", + zoneid=self.zone.id, + guestiptype=self.services["network_offering_vlan"]["guestiptype"], + supportedServices="SourceNat", + specifyvlan=self.services["network_offering_vlan"]["specifyvlan"], + state="Enabled" + ) + status = validateList(network_offering_vpc_true_list) + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true") + # Listing networks in VPC + list_networks_in_vpc = Network.list(self.userapiclient, + vpcid=vpc_1.id + ) + self.assertIsNone(list_networks_in_vpc, "Networks found for newly created VPC") + # If number of networks is 1, then creating network + if len(list_networks_before) == 1: + network_created = Network.create( + self.userapiclient, + self.services["network_without_acl"], + networkofferingid=network_offering_vpc_true_list[0].id, + vpcid=vpc_1.id, + gateway=self.services["ntwk"]["gateway"], + netmask=self.services["ntwk"]["netmask"], + domainid=self.domain.id, + accountid=self.account.name, + ) + self.assertIsNotNone( + network_created, + "Network is not created" + ) + self.cleanup.append(network_created) + self.cleanup.append(vpc_1) + # Creating expected and actual values dictionaries + expected_dict = { + "id":self.services["network_without_acl"]["zoneid"], + "name":self.services["network_without_acl"]["name"], + } + actual_dict = { + "id":network_created.zoneid, + "name":network_created.name, + } + network_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + network_status, + "Listed network details are not as expected" + ) + else: + self.assertEqual( + len(list_networks_before), + 1, + "more than 1 network created at class level" + ) + # Listing the networks + list_networks_after = Network.list(self.userapiclient, listall=self.services["listall"]) + status = validateList(list_networks_after) + self.assertEquals(PASS, status[0], "No networks found using list call") + # Asserting for the length of the networks + self.assertEqual( + 2, + len(list_networks_after), + "Number of networks created is not matching expected" + ) + # Listing networks in VPC after creation of network + list_networks_in_vpc = Network.list(self.userapiclient, + vpcid=vpc_1.id + ) + status = validateList(list_networks_in_vpc) + self.assertEquals(PASS, status[0], "No networks found in vpc") + # Asserting for the length of the networks + self.assertEqual( + 1, + len(list_networks_in_vpc), + "Number of networks created in vpc is not matching expected" + ) + # List VPCs for specific network created in vpc + vpc_list = VPC.list( + self.userapiclient, + id=network_created.vpcid + ) + # verify no vpc is present for newly created user + status = validateList(vpc_list) + self.assertEquals(PASS, status[0], "VPCs not found.") + # verify vpc name matches for newly created vpc name and vpc list name + self.assertEqual( + vpc_1.name, + vpc_list[0].name, + "VPC names not matching" + ) + return + + @attr(tags=["advanced"]) + def test_07_creation_deletion_network(self): + """ + @Desc: Test delete network + @Steps + Step1 : Create Network + Step2 : Verify Network is created + Step3 : Delete Network + Step4 : Verify network is deleted + """ + # Listing the networks for a user + list_networks_before = Network.list(self.userapiclient, listall=self.services["listall"]) + # Verifying listed networks for account created at class level + self.assertIsNotNone(list_networks_before, "Network create failed at class level") + # List network offering for vpc = false + network_offering_vpc_false_list = NetworkOffering.list( + self.userapiclient, + forvpc="false", + zoneid=self.zone.id, + guestiptype=self.services["network_offering_vlan"]["guestiptype"], + supportedServices="SourceNat", + specifyvlan=self.services["network_offering_vlan"]["specifyvlan"], + state="Enabled" + ) + status = validateList(network_offering_vpc_false_list) + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = false") + # If number of networks is 1, then creating network + if len(list_networks_before) == 1: + network_created = Network.create( + self.userapiclient, + self.services["network_without_acl"], + networkofferingid=network_offering_vpc_false_list[0].id, + ) + self.assertIsNotNone( + network_created, + "Network is not created" + ) + # Creating expected and actual values dictionaries + expected_dict = { + "id":self.services["network_without_acl"]["zoneid"], + "name":self.services["network_without_acl"]["name"], + } + actual_dict = { + "id":network_created.zoneid, + "name":network_created.name, + } + network_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + network_status, + "Listed network details are not as expected" + ) + else: + self.assertEqual( + len(list_networks_before), + 1, + "more than 1 network created at class level" + ) + # Listing the networks + list_networks_after = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_networks_after) + self.assertEquals(PASS, status[0], "No networks found using list call") + # Asserting for the length of the networks + self.assertEqual( + 2, + len(list_networks_after), + "Number of networks created is not matching expected" + ) + # Delete Network + Network.delete(network_created, self.userapiclient) + # List Networks + list_networks_after_delete = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_networks_after_delete) + self.assertEquals(PASS, status[0], "No networks found using list call") + self.assertEqual( + 1, + len(list_networks_after_delete), + "Number of networks created is not matching expected" + ) + # Verify deleted network is not present + self.assertNotEquals( + network_created.id, + list_networks_after_delete[0].id, + "Deleted network present" + ) + return + + @attr(tags=["advanced"]) + def test_08_update_network(self): + """ + @Desc: Test update network + @Steps + Step1 : Create Network + Step2 : Verify Network is created + Step3 : Update Network name, display text and network domain + Step4 : Verify network is updated + """ + # Listing the networks for a user + list_networks_before = Network.list(self.userapiclient, listall=self.services["listall"]) + # Verifying listed networks for account created at class level + self.assertIsNotNone(list_networks_before, "Network create failed at class level") + self.assertEquals( + 1, + len(list_networks_before), + "More than 1 network created at class level" + ) + # List network offering for vpc = false + network_offering_vpc_false_list = NetworkOffering.list( + self.userapiclient, + forvpc="false", + zoneid=self.zone.id, + guestiptype=self.services["network_offering_vlan"]["guestiptype"], + supportedServices="SourceNat", + specifyvlan=self.services["network_offering_vlan"]["specifyvlan"], + state="Enabled" + ) + status = validateList(network_offering_vpc_false_list) + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = false") + # creating network + network_created = Network.create( + self.userapiclient, + self.services["network_without_acl"], + networkofferingid=network_offering_vpc_false_list[0].id, + ) + self.assertIsNotNone( + network_created, + "Network is not created" + ) + self.cleanup.append(network_created) + # Creating expected and actual values dictionaries + expected_dict = { + "id":self.services["network_without_acl"]["zoneid"], + "name":self.services["network_without_acl"]["name"], + } + actual_dict = { + "id":network_created.zoneid, + "name":network_created.name, + } + network_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + network_status, + "Listed network details are not as expected" + ) + # Listing the networks + list_networks_after = Network.list(self.userapiclient, listall=self.services["listall"]) + status = validateList(list_networks_after) + self.assertEquals(PASS, status[0], "No networks found using list call") + # Asserting for the length of the networks + self.assertEqual( + 2, + len(list_networks_after), + "Number of networks created is not matching expected" + ) + # Update Network + network_updated = Network.update(network_created, + self.userapiclient, + name="NewNetworkName", + displaytext="NewNetworkDisplayText", + networkdomain="cs13cloud.internal.new" + ) + # List Networks + list_networks_after_update = Network.list(self.userapiclient, listall=self.services["listall"]) + status = validateList(list_networks_after_update) + self.assertEquals(PASS, status[0], "No networks found using list call") + self.assertEqual( + 2, + len(list_networks_after_update), + "Number of networks created is not matching expected" + ) + # Creating expected and actual values dictionaries + expected_dict = { + "name":"NewNetworkName", + "displaytext":"NewNetworkDisplayText", + "networkdomain":"cs13cloud.internal.new" + } + actual_dict = { + "name":network_updated.name, + "displaytext":network_updated.displaytext, + "networkdomain":network_updated.networkdomain + } + network_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + network_status, + "Listed network details are not as expected" + ) + return + + @attr(tags=["advanced"]) + def test_09_list_virtual_machines_single_network(self): + """ + @Desc: Test update network + @Steps + Step1 : Create Network + Step2 : Verify Network is created + Step3 : Create Virtual Machine as per page size + Step4 : Verify list Virtual machines and pagination + """ + # Listing the networks for a user + list_networks_before = Network.list(self.userapiclient, listall=self.services["listall"]) + # Verifying listed networks for account created at class level + self.assertIsNotNone(list_networks_before, "Network create failed at class level") + # Create Virtual Machine + # Listing all the instances for a user + list_instances_before = VirtualMachine.list(self.userapiclient, listall=self.services["listall"]) + # Verifying listed instances for account created at class level + self.assertIsNone( + list_instances_before, + "Virtual Machine already exists for newly created user" + ) + # If number of instances are less than (pagesize + 1), then creating them + for i in range(0, (self.services["pagesize"] + 1)): + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=list_networks_before[0].id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "VM creation failed" + ) + if(i < (self.services["pagesize"])): + self.cleanup.append(vm_created) + + self.assertEqual( + self.services["virtual_machine"]["displayname"], + vm_created.displayname, + "Newly created VM name and the test data VM name are not matching" + ) + # Listing all the instances again after creating VM's + list_instances_after = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + networkid=list_networks_before[0].id + ) + status = validateList(list_instances_after) + self.assertEquals( + PASS, + status[0], + "Listing of instances after creation failed" + ) + # Verifying the length of the instances is (page size + 1) + self.assertEqual( + len(list_instances_after), + (self.services["pagesize"] + 1), + "Number of instances created is not matching as expected" + ) + # Listing all the volumes in page1 + list_instances_page1 = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=1, + pagesize=self.services["pagesize"], + networkid=list_networks_before[0].id + ) + status = validateList(list_instances_page1) + self.assertEquals( + PASS, + status[0], + "Listing of instances in page1 failed" + ) + # Verifying that the length of the instances in page 1 is (page size) + self.assertEqual( + self.services["pagesize"], + len(list_instances_page1), + "List VM response is not matching with the page size length for page 1" + ) + # Listing all the VM's in page2 + list_instances_page2 = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"], + networkid=list_networks_before[0].id + ) + status = validateList(list_instances_page2) + self.assertEquals( + PASS, + status[0], + "Listing of instances in page2 failed" + ) + # Verifying that the length of the VM's in page 2 is 1 + self.assertEqual( + 1, + len(list_instances_page2), + "List VM response is not matching with the page size length for page 2" + ) + instance_page2 = list_instances_page2[0] + # Deleting a single VM + VirtualMachine.delete(vm_created, self.userapiclient) + # Listing the VM's in page 2 + list_instance_response = VirtualMachine.list( + self.userapiclient, + listall=self.services["listall"], + page=2, + pagesize=self.services["pagesize"], + networkid=list_networks_before[0].id + ) + # verifying that VM does not exists on page 2 + self.assertEqual( + list_instance_response, + None, + "VM was not deleted" + ) + return + + @attr(tags=["advanced"]) + def test_10_list_networks_in_vpc(self): + """ + @Desc: Test list networks in vpc and verify VPC name + @Steps + Step1 : List VPC Offering + Step2 : List VPCs for newly created user + Step3 : Create VPC + Step4 : List VPC and verify that count is increased by 1 + Step5 : Create network + Step6 : List Networks in created vpc + Step7 : Verify network name matches for newly created network name and name from network list + """ + # List VPC Offering + vpc_offs_list = VpcOffering.list(self.userapiclient, isdefault="true") + if vpc_offs_list is None: + self.fail("Default VPC offerings not found") + else: + vpc_offs = vpc_offs_list[0] + # List VPCs for newly created user + vpc_list = VPC.list( + self.userapiclient, + listall=self.services["listall"] + ) + # No VPCs should be present for newly created user + status = validateList(vpc_list) + self.assertEquals(FAIL, status[0], "VPCs found for newly created user") + vpc_count_before = 0 + vpc_1 = VPC.create( + self.userapiclient, + self.services["vpc"], + vpcofferingid=vpc_offs.id, + zoneid=self.zone.id, + ) + self.assertIsNotNone(vpc_1, "VPC is not created") + # List VPCs + vpc_list = VPC.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(vpc_list) + self.assertEquals(PASS, status[0], "VPC is not created") + self.assertEquals( + vpc_count_before + 1, + len(vpc_list), + "VPC is not created" + ) + # Listing the networks for a user + list_networks_before = Network.list(self.userapiclient, listall=self.services["listall"]) + # Verifying listed networks for account created at class level + self.assertIsNotNone(list_networks_before, "Network create failed at class level") + # List network offering for vpc = true + network_offering_vpc_true_list = NetworkOffering.list( + self.userapiclient, + forvpc="true", + zoneid=self.zone.id, + guestiptype=self.services["network_offering_vlan"]["guestiptype"], + supportedServices="SourceNat", + specifyvlan=self.services["network_offering_vlan"]["specifyvlan"], + state="Enabled" + ) + status = validateList(network_offering_vpc_true_list) + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true") + # If number of networks is 1, then creating network + if len(list_networks_before) == 1: + network_created = Network.create( + self.userapiclient, + self.services["network_without_acl"], + networkofferingid=network_offering_vpc_true_list[0].id, + vpcid=vpc_1.id, + gateway=self.services["ntwk"]["gateway"], + netmask=self.services["ntwk"]["netmask"] + ) + self.assertIsNotNone( + network_created, + "Network is not created" + ) + self.cleanup.append(network_created) + self.cleanup.append(vpc_1) + # Creating expected and actual values dictionaries + expected_dict = { + "id":self.services["network_without_acl"]["zoneid"], + "name":self.services["network_without_acl"]["name"], + } + actual_dict = { + "id":network_created.zoneid, + "name":network_created.name, + } + network_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + network_status, + "Listed network details are not as expected" + ) + else: + self.assertEqual( + len(list_networks_before), + 1, + "more than 1 network created at class level" + ) + # Listing the networks + list_networks_after = Network.list(self.userapiclient, listall=self.services["listall"]) + status = validateList(list_networks_after) + self.assertEquals(PASS, status[0], "No networks found using list call") + # Asserting for the length of the networks + self.assertEqual( + 2, + len(list_networks_after), + "Number of networks created is not matching expected" + ) + # Listing the networks + list_networks_in_vpc = Network.list( + self.userapiclient, + listall=self.services["listall"], + vpcid=vpc_1.id + ) + status = validateList(list_networks_in_vpc) + self.assertEquals(PASS, status[0], "No networks found using list call") + # Verify network name matches for newly created network name and name from network list + self.assertEqual( + network_created.name, + list_networks_in_vpc[0].name, + "Network names not matching" + ) + return + + @attr(tags=["advanced"]) + def test_11_update_vpc(self): + """ + @Desc: Test create vpc with network domain as parameter + @Steps + Step1 : List VPC Offering + Step2 : List VPCs for newly created user + Step3 : Create VPCs + Step4 : Verify count of VPCs created + Step5 : Update VPC name and display text + Step6 : Verify name and display text is updated + """ + # List VPC Offering + vpc_offs_list = VpcOffering.list(self.userapiclient, isdefault="true") + if vpc_offs_list is None: + self.fail("Default VPC offerings not found") + else: + vpc_offs = vpc_offs_list[0] + # List VPCs + vpc_list = VPC.list( + self.userapiclient, + listall=self.services["listall"] + ) + # verify no vpc is present for newly created user + status = validateList(vpc_list) + self.assertEquals(FAIL, status[0], "VPCs found for newly created user") + vpc_count_before = 0 + vpc_1 = VPC.create( + self.userapiclient, + self.services["vpc"], + vpcofferingid=vpc_offs.id, + zoneid=self.zone.id, + ) + self.assertIsNotNone(vpc_1, "VPC is not created") + self.cleanup.append(vpc_1) + # verify vpc is created and not none + # Verify VPC name with test data + self.assertNotEquals( + -1, + vpc_1.name.find(self.services["vpc"]["name"]), + "VPC name not matched" + ) + # verify zone with test data + self.assertEquals( + self.zone.id, + vpc_1.zoneid, + "Zone is not matching in the vpc created" + ) + # Asserting for the length of the VPCs + vpc_count_after = VPC.list(self.userapiclient, listall=self.services["listall"]) + status = validateList(vpc_count_after) + self.assertEquals(PASS, status[0], "VPC list count is null") + self.assertEqual( + 1, + len(vpc_count_after), + "Number of VPCs created is not matching expected" + ) + # Update VPC + vpc_updated = VPC.update( + vpc_1, + self.userapiclient, + name="NewVPCName", + displaytext="NewVPCDisplayText", + ) + # List Networks + list_vpcs_after_update = VPC.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_vpcs_after_update) + self.assertEquals(PASS, status[0], "No vpcs found using list call") + self.assertEqual( + 1, + len(list_vpcs_after_update), + "Number of vpcs created is not matching expected" + ) + # Creating expected and actual values dictionaries + expected_dict = { + "name":"NewVPCName", + "displaytext":"NewVPCDisplayText", + } + actual_dict = { + "name":vpc_updated.name, + "displaytext":vpc_updated.displaytext, + } + vpc_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + vpc_status, + "Listed vpc details are not as expected" + ) + return + + @attr(tags=["advanced"]) + def test_12_list_create_delete_networkACL(self): + """ + @Desc: Test create network in vpc and verify VPC name + @Steps + Step1 : List VPC Offering + Step2 : List VPCs for newly created user + Step3 : Create VPC + Step4 : List VPC and verify that count is increased by 1 + Step5 : Create network + Step6 : Verify network is created + Step7 : List Network ACLs + Step8 : Create Network ACL + Step9 : Verify NetworkACL is created + Step10 : Delete NetworkACL + Step11 : Verify NetworkACL is deleted + """ + # List VPC Offering + vpc_offs_list = VpcOffering.list(self.userapiclient, + isdefault="true", + ) + if vpc_offs_list is None: + self.fail("Default VPC offerings not found") + else: + vpc_offs = vpc_offs_list[0] + # List VPCs for newly created user + vpc_list = VPC.list( + self.userapiclient, + listall=self.services["listall"] + ) + # No VPCs should be present for newly created user + status = validateList(vpc_list) + self.assertEquals(FAIL, status[0], "VPCs found for newly created user") + vpc_count_before = 0 + vpc_1 = VPC.create( + self.userapiclient, + self.services["vpc"], + vpcofferingid=vpc_offs.id, + zoneid=self.zone.id, + ) + self.assertIsNotNone(vpc_1, "VPC is not created") + # List VPCs + vpc_list = VPC.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(vpc_list) + self.assertEquals(PASS, status[0], "VPC is not created") + self.assertEquals( + vpc_count_before + 1, + len(vpc_list), + "VPC is not created" + ) + # Listing the networks for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying listed networks for account created at class level + self.assertIsNotNone(list_networks_before, "Network create failed at class level") + # List network offering for vpc = true + network_offering_vpc_true_list = NetworkOffering.list( + self.userapiclient, + forvpc="true", + zoneid=self.zone.id, + guestiptype=self.services["network_offering_vlan"]["guestiptype"], + supportedServices="SourceNat", + specifyvlan=self.services["network_offering_vlan"]["specifyvlan"], + state="Enabled" + ) + status = validateList(network_offering_vpc_true_list) + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true") + # Listing networks in VPC + list_networks_in_vpc = Network.list(self.userapiclient, + vpcid=vpc_1.id + ) + self.assertIsNone(list_networks_in_vpc, "Networks found for newly created VPC") + # If number of networks is 1, then creating network + if len(list_networks_before) == 1: + network_created = Network.create( + self.userapiclient, + self.services["network_without_acl"], + networkofferingid=network_offering_vpc_true_list[0].id, + vpcid=vpc_1.id, + gateway=self.services["ntwk"]["gateway"], + netmask=self.services["ntwk"]["netmask"], + domainid=self.domain.id, + accountid=self.account.name, + ) + self.cleanup.append(network_created) + self.cleanup.append(vpc_1) + self.assertIsNotNone( + network_created, + "Network is not created" + ) + # Creating expected and actual values dictionaries + expected_dict = { + "id":self.services["network_without_acl"]["zoneid"], + "name":self.services["network_without_acl"]["name"], + } + actual_dict = { + "id":network_created.zoneid, + "name":network_created.name, + } + network_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + network_status, + "Listed network details are not as expected" + ) + else: + self.assertEqual( + len(list_networks_before), + 1, + "more than 1 network created at class level" + ) + # Listing the networks + list_networks_after = Network.list(self.userapiclient, listall=self.services["listall"]) + status = validateList(list_networks_after) + self.assertEquals(PASS, status[0], "No networks found using list call") + # Asserting for the length of the networks + self.assertEqual( + 2, + len(list_networks_after), + "Number of networks created is not matching expected" + ) + # Listing networks in VPC after creation of network + list_networks_in_vpc = Network.list(self.userapiclient, + vpcid=vpc_1.id + ) + status = validateList(list_networks_in_vpc) + self.assertEquals(PASS, status[0], "No networks found in vpc") + # Asserting for the length of the networks + self.assertEqual( + 1, + len(list_networks_in_vpc), + "Number of networks created in vpc is not matching expected" + ) + # List VPCs for specific network created in vpc + vpc_list = VPC.list( + self.userapiclient, + id=network_created.vpcid + ) + # List Network ACLs + list_network_acl = NetworkACL.list( + self.userapiclient, + networkid=network_created.id + ) + self.assertIsNone(list_network_acl, "ACL list is not empty for newly created network") + # Create NetworkACL + network_acl_created = NetworkACL.create( + self.userapiclient, + self.services["network_acl_rule"], + networkid=network_created.id + ) + self.assertIsNotNone( + network_acl_created, + "NetworkACL is not created" + ) + # List Network ACL + list_network_acl = NetworkACL.list( + self.userapiclient, + networkid=network_created.id + ) + status = validateList(list_network_acl) + self.assertEquals(PASS, status[0], "No networks acls found after creating") + # Asserting for the length of the networks + self.assertEqual( + 1, + len(list_network_acl), + "Number of networks acls reated is not matching expected" + ) + # Delete Network ACL + NetworkACL.delete(network_acl_created, self.userapiclient) + # List Network ACL + list_network_acl = NetworkACL.list( + self.userapiclient, + networkid=network_created.id + ) + self.assertIsNone(list_network_acl, "ACL list is not empty for newly created network") + return + +class TestNetworks_2(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + try: + cls._cleanup = [] + cls.testClient = super(TestNetworks_2, cls).getClsTestClient() + cls.api_client = cls.testClient.getApiClient() + cls.services = cls.testClient.getParsedTestDataConfig() + # Get Domain, Zone, Template + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + cls.services['mode'] = cls.zone.networktype + cls.account = Account.create( + cls.api_client, + cls.services["account"], + domainid=cls.domain.id + ) + # Getting authentication for user in newly created Account + cls.user = cls.account.user[0] + cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) + cls._cleanup.append(cls.account) + except Exception as e: + cls.tearDownClass() + raise Exception("Warning: Exception in setup : %s" % e) + return + + def setUp(self): + + self.apiClient = self.testClient.getApiClient() + self.cleanup = [] + + def tearDown(self): + # Clean up, terminate the created volumes + cleanup_resources(self.apiClient, self.cleanup) + return + + @classmethod + def tearDownClass(cls): + try: + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + + def __verify_values(self, expected_vals, actual_vals): + """ + @summary: Function to verify expected and actual values + Step1: Initializing return flag to True + Step1: Verifying length of expected and actual dictionaries is matching. + If not matching returning false + Step2: Listing all the keys from expected dictionary + Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value + If not making return flag to False + Step4: returning the return flag after all the values are verified + """ + return_flag = True + + if len(expected_vals) != len(actual_vals): + return False + + keys = expected_vals.keys() + for i in range(0, len(expected_vals)): + exp_val = expected_vals[keys[i]] + act_val = actual_vals[keys[i]] + if exp_val == act_val: + return_flag = return_flag and True + else: + return_flag = return_flag and False + self.debug("expected Value: %s, is not matching with actual value: %s" % ( + exp_val, + act_val + )) + return return_flag + + @attr(tags=["advanced", "provisioning"]) + def test_13_list_vpc_byid(self): + """ + @summary: Test List VPC with Id + @Steps + Step1: Listing all the vpc for a user before creating a vpc + Step2: Verifying no VPCs are listed + Step3: Creating a vpc + Step4: Listing the vpc for a user after creating a vpc + Step5: Verifying the list vpc size is increased by 1 + Step6: Listing the vpc by specifying vpc ID + Step7: Verifying the list vpc size is 1 + Step8: Verifying the details of the vpc + """ + # Listing all the vpc's for a user + list_vpc_before = VPC.list(self.userapiclient) + # Verifying No VPCs are listed + self.assertIsNone( + list_vpc_before, + "Vpc listed for newly created user" + ) + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals(PASS, status[0], "list vpc offering is none") + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone(vpc_created, "VPC Creation Failed") + self.cleanup.append(vpc_created) + # Listing the vpc for a user after creating a vpc + list_vpc_after = VPC.list(self.userapiclient) + status = validateList(list_vpc_after) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_vpc_after), + "list VPC not equal as expected" + ) + # List the vpc by specifying vpc ID + list_vpc_byid = VPC.list( + self.userapiclient, + id=vpc_created.id, + listall=self.services["listall"] + ) + + status = validateList(list_vpc_byid) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is 1 + self.assertEquals( + 1, + len(list_vpc_byid), + "list VPC not equal as expected" + ) + # Verifying the details of the vpc + expected_dict = { + "cidr":self.services["vpc"]["cidr"], + "id":vpc_created.id, + "displaytext":vpc_created.displaytext, + "account":self.account.name, + "domain":vpc_created.domain, + "domainid":self.domain.id, + "name":vpc_created.name + } + actual_dict = { + "cidr":str(list_vpc_byid[0].cidr), + "id":list_vpc_byid[0].id, + "displaytext":list_vpc_byid[0].displaytext, + "account":list_vpc_byid[0].account, + "domain":list_vpc_byid[0].domain, + "domainid":list_vpc_byid[0].domainid, + "name":list_vpc_byid[0].name + } + list_vpc_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vpc_status, + "Listed VPC details are not as expected" + ) + + return + + @attr(tags=["advanced", "provisioning"]) + def test_14_list_public_ipadress_by_associated_networkid(self): + """ + @summary: Test List Public IPAddress with associatednetworkid + @Steps + Step1: Listing all the public ipadresses for a user before creating a public ipaddress + Step2: Verifying no Public ipaddress are listed + Step3: Creating a network + Step4: Associating public ipaddress for network created in step3 + Step5: Listing the public ipaddress for a user after creating a public ipaddress + Step6: Verifying the list public ipaddress size is increased by 1 + Step7: Listing the public ipaddress by specifying associatednetworkid + Step8: Verifying the list public ipaddress size is 1 + Step9: Verifying the details of the public ipaddress + """ + # Listing all the public ipadresses for a user + list_public_ipadress_before = PublicIPAddress.list(self.userapiclient) + # Verifying No VPCs are listed + self.assertIsNone( + list_public_ipadress_before, + "Public ipaddresses listed for newly created user" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat", + zoneid=self.zone.id + ) + self.assertIsNotNone( + network_offerings_list, + "Isolated Network Offerings with sourceNat enabled are not found" + ) + #Creating a Network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Associating public ipaddress for network created + public_ipaddress_created = PublicIPAddress.create( + self.userapiclient, + accountid=self.account.name, + zoneid=self.zone.id, + domainid=self.domain.id, + networkid=network.id + ) + self.assertIsNotNone( + public_ipaddress_created, + "Failed to Associate Public IpAddress for Network" + ) + # Listing the public ipaddress for a user after associating a public ipaddress for network + list_public_ipaddress_after = PublicIPAddress.list(self.userapiclient) + status = validateList(list_public_ipaddress_after) + self.assertEquals( + PASS, + status[0], + "list Public IPAddress not as expected" + ) + # Verifying the list public ipaddress size is increased by 1 + self.assertEquals( + 1, + len(list_public_ipaddress_after), + "list Public IPAddress not equal as expected" + ) + # List the public ipaddress by specifying public ipaddress ID + list_public_ipaddress_byid = PublicIPAddress.list( + self.userapiclient, + associatednetworkid=network.id, + listall=self.services["listall"] + ) + status = validateList(list_public_ipaddress_byid) + self.assertEquals( + PASS, + status[0], + "list public ipaddress not as expected" + ) + # Verifying the list public ipaddress size is 1 + self.assertEquals( + 1, + len(list_public_ipaddress_byid), + "list public ipaddress not equal as expected" + ) + # Verifying the details of the public ipaddress + expected_dict = { + "account":public_ipaddress_created.ipaddress.account, + "associatednetworkid":public_ipaddress_created.ipaddress.associatednetworkid, + "associatednetworkname":public_ipaddress_created.ipaddress.associatednetworkname, + "domainid":public_ipaddress_created.ipaddress.domainid, + "forvirtualnetwork":public_ipaddress_created.ipaddress.forvirtualnetwork, + "id":public_ipaddress_created.ipaddress.id, + "ipaddress":public_ipaddress_created.ipaddress.ipaddress, + "isportable":public_ipaddress_created.ipaddress.isportable, + "issourcenat":public_ipaddress_created.ipaddress.issourcenat, + "isstatisnat":public_ipaddress_created.ipaddress.isstaticnat, + "issystem":public_ipaddress_created.ipaddress.issystem, + "networkid":public_ipaddress_created.ipaddress.network, + "physicalnetworkid":public_ipaddress_created.ipaddress.physicalnetworkid, + "zoneid":public_ipaddress_created.ipaddress.zoneid + } + actual_dict = { + "account":list_public_ipaddress_byid[0].account, + "associatednetworkid":list_public_ipaddress_byid[0].associatednetworkid, + "associatednetworkname":list_public_ipaddress_byid[0].associatednetworkname, + "domainid":list_public_ipaddress_byid[0].domainid, + "forvirtualnetwork":list_public_ipaddress_byid[0].forvirtualnetwork, + "id":list_public_ipaddress_byid[0].id, + "ipaddress":list_public_ipaddress_byid[0].ipaddress, + "isportable":list_public_ipaddress_byid[0].isportable, + "issourcenat":list_public_ipaddress_byid[0].issourcenat, + "isstatisnat":list_public_ipaddress_byid[0].isstaticnat, + "issystem":list_public_ipaddress_byid[0].issystem, + "networkid":list_public_ipaddress_byid[0].network, + "physicalnetworkid":list_public_ipaddress_byid[0].physicalnetworkid, + "zoneid":list_public_ipaddress_byid[0].zoneid + } + list_public_ipaddress_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_public_ipaddress_status, + "Listed Public IPAddress details are not as expected" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_15_list_privategateway_byvpcid(self): + """ + @summary: Test List PrivateGateway by vpcid + @Steps + Step1: Creating a VPC + Step2: Listing all the private gateway before creating a private gateway + Step3: Verifying no Private Gateway are listed + Step4: Listing the Private Gateway after creating a Private Gateway + Step5: Verifying the list Private Gateway size is increased by 1 + Step6: Listing the Private Gateway by specifying VPCID + Step7: Verifying the list Private Gateway size is 1 + Step8: Verifying the details of the Private Gateway + """ + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals( + PASS, + status[0], + "list vpc offering is none" + ) + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone(vpc_created, "VPC Creation Failed") + self.cleanup.append(vpc_created) + # Listing all the PrivateGateways + list_private_gateways_before = PrivateGateway.list( + self.apiClient, + listall=self.services["listall"], + vpcid=vpc_created.id + ) + # Verifying No PrivateGateways are listed + self.assertIsNone( + list_private_gateways_before, + "Listed private gateways for newly created VPC " + ) + #Creating a Private Gateway + private_gateway_created= PrivateGateway.create( + self.apiClient, + vpcid=vpc_created.id, + gateway=self.services["private_gateway"]["gateway"], + ipaddress=self.services["private_gateway"]["ipaddress"], + netmask=self.services["private_gateway"]["netmask"], + vlan=self.services["private_gateway"]["vlan"] + ) + self.assertIsNotNone( + private_gateway_created, + "Private Gateway Creation Failed" + ) + # Listing all the PrivateGateways + list_private_gateways_after = PrivateGateway.list( + self.apiClient, + listall=self.services["listall"], + vpcid=vpc_created.id + ) + # Verifying PrivateGateways are listed + status = validateList(list_private_gateways_after) + self.assertEquals(PASS, status[0], "Private Gateway Creation Failed") + self.assertEquals( + 1, + len(list_private_gateways_after), + "list Private Gateway not equal as expected" + ) + #Listing Private Gateway by vpcid + list_privategateway_byvpcid = PrivateGateway.list( + self.userapiclient, + listall=self.services["listall"], + vpcid=vpc_created.id + ) + status = validateList(list_privategateway_byvpcid) + self.assertEquals( + PASS, + status[0], + "list private gateway not as expected" + ) + # Verifying the list private gateway size is 1 + self.assertEquals( + 1, + len(list_privategateway_byvpcid), + "list private gateway not equal as expected" + ) + # Verifying the details of the private gateway + expected_dict = { + "account":private_gateway_created.account, + "aclid":private_gateway_created.aclid, + "domainid":private_gateway_created.domainid, + "gateway":self.services["private_gateway"]["gateway"], + "id":private_gateway_created.id, + "ipaddress":self.services["private_gateway"]["ipaddress"], + "netmask":self.services["private_gateway"]["netmask"], + "sourcenatsupported":private_gateway_created.sourcenatsupported, + "vlan":self.services["private_gateway"]["vlan"], + "vpcid":private_gateway_created.vpcid, + "zoneid":private_gateway_created.zoneid + } + actual_dict = { + "account":list_privategateway_byvpcid[0].account, + "aclid":list_privategateway_byvpcid[0].aclid, + "domainid":list_privategateway_byvpcid[0].domainid, + "gateway":list_privategateway_byvpcid[0].gateway, + "id":list_privategateway_byvpcid[0].id, + "ipaddress":list_privategateway_byvpcid[0].ipaddress, + "netmask":list_privategateway_byvpcid[0].netmask, + "sourcenatsupported":list_privategateway_byvpcid[0].sourcenatsupported, + "vlan":list_privategateway_byvpcid[0].vlan, + "vpcid":list_privategateway_byvpcid[0].vpcid, + "zoneid":list_privategateway_byvpcid[0].zoneid + } + list_private_gateway_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_private_gateway_status, + "Listed Private Gateway details are not as expected" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_16_create_list_delete_egressfirewallrule_bynetworkid(self): + """ + @summary: Test Create List Delete Egress Firewall Rule by Network ID + @Steps + Step1: Creating a Nerwork + Step2: Listing all the egressfirewall rule before creating a egressfirewall rule + Step3: Verifying no egressfirewall rule are listed + Step4: Creating a egressfirewall rule for a user + Step5: Listing the egressfirewall rule by specifying Network ID + Step7: Verifying the list egressfirewall rule size is 1 + Step8: Verifying the details of the egressfirewall rule + Step9: Deleting the egressfirewall rule by network id + Step10: Verifying no egressfirewall rule is listed + """ + # Listing all the Networks's for a user + list_networks_before = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying No Networks are listed + self.assertIsNone( + list_networks_before, + "Networks listed for newly created User" + ) + # Listing Network Offerings + network_offerings_list = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat", + zoneid=self.zone.id + ) + self.assertIsNotNone( + network_offerings_list, + "Isolated Network Offerings with sourceNat enabled are not found" + ) + # Creating a Network + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=network_offerings_list[0].id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # Listing Networks after + list_networks_after = Network.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_networks_after) + self.assertEquals( + PASS, + status[0], + "Network Creation Failed" + ) + # Verifying network list count is increased by 1 + self.assertEquals( + 1, + len(list_networks_after), + "Network Creation Failed" + ) + # Listing EgressFirewall Rule + list_egressfirewallrule_before = EgressFireWallRule.list( + self.userapiclient, + listall=self.services["listall"], + networkid=network.id + ) + # Verifying No EgressFirewall Rule are listed + self.assertIsNone( + list_egressfirewallrule_before, + "Listed egressfirewall rule for a user" + ) + # Creating a EgressFirewall Rule + egressfirewallrule_created = EgressFireWallRule.create( + self.userapiclient, + networkid=network.id, + protocol=self.services["ingress_rule"]["protocol"], + cidrlist=self.services["ingress_rule"]["cidrlist"], + startport=self.services["ingress_rule"]["startport"], + endport=self.services["ingress_rule"]["endport"], + ) + self.assertIsNotNone( + egressfirewallrule_created, + "EgressFirewall Rule Creation Failed" + ) + # ListingEgressFirewall Rule by networkid + list_egressfirewallrule_bynetworkid = EgressFireWallRule.list( + self.userapiclient, + listall=self.services["listall"], + networkid=network.id + ) + status = validateList(list_egressfirewallrule_bynetworkid) + self.assertEquals( + PASS, + status[0], + "list EgressFirewall Rule not as expected" + ) + # Verifying the list EgressFirewall Rule size is 1 + self.assertEquals( + 1, + len(list_egressfirewallrule_bynetworkid), + "list EgressFirewall Rule not equal as expected" + ) + # Verifying the details of the EgressFirewall Rule + expected_dict = { + "cidrlist":self.services["ingress_rule"]["cidrlist"], + "id":egressfirewallrule_created.id, + "networkid":egressfirewallrule_created.networkid, + "protocol":self.services["ingress_rule"]["protocol"] + } + actual_dict = { + "cidrlist":str(list_egressfirewallrule_bynetworkid[0].cidrlist), + "id":list_egressfirewallrule_bynetworkid[0].id, + "networkid":list_egressfirewallrule_bynetworkid[0].networkid, + "protocol":str(list_egressfirewallrule_bynetworkid[0].protocol).upper() + } + list_egressfirewallrule_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_egressfirewallrule_status, + "Listed EgressFirewall Rule details are not as expected" + ) + # Deleting the EgressFirewall Rule by networkid + egressfirewallrule_created.delete(self.userapiclient); + # Listing the EgressFirewall Rule by networkid + list_deleted_egressfirewallrule_bynetworkid = EgressFireWallRule.list( + self.userapiclient, + listall=self.services["listall"], + networkid=network.id + ) + # Verifying No EgressFirewall Rule are listed + self.assertIsNone( + list_deleted_egressfirewallrule_bynetworkid, + "EgressFirewall Rule deletion fails" + ) + return + + + @attr(tags=["advanced", "provisioning"]) + def test_17_restart_vpc(self): + """ + @summary: Test to restart VPC + @Steps + Step1: Listing the VPC before creating a VPC for a user + Step2: Verifying No VPCs are listed + Step3: Creating a VPC + Step4: Listing the VPC after creating a VPC for a user + Step5: Verifying the list VPC size is increased by 1 + Step6: Restarting the VPC + Step7: Verifying the Restart function return true + Step8: Listing the VPC by specifying VPCID + Step9: Verfying state of vpc + """ + # Listing all the vpc's for a user + list_vpc_before = VPC.list(self.userapiclient) + # Verifying No VPCs are listed + self.assertIsNone( + list_vpc_before, + "Vpc listed for newly created user" + ) + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals( + PASS, + status[0], + "list vpc offering is none" + ) + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone(vpc_created, "VPC Creation Failed") + # Listing the vpc for a user after creating a vpc + list_vpc_after = VPC.list(self.userapiclient) + status = validateList(list_vpc_after) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_vpc_after), + "list VPC not equal as expected" + ) + self.cleanup.append(vpc_created) + #Restarting VPC + vpc_restarted=VPC.restart(vpc_created, self.userapiclient) + #Verifying restart function resturns true + self.assertTrue(vpc_restarted,"Restart fails") + # List the vpc by specifying vpc ID + list_vpc_byid = VPC.list( + self.userapiclient, + id=vpc_created.id, + listall=self.services["listall"] + ) + status = validateList(list_vpc_byid) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is 1 + self.assertEquals( + 1, + len(list_vpc_byid), + "list VPC not equal as expected" + ) + #Verfying whether sate is Enabled + self.assertEqual( + "Enabled", + list_vpc_byid[0].state, + "Restarted VPC is not in Enabled state" + ) + return + + + + + @attr(tags=["advanced", "provisioning"]) + def test_18_create_list_vpn_gateway(self): + """ + @Desc: Test to Create and list Vpn Gateway by VPCid + @steps: + Step1: Create VPC + Step2: Listing VPN gateways for user before creating any VPN gateway + Step3: Verifying No VPN Gateways are listed + Step4: Creating a VPN Gateway using the vpc + Step5: Listing VPN gateway for user by vpcid + Step6: Verifying the list size is increased by 1 + Step7: Verifying the details of a VPN gateway + """ + # Listing all the vpc's for a user + list_vpc_before = VPC.list(self.userapiclient) + # Verifying No VPCs are listed + self.assertIsNone( + list_vpc_before, + "Vpc listed for newly created user" + ) + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals(PASS, status[0], "list vpc offering is none") + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone(vpc_created, "VPC Creation Failed") + self.cleanup.append(vpc_created) + # Listing the vpc for a user after creating a vpc + list_vpc_after = VPC.list(self.userapiclient) + status = validateList(list_vpc_after) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_vpc_after), + "list VPC not equal as expected" + ) + # Listing all the vpn gateways for a user + list_vpngateway_before = Vpn.listVpnGateway( + self.userapiclient, + listall=self.services["listall"], + vpcid=vpc_created.id + ) + # Verifying No VPN Gateways are listed + self.assertIsNone( + list_vpngateway_before, + "Vpn gateway listed for newly created user" + ) + #Creating a VPN Gateway + vpngateway_created= Vpn.createVpnGateway( + self.userapiclient, + vpcid=vpc_created.id, + ) + self.assertIsNotNone( + vpngateway_created, + "VPN Gateway creation failed" + ) + # Listing all the VPN Gateways for a User + list_vpngateway_after = Vpn.listVpnGateway( + self.userapiclient, + listall=self.services["listall"], + vpcid=vpc_created.id + ) + status = validateList(list_vpngateway_after) + self.assertEquals( + PASS, + status[0], + "List VPN Gateway not equal as expected" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_vpngateway_after + ), + "Failed to list vpn gateway" + ) + # Verifying the details of the vpn gateway + expected_dict = { + "account":vpngateway_created["account"], + "domainid":vpngateway_created["domainid"], + "id":vpngateway_created["id"], + "publicip":vpngateway_created["publicip"], + "vpcid":vpngateway_created["vpcid"] + } + actual_dict = { + "account":list_vpngateway_after[0].account, + "domainid":list_vpngateway_after[0].domainid, + "id":list_vpngateway_after[0].id, + "publicip":list_vpngateway_after[0].publicip, + "vpcid":list_vpngateway_after[0].vpcid + } + list_vpn_gateway_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vpn_gateway_status, + "Listed VPN Gateway details are not as expected" + ) + return + + @attr(tags=["advanced", "basic", "provisioning"]) + def test_19_create_list_reset_delete_vpnconnections(self): + """ + @Desc: Test to List Create Reset and Delete VPN Customer Gateways pagination + @steps: + Step1: Create VPC + Step2: Create VPN gateway + Step3: Create VPN Customer Gateway + Step4: Listing all the VPN Connections for a user + Step5: Verifying No VPN Connection are listed + Step6: Create a VPN Connection using VPN Gateway and VPN Customer Gateway + Step7: Listing all the VPN Connections by vpcid for a user + Step8: Verifying that list size is 1 + Step9: Reset the vpn connection + Step10:List the Vpn connection by vpcid + Step11: Verify the details of VPN Connection after reset + Step12: Deleting the VPN Connection + Step13: Listing all the VPN Connection for a user + Step14: Verifying that no VPN Connection are listed + """ + # Listing all the vpc's for a user + list_vpc_before = VPC.list(self.userapiclient) + # Verifying No VPCs are listed + self.assertIsNone( + list_vpc_before, + "Vpc listed for newly created user" + ) + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals(PASS, status[0], "list vpc offering is none") + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone(vpc_created, "VPC Creation Failed") + self.cleanup.append(vpc_created) + # Listing the vpc for a user after creating a vpc + list_vpc_after = VPC.list(self.userapiclient) + status = validateList(list_vpc_after) + self.assertEquals( + PASS, + status[0], + "list VPC not as expected" + ) + # Verifying the list vpc size is increased by 1 + self.assertEquals( + 1, + len(list_vpc_after), + "list VPC not equal as expected" + ) + # Listing all the vpn gateways for a user + list_vpngateway_before = Vpn.listVpnGateway( + self.userapiclient, + listall=self.services["listall"], + vpcid=vpc_created.id + ) + # Verifying No VPN Gateways are listed + self.assertIsNone( + list_vpngateway_before, + "Vpn gateway listed for newly created user" + ) + #Creating a VPN Gateway + vpngateway_created= Vpn.createVpnGateway( + self.userapiclient, + vpcid=vpc_created.id, + ) + self.assertIsNotNone( + vpngateway_created, + "VPN Gateway creation failed" + ) + # Listing all the VPN Gateways for a User + list_vpngateway_after = Vpn.listVpnGateway( + self.userapiclient, + listall=self.services["listall"], + vpcid=vpc_created.id + ) + status = validateList(list_vpngateway_after) + self.assertEquals( + PASS, + status[0], + "List VPN Gateway not equal as expected" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_vpngateway_after + ), + "Failed to list vpn gateway" + ) + # Listing all the VPN Customer Gateways for a User + list_vpncustomergateways_before = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying that no VPN Customer Gateways are listed + self.assertIsNone( + list_vpncustomergateways_before, + "VPN Customer Gateways listed for newly created User" + ) + # Creating VPN Customer Gateways + vpncustomergateway_created = VpnCustomerGateway.create( + self.userapiclient, + self.services["vpncustomergateway"], + name="VPNCustGateway", + gateway="10.102.153.1", + cidrlist="10.0.0.0/24", + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNotNone( + vpncustomergateway_created, + "VPN Customer Gateway creation failed" + ) + self.cleanup.append(vpncustomergateway_created) + # Listing all the VPN Customer Gateways for a User + list_vpncustomergateways_after = VpnCustomerGateway.list( + self.userapiclient, + listall=self.services["listall"], + ) + status = validateList(list_vpncustomergateways_after) + self.assertEquals( + PASS, + status[0], + "VPN Customer Gateway list failed" + ) + # Verifying that list size is 1 + self.assertEquals( + 1, + len(list_vpncustomergateways_after), + "Failed to list VPN Customer Gateways" + ) + # Listing all the vpc's for a user + list_vpn_connection_before = Vpn.listVpnConnection( + self.userapiclient, + listall=self.services["listall"], + vpcid=vpc_created.id + ) + # Verifying No VPC Connections are listed + self.assertIsNone( + list_vpn_connection_before, + "Vpn connection listed for newly created user" + ) + #Creating VPN Connection + vpnconnections_created=Vpn.createVpnConnection( + self.userapiclient, + s2scustomergatewayid=vpncustomergateway_created.id, + s2svpngatewayid=vpngateway_created["id"] + ) + self.assertIsNotNone( + vpnconnections_created, + "VPN Connection creation failed" + ) + # Listing the vpn connection for a user after creating a vpn connection + list_vpn_connection_after = Vpn.listVpnConnection( + self.userapiclient, + listall=self.services["listall"], + vpcid=vpc_created.id + ) + status = validateList(list_vpn_connection_after) + self.assertEquals( + PASS, + status[0], + "list VPN Connection not as expected" + ) + # Verifying the list vpn connection size is increased by 1 + self.assertEquals( + 1, + len(list_vpn_connection_after), + "list VPC Connection equal as expected" + ) + # Resets VPN Connection + Vpn.resetVpnConnection( + self.userapiclient, + id=list_vpn_connection_after[0].id, + ) + # Lists VPN Connection by vpcid + list_vpn_connection_after_reset=Vpn.listVpnConnection( + self.userapiclient, + listall=self.services["listall"], + vpcid=vpc_created.id + ) + status = validateList(list_vpn_connection_after_reset) + self.assertEquals( + PASS, + status[0], + "list VPN Connection not as expected" + ) + # Verifying the list vpn connection size is increased by 1 + self.assertEquals( + 1, + len(list_vpn_connection_after_reset), + "list VPN Connection not equal as expected" + ) + # Verifying the details of the vpn connection after reset + expected_dict = { + "account":list_vpn_connection_after[0].account, + "cidrlist":list_vpn_connection_after[0].cidrlist, + "domain":list_vpn_connection_after[0].domain, + "dpd":list_vpn_connection_after[0].dpd, + "gateway":list_vpn_connection_after[0].gateway, + "id":list_vpn_connection_after[0].id, + "passive":list_vpn_connection_after[0].passive, + "publicip":list_vpn_connection_after[0].publicip, + "s2scustomergatewayid":list_vpn_connection_after[0].s2scustomergatewayid, + "s2svpngatewayid":list_vpn_connection_after[0].s2svpngatewayid + } + actual_dict = { + "account":list_vpn_connection_after_reset[0].account, + "cidrlist":list_vpn_connection_after_reset[0].cidrlist, + "domain":list_vpn_connection_after_reset[0].domain, + "dpd":list_vpn_connection_after_reset[0].dpd, + "gateway":list_vpn_connection_after_reset[0].gateway, + "id":list_vpn_connection_after_reset[0].id, + "passive":list_vpn_connection_after_reset[0].passive, + "publicip":list_vpn_connection_after_reset[0].publicip, + "s2scustomergatewayid":list_vpn_connection_after_reset[0].s2scustomergatewayid, + "s2svpngatewayid":list_vpn_connection_after_reset[0].s2svpngatewayid + } + list_vpn_connection_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_vpn_connection_status, + "Listed VPN Connection details are not as expected" + ) + # Delete VPN Connection + Vpn.deleteVpnConnection( + self.userapiclient, + id=list_vpn_connection_after[0].id + ) + # Listing all the vpc connections for a user + list_vpn_connection_after_delete = Vpn.listVpnConnection( + self.userapiclient, + listall=self.services["listall"], + vpcid=vpc_created.id + ) + # Verifying No VPN Connections are listed + self.assertIsNone( + list_vpn_connection_after_delete, + "Vpn connection listed for newly created user" + ) + return + @attr(tags=["advanced", "provisioning"]) + def test_20_list_capabilities(self): + """ + @summary: Test List Capabilities + @Steps + Step1: Listing all the Capabilities for a user + Step2: Verifying the listcapabilities object is not null + Step3: Verifying list.cloudstack version is not null + """ + # Listing all the Capabilities for a user + listCapabilities=Configurations.listCapabilities(self.userapiclient) + # Verifying the listcapabilities object is not null + self.assertIsNotNone( + listCapabilities, + "Failed to list Capabilities" + ) + # Verifying list.cloudstack version is not null + self.assertIsNotNone( + listCapabilities.cloudstackversion, + "Failed to list cloud Stack version" + ) + return + + @attr(tags=["advanced", "provisioning"]) + def test_21_listNetworkacls_by_privategateway_aclid(self): + """ + @summary: Test to list Networkacllists by private gateway aclid + @Steps + Step1: Listing the Network acl's for a user + Step2: Verifying list is not none + Step3: Creating a VPC + Step4: Listing the privategateway for user + Step5: Verifying the no private gateway are listed for a user + Step6: Creating a private gateway using aclid + Step7: Listing private gateway for a user + Step8: Verifying list size is increased by 1 + Step9: Listing Networkacllist by paymentgateway aclid + """ + # Listing all thenetwork acl list for a user + list_networkacl = NetworkACLList.list(self.userapiclient) + self.assertIsNotNone(list_networkacl, "Failed to list network acl list") + # Verfying list is not none + status = validateList(list_networkacl) + self.assertEquals( + PASS, + status[0], + "Failed to list network acl list" + ) + + # Listing VPC Offerings + list_vpc_offering = VpcOffering.list(self.userapiclient) + status = validateList(list_vpc_offering) + self.assertEquals( + PASS, + status[0], + "list vpc offering is none" + ) + # Creating a vpc + vpc_created = VPC.create( + self.userapiclient, + self.services["vpc"], + list_vpc_offering[0].id, + self.zone.id + ) + self.assertIsNotNone(vpc_created, "VPC Creation Failed") + self.cleanup.append(vpc_created) + # Listing all the PrivateGateways + list_private_gateways_before = PrivateGateway.list( + self.apiClient, + listall=self.services["listall"], + vpcid=vpc_created.id + ) + # Verifying No PrivateGateways are listed + self.assertIsNone( + list_private_gateways_before, + "Listed private gateways for newly created VPC " + ) + #Creating a Private Gateway using aclid + private_gateway_created= PrivateGateway.create( + self.apiClient, + vpcid=vpc_created.id, + gateway=self.services["private_gateway"]["gateway"], + ipaddress=self.services["private_gateway"]["ipaddress"], + netmask=self.services["private_gateway"]["netmask"], + vlan=self.services["private_gateway"]["vlan"], + aclid=list_networkacl[0].id + ) + self.assertIsNotNone( + private_gateway_created, + "Private Gateway Creation Failed" + ) + # Listing all the PrivateGateways + list_private_gateways_after = PrivateGateway.list( + self.apiClient, + listall=self.services["listall"], + vpcid=vpc_created.id + ) + # Verifying PrivateGateways are listed + status = validateList(list_private_gateways_after) + self.assertEquals(PASS, status[0], "Failed to list Private Gateway") + self.assertEquals( + 1, + len(list_private_gateways_after), + "list Private Gateway not equal as expected" + ) + #Listing network acl list by paymentgateway.aclid + list=NetworkACLList.list(self.userapiclient, + listall=self.services["listall"], + id=private_gateway_created.aclid + ) + # Verifying the details of the Network acl list + expected_dict = { + "description":list_networkacl[0].description, + "id":list_networkacl[0].id, + "name":list_networkacl[0].name + } + actual_dict = { + "description":list[0].description, + "id":list[0].id, + "name":list[0].name + } + list_networkacl_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + list_networkacl_status, + "Listed Network acl list details are not as expected" + ) + return \ No newline at end of file diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py index 9df3f2f060..44ef8d5fc2 100644 --- a/tools/marvin/marvin/config/test_data.py +++ b/tools/marvin/marvin/config/test_data.py @@ -41,6 +41,14 @@ "name": "Project", "displaytext": "Test project" }, + "private_gateway": { + "ipaddress": "172.16.1.2", + "gateway": "172.16.1.1", + "netmask": "255.255.255.0", + "vlan":"10", + "name":"test_private_gateway" + + }, "account": { "email": "test-account@test.com", "firstname": "test", @@ -214,6 +222,34 @@ "StaticNat": "VirtualRouter" } }, + "network_offering_vlan": { + "name": 'Test Network offering', + "displaytext": 'Test Network offering', + "guestiptype": 'Isolated', + "supportedservices": 'Dhcp,Dns,SourceNat,PortForwarding', + "traffictype": 'GUEST', + "specifyvlan": 'False', + "availability": 'Optional', + "serviceProviderList" : { + "Dhcp": 'VirtualRouter', + "Dns": 'VirtualRouter', + "SourceNat": 'VirtualRouter', + "PortForwarding": 'VirtualRouter', + }, + }, + "network_offering_without_sourcenat": { + "name": 'Test Network offering', + "displaytext": 'Test Network offering', + "guestiptype": 'Isolated', + "supportedservices": 'Dhcp,Dns,UserData', + "traffictype": 'GUEST', + "availability": 'Optional', + "serviceProviderList" : { + "Dhcp": 'VirtualRouter', + "Dns": 'VirtualRouter', + "UserData": 'VirtualRouter', + }, + }, "isolated_network": { "name": "Isolated Network", "displaytext": "Isolated Network" @@ -230,6 +266,10 @@ "lbdevicecapacity": 2, "port": 22 }, + "network_without_acl": { + "name": "TestNetwork", + "displaytext": "TestNetwork", + }, "virtual_machine": { "displayname": "Test VM", "username": "root", @@ -345,6 +385,12 @@ "displaytext": "TestVPC", "cidr": "10.0.0.1/24" }, + "vpc_network_domain": { + "name": "TestVPC", + "displaytext": "TestVPC", + "cidr": '10.0.0.1/24', + "network_domain": "TestVPC" + }, "clusters": { 0: { "clustername": "Xen Cluster", @@ -592,6 +638,13 @@ }, }, + "network_acl_rule": { + "protocol":"TCP", + "traffictype":"ingress", + "cidrlist":"0.0.0.0/0", + "startport":"1", + "endport":"1" + }, "network_offering_internal_lb": { "name": "Network offering for internal lb service", "displaytext": "Network offering for internal lb service", diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py index 7d08e89eff..e5e558e17b 100644 --- a/tools/marvin/marvin/lib/base.py +++ b/tools/marvin/marvin/lib/base.py @@ -2702,6 +2702,52 @@ def create(cls, apiclient, publicipid, account=None, domainid=None, if openfirewall: cmd.openfirewall = openfirewall return Vpn(apiclient.createRemoteAccessVpn(cmd).__dict__) + + @classmethod + def createVpnGateway(cls, apiclient, vpcid): + """Create VPN Gateway """ + cmd = createVpnGateway.createVpnGatewayCmd() + cmd.vpcid = vpcid + return (apiclient.createVpnGateway(cmd).__dict__) + + @classmethod + def createVpnConnection(cls, apiclient, s2scustomergatewayid,s2svpngatewayid): + """Create VPN Connection """ + cmd = createVpnConnection.createVpnConnectionCmd() + cmd.s2scustomergatewayid = s2scustomergatewayid + cmd.s2svpngatewayid = s2svpngatewayid + return (apiclient.createVpnGateway(cmd).__dict__) + + @classmethod + def resetVpnConnection(cls, apiclient,id): + """Reset VPN Connection """ + cmd = resetVpnConnection.resetVpnConnectionCmd() + cmd.id = id + return (apiclient.resetVpnConnection(cmd).__dict__) + + @classmethod + def deleteVpnConnection(cls, apiclient,id): + """Delete VPN Connection """ + cmd = deleteVpnConnection.deleteVpnConnectionCmd() + cmd.id = id + return (apiclient.deleteVpnConnection(cmd).__dict__) + + @classmethod + def listVpnGateway(cls, apiclient, **kwargs): + """List all VPN Gateways matching criteria""" + + cmd = listVpnGateways.listVpnGatewaysCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVpnGateways(cmd)) + + @classmethod + def listVpnConnection(cls, apiclient, **kwargs): + """List all VPN Connections matching criteria""" + + cmd = listVpnConnections.listVpnConnectionsCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listVpnConnections(cmd)) + def delete(self, apiclient): """Delete remote VPN access""" @@ -3465,7 +3511,14 @@ def list(cls, apiclient, **kwargs): if 'account' in kwargs.keys() and 'domainid' in kwargs.keys(): cmd.listall=True return(apiclient.listConfigurations(cmd)) + + @classmethod + def listCapabilities(cls, apiclient, **kwargs): + """Lists capabilities""" + cmd = listCapabilities.listCapabilitiesCmd() + [setattr(cmd, k, v) for k, v in kwargs.items()] + return(apiclient.listCapabilities(cmd)) class NetScaler: @@ -3832,7 +3885,7 @@ def __init__(self, items): @classmethod def create(cls, apiclient, gateway, ipaddress, netmask, vlan, vpcid, - physicalnetworkid=None): + physicalnetworkid=None, ,aclid=None): """Create private gateway""" cmd = createPrivateGateway.createPrivateGatewayCmd() @@ -3843,6 +3896,8 @@ def create(cls, apiclient, gateway, ipaddress, netmask, vlan, vpcid, cmd.vpcid = vpcid if physicalnetworkid: cmd.physicalnetworkid = physicalnetworkid + if aclid: + cmd.aclid = aclid return PrivateGateway(apiclient.createPrivateGateway(cmd).__dict__) From c3c809647667229c4e46096a85dbbf75eec4d005 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Wed, 21 May 2014 03:56:42 -0700 Subject: [PATCH 495/683] Fixed issues in regression suite project cpu limits Signed-off-by: Abhinandan Prateek --- test/integration/component/test_cpu_project_limits.py | 3 ++- tools/marvin/marvin/lib/base.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/integration/component/test_cpu_project_limits.py b/test/integration/component/test_cpu_project_limits.py index b33b9f120c..e7958289ca 100644 --- a/test/integration/component/test_cpu_project_limits.py +++ b/test/integration/component/test_cpu_project_limits.py @@ -172,7 +172,8 @@ def createInstance(self, project, service_off, networks=None, api_client=None): projectid=project.id, networkids=networks, serviceofferingid=service_off.id) - vms = VirtualMachine.list(api_client, id=self.vm.id, listall=True) + vms = VirtualMachine.list(api_client, projectid=project.id, + id=self.vm.id, listall=True) self.assertIsInstance(vms, list, "List VMs should return a valid response") diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py index e5e558e17b..83233dd86d 100644 --- a/tools/marvin/marvin/lib/base.py +++ b/tools/marvin/marvin/lib/base.py @@ -578,7 +578,11 @@ def getState(self, apiclient, state, timeout=600): while timeout>0: try: - vms = VirtualMachine.list(apiclient, id=self.id, listAll=True) + projectid = None + if hasattr(self, "projectid"): + projectid = self.projectid + vms = VirtualMachine.list(apiclient, projectid=projectid, + id=self.id, listAll=True) validationresult = validateList(vms) if validationresult[0] == FAIL: raise Exception("VM list validation failed: %s" % validationresult[2]) From 2cf16e5147d654216b0948950cd7fca058a5a1f2 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Mon, 26 May 2014 14:52:40 +0530 Subject: [PATCH 496/683] Fixing syntax error in base library --- tools/marvin/marvin/lib/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py index 83233dd86d..c975c37a39 100644 --- a/tools/marvin/marvin/lib/base.py +++ b/tools/marvin/marvin/lib/base.py @@ -3889,7 +3889,7 @@ def __init__(self, items): @classmethod def create(cls, apiclient, gateway, ipaddress, netmask, vlan, vpcid, - physicalnetworkid=None, ,aclid=None): + physicalnetworkid=None, aclid=None): """Create private gateway""" cmd = createPrivateGateway.createPrivateGatewayCmd() From 30bd9b8fe03a7162d67ec16b94846b0afb77fc2b Mon Sep 17 00:00:00 2001 From: SrikanteswaraRao Talluri Date: Mon, 26 May 2014 19:23:41 +0530 Subject: [PATCH 497/683] CLOUDSTACK-6760: skipping unsupported scale VM test on KVM --- test/integration/smoke/test_scale_vm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/integration/smoke/test_scale_vm.py b/test/integration/smoke/test_scale_vm.py index 08f9ce5c81..f0ec534661 100644 --- a/test/integration/smoke/test_scale_vm.py +++ b/test/integration/smoke/test_scale_vm.py @@ -34,6 +34,9 @@ def setUpClass(cls): testClient = super(TestScaleVm, cls).getClsTestClient() cls.apiclient = testClient.getApiClient() cls.services = testClient.getParsedTestDataConfig() + cls.hypervisor = cls.testClient.getHypervisorInfo() + if cls.hypervisor.lower() == 'kvm': + raise unittest.SkipTest("ScaleVM is not supported on KVM. Hence, skipping the test") # Get Zone, Domain and templates domain = get_domain(cls.apiclient) From 2ab7bcade2f37cb17e071a6154fdae1d80e4ff99 Mon Sep 17 00:00:00 2001 From: Rajani Karuturi Date: Fri, 23 May 2014 15:50:06 +0530 Subject: [PATCH 498/683] Fixed CLOUDSTACK-6756: usage id is not being returned for an ip in deleted ip range --- api/src/com/cloud/dc/Vlan.java | 6 ++++++ api/src/com/cloud/network/IpAddress.java | 5 ++++- .../src/com/cloud/network/addr/PublicIp.java | 10 ++++++++++ engine/schema/src/com/cloud/dc/VlanVO.java | 20 +++++++++++++++++++ .../com/cloud/network/dao/IPAddressVO.java | 17 ++++++++++++++++ .../ConfigurationManagerImpl.java | 2 +- setup/db/db/schema-430to440.sql | 9 +++++++++ 7 files changed, 67 insertions(+), 2 deletions(-) diff --git a/api/src/com/cloud/dc/Vlan.java b/api/src/com/cloud/dc/Vlan.java index ac9acda741..dd12128a25 100644 --- a/api/src/com/cloud/dc/Vlan.java +++ b/api/src/com/cloud/dc/Vlan.java @@ -20,6 +20,8 @@ import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; +import java.util.Date; + public interface Vlan extends InfrastructureEntity, InternalIdentity, Identity { public enum VlanType { DirectAttached, VirtualNetwork @@ -41,6 +43,10 @@ public enum VlanType { public Long getNetworkId(); + public Date getRemoved(); + + public Date getCreated(); + public Long getPhysicalNetworkId(); public String getIp6Gateway(); diff --git a/api/src/com/cloud/network/IpAddress.java b/api/src/com/cloud/network/IpAddress.java index f831e275c7..2061771ed3 100644 --- a/api/src/com/cloud/network/IpAddress.java +++ b/api/src/com/cloud/network/IpAddress.java @@ -86,7 +86,10 @@ enum Purpose { Long getNetworkId(); - @Override boolean isDisplay(); + public Date getRemoved(); + + public Date getCreated(); + } diff --git a/engine/components-api/src/com/cloud/network/addr/PublicIp.java b/engine/components-api/src/com/cloud/network/addr/PublicIp.java index a20e3459e7..49cae4bacc 100644 --- a/engine/components-api/src/com/cloud/network/addr/PublicIp.java +++ b/engine/components-api/src/com/cloud/network/addr/PublicIp.java @@ -238,6 +238,16 @@ public boolean isDisplay() { return _addr.isDisplay(); } + @Override + public Date getRemoved() { + return _addr.getRemoved(); + } + + @Override + public Date getCreated() { + return _addr.getCreated(); + } + @Override public Class getEntityType() { return IpAddress.class; diff --git a/engine/schema/src/com/cloud/dc/VlanVO.java b/engine/schema/src/com/cloud/dc/VlanVO.java index ff103b9a07..50106e07fc 100644 --- a/engine/schema/src/com/cloud/dc/VlanVO.java +++ b/engine/schema/src/com/cloud/dc/VlanVO.java @@ -16,6 +16,9 @@ // under the License. package com.cloud.dc; +import com.cloud.utils.db.GenericDao; + +import java.util.Date; import java.util.UUID; import javax.persistence.Column; @@ -73,6 +76,13 @@ public class VlanVO implements Vlan { @Column(name = "uuid") String uuid; + @Column(name= GenericDao.REMOVED_COLUMN) + private Date removed; + + @Column(name = GenericDao.CREATED_COLUMN) + private Date created; + + public VlanVO(VlanType vlanType, String vlanTag, String vlanGateway, String vlanNetmask, long dataCenterId, String ipRange, Long networkId, Long physicalNetworkId, String ip6Gateway, String ip6Cidr, String ip6Range) { this.vlanType = vlanType; @@ -150,6 +160,16 @@ public void setUuid(String uuid) { this.uuid = uuid; } + @Override + public Date getRemoved() { + return removed; + } + + @Override + public Date getCreated() { + return created; + } + @Override public Long getPhysicalNetworkId() { return physicalNetworkId; diff --git a/engine/schema/src/com/cloud/network/dao/IPAddressVO.java b/engine/schema/src/com/cloud/network/dao/IPAddressVO.java index de2d934630..816e063c48 100644 --- a/engine/schema/src/com/cloud/network/dao/IPAddressVO.java +++ b/engine/schema/src/com/cloud/network/dao/IPAddressVO.java @@ -32,6 +32,7 @@ import javax.persistence.Transient; import com.cloud.network.IpAddress; +import com.cloud.utils.db.GenericDao; import com.cloud.utils.net.Ip; /** @@ -117,6 +118,12 @@ public class IPAddressVO implements IpAddress { @Column(name = "display", updatable = true, nullable = false) protected boolean display = true; + @Column(name= GenericDao.REMOVED_COLUMN) + private Date removed; + + @Column(name = GenericDao.CREATED_COLUMN) + private Date created; + protected IPAddressVO() { uuid = UUID.randomUUID().toString(); } @@ -351,4 +358,14 @@ public void setDisplay(boolean display) { public Class getEntityType() { return IpAddress.class; } + + @Override + public Date getRemoved() { + return removed; + } + + @Override + public Date getCreated() { + return created; + } } diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 3f79a76410..34a3d4f886 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -3171,7 +3171,7 @@ public boolean deleteVlanAndPublicIpRange(long userId, final long vlanDbId, Acco @Override public void doInTransactionWithoutResult(TransactionStatus status) { _publicIpAddressDao.deletePublicIPRange(vlanDbId); - _vlanDao.expunge(vlanDbId); + _vlanDao.remove(vlanDbId); } }); diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index 7fa93e78d9..85eb17308a 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -1695,3 +1695,12 @@ INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervis INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'FreeBSD 10', 226, now(), 0); INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Other PV', 139, now(), 0); INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Other PV', 140, now(), 0); + +alter table user_ip_address add column removed datetime DEFAULT NULL COMMENT 'date removed'; +alter table user_ip_address add column created datetime NULL COMMENT 'date created'; + +alter table vlan add column removed datetime DEFAULT NULL COMMENT 'date removed'; +alter table vlan add column created datetime NULL COMMENT 'date created'; + +alter table user_ip_address drop key public_ip_address; +alter table user_ip_address add UNIQUE KEY public_ip_address (public_ip_address,source_network_id, removed); \ No newline at end of file From 587ee544f2d8223599e5ee8c56f926ebf7882b8c Mon Sep 17 00:00:00 2001 From: Saurav Lahiri Date: Tue, 15 Apr 2014 12:08:11 +0000 Subject: [PATCH 499/683] CLOUDSTACK-6328: run.sh check if an existing java process is running, before spawining new ones Signed-off-by: Jayapal --- .../patches/debian/config/etc/init.d/cloud | 14 ++++----- systemvm/scripts/run.sh | 30 ++++++++++++++----- systemvm/scripts/utils.sh | 21 +++++++++++++ 3 files changed, 50 insertions(+), 15 deletions(-) create mode 100644 systemvm/scripts/utils.sh diff --git a/systemvm/patches/debian/config/etc/init.d/cloud b/systemvm/patches/debian/config/etc/init.d/cloud index 83853bcd4e..b18b8b1c8a 100755 --- a/systemvm/patches/debian/config/etc/init.d/cloud +++ b/systemvm/patches/debian/config/etc/init.d/cloud @@ -75,17 +75,15 @@ _failure() { } RETVAL=$? CLOUDSTACK_HOME="/usr/local/cloud" +if [ -f $CLOUDSTACK_HOME/systemvm/utils.sh ]; +then + . $CLOUDSTACK_HOME/systemvm/utils.sh +else + _failure +fi # mkdir -p /var/log/vmops -get_pids() { - local i - for i in $(ps -ef| grep java | grep -v grep | awk '{print $2}'); - do - echo $(pwdx $i) | grep "$CLOUDSTACK_HOME" | awk -F: '{print $1}'; - done -} - start() { local pid=$(get_pids) if [ "$pid" != "" ]; then diff --git a/systemvm/scripts/run.sh b/systemvm/scripts/run.sh index 146d96f028..b6a3a27b9d 100755 --- a/systemvm/scripts/run.sh +++ b/systemvm/scripts/run.sh @@ -23,15 +23,31 @@ #_run.sh runs the agent client. # set -x - +readonly PROGNAME=$(basename "$0") +readonly LOCKDIR=/tmp +readonly LOCKFD=500 + +CLOUDSTACK_HOME="/usr/local/cloud" +. $CLOUDSTACK_HOME/systemvm/utils.sh + +LOCKFILE=$LOCKDIR/$PROGNAME.xlock +lock $LOCKFILE $LOCKFD +if [ $? -eq 1 ];then + exit 1 +fi + while true do - ./_run.sh "$@" & - wait - ex=$? - if [ $ex -eq 0 ] || [ $ex -eq 1 ] || [ $ex -eq 66 ] || [ $ex -gt 128 ]; then - # permanent errors - sleep 5 + pid=$(get_pids) + action=`cat /usr/local/cloud/systemvm/user_request` + if [ "$pid" == "" ] && [ "$action" == "start" ] ; then + ./_run.sh "$@" & + wait + ex=$? + if [ $ex -eq 0 ] || [ $ex -eq 1 ] || [ $ex -eq 66 ] || [ $ex -gt 128 ]; then + # permanent errors + sleep 5 + fi fi # user stop agent by service cloud stop diff --git a/systemvm/scripts/utils.sh b/systemvm/scripts/utils.sh new file mode 100644 index 0000000000..4d55fc76cf --- /dev/null +++ b/systemvm/scripts/utils.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +CLOUDSTACK_HOME="/usr/local/cloud" + +get_pids() { + local i + for i in $(ps -ef| grep java | grep -v grep | awk '{print $2}'); + do + echo $(pwdx $i) | grep "$CLOUDSTACK_HOME" | awk -F: '{print $1}'; + done +} + +lock() +{ + lockfile=$1 + lockfd=$2 + eval "exec $lockfd>$lockfile" + flock -n $lockfd\ + && return 0 \ + || return 1 +} From 37a3a65c7c7f083a5536c078a1c8436ef9e14597 Mon Sep 17 00:00:00 2001 From: Jayapal Date: Mon, 26 May 2014 15:10:35 +0530 Subject: [PATCH 500/683] CLOUDSTACK-6761: Fixed removing proxy arp rule on deleting static nat or PF rule on ip The proxy-arp add/del is done on firewall rule add/del. The proxy-arp rule is deleted only when there is no static nat or dest nat rule is not using the ip. When there is static nat or PF and firewall rule a. Delete firewall rule. It skips delete proxy-arp because the rule is used by static nat rule. b. After deleting fw rule if we disable static nat there is no way to delete proxy-arp rule. On VM expunge we are deleting firewall rules first then static nat rules. This caused the stale proxy-arp rules. With this fix adding/deleting proxy arp rule on static nat/PF rule add/del. --- .../src/com/cloud/network/resource/JuniperSrxResource.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java b/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java index ed6011b9a7..2089b1d66d 100644 --- a/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java +++ b/plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java @@ -965,6 +965,7 @@ private Answer execute(SetStaticNatRulesCommand cmd, int numRetries) { private void addStaticNatRule(Long publicVlanTag, String publicIp, String privateIp, List rules) throws ExecutionException { manageStaticNatRule(SrxCommand.ADD, publicIp, privateIp); manageAddressBookEntry(SrxCommand.ADD, _privateZone, privateIp, null); + manageProxyArp(SrxCommand.ADD, publicVlanTag, publicIp); // Add a new security policy with the current set of applications addSecurityPolicyAndApplications(SecurityPolicyType.STATIC_NAT, privateIp, extractApplications(rules)); @@ -979,6 +980,7 @@ private void removeStaticNatRule(Long publicVlanTag, String publicIp, String pri removeSecurityPolicyAndApplications(SecurityPolicyType.STATIC_NAT, privateIp); manageAddressBookEntry(SrxCommand.DELETE, _privateZone, privateIp, null); + manageProxyArp(SrxCommand.DELETE, publicVlanTag, publicIp); s_logger.debug("Removed static NAT rule for public IP " + publicIp + ", and private IP " + privateIp); } @@ -1248,6 +1250,7 @@ private void addDestinationNatRule(Protocol protocol, Long publicVlanTag, String List applications = new ArrayList(); applications.add(new Object[] {protocol, destPortStart, destPortEnd}); addSecurityPolicyAndApplications(SecurityPolicyType.DESTINATION_NAT, privateIp, applications); + manageProxyArp(SrxCommand.ADD, publicVlanTag, publicIp); String srcPortRange = srcPortStart + "-" + srcPortEnd; String destPortRange = destPortStart + "-" + destPortEnd; @@ -1258,6 +1261,7 @@ private void addDestinationNatRule(Protocol protocol, Long publicVlanTag, String private void removeDestinationNatRule(Long publicVlanTag, String publicIp, String privateIp, int srcPort, int destPort) throws ExecutionException { manageDestinationNatRule(SrxCommand.DELETE, publicIp, privateIp, srcPort, destPort); manageDestinationNatPool(SrxCommand.DELETE, privateIp, destPort); + manageProxyArp(SrxCommand.DELETE, publicVlanTag, publicIp); removeSecurityPolicyAndApplications(SecurityPolicyType.DESTINATION_NAT, privateIp); From 60b82abe20e3c5cad81b63c60685abeb00a3eb16 Mon Sep 17 00:00:00 2001 From: Koushik Das Date: Tue, 27 May 2014 11:43:22 +0530 Subject: [PATCH 501/683] CLOUDSTACK-6767: [Automation] integration.smoke.test_volumes.TestVolumes.test_07_resize_fail is failing on simulator This test is not supported for simulator, updated tags from 'selfservice' to 'provisioning' --- test/integration/smoke/test_volumes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index e938e20098..73c2722d8f 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -491,7 +491,7 @@ def test_06_download_detached_volume(self): % (extract_vol.url, self.volume.id) ) - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "provisioning"]) def test_07_resize_fail(self): """Test resize (negative) non-existent volume""" # Verify the size is the new size is what we wanted it to be. From b85f687cd7f12cd14a1feeb80593ba55e05b2fa8 Mon Sep 17 00:00:00 2001 From: Anshul Gangwar Date: Wed, 14 May 2014 13:18:41 +0530 Subject: [PATCH 502/683] CLOUDSTACK-6663: Fixed Hyper-V agent fails to start on some setups. During startup agent tries to get nic info of 0.0.0.0. To get it, it iterates through all nics and return the last NIC in the list if it doesn't match with any IP address. In case last NIC doesn't have unicastAddress, Hyper-V agent will fail to start. We don't need IP address during initialization. It get initialized with startupcommand later. --- .../hyperv/DotNet/ServerResource/AgentShell/AgentService.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs index 9d66a5cd1b..febd10abb4 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/AgentShell/AgentService.cs @@ -72,8 +72,6 @@ public static void ConfigServerResource() // use of VisualStudio settings designer. The designer allows us to avoid // accessing config using their key strings. HypervResourceControllerConfig rsrcCnf = new HypervResourceControllerConfig(); - rsrcCnf.PrivateIpAddress = AgentSettings.Default.private_ip_address; - rsrcCnf.GatewayIpAddress = AgentSettings.Default.gateway_ip_address; rsrcCnf.RootDeviceReservedSpaceBytes = AgentSettings.Default.RootDeviceReservedSpaceBytes; rsrcCnf.RootDeviceName = AgentSettings.Default.RootDeviceName; rsrcCnf.ParentPartitionMinMemoryMb = AgentSettings.Default.dom0MinMemory; From c535b894840e1a625186f7c62796e80950293221 Mon Sep 17 00:00:00 2001 From: Jayapal Date: Tue, 27 May 2014 14:30:12 +0530 Subject: [PATCH 503/683] CLOUDSTACK-6328: added license header and removed white space --- systemvm/scripts/run.sh | 2 +- systemvm/scripts/utils.sh | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/systemvm/scripts/run.sh b/systemvm/scripts/run.sh index b6a3a27b9d..76e89a8cae 100755 --- a/systemvm/scripts/run.sh +++ b/systemvm/scripts/run.sh @@ -34,7 +34,7 @@ LOCKFILE=$LOCKDIR/$PROGNAME.xlock lock $LOCKFILE $LOCKFD if [ $? -eq 1 ];then exit 1 -fi +fi while true do diff --git a/systemvm/scripts/utils.sh b/systemvm/scripts/utils.sh index 4d55fc76cf..bdd85f0b87 100644 --- a/systemvm/scripts/utils.sh +++ b/systemvm/scripts/utils.sh @@ -1,4 +1,21 @@ -#!/bin/bash +#!/usr/bin/env bash +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + CLOUDSTACK_HOME="/usr/local/cloud" From 3125ae5c6a7a286a4891755e0d8d57bfc6e7ce97 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Tue, 27 May 2014 14:37:07 +0530 Subject: [PATCH 504/683] CLOUDSTACK-6726: Fixing BVT test case test_network.py --- test/integration/smoke/test_network.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index f81e95f827..410087864e 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -383,12 +383,13 @@ def test_01_port_fwd_on_src_nat(self): try: nat_rule.delete(self.apiclient) - list_nat_rule_response = list_nat_rules( - self.apiclient, - id=nat_rule.id - ) - except CloudstackAPIException: - self.fail("Nat Rule Deletion or Listing Failed") + except Exception as e: + self.fail("NAT Rule Deletion Failed: %s" % e) + + # NAT rule listing should fail as the nat rule does not exist + with self.assertRaises(Exception): + list_nat_rules(self.apiclient, + id=nat_rule.id) # Check if the Public SSH port is inaccessible with self.assertRaises(Exception): From 50d4963d5366f1c13c58b58ac3a4bac6f99973e6 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Tue, 27 May 2014 14:41:59 +0530 Subject: [PATCH 505/683] CLOUDSTACK-6764: Marvin - Accomodating networkid parameter while deploying VM in advanced zone and account contains mor than one network --- tools/marvin/marvin/lib/base.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py index c975c37a39..edc01e163b 100644 --- a/tools/marvin/marvin/lib/base.py +++ b/tools/marvin/marvin/lib/base.py @@ -316,7 +316,8 @@ def ssh_access_group(cls, apiclient, cmd): @classmethod def access_ssh_over_nat( - cls, apiclient, services, virtual_machine, allow_egress=False): + cls, apiclient, services, virtual_machine, allow_egress=False, + networkid=None): """ Program NAT and PF rules to open up ssh access to deployed guest @return: @@ -326,7 +327,8 @@ def access_ssh_over_nat( accountid=virtual_machine.account, zoneid=virtual_machine.zoneid, domainid=virtual_machine.domainid, - services=services + services=services, + networkid=networkid ) FireWallRule.create( apiclient=apiclient, @@ -482,7 +484,8 @@ def create(cls, apiclient, services, templateid=None, accountid=None, apiclient, services, virtual_machine, - allow_egress=allow_egress) + allow_egress=allow_egress, + networkid=cmd.networkids[0] if cmd.networkids else None) elif mode.lower() == 'basic': if virtual_machine.publicip is not None: # EIP/ELB (netscaler) enabled zone From 24ef79aef82b69015c6e552258c4829d5a15a9d8 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Tue, 27 May 2014 14:44:59 +0530 Subject: [PATCH 506/683] CLOUDSTACK-5342: Fix for failure in adding network to VM --- .../component/test_add_remove_network.py | 55 ++++++++++++++++--- tools/marvin/marvin/lib/base.py | 4 ++ 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/test/integration/component/test_add_remove_network.py b/test/integration/component/test_add_remove_network.py index c17293d17a..20aefe417e 100644 --- a/test/integration/component/test_add_remove_network.py +++ b/test/integration/component/test_add_remove_network.py @@ -290,7 +290,14 @@ def addNetworkToVm(self, network, vm, ipaddress=None): self.debug("virtual machine nics: %s" % vm_list[0].nic) nics = [x for x in vm_list[0].nic if x.networkid == network.id] self.debug("Filtered nics list: %s:" % nics) - self.addednics.append(nics[-1]) + + # Only the nics added to self.virtual_machine should be added to this list + # Nics added to his list are removed before execution of next test case because we are using + # same virtual machine in all test cases, so it is important that the common + # virtual machine should contain only the default nic whenever new test case + # execution starts + if vm.id == self.virtual_machine.id: + self.addednics.append(nics[-1]) self.assertTrue(len(nics) == 1, "nics list should contain the nic of added isolated network,\ the number of nics for the network should be 1, instead they are %s" % @@ -386,12 +393,23 @@ def test_03_add_nw_multiple_times(self, value): if network is None: self.skipTest("Network should not be none. Case not handled for Network of type %s" % value) + try: + virtual_machine = VirtualMachine.create( + self.api_client, self.services["virtual_machine"], + accountid=self.account.name, domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + mode=self.zone.networktype, + networkids=[self.defaultNetworkId]) + self.cleanup.append(virtual_machine) + except Exception as e: + self.fail("Failed to deply virtual machine: %s" % e) + # Adding network to vm for the first time - self.addNetworkToVm(network, self.virtual_machine) + self.addNetworkToVm(network, virtual_machine) # Trying to add same network to vm for the second time with self.assertRaises(Exception) as e: - self.addNetworkToVm(network, self.virtual_machine) + self.addNetworkToVm(network, virtual_machine) self.debug("Adding same network again failed with exception: %s" % e.exception) return @@ -409,8 +427,19 @@ def test_04_vpc_nw_running_vm(self, value): # Validate the following: # 1. Adding VPC to vm should fail + try: + virtual_machine = VirtualMachine.create( + self.api_client, self.services["virtual_machine"], + accountid=self.account.name, domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + mode=self.zone.networktype, + networkids=[self.defaultNetworkId]) + self.cleanup.append(virtual_machine) + except Exception as e: + self.fail("Failed to deply virtual machine: %s" % e) + network = self.isolated_network - self.addNetworkToVm(network, self.virtual_machine) + self.addNetworkToVm(network, virtual_machine) self.debug("Creating VPC offering") vpc_off = VpcOffering.create(self.api_client,self.services["vpc_offering"]) @@ -426,11 +455,10 @@ def test_04_vpc_nw_running_vm(self, value): self.debug("Trying to add VPC to vm belonging to isolated network, this should fail") with self.assertRaises(Exception): - self.virtual_machine.add_nic(self.apiclient, vpc.id) + virtual_machine.add_nic(self.apiclient, vpc.id) self.debug("Disabling vpc offering: %s" % vpc_off.id) vpc_off.update(self.apiclient, state='Disabled') - return @attr(tags = ["advanced"]) @@ -487,10 +515,20 @@ def test_06_add_nw_ipaddress_running_vm(self): # 2. The newly added nic has the ip address same as # that passed while adding the network + try: + virtual_machine = VirtualMachine.create( + self.api_client, self.services["virtual_machine"], + accountid=self.account.name, domainid=self.account.domainid, + serviceofferingid=self.service_offering.id, + mode=self.zone.networktype, + networkids=[self.defaultNetworkId]) + self.cleanup.append(virtual_machine) + except Exception as e: + self.fail("Failed to deply virtual machine: %s" % e) + ipaddress = self.shared_nw_endip self.debug("Adding network to vm with ip address %s: " % ipaddress) - self.addNetworkToVm(self.shared_network, self.virtual_machine,ipaddress = ipaddress) - + self.addNetworkToVm(self.shared_network, virtual_machine,ipaddress = ipaddress) return @attr(tags = ["advanced"]) @@ -1065,7 +1103,6 @@ def test_13_set_foreign_nic_as_default(self): serviceofferingid=self.service_offering.id,mode=self.zone.networktype) time.sleep(self.services["sleep"]) self.debug("Deployed virtual machine: %s" % virtual_machine.id) - foreignNicId = virtual_machine.nic[0].id self.debug("Trying to set nic of new virtual machine as default nic of existing virtual machine, This \ diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py index edc01e163b..268172490f 100644 --- a/tools/marvin/marvin/lib/base.py +++ b/tools/marvin/marvin/lib/base.py @@ -503,6 +503,10 @@ def start(self, apiclient): cmd = startVirtualMachine.startVirtualMachineCmd() cmd.id = self.id apiclient.startVirtualMachine(cmd) + response = self.getState(apiclient, VirtualMachine.RUNNING) + if response[0] == FAIL: + raise Exception(response[1]) + return def stop(self, apiclient, forced=None): """Stop the instance""" From 2a28a3c5a4dc006cf8f158dfefa67a331f504c4a Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Tue, 27 May 2014 15:46:51 +0530 Subject: [PATCH 507/683] Fixed Regression issues mentioned in following test failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit integration.smoke.test_iso - CLOUDSTACK-6774, CLOUDSTACK-6769 integration.smoke.test_non_contigiousvlan - CLOUDSTACK-6776 integration.smoke.test_primary_storage - CLOUDSTACK-6770 integration.smoke.test_secondary_storage – CLOUDSTACK-6777, CLOUDSTACK-6773 integration.smoke.test_scale_vm - CLOUDSTACK-6768 Signed-off-by: Abhinandan Prateek --- test/integration/smoke/test_iso.py | 2 +- test/integration/smoke/test_non_contigiousvlan.py | 2 +- test/integration/smoke/test_primary_storage.py | 4 ++-- test/integration/smoke/test_scale_vm.py | 2 +- test/integration/smoke/test_secondary_storage.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py index 5821ec7d14..93f436fc99 100644 --- a/test/integration/smoke/test_iso.py +++ b/test/integration/smoke/test_iso.py @@ -75,7 +75,7 @@ def tearDown(self): return - @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"], BugId="CLOUDSTACK-6769, CLOUDSTACK-6774") def test_01_create_iso(self): """Test create public & private ISO """ diff --git a/test/integration/smoke/test_non_contigiousvlan.py b/test/integration/smoke/test_non_contigiousvlan.py index a84e62fc39..90235ecd2c 100644 --- a/test/integration/smoke/test_non_contigiousvlan.py +++ b/test/integration/smoke/test_non_contigiousvlan.py @@ -32,7 +32,7 @@ def __init__(self): } -@attr(tags = ["simulator", "advanced", "selfservice"]) +@attr(tags = ["simulator", "advanced", "selfservice"], BugId="CLOUDSTACK-6776") class TestUpdatePhysicalNetwork(cloudstackTestCase): """ Test to extend physical network vlan range diff --git a/test/integration/smoke/test_primary_storage.py b/test/integration/smoke/test_primary_storage.py index 3147d86645..3c1aa622d0 100644 --- a/test/integration/smoke/test_primary_storage.py +++ b/test/integration/smoke/test_primary_storage.py @@ -51,7 +51,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"], BugId="CLOUDSTACK-6770") def test_01_primary_storage_nfs(self): """Test primary storage pools - XEN, KVM, VMWare """ @@ -144,7 +144,7 @@ def test_01_primary_storage_nfs(self): return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"], BugId="CLOUDSTACK-6770") def test_01_primary_storage_iscsi(self): """Test primary storage pools - XEN, KVM, VMWare """ diff --git a/test/integration/smoke/test_scale_vm.py b/test/integration/smoke/test_scale_vm.py index f0ec534661..261fe93fb2 100644 --- a/test/integration/smoke/test_scale_vm.py +++ b/test/integration/smoke/test_scale_vm.py @@ -103,7 +103,7 @@ def tearDown(self): return @attr(hypervisor="xenserver") - @attr(tags=["advanced", "basic", "provisioning"]) + @attr(tags=["advanced", "basic", "provisioning"], BugId="CLOUDSTACK-6768") def test_01_scale_vm(self): """Test scale virtual machine """ diff --git a/test/integration/smoke/test_secondary_storage.py b/test/integration/smoke/test_secondary_storage.py index 90304b357c..481d907be3 100644 --- a/test/integration/smoke/test_secondary_storage.py +++ b/test/integration/smoke/test_secondary_storage.py @@ -160,7 +160,7 @@ def test_01_sys_vm_start(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"], BugId="CLOUDSTACK-6773, CLOUDSTACK-6777") def test_02_sys_template_ready(self): """Test system templates are ready """ From 7415a27184c84bce23b1739a7c4d609e2c2e37db Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Tue, 27 May 2014 16:18:25 +0200 Subject: [PATCH 508/683] CLOUDSTACK-6783: Return a proper LibvirtStoragePool object after creating the pool In situations where libvirt lost the storage pool the KVM Agent will re-create the storage pool in libvirt. This could be then libvirt is restarted for example. The object returned internally was missing essential information like the sourceDir aka the Ceph pool, the monitor IPs, cephx information and such. In this case the first operation on this newly created pool would fail. All operations afterwards would succeed. --- .../kvm/storage/LibvirtStorageAdaptor.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java index 52bbef3d77..681fcee807 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java @@ -539,6 +539,20 @@ public KVMStoragePool createStoragePool(String name, String host, int port, Stri pool.setLocalPath(""); } + if (pool.getType() == StoragePoolType.RBD + || pool.getType() == StoragePoolType.Gluster) { + pool.setSourceHost(spd.getSourceHost()); + pool.setSourcePort(spd.getSourcePort()); + pool.setSourceDir(spd.getSourceDir()); + String authUsername = spd.getAuthUserName(); + if (authUsername != null) { + Secret secret = conn.secretLookupByUUIDString(spd.getSecretUUID()); + String secretValue = new String(Base64.encodeBase64(secret.getByteValue())); + pool.setAuthUsername(authUsername); + pool.setAuthSecret(secretValue); + } + } + pool.setCapacity(sp.getInfo().capacity); pool.setUsed(sp.getInfo().allocation); pool.setAvailable(sp.getInfo().available); From 5c30809a7de8f8e45012e0afb0ae081973d137e8 Mon Sep 17 00:00:00 2001 From: Koushik Das Date: Tue, 27 May 2014 20:35:24 +0530 Subject: [PATCH 509/683] CLOUDSTACK-6781: Disabling failing test corresponding to this bug Once the bug is fixed this needs to be enabled back --- test/integration/smoke/test_portable_publicip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/smoke/test_portable_publicip.py b/test/integration/smoke/test_portable_publicip.py index 2d02a7114e..a511e815a9 100644 --- a/test/integration/smoke/test_portable_publicip.py +++ b/test/integration/smoke/test_portable_publicip.py @@ -75,7 +75,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["simulator", "basic", "advanced", "portablepublicip", "selfservice"]) + @attr(tags = ["simulator", "basic", "advanced", "portablepublicip", "selfservice"],BugId="CLOUDSTACK-6781") def test_createPortablePublicIPRange(self): """ Test to create a portable public ip range """ From a553bb516dccb637985dadc91d8eb5ec16d55ab5 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 27 May 2014 11:38:46 -0700 Subject: [PATCH 510/683] CLOUDSTACK-6744 > UI > zone wizard > baremetal hypervisor > support EIP ELB feature. This reverts commit 65bb733a4237242e7f800956840c1a09be18fbb5. --- ui/scripts/zoneWizard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index a6321cf809..0a84bdb9bc 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -574,7 +574,7 @@ }); if (thisNetworkOffering.havingEIP == true && thisNetworkOffering.havingELB == true) { //EIP ELB - if (args.hypervisor == "VMware") { //VMware does not support EIP ELB + if (args.hypervisor == "VMware" || args.hypervisor == "BareMetal") { //VMware, BareMetal don't support EIP ELB return true; //move to next item in $.each() loop } if (args.context.zones[0]["network-model"] == "Advanced" && args.context.zones[0]["zone-advanced-sg-enabled"] == "on") { // Advanced SG-enabled zone doesn't support EIP ELB From 18c6ae07961f0cf787fe695da4b25b8d8f955acc Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Tue, 27 May 2014 14:55:22 -0700 Subject: [PATCH 511/683] CLOUDSTACK-6597: Updatevm - root admin should be allowed to change instance name --- api/src/com/cloud/event/EventTypes.java | 45 ++++++++++++++----- api/src/com/cloud/network/vpc/NetworkACL.java | 3 +- .../com/cloud/network/vpc/NetworkACLItem.java | 3 +- .../user/vpn/CreateRemoteAccessVpnCmd.java | 8 +--- .../src/com/cloud/event/ActionEventUtils.java | 8 ++-- .../network/vpc/NetworkACLServiceImpl.java | 4 ++ .../vpn/RemoteAccessVpnManagerImpl.java | 2 + .../src/com/cloud/vm/UserVmManagerImpl.java | 3 ++ 8 files changed, 52 insertions(+), 24 deletions(-) diff --git a/api/src/com/cloud/event/EventTypes.java b/api/src/com/cloud/event/EventTypes.java index d9aa3f45f6..a856bd908d 100755 --- a/api/src/com/cloud/event/EventTypes.java +++ b/api/src/com/cloud/event/EventTypes.java @@ -19,6 +19,13 @@ import java.util.HashMap; import java.util.Map; +import com.cloud.network.IpAddress; +import com.cloud.network.Site2SiteVpnGateway; +import com.cloud.network.rules.FirewallRule; +import com.cloud.network.rules.HealthCheckPolicy; +import com.cloud.network.rules.StickinessPolicy; +import com.cloud.network.vpc.NetworkACL; +import com.cloud.network.vpc.NetworkACLItem; import com.cloud.server.ResourceTag; import com.cloud.vm.ConsoleProxy; import com.cloud.vm.SecondaryStorageVm; @@ -35,7 +42,6 @@ import com.cloud.network.PhysicalNetwork; import com.cloud.network.PhysicalNetworkServiceProvider; import com.cloud.network.PhysicalNetworkTrafficType; -import com.cloud.network.PublicIpAddress; import com.cloud.network.RemoteAccessVpn; import com.cloud.network.as.AutoScaleCounter; import com.cloud.network.as.AutoScalePolicy; @@ -539,21 +545,27 @@ public class EventTypes { entityEventDetails.put(EVENT_NETWORK_DELETE, Network.class); entityEventDetails.put(EVENT_NETWORK_UPDATE, Network.class); entityEventDetails.put(EVENT_NETWORK_RESTART, Network.class); - entityEventDetails.put(EVENT_NET_IP_ASSIGN, PublicIpAddress.class); - entityEventDetails.put(EVENT_NET_IP_RELEASE, PublicIpAddress.class); - entityEventDetails.put(EVENT_NET_RULE_ADD, Network.class); - entityEventDetails.put(EVENT_NET_RULE_DELETE, Network.class); - entityEventDetails.put(EVENT_NET_RULE_MODIFY, Network.class); - entityEventDetails.put(EVENT_FIREWALL_OPEN, Network.class); - entityEventDetails.put(EVENT_FIREWALL_CLOSE, Network.class); + entityEventDetails.put(EVENT_NET_IP_ASSIGN, IpAddress.class); + entityEventDetails.put(EVENT_PORTABLE_IP_ASSIGN, IpAddress.class); + entityEventDetails.put(EVENT_PORTABLE_IP_RELEASE, IpAddress.class); + entityEventDetails.put(EVENT_NET_IP_RELEASE, IpAddress.class); + entityEventDetails.put(EVENT_NET_RULE_ADD, FirewallRule.class); + entityEventDetails.put(EVENT_NET_RULE_DELETE, FirewallRule.class); + entityEventDetails.put(EVENT_NET_RULE_MODIFY, FirewallRule.class); + entityEventDetails.put(EVENT_FIREWALL_OPEN, FirewallRule.class); + entityEventDetails.put(EVENT_FIREWALL_CLOSE, FirewallRule.class); // Load Balancers entityEventDetails.put(EVENT_ASSIGN_TO_LOAD_BALANCER_RULE, LoadBalancer.class); entityEventDetails.put(EVENT_REMOVE_FROM_LOAD_BALANCER_RULE, LoadBalancer.class); entityEventDetails.put(EVENT_LOAD_BALANCER_CREATE, LoadBalancer.class); entityEventDetails.put(EVENT_LOAD_BALANCER_DELETE, LoadBalancer.class); - entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_CREATE, LoadBalancer.class); - entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_DELETE, LoadBalancer.class); + entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_CREATE, StickinessPolicy.class); + entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_UPDATE, StickinessPolicy.class); + entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_DELETE, StickinessPolicy.class); + entityEventDetails.put(EVENT_LB_HEALTHCHECKPOLICY_CREATE, HealthCheckPolicy.class); + entityEventDetails.put(EVENT_LB_HEALTHCHECKPOLICY_UPDATE, HealthCheckPolicy.class); + entityEventDetails.put(EVENT_LB_HEALTHCHECKPOLICY_DELETE, HealthCheckPolicy.class); entityEventDetails.put(EVENT_LOAD_BALANCER_UPDATE, LoadBalancer.class); entityEventDetails.put(EVENT_LB_CERT_UPLOAD, LoadBalancer.class); entityEventDetails.put(EVENT_LB_CERT_DELETE, LoadBalancer.class); @@ -693,8 +705,8 @@ public class EventTypes { entityEventDetails.put(EVENT_REMOTE_ACCESS_VPN_DESTROY, RemoteAccessVpn.class); entityEventDetails.put(EVENT_VPN_USER_ADD, RemoteAccessVpn.class); entityEventDetails.put(EVENT_VPN_USER_REMOVE, RemoteAccessVpn.class); - entityEventDetails.put(EVENT_S2S_VPN_GATEWAY_CREATE, RemoteAccessVpn.class); - entityEventDetails.put(EVENT_S2S_VPN_GATEWAY_DELETE, RemoteAccessVpn.class); + entityEventDetails.put(EVENT_S2S_VPN_GATEWAY_CREATE, Site2SiteVpnGateway.class); + entityEventDetails.put(EVENT_S2S_VPN_GATEWAY_DELETE, Site2SiteVpnGateway.class); entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_CREATE, RemoteAccessVpn.class); entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_DELETE, RemoteAccessVpn.class); entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_UPDATE, RemoteAccessVpn.class); @@ -757,6 +769,15 @@ public class EventTypes { entityEventDetails.put(EVENT_EXTERNAL_FIREWALL_DEVICE_DELETE, PhysicalNetwork.class); entityEventDetails.put(EVENT_EXTERNAL_FIREWALL_DEVICE_CONFIGURE, PhysicalNetwork.class); + // Network ACL + entityEventDetails.put(EVENT_NETWORK_ACL_CREATE, NetworkACL.class); + entityEventDetails.put(EVENT_NETWORK_ACL_DELETE, NetworkACL.class); + entityEventDetails.put(EVENT_NETWORK_ACL_REPLACE, NetworkACL.class); + entityEventDetails.put(EVENT_NETWORK_ACL_UPDATE, NetworkACL.class); + entityEventDetails.put(EVENT_NETWORK_ACL_ITEM_CREATE, NetworkACLItem.class); + entityEventDetails.put(EVENT_NETWORK_ACL_ITEM_UPDATE, NetworkACLItem.class); + entityEventDetails.put(EVENT_NETWORK_ACL_ITEM_DELETE, NetworkACLItem.class); + // VPC entityEventDetails.put(EVENT_VPC_CREATE, Vpc.class); entityEventDetails.put(EVENT_VPC_UPDATE, Vpc.class); diff --git a/api/src/com/cloud/network/vpc/NetworkACL.java b/api/src/com/cloud/network/vpc/NetworkACL.java index 193a48c60f..b0c87cc112 100644 --- a/api/src/com/cloud/network/vpc/NetworkACL.java +++ b/api/src/com/cloud/network/vpc/NetworkACL.java @@ -18,9 +18,10 @@ package com.cloud.network.vpc; import org.apache.cloudstack.api.Displayable; +import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; -public interface NetworkACL extends InternalIdentity, Displayable { +public interface NetworkACL extends InternalIdentity, Identity, Displayable { public static final long DEFAULT_DENY = 1; public static final long DEFAULT_ALLOW = 2; diff --git a/api/src/com/cloud/network/vpc/NetworkACLItem.java b/api/src/com/cloud/network/vpc/NetworkACLItem.java index 8e288a2b96..75153fd7c5 100644 --- a/api/src/com/cloud/network/vpc/NetworkACLItem.java +++ b/api/src/com/cloud/network/vpc/NetworkACLItem.java @@ -19,9 +19,10 @@ import java.util.List; import org.apache.cloudstack.api.Displayable; +import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; -public interface NetworkACLItem extends InternalIdentity, Displayable { +public interface NetworkACLItem extends InternalIdentity, Identity, Displayable { String getUuid(); diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java index 14b781d236..2bef64e1c6 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateRemoteAccessVpnCmd.java @@ -147,12 +147,8 @@ public void create() { try { RemoteAccessVpn vpn = _ravService.createRemoteAccessVpn(publicIpId, ipRange, getOpenFirewall(), isDisplay()); if (vpn != null) { - setEntityId(vpn.getServerAddressId()); - // find uuid for server ip address - IpAddress ipAddr = _entityMgr.findById(IpAddress.class, vpn.getServerAddressId()); - if (ipAddr != null) { - setEntityUuid(ipAddr.getUuid()); - } + setEntityId(vpn.getId()); + setEntityUuid(vpn.getUuid()); } else { throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create remote access vpn"); } diff --git a/server/src/com/cloud/event/ActionEventUtils.java b/server/src/com/cloud/event/ActionEventUtils.java index 363bb93b4d..9e8e087e51 100755 --- a/server/src/com/cloud/event/ActionEventUtils.java +++ b/server/src/com/cloud/event/ActionEventUtils.java @@ -277,8 +277,8 @@ private static void populateFirstClassEntities(Map eventDescript CallContext context = CallContext.current(); Map contextMap = context.getContextParameters(); - try{ - for(Map.Entry entry : contextMap.entrySet()){ + for(Map.Entry entry : contextMap.entrySet()){ + try{ Object key = entry.getKey(); Class clz = Class.forName((String)key); if(clz instanceof Class && Identity.class.isAssignableFrom(clz)){ @@ -286,9 +286,9 @@ private static void populateFirstClassEntities(Map eventDescript String uuid = ((Identity) objVO).getUuid(); eventDescription.put(ReflectUtil.getEntityName(clz), uuid); } + } catch (Exception e){ + s_logger.trace("Caught exception while populating first class entities for event bus, moving on"); } - }catch (Exception e){ - s_logger.debug("Caught exception while populating first class entities for event bus, moving on", e); } } diff --git a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java index 19a26c1627..f871b8ef37 100644 --- a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java +++ b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java @@ -108,6 +108,7 @@ public NetworkACL createNetworkACL(String name, String description, long vpcId, } @Override + @ActionEvent(eventType = EventTypes.EVENT_NETWORK_ACL_CREATE, eventDescription = "creating network acl list", async = true) public NetworkACL getNetworkACL(long id) { return _networkAclMgr.getNetworkACL(id); } @@ -471,6 +472,7 @@ public NetworkACLItem getNetworkACLItem(long ruleId) { } @Override + @ActionEvent(eventType = EventTypes.EVENT_NETWORK_ACL_ITEM_CREATE, eventDescription = "Applying Network ACL Item", async = true) public boolean applyNetworkACL(long aclId) throws ResourceUnavailableException { return _networkAclMgr.applyNetworkACL(aclId); } @@ -601,6 +603,7 @@ public Pair, Integer> listNetworkACLItems(ListNet } @Override + @ActionEvent(eventType = EventTypes.EVENT_NETWORK_ACL_ITEM_DELETE, eventDescription = "Deleting Network ACL Item", async = true) public boolean revokeNetworkACLItem(long ruleId) { NetworkACLItemVO aclItem = _networkACLItemDao.findById(ruleId); if(aclItem != null){ @@ -620,6 +623,7 @@ public boolean revokeNetworkACLItem(long ruleId) { } @Override + @ActionEvent(eventType = EventTypes.EVENT_NETWORK_ACL_ITEM_UPDATE, eventDescription = "Updating Network ACL Item", async = true) public NetworkACLItem updateNetworkACLItem(Long id, String protocol, List sourceCidrList, NetworkACLItem.TrafficType trafficType, String action, Integer number, Integer sourcePortStart, Integer sourcePortEnd, Integer icmpCode, Integer icmpType, String newUUID, Boolean forDisplay) throws ResourceUnavailableException { NetworkACLItemVO aclItem = _networkACLItemDao.findById(id); diff --git a/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java b/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java index 757f618eeb..f4d8947824 100755 --- a/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java +++ b/server/src/com/cloud/network/vpn/RemoteAccessVpnManagerImpl.java @@ -285,6 +285,7 @@ private void validateRemoteAccessVpnConfiguration() throws ConfigurationExceptio @Override @DB + @ActionEvent(eventType = EventTypes.EVENT_REMOTE_ACCESS_VPN_DESTROY, eventDescription = "removing remote access vpn", async = true) public boolean destroyRemoteAccessVpnForIp(long ipId, Account caller) throws ResourceUnavailableException { final RemoteAccessVpnVO vpn = _remoteAccessVpnDao.findByPublicIpAddress(ipId); if (vpn == null) { @@ -449,6 +450,7 @@ public List listVpnUsers(long vpnOwnerId, String userName) { @Override @DB + @ActionEvent(eventType = EventTypes.EVENT_REMOTE_ACCESS_VPN_CREATE, eventDescription = "creating remote access vpn", async = true) public RemoteAccessVpnVO startRemoteAccessVpn(long ipAddressId, boolean openFirewall) throws ResourceUnavailableException { Account caller = CallContext.current().getCallingAccount(); diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index cf04270b80..14d2eefcdc 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -957,6 +957,7 @@ private UserVm upgradeStoppedVirtualMachine(Long vmId, Long svcOffId, Map Date: Tue, 27 May 2014 15:44:20 -0700 Subject: [PATCH 512/683] CLOUDSTACK-6789: UI > User page > fix a bug that a domain-admin was unable to delete other domain-admin in the same domain. --- ui/scripts/accounts.js | 24 +++++++++++++----------- ui/scripts/sharedFunctions.js | 12 ------------ 2 files changed, 13 insertions(+), 23 deletions(-) diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js index 4eaa401113..2ebfe82c42 100644 --- a/ui/scripts/accounts.js +++ b/ui/scripts/accounts.js @@ -1527,19 +1527,21 @@ allowedActions.push("enable"); allowedActions.push("remove"); } - } else { - if (isSelfOrChildDomainUser(jsonObj.username, jsonObj.accounttype, jsonObj.domainid, jsonObj.iscallerchilddomain)) { - if (isDomainAdmin() && jsonObj.username != g_username) { - allowedActions.push("edit"); - if (jsonObj.state == "enabled") - allowedActions.push("disable"); - if (jsonObj.state == "disabled") - allowedActions.push("enable"); - allowedActions.push("remove"); - } + } else { //domain-admin, regular-user + if (jsonObj.username == g_username) { //selected user is self + allowedActions.push("changePassword"); + allowedActions.push("generateKeys"); + } else if (isDomainAdmin()) { //if selected user is not self, and the current login is domain-admin + allowedActions.push("edit"); + if (jsonObj.state == "enabled") + allowedActions.push("disable"); + if (jsonObj.state == "disabled") + allowedActions.push("enable"); + allowedActions.push("remove"); + allowedActions.push("changePassword"); allowedActions.push("generateKeys"); - } + } } return allowedActions; } diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index 9cb48a20a7..d20634935e 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -765,18 +765,6 @@ var addGuestNetworkDialog = { return (g_role == 0); } - function isSelfOrChildDomainUser(username, useraccounttype, userdomainid, iscallerchilddomain) { - if (username == g_username) { //is self - return true; - } else if (isDomainAdmin() && !iscallerchilddomain && (useraccounttype == 0)) { //domain admin to user - return true; - } else if (isDomainAdmin() && iscallerchilddomain && (userdomainid != g_domainid)) { //domain admin to subdomain admin and user - return true; - } else { - return false; - } - } - // FUNCTION: Handles AJAX error callbacks. You can pass in an optional function to // handle errors that are not already handled by this method. From c91780449ae13d40ba9a2acfc5e0e6176f1beaee Mon Sep 17 00:00:00 2001 From: Rajani Karuturi Date: Tue, 27 May 2014 20:50:07 +0530 Subject: [PATCH 513/683] FIXED CLOUDSTACK-6781 [Automation] integration.smoke.test_portable_publicip.TestPortablePublicIPRange.test_createPortablePublicIPRange failing on 4.4 Signed-off-by: Abhinandan Prateek --- engine/schema/src/com/cloud/network/dao/IPAddressVO.java | 1 - 1 file changed, 1 deletion(-) diff --git a/engine/schema/src/com/cloud/network/dao/IPAddressVO.java b/engine/schema/src/com/cloud/network/dao/IPAddressVO.java index 816e063c48..0be781b500 100644 --- a/engine/schema/src/com/cloud/network/dao/IPAddressVO.java +++ b/engine/schema/src/com/cloud/network/dao/IPAddressVO.java @@ -53,7 +53,6 @@ public class IPAddressVO implements IpAddress { @Column(name = "domain_id") private Long allocatedInDomainId = null; - @Id @Column(name = "public_ip_address") @Enumerated(value = EnumType.STRING) private Ip address = null; From a3dd5d1522bd73484b58af0013157c8bbdec4126 Mon Sep 17 00:00:00 2001 From: Abhinandan Prateek Date: Wed, 28 May 2014 10:48:44 +0530 Subject: [PATCH 514/683] Revert "CLOUDSTACK-6781: Disabling failing test corresponding to this bug" This reverts commit 5c30809a7de8f8e45012e0afb0ae081973d137e8. --- test/integration/smoke/test_portable_publicip.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/smoke/test_portable_publicip.py b/test/integration/smoke/test_portable_publicip.py index a511e815a9..2d02a7114e 100644 --- a/test/integration/smoke/test_portable_publicip.py +++ b/test/integration/smoke/test_portable_publicip.py @@ -75,7 +75,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["simulator", "basic", "advanced", "portablepublicip", "selfservice"],BugId="CLOUDSTACK-6781") + @attr(tags = ["simulator", "basic", "advanced", "portablepublicip", "selfservice"]) def test_createPortablePublicIPRange(self): """ Test to create a portable public ip range """ From 63090434b1cb4e7b87f0e024fbbc644faee863f7 Mon Sep 17 00:00:00 2001 From: rayeesn Date: Tue, 27 May 2014 07:53:23 -0700 Subject: [PATCH 515/683] CLOUDSTACK-6392: system template always create with name master instead of specific branch Signed-off-by: Abhinandan Prateek --- tools/appliance/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh index a228e26608..db5dcb094b 100755 --- a/tools/appliance/build.sh +++ b/tools/appliance/build.sh @@ -28,7 +28,7 @@ fi build_date=`date +%Y-%m-%d` # set fixed or leave empty to use git to determine -branch=master +branch= if [ -z "$branch" ] ; then branch=`git status | grep '# On branch' | awk '{print $4}'` From 80b9849981a608e46945da1ab813cd78f4bb8bcc Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Wed, 28 May 2014 11:39:37 +0530 Subject: [PATCH 516/683] Disabling the failed test cases mentioned in the following tickets integration.smoke.test_iso - CLOUDSTACK-6769, CLOUDSTACK-6774 Signed-off-by: Abhinandan Prateek --- test/integration/smoke/test_iso.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py index 93f436fc99..a3e42f195d 100644 --- a/test/integration/smoke/test_iso.py +++ b/test/integration/smoke/test_iso.py @@ -138,6 +138,7 @@ def test_01_create_iso(self): class TestISO(cloudstackTestCase): @classmethod + @attr(BugId="CLOUDSTACK-6769, CLOUDSTACK-6774") def setUpClass(cls): testClient = super(TestISO, cls).getClsTestClient() cls.apiclient = testClient.getApiClient() From 323de6823deda16ddafab5d79f18996c70130e2b Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Tue, 27 May 2014 05:51:01 -0700 Subject: [PATCH 517/683] CLOUDSTACK-6782: Egress FW rules test cases - Format unicode to string before string matching --- test/integration/component/test_egress_fw_rules.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/integration/component/test_egress_fw_rules.py b/test/integration/component/test_egress_fw_rules.py index a42caa9bb8..4b4b6eee66 100644 --- a/test/integration/component/test_egress_fw_rules.py +++ b/test/integration/component/test_egress_fw_rules.py @@ -275,7 +275,10 @@ def exec_script_on_user_vm(self, script, exec_cmd_params, expected_result, negat self.debug("script: %s" % script+exec_cmd_params) self.debug("result: %s" % result) - str_result = str(str(result).strip()) + if isinstance(result, list): + str_result = str([str(x) for x in result]) + else: + str_result = str(result) str_expected_result = str(expected_result).strip() if str_result == str_expected_result: exec_success = True From 0710c089c2d6038437ff1e6b490efaff7753ffc6 Mon Sep 17 00:00:00 2001 From: Hiroki Ohashi Date: Thu, 29 May 2014 19:12:11 +0200 Subject: [PATCH 518/683] Allow usaage reporting on removed service offering --- server/src/com/cloud/api/ApiResponseHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index a4f08fd4e3..119f56d32f 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -3296,7 +3296,7 @@ public UsageRecordResponse createUsageResponse(Usage usageRecord) { } if (usageRecord.getUsageType() == UsageTypes.RUNNING_VM || usageRecord.getUsageType() == UsageTypes.ALLOCATED_VM) { - ServiceOfferingVO svcOffering = _entityMgr.findById(ServiceOfferingVO.class, usageRecord.getOfferingId().toString()); + ServiceOfferingVO svcOffering = _entityMgr.findByIdIncludingRemoved(ServiceOfferingVO.class, usageRecord.getOfferingId().toString()); //Service Offering Id usageRecResponse.setOfferingId(svcOffering.getUuid()); //VM Instance ID From 76c71c7bc1fc0368e7d86c63107e269f34787c23 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 29 May 2014 11:52:42 -0700 Subject: [PATCH 519/683] CLOUDSTACK-6805: UI > create account > fix a bug that account creation failed when password contains # character. --- ui/scripts/accountsWizard.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/scripts/accountsWizard.js b/ui/scripts/accountsWizard.js index e02a04eea8..f022193270 100644 --- a/ui/scripts/accountsWizard.js +++ b/ui/scripts/accountsWizard.js @@ -182,6 +182,8 @@ password = args.data.password; if (md5Hashed) { password = $.md5(password); + } else { + password = todb(password); } array1.push("&password=" + password); } @@ -218,6 +220,7 @@ $.ajax({ url: createURL('importLdapUsers' + array1.join("")), dataType: "json", + type: "POST", async: false, success: function(json) { var count = json.ldapuserresponse.count; @@ -233,6 +236,7 @@ $.ajax({ url: createURL('ldapCreateAccount' + array1.join("")), dataType: "json", + type: "POST", async: false, success: function(json) { var item = json.createaccountresponse.account; @@ -249,6 +253,7 @@ $.ajax({ url: createURL('createAccount' + array1.join("")), dataType: "json", + type: "POST", async: false, success: function(json) { var item = json.createaccountresponse.account; From f5ce280da32c4e0837fa39651dc801ba3f906e41 Mon Sep 17 00:00:00 2001 From: Devdeep Singh Date: Tue, 20 May 2014 11:40:51 +0530 Subject: [PATCH 520/683] CLOUDSTACK-6810: Fix storage migration of a vm with volume on local was failing. When a plan with hostid included was passed to the local storage pool allocator, it returned all the local storage pools in the cluster, instead of just the local pool on the given host in the plan. This was happening the search at a host level was happening only for data disk. Fixed this. Additionally, the query to list the storage pools on a host was failing if the pool did have tags. Fixed the query too. CLOUDSTACK-6802: Fix for not being able to attach data disk on local. This issue gets fixed with the above issue too. The query to list pools on a host was failing if there were no tags on the storage pool. --- .../datastore/db/PrimaryDataStoreDaoImpl.java | 44 ++++++++----------- .../allocator/LocalStoragePoolAllocator.java | 6 +-- 2 files changed, 21 insertions(+), 29 deletions(-) diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java index 7e558f81ea..92793f1fb1 100644 --- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java +++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/PrimaryDataStoreDaoImpl.java @@ -24,7 +24,6 @@ import java.util.List; import java.util.Map; -import javax.annotation.PostConstruct; import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; @@ -55,9 +54,6 @@ public class PrimaryDataStoreDaoImpl extends GenericDaoBase protected final SearchBuilder DcPodAnyClusterSearch; protected final SearchBuilder DeleteLvmSearch; protected final GenericSearchBuilder StatusCountSearch; - protected SearchBuilder HostSearch; - protected SearchBuilder HostPoolSearch; - protected SearchBuilder TagPoolSearch; @Inject protected StoragePoolDetailsDao _detailsDao; @@ -120,26 +116,6 @@ public PrimaryDataStoreDaoImpl() { } - @PostConstruct - void init() { - HostSearch = createSearchBuilder(); - TagPoolSearch = _detailsDao.createSearchBuilder(); - HostPoolSearch = _hostDao.createSearchBuilder(); - // Search for pools on the host - HostPoolSearch.and("hostId", HostPoolSearch.entity().getHostId(), Op.EQ); - // Set criteria for pools - HostSearch.and("scope", HostSearch.entity().getScope(), Op.EQ); - HostSearch.and("removed", HostSearch.entity().getRemoved(), Op.NULL); - HostSearch.and("status", HostSearch.entity().getStatus(), Op.EQ); - HostSearch.join("hostJoin", HostPoolSearch, HostSearch.entity().getId(), HostPoolSearch.entity().getPoolId(), JoinBuilder.JoinType.INNER); - // Set criteria for tags - TagPoolSearch.and("name", TagPoolSearch.entity().getName(), Op.EQ); - TagPoolSearch.and("value", TagPoolSearch.entity().getValue(), Op.EQ); - - HostSearch.join("tagJoin", TagPoolSearch, HostSearch.entity().getId(), TagPoolSearch.entity().getResourceId(), JoinBuilder.JoinType.INNER); - HostSearch.done(); - } - @Override public List findPoolByName(String name) { SearchCriteria sc = AllFieldSearch.create(); @@ -345,11 +321,29 @@ public List findLocalStoragePoolsByTags(long dcId, long podId, Lo @Override public List findLocalStoragePoolsByHostAndTags(long hostId, String[] tags) { + SearchBuilder hostSearch = createSearchBuilder(); + SearchBuilder hostPoolSearch = _hostDao.createSearchBuilder(); + SearchBuilder tagPoolSearch = _detailsDao.createSearchBuilder();; - SearchCriteria sc = HostSearch.create(); + // Search for pools on the host + hostPoolSearch.and("hostId", hostPoolSearch.entity().getHostId(), Op.EQ); + // Set criteria for pools + hostSearch.and("scope", hostSearch.entity().getScope(), Op.EQ); + hostSearch.and("removed", hostSearch.entity().getRemoved(), Op.NULL); + hostSearch.and("status", hostSearch.entity().getStatus(), Op.EQ); + hostSearch.join("hostJoin", hostPoolSearch, hostSearch.entity().getId(), hostPoolSearch.entity().getPoolId(), JoinBuilder.JoinType.INNER); + + if (!(tags == null || tags.length == 0 )) { + tagPoolSearch.and("name", tagPoolSearch.entity().getName(), Op.EQ); + tagPoolSearch.and("value", tagPoolSearch.entity().getValue(), Op.EQ); + hostSearch.join("tagJoin", tagPoolSearch, hostSearch.entity().getId(), tagPoolSearch.entity().getResourceId(), JoinBuilder.JoinType.INNER); + } + + SearchCriteria sc = hostSearch.create(); sc.setJoinParameters("hostJoin", "hostId", hostId ); sc.setParameters("scope", ScopeType.HOST.toString()); sc.setParameters("status", Status.Up.toString()); + if (!(tags == null || tags.length == 0 )) { Map details = tagsToDetails(tags); for (Map.Entry detail : details.entrySet()) { diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java index e988327ce0..446e101141 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/LocalStoragePoolAllocator.java @@ -36,7 +36,6 @@ import com.cloud.deploy.DeploymentPlanner.ExcludeList; import com.cloud.service.dao.ServiceOfferingDao; import com.cloud.storage.StoragePool; -import com.cloud.storage.Volume; import com.cloud.storage.dao.StoragePoolHostDao; import com.cloud.utils.NumbersUtil; import com.cloud.vm.DiskProfile; @@ -73,9 +72,8 @@ protected List select(DiskProfile dskCh, VirtualMachineProfile vmPr List suitablePools = new ArrayList(); // data disk and host identified from deploying vm (attach volume case) - if (dskCh.getType() == Volume.Type.DATADISK && plan.getHostId() != null) { - List hostTagsPools = null; - hostTagsPools =_storagePoolDao.findLocalStoragePoolsByHostAndTags(plan.getHostId(), dskCh.getTags()); + if (plan.getHostId() != null) { + List hostTagsPools = _storagePoolDao.findLocalStoragePoolsByHostAndTags(plan.getHostId(), dskCh.getTags()); for (StoragePoolVO pool : hostTagsPools) { if (pool != null && pool.isLocal()) { StoragePool storagePool = (StoragePool)this.dataStoreMgr.getPrimaryDataStore(pool.getId()); From c5a1423d3d02e33c33eb630f6f4df24b731eba69 Mon Sep 17 00:00:00 2001 From: Rajani Karuturi Date: Fri, 30 May 2014 11:47:17 +0530 Subject: [PATCH 521/683] FIXED CLOUDSTACK-6808 Need to add Database Information to Alter table statements in a commit to schema-430to440.sql --- setup/db/db/schema-430to440.sql | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index 85eb17308a..cb042e43f8 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -1696,11 +1696,11 @@ INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervis INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Other PV', 139, now(), 0); INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Other PV', 140, now(), 0); -alter table user_ip_address add column removed datetime DEFAULT NULL COMMENT 'date removed'; -alter table user_ip_address add column created datetime NULL COMMENT 'date created'; +alter table `cloud`.`user_ip_address` add column removed datetime DEFAULT NULL COMMENT 'date removed'; +alter table `cloud`.`user_ip_address` add column created datetime NULL COMMENT 'date created'; -alter table vlan add column removed datetime DEFAULT NULL COMMENT 'date removed'; -alter table vlan add column created datetime NULL COMMENT 'date created'; +alter table `cloud`.`vlan` add column removed datetime DEFAULT NULL COMMENT 'date removed'; +alter table `cloud`.`vlan` add column created datetime NULL COMMENT 'date created'; -alter table user_ip_address drop key public_ip_address; -alter table user_ip_address add UNIQUE KEY public_ip_address (public_ip_address,source_network_id, removed); \ No newline at end of file +alter table `cloud`.`user_ip_address` drop key public_ip_address; +alter table `cloud`.`user_ip_address` add UNIQUE KEY public_ip_address (public_ip_address,source_network_id, removed); \ No newline at end of file From cc663bb7fc515a4960cd483e8f5697bc141ce95e Mon Sep 17 00:00:00 2001 From: Rajani Karuturi Date: Fri, 30 May 2014 11:47:56 +0530 Subject: [PATCH 522/683] FIXED CLOUDSTACK-6669 Support volume resize in usage server --- .../src/com/cloud/usage/UsageManagerImpl.java | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/usage/src/com/cloud/usage/UsageManagerImpl.java b/usage/src/com/cloud/usage/UsageManagerImpl.java index 4ceecbb973..159380b94c 100644 --- a/usage/src/com/cloud/usage/UsageManagerImpl.java +++ b/usage/src/com/cloud/usage/UsageManagerImpl.java @@ -961,9 +961,8 @@ private boolean isIPEvent(String eventType) { } private boolean isVolumeEvent(String eventType) { - if (eventType == null) - return false; - return (eventType.equals(EventTypes.EVENT_VOLUME_CREATE) || eventType.equals(EventTypes.EVENT_VOLUME_DELETE)); + return eventType != null && + (eventType.equals(EventTypes.EVENT_VOLUME_CREATE) || eventType.equals(EventTypes.EVENT_VOLUME_DELETE) || eventType.equals(EventTypes.EVENT_VOLUME_RESIZE)); } private boolean isTemplateEvent(String eventType) { @@ -1366,20 +1365,9 @@ private void createIPHelperEvent(UsageEventVO event) { private void createVolumeHelperEvent(UsageEventVO event) { - Long doId = -1L; - long zoneId = -1L; - Long templateId = -1L; - long size = -1L; - long volId = event.getResourceId(); - if (EventTypes.EVENT_VOLUME_CREATE.equals(event.getType())) { - doId = event.getOfferingId(); - zoneId = event.getZoneId(); - templateId = event.getTemplateId(); - size = event.getSize(); - } - if (EventTypes.EVENT_VOLUME_CREATE.equals(event.getType())) { + if (EventTypes.EVENT_VOLUME_CREATE.equals(event.getType()) || EventTypes.EVENT_VOLUME_RESIZE.equals(event.getType())) { SearchCriteria sc = _usageVolumeDao.createSearchCriteria(); sc.addAnd("accountId", SearchCriteria.Op.EQ, event.getAccountId()); sc.addAnd("id", SearchCriteria.Op.EQ, volId); @@ -1389,6 +1377,7 @@ private void createVolumeHelperEvent(UsageEventVO event) { //This is a safeguard to avoid double counting of volumes. s_logger.error("Found duplicate usage entry for volume: " + volId + " assigned to account: " + event.getAccountId() + "; marking as deleted..."); } + //an entry exists if it is a resize volume event. marking the existing deleted and creating a new one in the case of resize. for (UsageVolumeVO volumesVO : volumesVOs) { if (s_logger.isDebugEnabled()) { s_logger.debug("deleting volume: " + volumesVO.getId() + " from account: " + volumesVO.getAccountId()); @@ -1400,7 +1389,7 @@ private void createVolumeHelperEvent(UsageEventVO event) { s_logger.debug("create volume with id : " + volId + " for account: " + event.getAccountId()); } Account acct = _accountDao.findByIdIncludingRemoved(event.getAccountId()); - UsageVolumeVO volumeVO = new UsageVolumeVO(volId, zoneId, event.getAccountId(), acct.getDomainId(), doId, templateId, size, event.getCreateDate(), null); + UsageVolumeVO volumeVO = new UsageVolumeVO(volId, event.getZoneId(), event.getAccountId(), acct.getDomainId(), event.getOfferingId(), event.getTemplateId(), event.getSize(), event.getCreateDate(), null); _usageVolumeDao.persist(volumeVO); } else if (EventTypes.EVENT_VOLUME_DELETE.equals(event.getType())) { SearchCriteria sc = _usageVolumeDao.createSearchCriteria(); From 48ea9e0b5e87fee067b711890cd5a5d7c9079bf1 Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Fri, 30 May 2014 10:23:50 -0700 Subject: [PATCH 523/683] CLOUDSTACK-6599: 1. Adding the missing Template/Volume URLs expiration functionality 2. Improvement - While deleting the volume during expiration use rm -rf as vmware now contains directoy 3. Improvement - Use standard Answer so that the error gets logged in case deletion of expiration link didnt work fine. 4. Improvement - In case of domain change, expire the old urls --- .../DeleteEntityDownloadURLAnswer.java | 37 -------- .../image/datastore/ImageStoreEntity.java | 3 + .../datastore/db/TemplateDataStoreDao.java | 2 + .../datastore/db/TemplateDataStoreVO.java | 23 +++++ .../datastore/db/VolumeDataStoreDao.java | 2 + .../datastore/db/VolumeDataStoreVO.java | 12 +++ .../storage/image/store/ImageStoreImpl.java | 7 ++ .../image/BaseImageStoreDriverImpl.java | 5 ++ .../storage/image/ImageStoreDriver.java | 3 + .../image/db/TemplateDataStoreDaoImpl.java | 13 +++ .../image/db/VolumeDataStoreDaoImpl.java | 14 +++ .../CloudStackImageStoreDriverImpl.java | 26 ++++++ .../ConfigurationManagerImpl.java | 25 ++++++ .../src/com/cloud/storage/StorageManager.java | 2 + .../com/cloud/storage/StorageManagerImpl.java | 87 +++++++++++++++++++ .../cloud/storage/VolumeApiServiceImpl.java | 2 + .../cloud/template/TemplateManagerImpl.java | 13 ++- .../ChildTestConfiguration.java | 9 +- .../storage/template/UploadManager.java | 4 +- .../storage/template/UploadManagerImpl.java | 12 +-- setup/db/db/schema-430to440.sql | 7 +- utils/src/com/cloud/utils/DateUtil.java | 11 +++ 22 files changed, 270 insertions(+), 49 deletions(-) delete mode 100644 core/src/com/cloud/agent/api/storage/DeleteEntityDownloadURLAnswer.java diff --git a/core/src/com/cloud/agent/api/storage/DeleteEntityDownloadURLAnswer.java b/core/src/com/cloud/agent/api/storage/DeleteEntityDownloadURLAnswer.java deleted file mode 100644 index 7b8da59c5d..0000000000 --- a/core/src/com/cloud/agent/api/storage/DeleteEntityDownloadURLAnswer.java +++ /dev/null @@ -1,37 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -package com.cloud.agent.api.storage; - -import com.cloud.agent.api.Answer; - -public class DeleteEntityDownloadURLAnswer extends Answer { - - String resultString; - short resultCode; - public static final short RESULT_SUCCESS = 1; - public static final short RESULT_FAILURE = 0; - - public DeleteEntityDownloadURLAnswer(String resultString, short resultCode) { - super(); - this.resultString = resultString; - this.resultCode = resultCode; - } - - public DeleteEntityDownloadURLAnswer() { - } - -} diff --git a/engine/api/src/org/apache/cloudstack/storage/image/datastore/ImageStoreEntity.java b/engine/api/src/org/apache/cloudstack/storage/image/datastore/ImageStoreEntity.java index 43a0f75c8d..461bd50ab0 100644 --- a/engine/api/src/org/apache/cloudstack/storage/image/datastore/ImageStoreEntity.java +++ b/engine/api/src/org/apache/cloudstack/storage/image/datastore/ImageStoreEntity.java @@ -20,6 +20,7 @@ import java.util.Set; +import com.cloud.storage.Upload; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.SnapshotInfo; @@ -43,4 +44,6 @@ public interface ImageStoreEntity extends DataStore, ImageStore { String getMountPoint(); // get the mount point on ssvm. String createEntityExtractUrl(String installPath, ImageFormat format, DataObject dataObject); // get the entity download URL + + void deleteExtractUrl(String installPath, String url, Upload.Type volume); } diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java index 271bbcae14..cb159499eb 100644 --- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java +++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreDao.java @@ -74,4 +74,6 @@ public interface TemplateDataStoreDao extends GenericDao listOnCache(long templateId); void updateStoreRoleToCachce(long storeId); + + List listTemplateDownloadUrls(); } diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreVO.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreVO.java index bb40bf5d11..bb05300e21 100755 --- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreVO.java +++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/TemplateDataStoreVO.java @@ -98,6 +98,13 @@ public class TemplateDataStoreVO implements StateObject, List listDestroyed(long storeId); void duplicateCacheRecordsOnRegionStore(long storeId); + + List listVolumeDownloadUrls(); } diff --git a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java index 588eae8ba5..aa57e74214 100755 --- a/engine/schema/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java +++ b/engine/schema/src/org/apache/cloudstack/storage/datastore/db/VolumeDataStoreVO.java @@ -102,6 +102,10 @@ public class VolumeDataStoreVO implements StateObject callback) { } + + @Override + public void deleteEntityExtractUrl(DataStore store, String installPath, String url, Upload.Type entityType){ + } } diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/ImageStoreDriver.java b/engine/storage/src/org/apache/cloudstack/storage/image/ImageStoreDriver.java index fa7ea372f7..e71529edb8 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/image/ImageStoreDriver.java +++ b/engine/storage/src/org/apache/cloudstack/storage/image/ImageStoreDriver.java @@ -18,6 +18,7 @@ */ package org.apache.cloudstack.storage.image; +import com.cloud.storage.Upload; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreDriver; @@ -26,4 +27,6 @@ public interface ImageStoreDriver extends DataStoreDriver { String createEntityExtractUrl(DataStore store, String installPath, ImageFormat format, DataObject dataObject); + + void deleteEntityExtractUrl(DataStore store, String installPath, String url, Upload.Type entityType); } diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java index cce7f08244..50334f4644 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java +++ b/engine/storage/src/org/apache/cloudstack/storage/image/db/TemplateDataStoreDaoImpl.java @@ -63,6 +63,7 @@ public class TemplateDataStoreDaoImpl extends GenericDaoBase storeTemplateSearch; private SearchBuilder storeTemplateStateSearch; private SearchBuilder storeTemplateDownloadStatusSearch; + private SearchBuilder downloadTemplateSearch; @Inject private DataStoreManager _storeMgr; @@ -131,6 +132,11 @@ public boolean configure(String name, Map params) throws Configu storeTemplateSearch.and("destroyed", storeTemplateSearch.entity().getDestroyed(), SearchCriteria.Op.EQ); storeTemplateSearch.done(); + downloadTemplateSearch = createSearchBuilder(); + downloadTemplateSearch.and("download_url", downloadTemplateSearch.entity().getExtractUrl(), Op.NNULL); + downloadTemplateSearch.and("destroyed", downloadTemplateSearch.entity().getDestroyed(), SearchCriteria.Op.EQ); + downloadTemplateSearch.done(); + return true; } @@ -488,4 +494,11 @@ public void updateStoreRoleToCachce(long storeId) { } + @Override + public List listTemplateDownloadUrls() { + SearchCriteria sc = downloadTemplateSearch.create(); + sc.setParameters("destroyed", false); + return listBy(sc); + } + } diff --git a/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java b/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java index e906d95be6..9309f6ef3c 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java +++ b/engine/storage/src/org/apache/cloudstack/storage/image/db/VolumeDataStoreDaoImpl.java @@ -50,6 +50,7 @@ public class VolumeDataStoreDaoImpl extends GenericDaoBase storeSearch; private SearchBuilder cacheSearch; private SearchBuilder storeVolumeSearch; + private SearchBuilder downloadVolumeSearch; @Inject DataStoreManager storeMgr; @@ -85,6 +86,12 @@ public boolean configure(String name, Map params) throws Configu updateStateSearch.and("state", updateStateSearch.entity().getState(), Op.EQ); updateStateSearch.and("updatedCount", updateStateSearch.entity().getUpdatedCount(), Op.EQ); updateStateSearch.done(); + + downloadVolumeSearch = createSearchBuilder(); + downloadVolumeSearch.and("download_url", downloadVolumeSearch.entity().getExtractUrl(), Op.NNULL); + downloadVolumeSearch.and("destroyed", downloadVolumeSearch.entity().getDestroyed(), SearchCriteria.Op.EQ); + downloadVolumeSearch.done(); + return true; } @@ -253,4 +260,11 @@ public void duplicateCacheRecordsOnRegionStore(long storeId) { } } + + @Override + public List listVolumeDownloadUrls() { + SearchCriteria sc = downloadVolumeSearch.create(); + sc.setParameters("destroyed", false); + return listBy(sc); + } } diff --git a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java index c2e26d52f6..c25e99f727 100644 --- a/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java +++ b/plugins/storage/image/default/src/org/apache/cloudstack/storage/datastore/driver/CloudStackImageStoreDriverImpl.java @@ -22,6 +22,8 @@ import javax.inject.Inject; +import com.cloud.agent.api.storage.DeleteEntityDownloadURLCommand; +import com.cloud.storage.Upload; import org.apache.log4j.Logger; import org.apache.cloudstack.engine.subsystem.api.storage.DataObject; @@ -109,4 +111,28 @@ private String generateCopyUrl(String ipAddress, String uuid) { return scheme + "://" + hostname + "/userdata/" + uuid; } + @Override + public void deleteEntityExtractUrl(DataStore store, String installPath, String downloadUrl, Upload.Type entityType) { + // find an endpoint to send command + EndPoint ep = _epSelector.select(store); + + // Delete Symlink at ssvm. In case of volume also delete the volume. + DeleteEntityDownloadURLCommand cmd = new DeleteEntityDownloadURLCommand(installPath, entityType, downloadUrl, ((ImageStoreEntity) store).getMountPoint()); + + Answer ans = null; + if (ep == null) { + String errMsg = "No remote endpoint to send command, check if host or ssvm is down?"; + s_logger.error(errMsg); + ans = new Answer(cmd, false, errMsg); + } else { + ans = ep.sendMessage(cmd); + } + if (ans == null || !ans.getResult()) { + String errorString = "Unable to delete the url " + downloadUrl + " for path " + installPath + " on ssvm, " + ans.getDetails(); + s_logger.error(errorString); + throw new CloudRuntimeException(errorString); + } + + } + } diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 34a3d4f886..0dc067a1d3 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -17,6 +17,7 @@ package com.cloud.configuration; import java.net.URI; +import java.sql.Date; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; @@ -36,6 +37,7 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; +import com.cloud.storage.StorageManager; import org.apache.log4j.Logger; import org.apache.cloudstack.acl.SecurityChecker; @@ -314,6 +316,8 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati AffinityGroupDao _affinityGroupDao; @Inject AffinityGroupService _affinityGroupService; + @Inject + StorageManager _storageManager; // FIXME - why don't we have interface for DataCenterLinkLocalIpAddressDao? @Inject @@ -584,6 +588,27 @@ public String updateConfiguration(long userId, String name, String category, Str throw new CloudRuntimeException("Failed to update SecondaryStorage offering's use_local_storage option to value:" + useLocalStorage); } } + }else if (Config.SecStorageSecureCopyCert.key().equalsIgnoreCase(name)) { + //FIXME - Ideally there should be a listener model to listen to global config changes and be able to take action gracefully. + //Expire the download urls + String sqlTemplate = "update template_store_ref set download_url_created=?"; + String sqlVolume = "update volume_store_ref set download_url_created=?"; + try { + // Change for templates + pstmt = txn.prepareAutoCloseStatement(sqlTemplate); + pstmt.setDate(1, new Date(-1l));// Set the time before the epoch time. + pstmt.executeUpdate(); + // Change for volumes + pstmt = txn.prepareAutoCloseStatement(sqlVolume); + pstmt.setDate(1, new Date(-1l));// Set the time before the epoch time. + pstmt.executeUpdate(); + // Cleanup the download urls + _storageManager.cleanupDownloadUrls(); + } catch (Throwable e) { + throw new CloudRuntimeException("Failed to clean up download URLs in template_store_ref or volume_store_ref due to exception ", e); + } + + } txn.commit(); diff --git a/server/src/com/cloud/storage/StorageManager.java b/server/src/com/cloud/storage/StorageManager.java index c8a7051e34..eebbf7fa12 100755 --- a/server/src/com/cloud/storage/StorageManager.java +++ b/server/src/com/cloud/storage/StorageManager.java @@ -114,4 +114,6 @@ public interface StorageManager extends StorageService { Long getDiskIopsReadRate(ServiceOfferingVO offering, DiskOfferingVO diskOffering); Long getDiskIopsWriteRate(ServiceOfferingVO offering, DiskOfferingVO diskOffering); + + void cleanupDownloadUrls(); } diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index c27a457f0e..a1f4cd68c3 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -41,6 +41,8 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; +import com.cloud.utils.DateUtil; +import org.apache.cloudstack.storage.image.datastore.ImageStoreEntity; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; @@ -284,6 +286,8 @@ public void setDiscoverers(List discoverers) { boolean _templateCleanupEnabled = true; int _storageCleanupInterval; int _storagePoolAcquisitionWaitSeconds = 1800; // 30 minutes + int _downloadUrlCleanupInterval; + int _downloadUrlExpirationInterval; // protected BigDecimal _overProvisioningFactor = new BigDecimal(1); private long _serverId; @@ -455,6 +459,12 @@ public boolean configure(String name, Map params) throws Configu s_logger.info("Storage cleanup enabled: " + _storageCleanupEnabled + ", interval: " + _storageCleanupInterval + ", template cleanup enabled: " + _templateCleanupEnabled); + String cleanupInterval = configs.get("extract.url.cleanup.interval"); + _downloadUrlCleanupInterval = NumbersUtil.parseInt(cleanupInterval, 7200); + + String urlExpirationInterval = configs.get("extract.url.expiration.interval"); + _downloadUrlExpirationInterval = NumbersUtil.parseInt(urlExpirationInterval, 14400); + String workers = configs.get("expunge.workers"); int wrks = NumbersUtil.parseInt(workers, 10); _executor = Executors.newScheduledThreadPool(wrks, new NamedThreadFactory("StorageManager-Scavenger")); @@ -507,6 +517,9 @@ public boolean start() { } else { s_logger.debug("Storage cleanup is not enabled, so the storage cleanup thread is not being scheduled."); } + + _executor.scheduleWithFixedDelay(new DownloadURLGarbageCollector(), _downloadUrlCleanupInterval, _downloadUrlCleanupInterval, TimeUnit.SECONDS); + return true; } @@ -1962,6 +1975,80 @@ public void doInTransactionWithoutResult(TransactionStatus status) { return true; } + protected class DownloadURLGarbageCollector implements Runnable { + + public DownloadURLGarbageCollector() { + } + + @Override + public void run() { + try { + s_logger.trace("Download URL Garbage Collection Thread is running."); + + cleanupDownloadUrls(); + + } catch (Exception e) { + s_logger.error("Caught the following Exception", e); + } + } + } + + @Override + public void cleanupDownloadUrls(){ + + // Cleanup expired volume URLs + List volumesOnImageStoreList = _volumeStoreDao.listVolumeDownloadUrls(); + for(VolumeDataStoreVO volumeOnImageStore : volumesOnImageStoreList){ + + try { + long downloadUrlCurrentAgeInSecs = DateUtil.getTimeDifference(DateUtil.now(), volumeOnImageStore.getExtractUrlCreated()); + if(downloadUrlCurrentAgeInSecs < _downloadUrlExpirationInterval){ // URL hasnt expired yet + continue; + } + + s_logger.debug("Removing download url " + volumeOnImageStore.getExtractUrl() + " for volume id " + volumeOnImageStore.getVolumeId()); + + // Remove it from image store + ImageStoreEntity secStore = (ImageStoreEntity) _dataStoreMgr.getDataStore(volumeOnImageStore.getDataStoreId(), DataStoreRole.Image); + secStore.deleteExtractUrl(volumeOnImageStore.getInstallPath(), volumeOnImageStore.getExtractUrl(), Upload.Type.VOLUME); + + // Now expunge it from DB since this entry was created only for download purpose + _volumeStoreDao.expunge(volumeOnImageStore.getId()); + }catch(Throwable th){ + s_logger.warn("Caught exception while deleting download url " +volumeOnImageStore.getExtractUrl() + + " for volume id " + volumeOnImageStore.getVolumeId(), th); + } + } + + // Cleanup expired template URLs + List templatesOnImageStoreList = _templateStoreDao.listTemplateDownloadUrls(); + for(TemplateDataStoreVO templateOnImageStore : templatesOnImageStoreList){ + + try { + long downloadUrlCurrentAgeInSecs = DateUtil.getTimeDifference(DateUtil.now(), templateOnImageStore.getExtractUrlCreated()); + if(downloadUrlCurrentAgeInSecs < _downloadUrlExpirationInterval){ // URL hasnt expired yet + continue; + } + + s_logger.debug("Removing download url " + templateOnImageStore.getExtractUrl() + " for template id " + templateOnImageStore.getTemplateId()); + + // Remove it from image store + ImageStoreEntity secStore = (ImageStoreEntity) _dataStoreMgr.getDataStore(templateOnImageStore.getDataStoreId(), DataStoreRole.Image); + secStore.deleteExtractUrl(templateOnImageStore.getInstallPath(), templateOnImageStore.getExtractUrl(), Upload.Type.TEMPLATE); + + // Now remove download details from DB. + templateOnImageStore.setExtractUrl(null); + templateOnImageStore.setExtractUrlCreated(null); + _templateStoreDao.update(templateOnImageStore.getId(), templateOnImageStore); + }catch(Throwable th){ + s_logger.warn("caught exception while deleting download url " +templateOnImageStore.getExtractUrl() + + " for template id " +templateOnImageStore.getTemplateId(), th); + } + } + + + } + // get bytesReadRate from service_offering, disk_offering and vm.disk.throttling.bytes_read_rate @Override public Long getDiskBytesReadRate(ServiceOfferingVO offering, DiskOfferingVO diskOffering) { diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index 152531571b..42d318c6c2 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -26,6 +26,7 @@ import javax.inject.Inject; +import com.cloud.utils.DateUtil; import org.apache.log4j.Logger; import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd; @@ -1870,6 +1871,7 @@ public String extractVolume(ExtractVolumeCmd cmd) { String extractUrl = secStore.createEntityExtractUrl(vol.getPath(), vol.getFormat(), vol); volumeStoreRef = _volumeStoreDao.findByVolume(volumeId); volumeStoreRef.setExtractUrl(extractUrl); + volumeStoreRef.setExtractUrlCreated(DateUtil.now()); _volumeStoreDao.update(volumeStoreRef.getId(), volumeStoreRef); return extractUrl; diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java index 0cc74388f0..3ebb43aa15 100755 --- a/server/src/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/com/cloud/template/TemplateManagerImpl.java @@ -31,6 +31,7 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; +import com.cloud.utils.DateUtil; import org.apache.log4j.Logger; import org.apache.cloudstack.acl.SecurityChecker.AccessType; @@ -437,12 +438,20 @@ private String extract(Account caller, Long templateId, String url, Long zoneId, throw new InvalidParameterValueException("The " + desc + " has not been downloaded "); } + // Check if the url already exists + if(tmpltStoreRef.getExtractUrl() != null){ + return tmpltStoreRef.getExtractUrl(); + } + // Handle NFS to S3 object store migration case, we trigger template sync from NFS to S3 during extract template or copy template _tmpltSvr.syncTemplateToRegionStore(templateId, tmpltStore); TemplateInfo templateObject = _tmplFactory.getTemplate(templateId, tmpltStore); - - return tmpltStore.createEntityExtractUrl(templateObject.getInstallPath(), template.getFormat(), templateObject); + String extractUrl = tmpltStore.createEntityExtractUrl(tmpltStoreRef.getInstallPath(), template.getFormat(), templateObject); + tmpltStoreRef.setExtractUrl(extractUrl); + tmpltStoreRef.setExtractUrlCreated(DateUtil.now()); + _tmplStoreDao.update(tmpltStoreRef.getId(), tmpltStoreRef); + return extractUrl; } @Override diff --git a/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java b/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java index 22516c03a4..4760144043 100644 --- a/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java +++ b/server/test/org/apache/cloudstack/networkoffering/ChildTestConfiguration.java @@ -19,6 +19,7 @@ import java.io.IOException; +import com.cloud.storage.StorageManager; import org.mockito.Mockito; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; @@ -132,7 +133,8 @@ PortableIpRangeDaoImpl.class, RegionDaoImpl.class, PortableIpDaoImpl.class, AccountGuestVlanMapDaoImpl.class}, includeFilters = {@Filter(value = ChildTestConfiguration.Library.class, type = FilterType.CUSTOM)}, useDefaultFilters = false) -public class ChildTestConfiguration { +public class + ChildTestConfiguration { @Bean public ManagementService managementService() { @@ -329,6 +331,11 @@ public AffinityGroupService affinityGroupService() { return Mockito.mock(AffinityGroupService.class); } + @Bean + public StorageManager storageManager() { + return Mockito.mock(StorageManager.class); + } + public static class Library implements TypeFilter { @Override diff --git a/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadManager.java b/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadManager.java index be99fea79f..81168b8388 100755 --- a/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadManager.java +++ b/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadManager.java @@ -16,11 +16,11 @@ // under the License. package org.apache.cloudstack.storage.template; +import com.cloud.agent.api.Answer; import org.apache.cloudstack.storage.resource.SecondaryStorageResource; import com.cloud.agent.api.storage.CreateEntityDownloadURLAnswer; import com.cloud.agent.api.storage.CreateEntityDownloadURLCommand; -import com.cloud.agent.api.storage.DeleteEntityDownloadURLAnswer; import com.cloud.agent.api.storage.DeleteEntityDownloadURLCommand; import com.cloud.agent.api.storage.UploadAnswer; import com.cloud.agent.api.storage.UploadCommand; @@ -77,6 +77,6 @@ String uploadPublicTemplate(long id, String url, String name, ImageFormat format CreateEntityDownloadURLAnswer handleCreateEntityURLCommand(CreateEntityDownloadURLCommand cmd); - DeleteEntityDownloadURLAnswer handleDeleteEntityDownloadURLCommand(DeleteEntityDownloadURLCommand cmd); + Answer handleDeleteEntityDownloadURLCommand(DeleteEntityDownloadURLCommand cmd); } diff --git a/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadManagerImpl.java b/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadManagerImpl.java index cdbc52dec5..d046eb9f57 100755 --- a/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadManagerImpl.java +++ b/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadManagerImpl.java @@ -29,13 +29,13 @@ import javax.naming.ConfigurationException; +import com.cloud.agent.api.Answer; import org.apache.log4j.Logger; import org.apache.cloudstack.storage.resource.SecondaryStorageResource; import com.cloud.agent.api.storage.CreateEntityDownloadURLAnswer; import com.cloud.agent.api.storage.CreateEntityDownloadURLCommand; -import com.cloud.agent.api.storage.DeleteEntityDownloadURLAnswer; import com.cloud.agent.api.storage.DeleteEntityDownloadURLCommand; import com.cloud.agent.api.storage.UploadAnswer; import com.cloud.agent.api.storage.UploadCommand; @@ -303,7 +303,7 @@ public CreateEntityDownloadURLAnswer handleCreateEntityURLCommand(CreateEntityDo } @Override - public DeleteEntityDownloadURLAnswer handleDeleteEntityDownloadURLCommand(DeleteEntityDownloadURLCommand cmd) { + public Answer handleDeleteEntityDownloadURLCommand(DeleteEntityDownloadURLCommand cmd) { //Delete the soft link. Example path = volumes/8/74eeb2c6-8ab1-4357-841f-2e9d06d1f360.vhd s_logger.warn("handleDeleteEntityDownloadURLCommand Path:" + cmd.getPath() + " Type:" + cmd.getType().toString()); @@ -318,24 +318,24 @@ public DeleteEntityDownloadURLAnswer handleDeleteEntityDownloadURLCommand(Delete if (result != null) { String errorString = "Error in deleting =" + result; s_logger.warn(errorString); - return new DeleteEntityDownloadURLAnswer(errorString, CreateEntityDownloadURLAnswer.RESULT_FAILURE); + return new Answer(cmd, false, errorString); } // If its a volume also delete the Hard link since it was created only for the purpose of download. if (cmd.getType() == Upload.Type.VOLUME) { command = new Script("/bin/bash", s_logger); command.add("-c"); - command.add("rm -f /mnt/SecStorage/" + cmd.getParentPath() + File.separator + path); + command.add("rm -rf /mnt/SecStorage/" + cmd.getParentPath() + File.separator + path); s_logger.warn(" " + parentDir + File.separator + path); result = command.execute(); if (result != null) { String errorString = "Error in linking err=" + result; s_logger.warn(errorString); - return new DeleteEntityDownloadURLAnswer(errorString, CreateEntityDownloadURLAnswer.RESULT_FAILURE); + return new Answer(cmd, false, errorString); } } - return new DeleteEntityDownloadURLAnswer("", CreateEntityDownloadURLAnswer.RESULT_SUCCESS); + return new Answer(cmd, true, ""); } private String getInstallPath(String jobId) { diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index cb042e43f8..208c0ae1bb 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -1703,4 +1703,9 @@ alter table `cloud`.`vlan` add column removed datetime DEFAULT NULL COMMENT 'dat alter table `cloud`.`vlan` add column created datetime NULL COMMENT 'date created'; alter table `cloud`.`user_ip_address` drop key public_ip_address; -alter table `cloud`.`user_ip_address` add UNIQUE KEY public_ip_address (public_ip_address,source_network_id, removed); \ No newline at end of file +alter table `cloud`.`user_ip_address` add UNIQUE KEY public_ip_address (public_ip_address,source_network_id, removed); + +ALTER TABLE `cloud`.`volume_store_ref` ADD `download_url_created` datetime; +ALTER TABLE `cloud`.`template_store_ref` ADD `download_url_created` datetime; +ALTER TABLE `cloud`.`template_store_ref` ADD `download_url` varchar(255); + diff --git a/utils/src/com/cloud/utils/DateUtil.java b/utils/src/com/cloud/utils/DateUtil.java index fc7fd0191e..be18fa283d 100644 --- a/utils/src/com/cloud/utils/DateUtil.java +++ b/utils/src/com/cloud/utils/DateUtil.java @@ -261,6 +261,17 @@ public static Date getNextRunTime(IntervalType type, String schedule, String tim } } + public static long getTimeDifference(Date date1, Date date2){ + + Calendar dateCalendar1 = Calendar.getInstance(); + dateCalendar1.setTime(date1); + Calendar dateCalendar2 = Calendar.getInstance(); + dateCalendar2.setTime(date2); + + return (dateCalendar1.getTimeInMillis() - dateCalendar2.getTimeInMillis() )/1000; + + } + // test only public static void main(String[] args) { TimeZone localTimezone = Calendar.getInstance().getTimeZone(); From be765ce8680564b743a73dd360c590c0e495c204 Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Fri, 30 May 2014 14:53:42 -0700 Subject: [PATCH 524/683] CLOUDSTACK-6599: Add the column in Java upgrade path since 4.2 already has the extract template/volume columns --- .../cloud/upgrade/dao/Upgrade430to440.java | 33 +++++++++++++++++++ setup/db/db/schema-430to440.sql | 4 --- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java index da71d445f3..b7b6bc4480 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java @@ -61,8 +61,41 @@ public File[] getPrepareScripts() { public void performDataMigration(Connection conn) { secondaryIpsAccountAndDomainIdsUpdate(conn); moveCidrsToTheirOwnTable(conn); + addExtractTemplateAndVolumeColumns(conn); + } + private void addExtractTemplateAndVolumeColumns(Connection conn) { + PreparedStatement pstmt = null; + ResultSet rs = null; + + try { + + // Add download_url_created, download_url to template_store_ref + pstmt = conn.prepareStatement("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'cloud' AND TABLE_NAME = 'template_store_ref' AND COLUMN_NAME = 'download_url_created'"); + rs = pstmt.executeQuery(); + if (!rs.next()) { + pstmt = conn.prepareStatement("ALTER TABLE `cloud`.`template_store_ref` ADD COLUMN `download_url_created` datetime"); + pstmt.executeUpdate(); + + pstmt = conn.prepareStatement("ALTER TABLE `cloud`.`template_store_ref` ADD COLUMN `download_url` varchar(255)"); + pstmt.executeUpdate(); + } + + // Add download_url_created to volume_store_ref - note download_url already exists + pstmt = conn.prepareStatement("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'cloud' AND TABLE_NAME = 'volume_store_ref' AND COLUMN_NAME = 'download_url_created'"); + rs = pstmt.executeQuery(); + if (!rs.next()) { + pstmt = conn.prepareStatement("ALTER TABLE `cloud`.`volume_store_ref` ADD COLUMN `download_url_created` datetime"); + pstmt.executeUpdate(); + } + + } catch (SQLException e) { + throw new CloudRuntimeException("Adding columns for Extract Template And Volume functionality failed"); + } + } + + private void secondaryIpsAccountAndDomainIdsUpdate(Connection conn) { PreparedStatement pstmt = null; diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index 208c0ae1bb..7e518e348f 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -1705,7 +1705,3 @@ alter table `cloud`.`vlan` add column created datetime NULL COMMENT 'date create alter table `cloud`.`user_ip_address` drop key public_ip_address; alter table `cloud`.`user_ip_address` add UNIQUE KEY public_ip_address (public_ip_address,source_network_id, removed); -ALTER TABLE `cloud`.`volume_store_ref` ADD `download_url_created` datetime; -ALTER TABLE `cloud`.`template_store_ref` ADD `download_url_created` datetime; -ALTER TABLE `cloud`.`template_store_ref` ADD `download_url` varchar(255); - From 1f7167555d92bc2d5eb964e6de88a052db1388a7 Mon Sep 17 00:00:00 2001 From: ynojima Date: Sat, 31 May 2014 01:49:36 -0600 Subject: [PATCH 525/683] CLOUDSTACK-6816 bugfix: cloudstack-setup-management make /root directory's permission 0777 improperly --- python/lib/cloudutils/serviceConfig.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/python/lib/cloudutils/serviceConfig.py b/python/lib/cloudutils/serviceConfig.py index d7c7e78c3a..3c23334292 100755 --- a/python/lib/cloudutils/serviceConfig.py +++ b/python/lib/cloudutils/serviceConfig.py @@ -763,9 +763,6 @@ def config(self): for port in self.ports: self.allowPort(port) - #FIXME: urgly make /root writable - bash("sudo chmod 0777 /root") - return True except: raise From 73330167228d14ea8494c9c1893627b6936626a7 Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Mon, 2 Jun 2014 17:52:37 -0700 Subject: [PATCH 526/683] CLOUDSTACK-6824: In case there is a failure to delete the soft link of a download url, dont bail out since there can be cases such as destroy ssvm where the soft links do not exist any more. --- .../cloudstack/storage/template/UploadManagerImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadManagerImpl.java b/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadManagerImpl.java index d046eb9f57..a8ed9a84d9 100755 --- a/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadManagerImpl.java +++ b/services/secondary-storage/server/src/org/apache/cloudstack/storage/template/UploadManagerImpl.java @@ -316,9 +316,9 @@ public Answer handleDeleteEntityDownloadURLCommand(DeleteEntityDownloadURLComman command.add("unlink /var/www/html/userdata/" + extractUrl.substring(extractUrl.lastIndexOf(File.separator) + 1)); String result = command.execute(); if (result != null) { - String errorString = "Error in deleting =" + result; - s_logger.warn(errorString); - return new Answer(cmd, false, errorString); + // FIXME - Ideally should bail out if you cant delete symlink. Not doing it right now. + // This is because the ssvm might already be destroyed and the symlinks do not exist. + s_logger.warn("Error in deleting symlink :" + result); } // If its a volume also delete the Hard link since it was created only for the purpose of download. @@ -329,7 +329,7 @@ public Answer handleDeleteEntityDownloadURLCommand(DeleteEntityDownloadURLComman s_logger.warn(" " + parentDir + File.separator + path); result = command.execute(); if (result != null) { - String errorString = "Error in linking err=" + result; + String errorString = "Error in deleting volume " + path + " : " + result; s_logger.warn(errorString); return new Answer(cmd, false, errorString); } From 67d92726cb4b0b195804fb8a3e3c76f9a2341b39 Mon Sep 17 00:00:00 2001 From: Rajani Karuturi Date: Tue, 3 Jun 2014 12:31:20 +0530 Subject: [PATCH 527/683] Fixed ResouceLeak on pstmtCidr in the function Upgrade430to440.moveCidrsToTheirOwnTable as reported by coverity Signed-off-by: Hugo Trippaers --- .../src/com/cloud/upgrade/dao/Upgrade430to440.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java index b7b6bc4480..46dc03f76c 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java @@ -253,14 +253,12 @@ private void moveCidrsToTheirOwnTable(Connection conn) { String[] cidrArray = cidrList.split(","); // insert a record per cidr String networkAclItemCidrSql = "INSERT INTO `cloud`.`network_acl_item_cidrs` (network_acl_item_id, cidr) VALUES (?,?)"; - for(String cidr: cidrArray) - { - pstmtCidr = conn.prepareStatement(networkAclItemCidrSql); - pstmtCidr.setLong(1,itemId); - pstmtCidr.setString(2,cidr); + pstmtCidr = conn.prepareStatement(networkAclItemCidrSql); + pstmtCidr.setLong(1, itemId); + for (String cidr : cidrArray) { + pstmtCidr.setString(2, cidr); pstmtCidr.executeUpdate(); } - pstmtCidr.close(); } } catch (SQLException e) { throw new CloudRuntimeException("Exception while Moving network acl item cidrs to a row per cidr", e); From d511847cfedad5478d1b4087c8f97be2c5bf3cc8 Mon Sep 17 00:00:00 2001 From: Rajani Karuturi Date: Tue, 3 Jun 2014 16:11:01 +0530 Subject: [PATCH 528/683] Fixed Resource leak (RESOURCE_LEAK) 11. overwrite_var: Overwriting "pstmt" in "pstmt = conn.prepareStatement("INSERT INTO `cloud`.`ldap_configuration`(hostname, port) VALUES(?,?)")" leaks the resource that "pstmt" refers to. Signed-off-by: Koushik Das --- .../schema/src/com/cloud/upgrade/dao/Upgrade421to430.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java index 7e26132d9e..889cad457a 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java @@ -130,18 +130,20 @@ private void encryptLdapConfigParams(Connection conn) { try { + pstmt = conn.prepareStatement(insertSql); for (String[] ldapParam : ldapParams) { String name = ldapParam[0]; String value = ldapParam[1]; String desc = ldapParam[2]; String encryptedValue = DBEncryptionUtil.encrypt(value); - pstmt = conn.prepareStatement(insertSql); pstmt.setString(1, name); pstmt.setBytes(2, encryptedValue.getBytes("UTF-8")); pstmt.setString(3, desc); pstmt.executeUpdate(); } + pstmt.close(); + /** * if encrypted, decrypt the ldap hostname and port and then update as they are not encrypted now. */ @@ -154,6 +156,8 @@ private void encryptLdapConfigParams(Connection conn) { hostname = DBEncryptionUtil.decrypt(resultSet.getString(1)); } + pstmt.close(); + pstmt = conn.prepareStatement("SELECT conf.value FROM `cloud`.`configuration` conf WHERE conf.name='ldap.port'"); resultSet = pstmt.executeQuery(); if (resultSet.next()) { @@ -162,6 +166,7 @@ private void encryptLdapConfigParams(Connection conn) { portNumber = Integer.valueOf(port); } } + pstmt.close(); if (StringUtils.isNotBlank(hostname)) { pstmt = conn.prepareStatement("INSERT INTO `cloud`.`ldap_configuration`(hostname, port) VALUES(?,?)"); @@ -172,6 +177,7 @@ private void encryptLdapConfigParams(Connection conn) { pstmt.setNull(2, Types.INTEGER); } pstmt.executeUpdate(); + pstmt.close(); } } catch (SQLException e) { From bd5cd69517083112f7b56575ccc0cdba2220a44b Mon Sep 17 00:00:00 2001 From: Rajani Karuturi Date: Tue, 3 Jun 2014 14:09:20 +0530 Subject: [PATCH 529/683] Fixed ResouceLeak on pstmtCidr in the function Upgrade430to440.moveCidrsToTheirOwnTable as reported by coverity Fixed another leak which might occur due to outer while loop. Signed-off-by: Daan Hoogland (cherry picked from commit 004e0cbf61e9bf29bd716c8a0d7ac2f10c57433b) (cherry picked from commit fa3bbe9a1946b3597fe5d1a8a448607d54106b7e) --- engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java index 46dc03f76c..b6753b9824 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java @@ -243,6 +243,9 @@ private void moveCidrsToTheirOwnTable(Connection conn) { pstmtItem = conn.prepareStatement(networkAclItemSql); rsItems = pstmtItem.executeQuery(); + String networkAclItemCidrSql = "INSERT INTO `cloud`.`network_acl_item_cidrs` (network_acl_item_id, cidr) VALUES (?,?)"; + pstmtCidr = conn.prepareStatement(networkAclItemCidrSql); + // for each network acl item while(rsItems.next()) { long itemId = rsItems.getLong(1); @@ -252,8 +255,6 @@ private void moveCidrsToTheirOwnTable(Connection conn) { // split it String[] cidrArray = cidrList.split(","); // insert a record per cidr - String networkAclItemCidrSql = "INSERT INTO `cloud`.`network_acl_item_cidrs` (network_acl_item_id, cidr) VALUES (?,?)"; - pstmtCidr = conn.prepareStatement(networkAclItemCidrSql); pstmtCidr.setLong(1, itemId); for (String cidr : cidrArray) { pstmtCidr.setString(2, cidr); From 0329bebac5aa7dd68d7d9350d3a2cc609ce5e4a9 Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Fri, 30 May 2014 22:32:37 +0200 Subject: [PATCH 530/683] update vlan uris Conflicts: engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java (cherry picked from commit 44012ddadfd73e76b3750e7ce1e6b4aa24d74796) --- .../cloud/upgrade/dao/Upgrade430to440.java | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java index b6753b9824..a3ac44769f 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java @@ -26,6 +26,7 @@ import org.apache.log4j.Logger; import com.cloud.network.Network; +import com.cloud.network.Networks.BroadcastDomainType; import com.cloud.utils.exception.CloudRuntimeException; import com.cloud.utils.script.Script; @@ -62,7 +63,7 @@ public void performDataMigration(Connection conn) { secondaryIpsAccountAndDomainIdsUpdate(conn); moveCidrsToTheirOwnTable(conn); addExtractTemplateAndVolumeColumns(conn); - + updateVlanUris(conn); } private void addExtractTemplateAndVolumeColumns(Connection conn) { @@ -283,6 +284,41 @@ private void moveCidrsToTheirOwnTable(Connection conn) { s_logger.debug("Done moving network acl item cidrs to a row per cidr"); } + private void updateVlanUris(Connection conn) { + s_logger.debug("updating vlan URIs"); + PreparedStatement pstmt = null; + ResultSet rs = null; + try { + pstmt = conn.prepareStatement("SELECT id, vlan_id FROM `cloud`.`vlan` where vlan_id not like '%:%'"); + rs = pstmt.executeQuery(); + while (rs.next()) { + long id = rs.getLong(1); + String vlan = rs.getString(2); + if (vlan == null || "".equals(vlan)) { + continue; + } + String vlanUri = BroadcastDomainType.Vlan.toUri(vlan).toString(); + pstmt = conn.prepareStatement("update `cloud`.`vlan` set vlan_id=? where id=?"); + pstmt.setString(1, vlanUri); + pstmt.setLong(2, id); + pstmt.executeUpdate(); + } + } catch (SQLException e) { + throw new CloudRuntimeException("Unable to update vlan URIs ", e); + } finally { + try { + if (rs != null) { + rs.close(); + } + + if (pstmt != null) { + pstmt.close(); + } + } catch (SQLException e) { + } + } + s_logger.debug("Done updateing vlan URIs"); + } @Override public File[] getCleanupScripts() { From 5e80e5d33d9a295b91cdba9377f52d9d963d802a Mon Sep 17 00:00:00 2001 From: Edison Su Date: Tue, 3 Jun 2014 11:11:10 -0700 Subject: [PATCH 531/683] CLOUDSTACK-5505: if vpc public network with snat enabled, then will triger this issue --- .../network/router/VpcVirtualNetworkApplianceManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java index c06843c8ca..c7d4d4c5c3 100644 --- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java @@ -442,7 +442,7 @@ private void createVpcAssociatePublicIPCommands(final VirtualRouter router, fina String macAddress = vlanMacAddress.get(BroadcastDomainType.getValue(BroadcastDomainType.fromString(ipAddr.getVlanTag()))); IpAddressTO ip = - new IpAddressTO(ipAddr.getAccountId(), ipAddr.getAddress().addr(), add, false, ipAddr.isSourceNat(), ipAddr.getVlanTag(), ipAddr.getGateway(), + new IpAddressTO(ipAddr.getAccountId(), ipAddr.getAddress().addr(), add, false, ipAddr.isSourceNat(), BroadcastDomainType.fromString(ipAddr.getVlanTag()).toString(), ipAddr.getGateway(), ipAddr.getNetmask(), macAddress, networkRate, ipAddr.isOneToOneNat()); ip.setTrafficType(network.getTrafficType()); From dfb59cd6cc0292a88cb619e53f34cdb713879ffd Mon Sep 17 00:00:00 2001 From: Edison Su Date: Tue, 3 Jun 2014 13:31:29 -0700 Subject: [PATCH 532/683] CLOUDSTACK-6464: if guest network type is vlan://untagged, and traffic label is used, kvm agent needs to honor traffic label --- .../cloud/hypervisor/kvm/resource/BridgeVifDriver.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java index 57b111e6e3..2bab7a1b6c 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java @@ -112,7 +112,13 @@ public LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType) throws Inte intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType), networkRateKBps); } } else { - intf.defBridgeNet(_bridges.get("guest"), null, nic.getMac(), getGuestNicModel(guestOsType), networkRateKBps); + String brname = ""; + if (trafficLabel != null && !trafficLabel.isEmpty()) { + brname = trafficLabel; + } else { + brname = _bridges.get("guest"); + } + intf.defBridgeNet(brname, null, nic.getMac(), getGuestNicModel(guestOsType), networkRateKBps); } } else if (nic.getType() == Networks.TrafficType.Control) { /* Make sure the network is still there */ From b4cb969d9b8162fc588f2e2923f64acf9dc1e487 Mon Sep 17 00:00:00 2001 From: Bharat Kumar Date: Wed, 4 Jun 2014 18:52:36 +0530 Subject: [PATCH 533/683] CLOUDSTACK-6769 Test case failure in test_iso.py Disableing all the tests in this suite untill issues mentioned in the above ticket are resolved. Signed-off-by: Abhinandan Prateek --- test/integration/smoke/test_iso.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py index a3e42f195d..d394c27419 100644 --- a/test/integration/smoke/test_iso.py +++ b/test/integration/smoke/test_iso.py @@ -230,7 +230,7 @@ def tearDown(self): return - @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"],BugId="CLOUDSTACK-6769, CLOUDSTACK-6774") def test_02_edit_iso(self): """Test Edit ISO """ @@ -295,7 +295,7 @@ def test_02_edit_iso(self): ) return - @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"], BugId="CLOUDSTACK-6769, CLOUDSTACK-6774") def test_03_delete_iso(self): """Test delete ISO """ @@ -323,7 +323,7 @@ def test_03_delete_iso(self): ) return - @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "provisioning"]) + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "provisioning"], BugId="CLOUDSTACK-6769, CLOUDSTACK-6774") def test_04_extract_Iso(self): "Test for extract ISO" @@ -374,7 +374,7 @@ def test_04_extract_Iso(self): ) return - @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"], BugId="CLOUDSTACK-6769, CLOUDSTACK-6774") def test_05_iso_permissions(self): """Update & Test for ISO permissions""" @@ -426,7 +426,7 @@ def test_05_iso_permissions(self): ) return - @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "multizone", "provisioning"]) + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "multizone", "provisioning"], BugId="CLOUDSTACK-6769, CLOUDSTACK-6774") def test_06_copy_iso(self): """Test for copy ISO from one zone to another""" From 81bf37f33853d95e7c4137d57a60e719963913c4 Mon Sep 17 00:00:00 2001 From: Bharat Kumar Date: Thu, 5 Jun 2014 11:11:38 +0530 Subject: [PATCH 534/683] CLOUDSTACK-6776: Removed hard coded vlan ids from BVT test_non_contiguous_vlan.py --- .../smoke/test_non_contigiousvlan.py | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/test/integration/smoke/test_non_contigiousvlan.py b/test/integration/smoke/test_non_contigiousvlan.py index 90235ecd2c..50b48d092c 100644 --- a/test/integration/smoke/test_non_contigiousvlan.py +++ b/test/integration/smoke/test_non_contigiousvlan.py @@ -15,31 +15,28 @@ # specific language governing permissions and limitations # under the License. -from marvin import cloudstackTestCase -from marvin.cloudstackAPI import * +#from marvin.cloudstackAPI import * from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.lib.base import Account from marvin.lib.base import PhysicalNetwork +from marvin.lib.common import setNonContiguousVlanIds, get_zone from nose.plugins.attrib import attr -class Services(): - def __init__(self): - self.services = { - "vlan": { - "part": ["4090-4091", "4092-4095"], - "full": "4090-4095", - } - } - - @attr(tags = ["simulator", "advanced", "selfservice"], BugId="CLOUDSTACK-6776") class TestUpdatePhysicalNetwork(cloudstackTestCase): """ Test to extend physical network vlan range """ def setUp(self): - self.vlan = Services().services["vlan"] self.apiClient = self.testClient.getApiClient() + self.zone = get_zone(self.apiClient, self.testClient.getZoneForTests()) + self.physicalnetwork, self.vlan = setNonContiguousVlanIds(self.apiClient, self.zone.id) + + self.physicalnetworkid = self.physicalnetwork.id + self.existing_vlan = self.physicalnetwork.vlan + + if self.vlan is None: + raise Exception("Failed to set non contiguous vlan ids to test. Free some ids from \ + from existing physical networks at ends") def test_extendPhysicalNetworkVlan(self): @@ -53,13 +50,13 @@ def test_extendPhysicalNetworkVlan(self): self.network = phy_networks[0] self.networkid = phy_networks[0].id self.existing_vlan = phy_networks[0].vlan - vlan1 = self.existing_vlan+","+self.vlan["part"][0] + vlan1 = self.existing_vlan+","+self.vlan["partial_range"][0] updatePhysicalNetworkResponse = self.network.update(self.apiClient, id = self.networkid, vlan = vlan1) self.assert_(updatePhysicalNetworkResponse is not None, msg="couldn't extend the physical network with vlan %s"%vlan1) self.assert_(isinstance(self.network, PhysicalNetwork)) - vlan2 = vlan1+","+self.vlan["part"][1] + vlan2 = vlan1+","+self.vlan["partial_range"][1] updatePhysicalNetworkResponse2 = self.network.update(self.apiClient, id = self.networkid, vlan = vlan2) self.assert_(updatePhysicalNetworkResponse2 is not None, msg="couldn't extend the physical network with vlan %s"%vlan2) @@ -68,7 +65,7 @@ def test_extendPhysicalNetworkVlan(self): vlanranges= updatePhysicalNetworkResponse2.vlan self.assert_(vlanranges is not None, "No VLAN ranges found on the deployment") - self.assert_(vlanranges.find(self.vlan["full"]) > 0, "vlan ranges are not extended") + self.assert_(str(vlanranges) == vlan2, "vlan ranges are not extended") def tearDown(self): @@ -82,6 +79,6 @@ def tearDown(self): self.network = phy_networks[0] self.networkid = phy_networks[0].id updateResponse = self.network.update(self.apiClient, id = self.networkid, vlan=self.existing_vlan) - self.assert_(updateResponse.vlan.find(self.vlan["full"]) < 0, + self.assert_(updateResponse.vlan.find(self.vlan["full_range"]) < 0, "VLAN was not removed successfully") From 025c143ac7929055577911114751118cf5319592 Mon Sep 17 00:00:00 2001 From: Koushik Das Date: Thu, 5 Jun 2014 13:53:57 +0530 Subject: [PATCH 535/683] CLOUDSTACK-6843: [Automation] List listServiceOfferings api fails with NPE Incorrect parameter name used in query building resulted in a bad sql query. --- server/src/com/cloud/api/query/QueryManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java index 3ce2b66664..1182be575a 100644 --- a/server/src/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/com/cloud/api/query/QueryManagerImpl.java @@ -2546,7 +2546,7 @@ private Pair, Integer> searchForServiceOfferingsInte } if (vmTypeStr != null) { - sc.addAnd("vm_type", SearchCriteria.Op.EQ, vmTypeStr); + sc.addAnd("vmType", SearchCriteria.Op.EQ, vmTypeStr); } return _srvOfferingJoinDao.searchAndCount(sc, searchFilter); From 945e879bf221454cd42f1e7ef0a46e9a4aa6a156 Mon Sep 17 00:00:00 2001 From: Rajesh Battala Date: Thu, 5 Jun 2014 12:01:43 +0530 Subject: [PATCH 536/683] CLOUDSTACK-6833 [Hyper-V] Volume snapshot creation returns success even though snapshots are not supported for Hyper-V --- server/src/com/cloud/storage/VolumeApiServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index 42d318c6c2..6703e61b3a 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -1662,6 +1662,9 @@ public Snapshot takeSnapshot(Long volumeId, Long policyId, Long snapshotId, Acco if (volume.getInstanceId() != null) vm = _vmInstanceDao.findById(volume.getInstanceId()); + if (volume.getHypervisorType() == HypervisorType.Hyperv) { + throw new InvalidParameterValueException("Volume Snapshots are not supported on Hypervisor Type : Hyper-V"); + } if (vm != null) { // serialize VM operation AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext(); From d59cc1ff8fa909d37609410e19142b158cecb2f3 Mon Sep 17 00:00:00 2001 From: Rajesh Battala Date: Thu, 5 Jun 2014 15:06:11 +0530 Subject: [PATCH 537/683] CLOUDSTACK-6831 [Hyper-V] Improve the logging for VM snapshot failures as it is not supported. Right now it is throwing NPEs --- .../hypervisor/dao/HypervisorCapabilitiesDaoImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java b/engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java index 2b94e69737..e83a4add7d 100644 --- a/engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java +++ b/engine/schema/src/com/cloud/hypervisor/dao/HypervisorCapabilitiesDaoImpl.java @@ -101,6 +101,12 @@ public Integer getMaxHostsPerCluster(HypervisorType hypervisorType, String hyper @Override public Boolean isVmSnapshotEnabled(HypervisorType hypervisorType, String hypervisorVersion) { HypervisorCapabilitiesVO result = getCapabilities(hypervisorType, hypervisorVersion); - return result.getVmSnapshotEnabled(); + // if default capability profile not present for any hypervisor type result will be null. + // So returning vm snapshot not supported if there is no default capability profile for hypervisor. + if (result != null) { + return result.getVmSnapshotEnabled(); + } else { + return false; + } } } From 431ea8e9c2a09d85b089cd5bf608eb0ab340f083 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 5 Jun 2014 13:44:33 -0700 Subject: [PATCH 538/683] CLOUDSTACK-6852: UI - add sharedFunction isModuleIncluded(). --- ui/scripts/sharedFunctions.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index d20634935e..c51bc8dc3d 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -1119,6 +1119,16 @@ cloudStack.converters = { } } +function isModuleIncluded(moduleName) { + for(var moduleIndex = 0; moduleIndex < cloudStack.modules.length; moduleIndex++) { + if (cloudStack.modules[moduleIndex] == moduleName) { + return true; + break; + } + } + return false; +} + //data parameter passed to API call in listView function listViewDataProvider(args, data, options) { From 9b9154132dbd41acddf4365779fc8af13a2acc4c Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Thu, 5 Jun 2014 13:44:57 -0700 Subject: [PATCH 539/683] CLOUDSTACK-6852: UI - attach volume action - VM dropdown - populate options based on whether module is included and whether service is enabled. --- ui/scripts/storage.js | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 2660aa5549..7e71448b21 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -901,6 +901,14 @@ }); } + + var drModuleIncluded = isModuleIncluded("dr"); + var volumeDrEnabled = false; + if (drModuleIncluded) { + volumeDrEnabled = cloudStack.dr.sharedFunctions.isVolumeDrEnabled(args.context.volumes[0]); + } + + $(['Running', 'Stopped']).each(function() { $.ajax({ url: createURL('listVirtualMachines'), @@ -910,11 +918,21 @@ async: false, success: function(json) { var instanceObjs = json.listvirtualmachinesresponse.virtualmachine; - $(instanceObjs).each(function() { - items.push({ - id: this.id, - description: this.displayname ? this.displayname : this.name - }); + $(instanceObjs).each(function() { + if (drModuleIncluded) { + var vmDrEnabled = cloudStack.dr.sharedFunctions.isVmDrEnabled(this); + if (vmDrEnabled == volumeDrEnabled) { + items.push({ + id: this.id, + description: this.displayname ? this.displayname : this.name + }); + } + } else { + items.push({ + id: this.id, + description: this.displayname ? this.displayname : this.name + }); + } }); } }); @@ -1989,7 +2007,7 @@ } if (jsonObj.state != "Creating") { - if (jsonObj.type == "ROOT") { + if (jsonObj.type == "ROOT") { if (jsonObj.vmstate == "Stopped") { allowedActions.push("createTemplate"); } From 03623fe57e6597782b628815140283151d066a36 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Thu, 5 Jun 2014 17:07:52 -0700 Subject: [PATCH 540/683] CLOUDSTACK-6853: Search for non-removed nics only when check if the running vm belongs to a certain network --- engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java index 7a05be8f60..f72690e8a2 100755 --- a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java @@ -297,6 +297,7 @@ public List listByNetworkIdAndStates(long networkId, State... states) if (UserVmSearch == null) { SearchBuilder nicSearch = _nicDao.createSearchBuilder(); nicSearch.and("networkId", nicSearch.entity().getNetworkId(), SearchCriteria.Op.EQ); + nicSearch.and("removed", nicSearch.entity().getRemoved(), SearchCriteria.Op.NULL); nicSearch.and().op("ip4Address", nicSearch.entity().getIp4Address(), SearchCriteria.Op.NNULL); nicSearch.or("ip6Address", nicSearch.entity().getIp6Address(), SearchCriteria.Op.NNULL); nicSearch.cp(); From 66df43572e1a12ad2bd32f8c0aa9acaeb271828e Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Thu, 5 Jun 2014 17:26:01 -0700 Subject: [PATCH 541/683] CLOUDSTACK-6676: cleanup ip address details on ip disassoc --- .../schema/src/com/cloud/network/dao/IPAddressDaoImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java index b569718965..e1530cacbb 100755 --- a/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java +++ b/engine/schema/src/com/cloud/network/dao/IPAddressDaoImpl.java @@ -25,6 +25,7 @@ import javax.ejb.Local; import javax.inject.Inject; +import org.apache.cloudstack.resourcedetail.dao.UserIpAddressDetailsDao; import org.apache.log4j.Logger; import org.springframework.stereotype.Component; @@ -63,6 +64,8 @@ public class IPAddressDaoImpl extends GenericDaoBase implemen protected GenericSearchBuilder CountFreePublicIps; @Inject ResourceTagDao _tagsDao; + @Inject + UserIpAddressDetailsDao _detailsDao; // make it public for JUnit test public IPAddressDaoImpl() { @@ -166,6 +169,8 @@ public void unassignIpAddress(long ipAddressId) { address.setSystem(false); address.setVmIp(null); address.setDisplay(true); + //remove resource details for the ip + _detailsDao.removeDetails(ipAddressId); update(ipAddressId, address); } From 96bfa8a73f0054db42beaff6a8ba3af058d3d915 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Thu, 5 Jun 2014 18:20:33 -0700 Subject: [PATCH 542/683] Fixed unittest --- .../networkoffering/CreateNetworkOfferingTest.java | 11 +++++++---- server/test/resources/createNetworkOffering.xml | 4 +++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java b/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java index ccebb95e2c..466adb52e0 100644 --- a/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java +++ b/server/test/org/apache/cloudstack/networkoffering/CreateNetworkOfferingTest.java @@ -26,6 +26,10 @@ import junit.framework.TestCase; +import org.apache.cloudstack.context.CallContext; +import org.apache.cloudstack.framework.config.dao.ConfigurationDao; +import org.apache.cloudstack.framework.config.impl.ConfigurationVO; +import org.apache.cloudstack.resourcedetail.dao.UserIpAddressDetailsDao; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -35,10 +39,6 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -import org.apache.cloudstack.context.CallContext; -import org.apache.cloudstack.framework.config.dao.ConfigurationDao; -import org.apache.cloudstack.framework.config.impl.ConfigurationVO; - import com.cloud.configuration.ConfigurationManager; import com.cloud.event.dao.UsageEventDao; import com.cloud.event.dao.UsageEventDetailsDao; @@ -90,6 +90,9 @@ public class CreateNetworkOfferingTest extends TestCase { @Inject UsageEventDetailsDao usageEventDetailsDao; + @Inject + UserIpAddressDetailsDao userIpAddressDetailsDao; + @Override @Before public void setUp() { diff --git a/server/test/resources/createNetworkOffering.xml b/server/test/resources/createNetworkOffering.xml index 887a8af724..1336367582 100644 --- a/server/test/resources/createNetworkOffering.xml +++ b/server/test/resources/createNetworkOffering.xml @@ -49,5 +49,7 @@ - + + + From 91d054cb00f6a5818f2be1c7e4d3f44a2c58bfcc Mon Sep 17 00:00:00 2001 From: sedukull Date: Fri, 6 Jun 2014 13:48:13 +0530 Subject: [PATCH 543/683] CLOUDSTACK-6793: Fixed an invalid Domain Id Issue Signed-off-by: sedukull --- .../src/com/cloud/user/dao/AccountDao.java | 9 +++++++++ .../src/com/cloud/user/dao/AccountDaoImpl.java | 16 ++++++++++++++++ .../cloud/tags/TaggedResourceManagerImpl.java | 16 ++++++++++++---- 3 files changed, 37 insertions(+), 4 deletions(-) diff --git a/engine/schema/src/com/cloud/user/dao/AccountDao.java b/engine/schema/src/com/cloud/user/dao/AccountDao.java index 2f737cd4a1..4c7ce8e31b 100644 --- a/engine/schema/src/com/cloud/user/dao/AccountDao.java +++ b/engine/schema/src/com/cloud/user/dao/AccountDao.java @@ -63,4 +63,13 @@ public interface AccountDao extends GenericDao { Account findActiveNonProjectAccount(String accountName, Long domainId); List getAccountIdsForDomains(List ids); + + /* + @Desc: Retrieves the DomainId for a given Account Id + @Input: id : Id of the Account + @Output: DomainId matching for the given Account Id. Returns -1 + in case of no match; + */ + long getDomainIdForGivenAccountId(long id); + } diff --git a/engine/schema/src/com/cloud/user/dao/AccountDaoImpl.java b/engine/schema/src/com/cloud/user/dao/AccountDaoImpl.java index 4bc23ed3ed..99bd7ee6d3 100755 --- a/engine/schema/src/com/cloud/user/dao/AccountDaoImpl.java +++ b/engine/schema/src/com/cloud/user/dao/AccountDaoImpl.java @@ -278,4 +278,20 @@ public List getAccountIdsForDomains(List domainIds) { return customSearch(sc, null); } + @Override + public long getDomainIdForGivenAccountId(long id) { + long domain_id = -1; + try { + AccountVO account_vo = findById(id); + domain_id = account_vo.getDomainId(); + } + catch (Exception e) { + s_logger.warn("getDomainIdForGivenAccountId: Exception :" + e.getMessage()); + } + finally { + return domain_id; + } + } + + } diff --git a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java index fa7fcb750c..2ccab0bf01 100644 --- a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java +++ b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java @@ -25,6 +25,8 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; +import com.cloud.user.dao.AccountDao; +import com.cloud.utils.exception.CloudRuntimeException; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; import org.apache.cloudstack.context.CallContext; @@ -33,7 +35,6 @@ import com.cloud.api.query.dao.ResourceTagJoinDao; import com.cloud.dc.DataCenterVO; -import com.cloud.domain.Domain; import com.cloud.domain.PartOf; import com.cloud.event.ActionEvent; import com.cloud.event.EventTypes; @@ -136,6 +137,8 @@ public class TaggedResourceManagerImpl extends ManagerBase implements TaggedReso ResourceTagJoinDao _resourceTagJoinDao; @Inject DomainManager _domainMgr; + @Inject + AccountDao _accountDao; @Override @@ -185,10 +188,10 @@ private Pair getAccountDomain(long resourceId, ResourceObjectType re accountId = Account.ACCOUNT_ID_SYSTEM; } - if (domainId == null) { - domainId = Domain.ROOT_DOMAIN; + if ( ((accountId != null) && (domainId == -1)) || (domainId == null) ) + { + domainId = _accountDao.getDomainIdForGivenAccountId(accountId); } - return new Pair(accountId, domainId); } @@ -226,6 +229,11 @@ public void doInTransactionWithoutResult(TransactionStatus status) { Pair accountDomainPair = getAccountDomain(id, resourceType); Long domainId = accountDomainPair.second(); Long accountId = accountDomainPair.first(); + + if ((domainId != null) && (domainId == -1)) + { + throw new CloudRuntimeException("Invalid DomainId : -1"); + } if (accountId != null) { _accountMgr.checkAccess(caller, null, false, _accountMgr.getAccount(accountId)); } else if (domainId != null && !_accountMgr.isNormalUser(caller.getId())) { From fc52e641d8f69d8c0b552119203b0a2bc58e488f Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Fri, 6 Jun 2014 17:28:07 +0200 Subject: [PATCH 544/683] try-with-resource to prevent resource leaks (cherry picked from commit 39f775c38126bb25a0418f82196caaba463f8c1c) --- .../cloud/upgrade/dao/Upgrade430to440.java | 267 ++++++------------ 1 file changed, 87 insertions(+), 180 deletions(-) diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java index a3ac44769f..51494e7aff 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade430to440.java @@ -67,28 +67,25 @@ public void performDataMigration(Connection conn) { } private void addExtractTemplateAndVolumeColumns(Connection conn) { - PreparedStatement pstmt = null; - ResultSet rs = null; - try { + try (PreparedStatement selectTemplateInfostmt = conn.prepareStatement("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'cloud' AND TABLE_NAME = 'template_store_ref' AND COLUMN_NAME = 'download_url_created'"); + ResultSet templateInfoResults = selectTemplateInfostmt.executeQuery(); + PreparedStatement addDownloadUrlCreatedToTemplateStorerefstatement = conn.prepareStatement("ALTER TABLE `cloud`.`template_store_ref` ADD COLUMN `download_url_created` datetime"); + PreparedStatement addDownloadUrlToTemplateStorerefstatement = conn.prepareStatement("ALTER TABLE `cloud`.`template_store_ref` ADD COLUMN `download_url` varchar(255)"); + PreparedStatement selectVolumeInfostmt = conn.prepareStatement("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'cloud' AND TABLE_NAME = 'volume_store_ref' AND COLUMN_NAME = 'download_url_created'"); + ResultSet volumeInfoResults = selectVolumeInfostmt.executeQuery(); + PreparedStatement addDownloadUrlCreatedToVolumeStorerefstatement = conn.prepareStatement("ALTER TABLE `cloud`.`volume_store_ref` ADD COLUMN `download_url_created` datetime"); + ) { // Add download_url_created, download_url to template_store_ref - pstmt = conn.prepareStatement("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'cloud' AND TABLE_NAME = 'template_store_ref' AND COLUMN_NAME = 'download_url_created'"); - rs = pstmt.executeQuery(); - if (!rs.next()) { - pstmt = conn.prepareStatement("ALTER TABLE `cloud`.`template_store_ref` ADD COLUMN `download_url_created` datetime"); - pstmt.executeUpdate(); - - pstmt = conn.prepareStatement("ALTER TABLE `cloud`.`template_store_ref` ADD COLUMN `download_url` varchar(255)"); - pstmt.executeUpdate(); + if (!templateInfoResults.next()) { + addDownloadUrlCreatedToTemplateStorerefstatement.executeUpdate(); + addDownloadUrlToTemplateStorerefstatement.executeUpdate(); } // Add download_url_created to volume_store_ref - note download_url already exists - pstmt = conn.prepareStatement("SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = 'cloud' AND TABLE_NAME = 'volume_store_ref' AND COLUMN_NAME = 'download_url_created'"); - rs = pstmt.executeQuery(); - if (!rs.next()) { - pstmt = conn.prepareStatement("ALTER TABLE `cloud`.`volume_store_ref` ADD COLUMN `download_url_created` datetime"); - pstmt.executeUpdate(); + if (!volumeInfoResults.next()) { + addDownloadUrlCreatedToVolumeStorerefstatement.executeUpdate(); } } catch (SQLException e) { @@ -96,24 +93,12 @@ private void addExtractTemplateAndVolumeColumns(Connection conn) { } } - - private void secondaryIpsAccountAndDomainIdsUpdate(Connection conn) { - PreparedStatement pstmt = null; - PreparedStatement pstmtVm = null; - PreparedStatement pstmtNw = null; - PreparedStatement pstmtUpdate = null; - - ResultSet rs1 = null; - ResultSet vmRs = null; - ResultSet networkRs = null; - String secondIpsSql = "SELECT id, vmId, network_id, account_id, domain_id, ip4_address FROM `cloud`.`nic_secondary_ips`"; - try { - pstmt = conn.prepareStatement(secondIpsSql); - rs1 = pstmt.executeQuery(); - + try (PreparedStatement pstmt = conn.prepareStatement(secondIpsSql); + ResultSet rs1 = pstmt.executeQuery(); + ) { while(rs1.next()) { long ipId = rs1.getLong(1); long vmId = rs1.getLong(2); @@ -122,130 +107,77 @@ private void secondaryIpsAccountAndDomainIdsUpdate(Connection conn) { long domainId = rs1.getLong(5); String ipAddr = rs1.getString(6); - pstmtVm = conn.prepareStatement("SELECT account_id, domain_id FROM `cloud`.`vm_instance` where id = ?"); - pstmtVm.setLong(1,vmId); - - vmRs = pstmtVm.executeQuery(); - - if (vmRs.next()) { - long vmAccountId = vmRs.getLong(1); - long vmDomainId = vmRs.getLong(2); - - if (vmAccountId != accountId && vmAccountId != domainId) { - // update the secondary ip accountid and domainid to vm accountid domainid - // check the network type. If network is shared accountid doaminid needs to be updated in - // in both nic_secondary_ips table and user_ip_address table - - pstmtUpdate = conn.prepareStatement("UPDATE `cloud`.`nic_secondary_ips` SET account_id = ?, domain_id= ? WHERE id = ?"); - pstmtUpdate.setLong(1, vmAccountId); - pstmtUpdate.setLong(2,vmDomainId); - pstmtUpdate.setLong(3,ipId); - pstmtUpdate.executeUpdate(); - pstmtUpdate.close(); - - pstmtNw = conn.prepareStatement("SELECT guest_type FROM `cloud`.`networks` where id = ?"); - pstmtNw.setLong(1,networkId); - - networkRs = pstmtNw.executeQuery(); - if (networkRs.next()) { - String guesttype = networkRs.getString(1); - - if (guesttype.equals(Network.GuestType.Shared.toString())) { - pstmtUpdate = conn.prepareStatement("UPDATE `cloud`.`user_ip_address` SET account_id = ?, domain_id= ? WHERE public_ip_address = ?"); - pstmtUpdate.setLong(1,vmAccountId); - pstmtUpdate.setLong(2,vmDomainId); - pstmtUpdate.setString(3,ipAddr); - pstmtUpdate.executeUpdate(); - pstmtUpdate.close(); - - } - } - networkRs.close(); - networkRs = null; - pstmtNw.close(); - pstmtNw = null; + try(PreparedStatement pstmtVm = conn.prepareStatement("SELECT account_id, domain_id FROM `cloud`.`vm_instance` where id = ?");) { + pstmtVm.setLong(1,vmId); + + try(ResultSet vmRs = pstmtVm.executeQuery();) { + + if (vmRs.next()) { + long vmAccountId = vmRs.getLong(1); + long vmDomainId = vmRs.getLong(2); + + if (vmAccountId != accountId && vmAccountId != domainId) { + // update the secondary ip accountid and domainid to vm accountid domainid + // check the network type. If network is shared accountid doaminid needs to be updated in + // in both nic_secondary_ips table and user_ip_address table + + try(PreparedStatement pstmtUpdate = conn.prepareStatement("UPDATE `cloud`.`nic_secondary_ips` SET account_id = ?, domain_id= ? WHERE id = ?");) { + pstmtUpdate.setLong(1, vmAccountId); + pstmtUpdate.setLong(2,vmDomainId); + pstmtUpdate.setLong(3,ipId); + pstmtUpdate.executeUpdate(); + } catch (SQLException e) { + throw new CloudRuntimeException("Exception while updating secondary ip for nic " + ipId, e); + } + + try(PreparedStatement pstmtNw = conn.prepareStatement("SELECT guest_type FROM `cloud`.`networks` where id = ?");) { + pstmtNw.setLong(1,networkId); + + try(ResultSet networkRs = pstmtNw.executeQuery();) { + if (networkRs.next()) { + String guesttype = networkRs.getString(1); + + if (guesttype.equals(Network.GuestType.Shared.toString())) { + try(PreparedStatement pstmtUpdate = conn.prepareStatement("UPDATE `cloud`.`user_ip_address` SET account_id = ?, domain_id= ? WHERE public_ip_address = ?");) { + pstmtUpdate.setLong(1,vmAccountId); + pstmtUpdate.setLong(2,vmDomainId); + pstmtUpdate.setString(3,ipAddr); + pstmtUpdate.executeUpdate(); + } catch (SQLException e) { + throw new CloudRuntimeException("Exception while updating public ip " + ipAddr, e); + } + } + } + } catch (SQLException e) { + throw new CloudRuntimeException("Exception while retrieving guest type for network " + networkId, e); + } + + } catch (SQLException e) { + throw new CloudRuntimeException("Exception while retrieving guest type for network " + networkId, e); + } + } // if + } // if } - } //if - - pstmtVm.close(); - pstmtVm = null; - vmRs.close(); - vmRs = null; + } } // while - - } catch (SQLException e) { throw new CloudRuntimeException("Exception while Moving private zone information to dedicated resources", e); - } finally { - - if (pstmt != null) { - try { - pstmt.close(); - - } catch (SQLException e) { - } - } - - - if (rs1 != null) { - try { - rs1.close(); - } catch (SQLException e) { - } - } - - - - if (pstmtVm != null) { - try { - pstmtVm.close(); - } catch (SQLException e) { - } - } - - if (vmRs != null) { - try { - vmRs.close(); - } catch (SQLException e) { - } - } - - - - if (pstmtNw != null) { - try { - pstmtNw.close(); - - } catch (SQLException e) { - } - } - - - if (networkRs != null) { - try { - networkRs.close(); - } catch (SQLException e) { - } - } } s_logger.debug("Done updating vm nic secondary ip account and domain ids"); } private void moveCidrsToTheirOwnTable(Connection conn) { - PreparedStatement pstmtItem = null; - PreparedStatement pstmtCidr = null; - ResultSet rsItems = null; + s_logger.debug("Moving network acl item cidrs to a row per cidr"); String networkAclItemSql = "SELECT id, cidr FROM `cloud`.`network_acl_item`"; + String networkAclItemCidrSql = "INSERT INTO `cloud`.`network_acl_item_cidrs` (network_acl_item_id, cidr) VALUES (?,?)"; - s_logger.debug("Moving network acl item cidrs to a row per cidr"); - try { - pstmtItem = conn.prepareStatement(networkAclItemSql); - rsItems = pstmtItem.executeQuery(); + try (PreparedStatement pstmtItem = conn.prepareStatement(networkAclItemSql); + ResultSet rsItems = pstmtItem.executeQuery(); + PreparedStatement pstmtCidr = conn.prepareStatement(networkAclItemCidrSql); + ) { - String networkAclItemCidrSql = "INSERT INTO `cloud`.`network_acl_item_cidrs` (network_acl_item_id, cidr) VALUES (?,?)"; - pstmtCidr = conn.prepareStatement(networkAclItemCidrSql); // for each network acl item while(rsItems.next()) { @@ -264,58 +196,33 @@ private void moveCidrsToTheirOwnTable(Connection conn) { } } catch (SQLException e) { throw new CloudRuntimeException("Exception while Moving network acl item cidrs to a row per cidr", e); - } finally { - - if (pstmtItem != null) { - try { - pstmtItem.close(); - - } catch (SQLException e) { - } - } - if (pstmtCidr != null) { - try { - pstmtCidr.close(); - - } catch (SQLException e) { - } - } } s_logger.debug("Done moving network acl item cidrs to a row per cidr"); } private void updateVlanUris(Connection conn) { s_logger.debug("updating vlan URIs"); - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - pstmt = conn.prepareStatement("SELECT id, vlan_id FROM `cloud`.`vlan` where vlan_id not like '%:%'"); - rs = pstmt.executeQuery(); - while (rs.next()) { - long id = rs.getLong(1); - String vlan = rs.getString(2); + try(PreparedStatement selectstatement = conn.prepareStatement("SELECT id, vlan_id FROM `cloud`.`vlan` where vlan_id not like '%:%'"); + ResultSet results = selectstatement.executeQuery()) { + + while (results.next()) { + long id = results.getLong(1); + String vlan = results.getString(2); if (vlan == null || "".equals(vlan)) { continue; } String vlanUri = BroadcastDomainType.Vlan.toUri(vlan).toString(); - pstmt = conn.prepareStatement("update `cloud`.`vlan` set vlan_id=? where id=?"); - pstmt.setString(1, vlanUri); - pstmt.setLong(2, id); - pstmt.executeUpdate(); + try(PreparedStatement updatestatement = conn.prepareStatement("update `cloud`.`vlan` set vlan_id=? where id=?");) + { + updatestatement.setString(1, vlanUri); + updatestatement.setLong(2, id); + updatestatement.executeUpdate(); + } catch (SQLException e) { + throw new CloudRuntimeException("Unable to update vlan URI " + vlanUri + " for vlan record " + id, e); + } } } catch (SQLException e) { throw new CloudRuntimeException("Unable to update vlan URIs ", e); - } finally { - try { - if (rs != null) { - rs.close(); - } - - if (pstmt != null) { - pstmt.close(); - } - } catch (SQLException e) { - } } s_logger.debug("Done updateing vlan URIs"); } From 9e2db2f2210904752eea2f3abf87b16bb3080384 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Fri, 6 Jun 2014 10:39:24 -0700 Subject: [PATCH 545/683] CLOUDSTACK-6585: added missing db upgrade statements --- setup/db/db/schema-430to440.sql | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index 7e518e348f..d149a65aa1 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -220,7 +220,7 @@ CREATE VIEW `cloud`.`volume_view` AS left join `cloud`.`cluster` ON storage_pool.cluster_id = cluster.id left join - `cloud`.`vm_template` ON volumes.template_id = vm_template.id + `cloud`.`vm_template` ON volumes.template_id = vm_template.id left join `cloud`.`vm_template` iso ON iso.id = volumes.iso_id left join @@ -1705,3 +1705,24 @@ alter table `cloud`.`vlan` add column created datetime NULL COMMENT 'date create alter table `cloud`.`user_ip_address` drop key public_ip_address; alter table `cloud`.`user_ip_address` add UNIQUE KEY public_ip_address (public_ip_address,source_network_id, removed); + +CREATE TABLE `cloud`.`load_balancer_stickiness_policy_details` ( + `id` bigint unsigned NOT NULL auto_increment, + `lb_policy_id` bigint unsigned NOT NULL COMMENT 'resource id', + `name` varchar(255) NOT NULL, + `value` varchar(1024) NOT NULL, + `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the detail can be displayed to the end user', + PRIMARY KEY (`id`), + CONSTRAINT `fk_lb_stickiness_policy_details__lb_stickiness_policy_id` FOREIGN KEY `fk_lb_stickiness_policy_details__lb_stickiness_policy_id`(`lb_policy_id`) REFERENCES `load_balancer_stickiness_policies`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `cloud`.`load_balancer_healthcheck_policy_details` ( + `id` bigint unsigned NOT NULL auto_increment, + `lb_policy_id` bigint NOT NULL COMMENT 'resource id', + `name` varchar(255) NOT NULL, + `value` varchar(1024) NOT NULL, + `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the detail can be displayed to the end user', + PRIMARY KEY (`id`), + CONSTRAINT `fk_lb_healthcheck_policy_details__lb_healthcheck_policy_id` FOREIGN KEY `fk_lb_healthcheck_policy_details__lb_healthcheck_policy_id`(`lb_policy_id`) REFERENCES `load_balancer_healthcheck_policies`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; From c29ed73d4d36fbbd8e48cae4217c655d8024c7cc Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 6 Jun 2014 13:16:27 -0700 Subject: [PATCH 546/683] CLOUDSTACK-6852: UI - modules - add global variable drModuleIncluded. --- ui/scripts/cloudStack.js | 3 +++ ui/scripts/sharedFunctions.js | 2 ++ ui/scripts/storage.js | 7 ++----- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index be7692de09..ad53a4a0a0 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -490,5 +490,8 @@ } document.title = _l('label.app.name'); + + // set value to global variable + drModuleIncluded = isModuleIncluded("dr"); }); })(cloudStack, jQuery); diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index c51bc8dc3d..bec03360c3 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -49,6 +49,8 @@ var md5HashedLogin = false; var pageSize = 20; //var pageSize = 1; //for testing only +var drModuleIncluded = false; + var rootAccountId = 1; //async action diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 7e71448b21..7ee475fe3e 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -900,14 +900,11 @@ hypervisor: args.context.volumes[0].hypervisor }); } - - - var drModuleIncluded = isModuleIncluded("dr"); + var volumeDrEnabled = false; if (drModuleIncluded) { volumeDrEnabled = cloudStack.dr.sharedFunctions.isVolumeDrEnabled(args.context.volumes[0]); - } - + } $(['Running', 'Stopped']).each(function() { $.ajax({ From d991e37865106e79a6a31e4af3a34b2446058eef Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 6 Jun 2014 13:26:53 -0700 Subject: [PATCH 547/683] CLOUDSTACK-6858: UI - remove obsolete variable rootAccountId whose value is no longer 1. --- ui/scripts/sharedFunctions.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index bec03360c3..445351afa9 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -51,8 +51,6 @@ var pageSize = 20; var drModuleIncluded = false; -var rootAccountId = 1; - //async action var pollAsyncJobResult = function(args) { $.ajax({ @@ -1183,10 +1181,7 @@ var addExtraPropertiesToGuestNetworkObject = function(jsonObj) { jsonObj.networkofferingidText = jsonObj.networkofferingid; if (jsonObj.acltype == "Domain") { - if (jsonObj.domainid == rootAccountId) - jsonObj.scope = "All"; - else - jsonObj.scope = "Domain (" + jsonObj.domain + ")"; + jsonObj.scope = "Domain (" + jsonObj.domain + ")"; } else if (jsonObj.acltype == "Account") { if (jsonObj.project != null) jsonObj.scope = "Account (" + jsonObj.domain + ", " + jsonObj.project + ")"; From e9ebe6e22e1db5104ed9a0f50de17c14c6b6fc28 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 6 Jun 2014 15:15:11 -0700 Subject: [PATCH 548/683] CLOUDSTACK-6852: UI - modules - (1) add new shared function addExtraPropertiesIfDrModuleIncluded(). (2) add DR fields to Instances detailView. --- ui/scripts/instances.js | 3 +++ ui/scripts/sharedFunctions.js | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index d219e6dc04..cda531e5c5 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -1878,6 +1878,9 @@ jsonObj.xenserverToolsVersion61plus = false; } + //if DR module is included + addExtraPropertiesIfDrModuleIncluded(jsonObj, "UserVM"); + args.response.success({ actionFilter: vmActionfilter, data: jsonObj diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index 445351afa9..56728202e6 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -1175,6 +1175,32 @@ function listViewDataProvider(args, data, options) { return data; } +var addExtraPropertiesIfDrModuleIncluded = function(jsonObj, resourceType) { + if (drModuleIncluded) { + $.ajax({ + url: createURL("listResourceDetails"), + data: { + resourceid: jsonObj.id, + resourcetype: resourceType + }, + async: false, + success: function(json) { + var drFieldNameArray = []; + var resourcedetails = json.listresourcedetailsresponse.resourcedetail; + if (resourcedetails != undefined) { + for (var i = 0; i < resourcedetails.length; i++) { + if (resourcedetails[i].key.indexOf("DR_") > -1) { + drFieldNameArray.push(resourcedetails[i].key); + jsonObj[resourcedetails[i].key] = resourcedetails[i].value; + } + } + } + jsonObj["drFieldNameArray"] = drFieldNameArray; + } + }); + } +} + //used by infrastructure page and network page var addExtraPropertiesToGuestNetworkObject = function(jsonObj) { jsonObj.networkdomaintext = jsonObj.networkdomain; From 961cd7657e7dbb69d497123071db3156bd15d8e9 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Fri, 6 Jun 2014 23:44:30 -0700 Subject: [PATCH 549/683] CLOUDSTACK-6859:Management Server PermGen run out of memory after some time due to class leak. --- .../async/AsyncCallbackDispatcher.java | 62 +++++++++++-------- 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/framework/ipc/src/org/apache/cloudstack/framework/async/AsyncCallbackDispatcher.java b/framework/ipc/src/org/apache/cloudstack/framework/async/AsyncCallbackDispatcher.java index 06cfcff8b0..b9aa12bc5b 100644 --- a/framework/ipc/src/org/apache/cloudstack/framework/async/AsyncCallbackDispatcher.java +++ b/framework/ipc/src/org/apache/cloudstack/framework/async/AsyncCallbackDispatcher.java @@ -21,10 +21,11 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; -import net.sf.cglib.proxy.Callback; -import net.sf.cglib.proxy.CallbackFilter; import net.sf.cglib.proxy.Enhancer; +import net.sf.cglib.proxy.Factory; import net.sf.cglib.proxy.MethodInterceptor; import net.sf.cglib.proxy.MethodProxy; @@ -39,6 +40,7 @@ public class AsyncCallbackDispatcher implements AsyncCompletionCallback { private Object _contextObject; private Object _resultObject; private AsyncCallbackDriver _driver = new InplaceAsyncCallbackDriver(); + private static Map enMap = new HashMap(); private AsyncCallbackDispatcher(T target) { assert (target != null); @@ -58,39 +60,45 @@ public Method getCallbackMethod() { @SuppressWarnings("unchecked") public T getTarget() { - Enhancer en = new Enhancer(); - Class clz = _targetObject.getClass(); String clzName = clz.getName(); if (clzName.contains("EnhancerByCloudStack")) clz = clz.getSuperclass(); - en.setSuperclass(clz); - en.setCallbacks(new Callback[] {new MethodInterceptor() { - @Override - public Object intercept(Object arg0, Method arg1, Object[] arg2, MethodProxy arg3) throws Throwable { - _callbackMethod = arg1; - _callbackMethod.setAccessible(true); - return null; - } - }, new MethodInterceptor() { - @Override - public Object intercept(Object arg0, Method arg1, Object[] arg2, MethodProxy arg3) throws Throwable { - return null; - } - }}); - en.setCallbackFilter(new CallbackFilter() { - @Override - public int accept(Method method) { - if (method.getParameterTypes().length == 0 && method.getName().equals("finalize")) { - return 1; - } - return 0; + + Enhancer en = null; + synchronized (enMap) { + en = enMap.get(clz); + if (en == null) { + en = new Enhancer(); + + en.setSuperclass(clz); + en.setCallback(new MethodInterceptor() { + @Override + public Object intercept(Object arg0, Method arg1, Object[] arg2, MethodProxy arg3) throws Throwable { + return null; + } + }); + enMap.put(clz, en); } - }); + } try { - return (T)en.create(); + T t = (T)en.create(); + Factory factory = (Factory)t; + factory.setCallback(0, new MethodInterceptor() { + @Override + public Object intercept(Object arg0, Method arg1, Object[] arg2, MethodProxy arg3) throws Throwable { + if (arg1.getParameterTypes().length == 0 && arg1.getName().equals("finalize")) { + return null; + } else { + _callbackMethod = arg1; + _callbackMethod.setAccessible(true); + return null; + } + } + }); + return t; } catch (Throwable e) { s_logger.error("Unexpected exception", e); } From f0ea44daf12b702ab1deb03d4e6bc3adfab46efc Mon Sep 17 00:00:00 2001 From: Olivier Lemasle Date: Fri, 6 Jun 2014 23:04:43 +0200 Subject: [PATCH 550/683] CLOUDSTACK-6669: Fix support resize in usage server Signed-off-by: Sebastien Goasguen --- usage/src/com/cloud/usage/parser/VolumeUsageParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usage/src/com/cloud/usage/parser/VolumeUsageParser.java b/usage/src/com/cloud/usage/parser/VolumeUsageParser.java index cd092a970d..81ebdc0e51 100644 --- a/usage/src/com/cloud/usage/parser/VolumeUsageParser.java +++ b/usage/src/com/cloud/usage/parser/VolumeUsageParser.java @@ -87,7 +87,7 @@ public static boolean parse(AccountVO account, Date startDate, Date endDate) { long zoneId = usageVol.getZoneId(); Long templateId = usageVol.getTemplateId(); long size = usageVol.getSize(); - String key = "" + volId; + String key = volId + "-" + doId + "-" + size; diskOfferingMap.put(key, new VolInfo(volId, zoneId, doId, templateId, size)); From c282bb3a1293fbbfdb306263ea52464862670fb3 Mon Sep 17 00:00:00 2001 From: Rajesh Battala Date: Mon, 9 Jun 2014 14:42:16 +0530 Subject: [PATCH 551/683] CLOUDSTACK-6603 [Upgrade]DB Exception while Autoscale monitoring after upgrading from 4.3 to 4.4 --- setup/db/db/schema-40to410.sql | 1 - setup/db/db/schema-430to440.sql | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/setup/db/db/schema-40to410.sql b/setup/db/db/schema-40to410.sql index 65fb350bf1..53b4a1a5b8 100644 --- a/setup/db/db/schema-40to410.sql +++ b/setup/db/db/schema-40to410.sql @@ -367,7 +367,6 @@ CREATE TABLE `cloud`.`autoscale_vmgroups` ( `max_members` int unsigned NOT NULL, `member_port` int unsigned NOT NULL, `interval` int unsigned NOT NULL, - `last_interval` datetime DEFAULT NULL, `profile_id` bigint unsigned NOT NULL, `state` varchar(255) NOT NULL COMMENT 'enabled or disabled, a vmgroup is disabled to stop autoscaling activity', `created` datetime NOT NULL COMMENT 'date created', diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index d149a65aa1..d172b94c21 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -657,6 +657,7 @@ ALTER TABLE `cloud`.`vpc` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' C ALTER TABLE `cloud`.`firewall_rules` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the rule can be displayed to the end user'; ALTER TABLE `cloud`.`autoscale_vmgroups` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the entry can be displayed to the end user'; ALTER TABLE `cloud`.`autoscale_vmprofiles` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the entry can be displayed to the end user'; +ALTER TABLE `cloud`.`autoscale_vmgroups` ADD COLUMN `last_interval` datetime NULL DEFAULT NULL COMMENT 'last updated time'; ALTER TABLE `cloud`.`network_acl_item` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the entry can be displayed to the end user'; ALTER TABLE `cloud`.`network_acl` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the entry can be displayed to the end user'; ALTER TABLE `cloud`.`remote_access_vpn` ADD COLUMN `display` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'True if the entry can be displayed to the end user'; From 89a03c7099fb5f0d6a3a892b036d064bfc2acb71 Mon Sep 17 00:00:00 2001 From: Koushik Das Date: Mon, 9 Jun 2014 16:45:17 +0530 Subject: [PATCH 552/683] CLOUDSTACK-6873: Tagged tests based on the limitation described in the bug --- test/integration/smoke/test_deploy_vm.py | 4 ++-- test/integration/smoke/test_vm_ha.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/integration/smoke/test_deploy_vm.py b/test/integration/smoke/test_deploy_vm.py index 3f7505810f..8d0a0eda20 100644 --- a/test/integration/smoke/test_deploy_vm.py +++ b/test/integration/smoke/test_deploy_vm.py @@ -206,7 +206,7 @@ def setUp(self): self.mock_volume_failure ] - @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6708") + @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6873") def test_deploy_vm_volume_creation_failure(self): """Test Deploy Virtual Machine - volume creation failure and retry @@ -317,7 +317,7 @@ def setUp(self): self.mock_start_failure ] - @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6708") + @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6873") def test_deploy_vm_start_failure(self): """Test Deploy Virtual Machine - start operation failure and retry diff --git a/test/integration/smoke/test_vm_ha.py b/test/integration/smoke/test_vm_ha.py index 406394635c..1fc69606a7 100644 --- a/test/integration/smoke/test_vm_ha.py +++ b/test/integration/smoke/test_vm_ha.py @@ -145,7 +145,7 @@ def setUp(self): ] self.cleanup = self.cleanup + self.mock_checkonhost_list - @attr(tags = ['selfservice']) + @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6873") def test_vm_ha(self): """Test VM HA From 1641b280544e1982f155f82b17d56d0f6ec82e6a Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Mon, 9 Jun 2014 11:38:34 -0700 Subject: [PATCH 553/683] CLOUDSTACK-6852: UI - modules - add DR fields to volume detailView, network detailView, zone detailView. --- ui/scripts/network.js | 4 ++++ ui/scripts/storage.js | 4 ++++ ui/scripts/system.js | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 9d5fb79b3c..4772c34564 100755 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -1383,6 +1383,10 @@ success: function(json) { var jsonObj = json.listnetworksresponse.network[0]; addExtraPropertiesToGuestNetworkObject(jsonObj); + + //if DR module is included + addExtraPropertiesIfDrModuleIncluded(jsonObj, "Network"); + args.response.success({ actionFilter: cloudStack.actionFilter.guestNetwork, data: jsonObj diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 7ee475fe3e..604f09d5db 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -1494,6 +1494,10 @@ async: true, success: function(json) { var jsonObj = json.listvolumesresponse.volume[0]; + + //if DR module is included + addExtraPropertiesIfDrModuleIncluded(jsonObj, "Volume"); + args.response.success({ actionFilter: volumeActionfilter, data: jsonObj diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 67e01f1cc9..156be7a399 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -1954,6 +1954,10 @@ success: function (json) { selectedGuestNetworkObj = json.listnetworksresponse.network[0]; addExtraPropertiesToGuestNetworkObject(selectedGuestNetworkObj); + + //if DR module is included + addExtraPropertiesIfDrModuleIncluded(selectedGuestNetworkObj, "Network"); + args.response.success({ actionFilter: cloudStack.actionFilter.guestNetwork, data: selectedGuestNetworkObj @@ -7591,6 +7595,9 @@ //override default error handling: cloudStack.dialog.notice({ message: parseXMLHttpResponse(XMLHttpResponse)}); }); + //if DR module is included + addExtraPropertiesIfDrModuleIncluded(selectedZoneObj, "Zone"); + args.response.success({ actionFilter: zoneActionfilter, data: selectedZoneObj From ac92b3690304ff224e7e2530ea7d8e39f28a05c3 Mon Sep 17 00:00:00 2001 From: amoghvk Date: Mon, 9 Jun 2014 14:59:31 -0700 Subject: [PATCH 554/683] CLOUDSTACK-6710: Add missing OS mappings --- setup/db/db/schema-430to440.sql | 706 ++++++++++++++++++++++++++++++++ 1 file changed, 706 insertions(+) diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index d172b94c21..adcd833699 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -1697,6 +1697,712 @@ INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervis INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Other PV', 139, now(), 0); INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'KVM', 'default', 'Other PV', 140, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5Guest', 149, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'windows8Server64Guest', 168, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5_64Guest', 114, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel6Guest', 205, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5Guest', 34, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5_64Guest', 33, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winVistaGuest', 56, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel6Guest', 197, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'suse64Guest', 203, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centosGuest', 143, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel6_64Guest', 204, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntu64Guest', 130, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5Guest', 38, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'win2000ServGuest', 55, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'darwin11_64Guest', 224, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel4Guest', 28, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'debian4Guest', 73, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winNetEnterprise64Guest', 51, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'darwin10_64Guest', 222, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5Guest', 32, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'suseGuest', 96, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'other26xLinuxGuest', 75, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winXPProGuest', 93, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'suseGuest', 202, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winNetDatacenterGuest', 87, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntu64Guest', 100, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'darwin11Guest', 223, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'windows8_64Guest', 166, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'debian4_64Guest', 74, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5_64Guest', 37, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'windows7Guest', 48, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'asianux3Guest', 69, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'otherGuest64', 103, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winVista64Guest', 101, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centosGuest', 111, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntu64Guest', 128, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5Guest', 191, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel6Guest', 195, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winLonghorn64Guest', 54, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'darwin10Guest', 221, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centosGuest', 11, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winNetWebGuest', 91, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'asianux3_64Guest', 70, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'solaris10Guest', 79, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntuGuest', 124, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'otherLinux64Guest', 99, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel6Guest', 199, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'freebsdGuest', 83, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winNetStandardGuest', 89, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'solaris10_64Guest', 80, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'win98Guest', 62, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntu64Guest', 129, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5_64Guest', 35, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winNetStandard64Guest', 90, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winNetEnterpriseGuest', 50, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel6Guest', 136, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'win95Guest', 63, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'win31Guest', 65, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centosGuest', 5, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'suse64Guest', 110, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'debian5Guest', 15, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel6_64Guest', 198, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'debian5_64Guest', 72, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntuGuest', 123, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel6_64Guest', 196, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5_64Guest', 192, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centos64Guest', 8, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winXPProGuest', 58, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'windows8Guest', 165, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel4Guest', 26, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel6_64Guest', 206, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winNetDatacenter64Guest', 88, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5Guest', 30, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel6_64Guest', 137, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntuGuest', 163, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntuGuest', 156, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5Guest', 36, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centosGuest', 13, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'windows8Server64Guest', 167, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winXPProGuest', 57, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centosGuest', 141, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centos64Guest', 12, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntuGuest', 59, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'netware6Guest', 77, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'suse64Guest', 97, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'suseGuest', 109, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centosGuest', 1, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel4Guest', 27, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5_64Guest', 31, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5Guest', 193, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'solaris8Guest', 82, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5_64Guest', 150, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5_64Guest', 39, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5_64Guest', 190, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntuGuest', 125, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'os2Guest', 104, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel2Guest', 131, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centos64Guest', 112, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centos64Guest', 201, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5Guest', 189, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winXPPro64Guest', 94, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'otherLinuxGuest', 98, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'suse64Guest', 108, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntu64Guest', 157, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centos64Guest', 6, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntu64Guest', 126, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5_64Guest', 194, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'unixWare7Guest', 86, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'win2000AdvServGuest', 95, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centos64Guest', 144, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntu64Guest', 127, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winNetBusinessGuest', 92, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'dosGuest', 102, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'win2000ServGuest', 61, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'windows7_64Guest', 49, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'win2000ProGuest', 105, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'netware5Guest', 78, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centosGuest', 7, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'otherGuest', 85, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centosGuest', 200, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntuGuest', 122, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntuGuest', 121, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'oesGuest', 68, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winLonghornGuest', 52, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centosGuest', 3, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel4Guest', 29, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'other26xLinux64Guest', 76, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'freebsd64Guest', 84, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centosGuest', 9, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'solaris9Guest', 81, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'otherGuest', 60, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winLonghorn64Guest', 53, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'rhel5Guest', 113, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'suseGuest', 107, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centosGuest', 4, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centos64Guest', 14, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centos64Guest', 10, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'winNTGuest', 64, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centos64Guest', 142, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'centosGuest', 2, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.0', 'ubuntu64Guest', 164, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5Guest', 149, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'windows8Server64Guest', 168, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5_64Guest', 114, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel6Guest', 205, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5Guest', 34, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5_64Guest', 33, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winVistaGuest', 56, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel6Guest', 197, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'suse64Guest', 203, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centosGuest', 143, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel6_64Guest', 204, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntu64Guest', 130, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5Guest', 38, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'win2000ServGuest', 55, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'darwin11_64Guest', 224, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel4Guest', 28, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'debian4Guest', 73, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winNetEnterprise64Guest', 51, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'darwin10_64Guest', 222, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5Guest', 32, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'suseGuest', 96, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'other26xLinuxGuest', 75, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winXPProGuest', 93, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'suseGuest', 202, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winNetDatacenterGuest', 87, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntu64Guest', 100, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'darwin11Guest', 223, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'windows8_64Guest', 166, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'debian4_64Guest', 74, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5_64Guest', 37, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'windows7Guest', 48, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'asianux3Guest', 69, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'otherGuest64', 103, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winVista64Guest', 101, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centosGuest', 111, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntu64Guest', 128, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5Guest', 191, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel6Guest', 195, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winLonghorn64Guest', 54, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'darwin10Guest', 221, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centosGuest', 11, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winNetWebGuest', 91, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'asianux3_64Guest', 70, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'solaris10Guest', 79, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntuGuest', 124, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'otherLinux64Guest', 99, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel6Guest', 199, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'freebsdGuest', 83, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winNetStandardGuest', 89, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'solaris10_64Guest', 80, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'win98Guest', 62, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntu64Guest', 129, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5_64Guest', 35, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winNetStandard64Guest', 90, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winNetEnterpriseGuest', 50, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel6Guest', 136, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'win95Guest', 63, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'win31Guest', 65, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centosGuest', 5, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'suse64Guest', 110, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'debian5Guest', 15, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel6_64Guest', 198, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'debian5_64Guest', 72, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntuGuest', 123, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel6_64Guest', 196, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5_64Guest', 192, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centos64Guest', 8, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winXPProGuest', 58, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'windows8Guest', 165, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel4Guest', 26, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel6_64Guest', 206, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winNetDatacenter64Guest', 88, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5Guest', 30, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel6_64Guest', 137, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntuGuest', 163, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntuGuest', 156, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5Guest', 36, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centosGuest', 13, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'windows8Server64Guest', 167, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winXPProGuest', 57, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centosGuest', 141, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centos64Guest', 12, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntuGuest', 59, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'netware6Guest', 77, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'suse64Guest', 97, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'suseGuest', 109, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centosGuest', 1, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel4Guest', 27, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5_64Guest', 31, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5Guest', 193, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'solaris8Guest', 82, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5_64Guest', 150, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5_64Guest', 39, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5_64Guest', 190, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntuGuest', 125, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'os2Guest', 104, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel2Guest', 131, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centos64Guest', 112, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centos64Guest', 201, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5Guest', 189, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winXPPro64Guest', 94, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'otherLinuxGuest', 98, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'suse64Guest', 108, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntu64Guest', 157, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centos64Guest', 6, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntu64Guest', 126, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5_64Guest', 194, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'unixWare7Guest', 86, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'win2000AdvServGuest', 95, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centos64Guest', 144, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntu64Guest', 127, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winNetBusinessGuest', 92, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'dosGuest', 102, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'win2000ServGuest', 61, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'windows7_64Guest', 49, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'win2000ProGuest', 105, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'netware5Guest', 78, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centosGuest', 7, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'otherGuest', 85, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centosGuest', 200, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntuGuest', 122, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntuGuest', 121, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'oesGuest', 68, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winLonghornGuest', 52, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centosGuest', 3, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel4Guest', 29, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'other26xLinux64Guest', 76, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'freebsd64Guest', 84, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centosGuest', 9, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'solaris9Guest', 81, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'otherGuest', 60, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winLonghorn64Guest', 53, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'rhel5Guest', 113, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'suseGuest', 107, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centosGuest', 4, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centos64Guest', 14, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centos64Guest', 10, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'winNTGuest', 64, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centos64Guest', 142, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'centosGuest', 2, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '4.1', 'ubuntu64Guest', 164, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5Guest', 149, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'windows8Server64Guest', 168, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5_64Guest', 114, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel6Guest', 205, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5Guest', 34, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5_64Guest', 33, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winVistaGuest', 56, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel6Guest', 197, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'suse64Guest', 203, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centosGuest', 143, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel6_64Guest', 204, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntu64Guest', 130, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5Guest', 38, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'win2000ServGuest', 55, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'darwin11_64Guest', 224, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel4Guest', 28, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'debian4Guest', 73, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winNetEnterprise64Guest', 51, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'darwin10_64Guest', 222, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5Guest', 32, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'suseGuest', 96, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'other26xLinuxGuest', 75, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winXPProGuest', 93, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'suseGuest', 202, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winNetDatacenterGuest', 87, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntu64Guest', 100, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'darwin11Guest', 223, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'windows8_64Guest', 166, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'debian4_64Guest', 74, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5_64Guest', 37, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'windows7Guest', 48, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'asianux3Guest', 69, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'otherGuest64', 103, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winVista64Guest', 101, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centosGuest', 111, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntu64Guest', 128, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5Guest', 191, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel6Guest', 195, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winLonghorn64Guest', 54, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'darwin10Guest', 221, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centosGuest', 11, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winNetWebGuest', 91, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'asianux3_64Guest', 70, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'solaris10Guest', 79, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntuGuest', 124, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'otherLinux64Guest', 99, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel6Guest', 199, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'freebsdGuest', 83, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winNetStandardGuest', 89, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'solaris10_64Guest', 80, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'win98Guest', 62, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntu64Guest', 129, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5_64Guest', 35, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winNetStandard64Guest', 90, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winNetEnterpriseGuest', 50, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel6Guest', 136, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'win95Guest', 63, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'win31Guest', 65, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centosGuest', 5, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'suse64Guest', 110, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'debian5Guest', 15, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel6_64Guest', 198, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'debian5_64Guest', 72, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntuGuest', 123, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel6_64Guest', 196, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5_64Guest', 192, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centos64Guest', 8, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winXPProGuest', 58, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'windows8Guest', 165, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel4Guest', 26, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel6_64Guest', 206, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winNetDatacenter64Guest', 88, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5Guest', 30, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel6_64Guest', 137, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntuGuest', 163, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntuGuest', 156, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5Guest', 36, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centosGuest', 13, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'windows8Server64Guest', 167, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winXPProGuest', 57, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centosGuest', 141, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centos64Guest', 12, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntuGuest', 59, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'netware6Guest', 77, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'suse64Guest', 97, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'suseGuest', 109, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centosGuest', 1, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel4Guest', 27, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5_64Guest', 31, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5Guest', 193, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'solaris8Guest', 82, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5_64Guest', 150, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5_64Guest', 39, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5_64Guest', 190, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntuGuest', 125, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'os2Guest', 104, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel2Guest', 131, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centos64Guest', 112, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centos64Guest', 201, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5Guest', 189, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winXPPro64Guest', 94, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'otherLinuxGuest', 98, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'suse64Guest', 108, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntu64Guest', 157, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centos64Guest', 6, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntu64Guest', 126, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5_64Guest', 194, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'unixWare7Guest', 86, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'win2000AdvServGuest', 95, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centos64Guest', 144, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntu64Guest', 127, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winNetBusinessGuest', 92, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'dosGuest', 102, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'win2000ServGuest', 61, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'windows7_64Guest', 49, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'win2000ProGuest', 105, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'netware5Guest', 78, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centosGuest', 7, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'otherGuest', 85, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centosGuest', 200, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntuGuest', 122, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntuGuest', 121, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'oesGuest', 68, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winLonghornGuest', 52, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centosGuest', 3, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel4Guest', 29, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'other26xLinux64Guest', 76, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'freebsd64Guest', 84, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centosGuest', 9, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'solaris9Guest', 81, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'otherGuest', 60, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winLonghorn64Guest', 53, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'rhel5Guest', 113, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'suseGuest', 107, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centosGuest', 4, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centos64Guest', 14, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centos64Guest', 10, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'winNTGuest', 64, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centos64Guest', 142, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'centosGuest', 2, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.0', 'ubuntu64Guest', 164, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5Guest', 149, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'windows8Server64Guest', 168, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5_64Guest', 114, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel6Guest', 205, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5Guest', 34, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5_64Guest', 33, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winVistaGuest', 56, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel6Guest', 197, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'suse64Guest', 203, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centosGuest', 143, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel6_64Guest', 204, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntu64Guest', 130, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5Guest', 38, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'win2000ServGuest', 55, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'darwin11_64Guest', 224, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel4Guest', 28, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'debian4Guest', 73, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winNetEnterprise64Guest', 51, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'darwin10_64Guest', 222, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5Guest', 32, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'suseGuest', 96, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'other26xLinuxGuest', 75, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winXPProGuest', 93, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'suseGuest', 202, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winNetDatacenterGuest', 87, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntu64Guest', 100, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'darwin11Guest', 223, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'windows8_64Guest', 166, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'debian4_64Guest', 74, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5_64Guest', 37, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'windows7Guest', 48, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'asianux3Guest', 69, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'otherGuest64', 103, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winVista64Guest', 101, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centosGuest', 111, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntu64Guest', 128, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5Guest', 191, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel6Guest', 195, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winLonghorn64Guest', 54, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'darwin10Guest', 221, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centosGuest', 11, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winNetWebGuest', 91, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'asianux3_64Guest', 70, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'solaris10Guest', 79, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntuGuest', 124, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'otherLinux64Guest', 99, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel6Guest', 199, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'freebsdGuest', 83, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winNetStandardGuest', 89, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'solaris10_64Guest', 80, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'win98Guest', 62, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntu64Guest', 129, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5_64Guest', 35, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winNetStandard64Guest', 90, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winNetEnterpriseGuest', 50, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel6Guest', 136, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'win95Guest', 63, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'win31Guest', 65, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centosGuest', 5, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'suse64Guest', 110, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'debian5Guest', 15, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel6_64Guest', 198, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'debian5_64Guest', 72, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntuGuest', 123, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel6_64Guest', 196, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5_64Guest', 192, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centos64Guest', 8, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winXPProGuest', 58, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'windows8Guest', 165, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel4Guest', 26, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel6_64Guest', 206, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winNetDatacenter64Guest', 88, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5Guest', 30, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel6_64Guest', 137, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntuGuest', 163, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntuGuest', 156, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5Guest', 36, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centosGuest', 13, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'windows8Server64Guest', 167, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winXPProGuest', 57, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centosGuest', 141, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centos64Guest', 12, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntuGuest', 59, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'netware6Guest', 77, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'suse64Guest', 97, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'suseGuest', 109, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centosGuest', 1, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel4Guest', 27, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5_64Guest', 31, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5Guest', 193, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'solaris8Guest', 82, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5_64Guest', 150, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5_64Guest', 39, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5_64Guest', 190, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntuGuest', 125, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'os2Guest', 104, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel2Guest', 131, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centos64Guest', 112, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centos64Guest', 201, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5Guest', 189, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winXPPro64Guest', 94, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'otherLinuxGuest', 98, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'suse64Guest', 108, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntu64Guest', 157, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centos64Guest', 6, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntu64Guest', 126, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5_64Guest', 194, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'unixWare7Guest', 86, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'win2000AdvServGuest', 95, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centos64Guest', 144, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntu64Guest', 127, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winNetBusinessGuest', 92, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'dosGuest', 102, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'win2000ServGuest', 61, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'windows7_64Guest', 49, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'win2000ProGuest', 105, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'netware5Guest', 78, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centosGuest', 7, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'otherGuest', 85, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centosGuest', 200, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntuGuest', 122, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntuGuest', 121, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'oesGuest', 68, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winLonghornGuest', 52, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centosGuest', 3, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel4Guest', 29, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'other26xLinux64Guest', 76, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'freebsd64Guest', 84, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centosGuest', 9, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'solaris9Guest', 81, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'otherGuest', 60, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winLonghorn64Guest', 53, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'rhel5Guest', 113, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'suseGuest', 107, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centosGuest', 4, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centos64Guest', 14, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centos64Guest', 10, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'winNTGuest', 64, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centos64Guest', 142, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'centosGuest', 2, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.1', 'ubuntu64Guest', 164, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5Guest', 149, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'windows8Server64Guest', 168, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5_64Guest', 114, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel6Guest', 205, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5Guest', 34, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5_64Guest', 33, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winVistaGuest', 56, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel6Guest', 197, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'suse64Guest', 203, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centosGuest', 143, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel6_64Guest', 204, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntu64Guest', 130, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5Guest', 38, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'win2000ServGuest', 55, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'darwin11_64Guest', 224, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel4Guest', 28, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'debian4Guest', 73, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winNetEnterprise64Guest', 51, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'darwin10_64Guest', 222, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5Guest', 32, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'suseGuest', 96, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'other26xLinuxGuest', 75, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winXPProGuest', 93, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'suseGuest', 202, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winNetDatacenterGuest', 87, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntu64Guest', 100, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'darwin11Guest', 223, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'windows8_64Guest', 166, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'debian4_64Guest', 74, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5_64Guest', 37, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'windows7Guest', 48, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'asianux3Guest', 69, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'otherGuest64', 103, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winVista64Guest', 101, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centosGuest', 111, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntu64Guest', 128, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5Guest', 191, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel6Guest', 195, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winLonghorn64Guest', 54, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'darwin10Guest', 221, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centosGuest', 11, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winNetWebGuest', 91, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'asianux3_64Guest', 70, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'solaris10Guest', 79, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntuGuest', 124, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'otherLinux64Guest', 99, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel6Guest', 199, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'freebsdGuest', 83, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winNetStandardGuest', 89, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'solaris10_64Guest', 80, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'win98Guest', 62, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntu64Guest', 129, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5_64Guest', 35, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winNetStandard64Guest', 90, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winNetEnterpriseGuest', 50, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel6Guest', 136, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'win95Guest', 63, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'win31Guest', 65, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centosGuest', 5, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'suse64Guest', 110, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'debian5Guest', 15, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel6_64Guest', 198, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'debian5_64Guest', 72, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntuGuest', 123, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel6_64Guest', 196, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5_64Guest', 192, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centos64Guest', 8, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winXPProGuest', 58, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'windows8Guest', 165, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel4Guest', 26, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel6_64Guest', 206, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winNetDatacenter64Guest', 88, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5Guest', 30, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel6_64Guest', 137, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntuGuest', 163, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntuGuest', 156, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5Guest', 36, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centosGuest', 13, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'windows8Server64Guest', 167, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winXPProGuest', 57, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centosGuest', 141, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centos64Guest', 12, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntuGuest', 59, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'netware6Guest', 77, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'suse64Guest', 97, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'suseGuest', 109, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centosGuest', 1, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel4Guest', 27, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5_64Guest', 31, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5Guest', 193, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'solaris8Guest', 82, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5_64Guest', 150, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5_64Guest', 39, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5_64Guest', 190, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntuGuest', 125, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'os2Guest', 104, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel2Guest', 131, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centos64Guest', 112, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centos64Guest', 201, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5Guest', 189, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winXPPro64Guest', 94, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'otherLinuxGuest', 98, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'suse64Guest', 108, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntu64Guest', 157, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centos64Guest', 6, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntu64Guest', 126, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5_64Guest', 194, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'unixWare7Guest', 86, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'win2000AdvServGuest', 95, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centos64Guest', 144, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntu64Guest', 127, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winNetBusinessGuest', 92, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'dosGuest', 102, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'win2000ServGuest', 61, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'windows7_64Guest', 49, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'win2000ProGuest', 105, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'netware5Guest', 78, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centosGuest', 7, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'otherGuest', 85, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centosGuest', 200, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntuGuest', 122, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntuGuest', 121, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'oesGuest', 68, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winLonghornGuest', 52, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centosGuest', 3, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel4Guest', 29, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'other26xLinux64Guest', 76, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'freebsd64Guest', 84, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centosGuest', 9, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'solaris9Guest', 81, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'otherGuest', 60, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winLonghorn64Guest', 53, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'rhel5Guest', 113, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'suseGuest', 107, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centosGuest', 4, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centos64Guest', 14, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centos64Guest', 10, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'winNTGuest', 64, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centos64Guest', 142, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'centosGuest', 2, now(), 0); +INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version, guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'VMware', '5.5', 'ubuntu64Guest', 164, now(), 0); + alter table `cloud`.`user_ip_address` add column removed datetime DEFAULT NULL COMMENT 'date removed'; alter table `cloud`.`user_ip_address` add column created datetime NULL COMMENT 'date created'; From a4b401f29f83f2f0b467a9d05b509f951b5a3bca Mon Sep 17 00:00:00 2001 From: amoghvk Date: Mon, 9 Jun 2014 17:06:26 -0700 Subject: [PATCH 555/683] CLOUDSTACK-6358: Remove hardcoded VMware mappings, handle snapshots --- .../vmsnapshot/DefaultVMSnapshotStrategy.java | 12 ++++++++-- .../com/cloud/hypervisor/guru/VMwareGuru.java | 11 +++++++++ .../vmware/resource/VmwareResource.java | 24 ++++++++++++++----- 3 files changed, 39 insertions(+), 8 deletions(-) diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java index 21f4968ca7..bfc6d79462 100644 --- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java +++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/vmsnapshot/DefaultVMSnapshotStrategy.java @@ -136,7 +136,11 @@ public VMSnapshot takeVMSnapshot(VMSnapshot vmSnapshot) { HostVO host = hostDao.findById(hostId); GuestOSHypervisorVO guestOsMapping = guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), host.getHypervisorType().toString(), host.getHypervisorVersion()); CreateVMSnapshotCommand ccmd = new CreateVMSnapshotCommand(userVm.getInstanceName(), target, volumeTOs, guestOS.getDisplayName(), userVm.getState()); - ccmd.setPlatformEmulator(guestOsMapping.getGuestOsName()); + if (guestOsMapping == null) { + ccmd.setPlatformEmulator(null); + } else { + ccmd.setPlatformEmulator(guestOsMapping.getGuestOsName()); + } ccmd.setWait(_wait); answer = (CreateVMSnapshotAnswer)agentMgr.send(hostId, ccmd); @@ -347,7 +351,11 @@ public boolean revertVMSnapshot(VMSnapshot vmSnapshot) { HostVO host = hostDao.findById(hostId); GuestOSHypervisorVO guestOsMapping = guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), host.getHypervisorType().toString(), host.getHypervisorVersion()); RevertToVMSnapshotCommand revertToSnapshotCommand = new RevertToVMSnapshotCommand(vmInstanceName, vmSnapshotTO, volumeTOs, guestOS.getDisplayName()); - revertToSnapshotCommand.setPlatformEmulator(guestOsMapping.getGuestOsName()); + if (guestOsMapping == null) { + revertToSnapshotCommand.setPlatformEmulator(null); + } else { + revertToSnapshotCommand.setPlatformEmulator(guestOsMapping.getGuestOsName()); + } RevertToVMSnapshotAnswer answer = (RevertToVMSnapshotAnswer)agentMgr.send(hostId, revertToSnapshotCommand); if (answer != null && answer.getResult()) { diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java index 77c45b26b7..08d12f2eb7 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java @@ -81,11 +81,13 @@ import com.cloud.secstorage.CommandExecLogDao; import com.cloud.secstorage.CommandExecLogVO; import com.cloud.storage.DataStoreRole; +import com.cloud.storage.GuestOSHypervisorVO; import com.cloud.storage.GuestOSVO; import com.cloud.storage.Storage; import com.cloud.storage.Volume; import com.cloud.storage.VolumeVO; import com.cloud.storage.dao.GuestOSDao; +import com.cloud.storage.dao.GuestOSHypervisorDao; import com.cloud.storage.dao.VolumeDao; import com.cloud.storage.secondary.SecondaryStorageVmManager; import com.cloud.template.VirtualMachineTemplate.BootloaderType; @@ -112,6 +114,8 @@ public class VMwareGuru extends HypervisorGuruBase implements HypervisorGuru, Co @Inject private GuestOSDao _guestOsDao; @Inject + GuestOSHypervisorDao _guestOsHypervisorDao; + @Inject private HostDao _hostDao; @Inject private HostDetailsDao _hostDetailsDao; @@ -309,6 +313,13 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) { GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId()); to.setOs(guestOS.getDisplayName()); to.setHostName(vm.getHostName()); + HostVO host = _hostDao.findById(vm.getVirtualMachine().getHostId()); + GuestOSHypervisorVO guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), getHypervisorType().toString(), host.getHypervisorVersion()); + if (guestOsMapping == null) { + to.setPlatformEmulator(null); + } else { + to.setPlatformEmulator(guestOsMapping.getGuestOsName()); + } return to; } diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java index 52421fa440..faf63b48c9 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/resource/VmwareResource.java @@ -38,6 +38,7 @@ import java.util.Set; import java.util.TimeZone; import java.util.UUID; + import javax.naming.ConfigurationException; import org.apache.log4j.Logger; @@ -238,7 +239,6 @@ import com.cloud.hypervisor.vmware.mo.VmwareHypervisorHostNetworkSummary; import com.cloud.hypervisor.vmware.mo.VmwareHypervisorHostResourceSummary; import com.cloud.hypervisor.vmware.util.VmwareContext; -import com.cloud.hypervisor.vmware.util.VmwareGuestOsMapper; import com.cloud.hypervisor.vmware.util.VmwareHelper; import com.cloud.network.Networks; import com.cloud.network.Networks.BroadcastDomainType; @@ -1394,7 +1394,7 @@ protected StartAnswer execute(StartCommand cmd) { tearDownVm(vmMo); }else if (!hyperHost.createBlankVm(vmNameOnVcenter, vmInternalCSName, vmSpec.getCpus(), vmSpec.getMaxSpeed().intValue(), getReservedCpuMHZ(vmSpec), vmSpec.getLimitCpuUse(), (int)(vmSpec.getMaxRam() / (1024 * 1024)), getReservedMemoryMb(vmSpec), - translateGuestOsIdentifier(vmSpec.getArch(), vmSpec.getOs()).value(), rootDiskDataStoreDetails.first(), false)) { + translateGuestOsIdentifier(vmSpec.getArch(), vmSpec.getOs(), vmSpec.getPlatformEmulator()).value(), rootDiskDataStoreDetails.first(), false)) { throw new Exception("Failed to create VM. vmName: " + vmInternalCSName); } } @@ -1418,7 +1418,7 @@ protected StartAnswer execute(StartCommand cmd) { } VirtualMachineConfigSpec vmConfigSpec = new VirtualMachineConfigSpec(); - String guestOsId = translateGuestOsIdentifier(vmSpec.getArch(), vmSpec.getOs()).value(); + String guestOsId = translateGuestOsIdentifier(vmSpec.getArch(), vmSpec.getOs(), vmSpec.getPlatformEmulator()).value(); VmwareHelper.setBasicVmConfig(vmConfigSpec, vmSpec.getCpus(), vmSpec.getMaxSpeed(), getReservedCpuMHZ(vmSpec), (int)(vmSpec.getMaxRam() / (1024 * 1024)), getReservedMemoryMb(vmSpec), @@ -4374,13 +4374,25 @@ protected OptionValue[] configureVnc(OptionValue[] optionsToMerge, VmwareHypervi } } - private VirtualMachineGuestOsIdentifier translateGuestOsIdentifier(String cpuArchitecture, String cloudGuestOs) { + private VirtualMachineGuestOsIdentifier translateGuestOsIdentifier(String cpuArchitecture, String guestOs, String cloudGuestOs) { if (cpuArchitecture == null) { - s_logger.warn("CPU arch is not set, default to i386. guest os: " + cloudGuestOs); + s_logger.warn("CPU arch is not set, default to i386. guest os: " + guestOs); cpuArchitecture = "i386"; } - VirtualMachineGuestOsIdentifier identifier = VmwareGuestOsMapper.getGuestOsIdentifier(cloudGuestOs); + if(cloudGuestOs == null) { + s_logger.warn("Guest OS mapping name is not set for guest os: " + guestOs); + } + + VirtualMachineGuestOsIdentifier identifier = null; + try { + if (cloudGuestOs != null) { + identifier = VirtualMachineGuestOsIdentifier.fromValue(cloudGuestOs); + s_logger.debug("Using mapping name : " + identifier.toString()); + } + } catch (IllegalArgumentException e) { + s_logger.warn("Unable to find Guest OS Identifier in VMware for mapping name: " + cloudGuestOs + ". Continuing with defaults."); + } if (identifier != null) { return identifier; } From a1f278e9d47e8029d58df6d3aae13495965ca434 Mon Sep 17 00:00:00 2001 From: Olivier Lemasle Date: Sun, 8 Jun 2014 17:59:17 +0200 Subject: [PATCH 556/683] CLOUDSTACK-6850: Return cpu cores, cpu speed and memory in listUsageRecords Signed-off-by: Sebastien Goasguen --- .../api/response/UsageRecordResponse.java | 24 ++++++++ .../org/apache/cloudstack/usage/Usage.java | 6 ++ .../com/cloud/usage/UsageVMInstanceVO.java | 17 ++++++ .../schema/src/com/cloud/usage/UsageVO.java | 46 +++++++++++++++ .../usage/dao/UsageVMInstanceDaoImpl.java | 28 ++++++--- .../src/com/cloud/api/ApiResponseHelper.java | 4 ++ setup/db/db/schema-430to440.sql | 5 ++ .../usage/parser/VMInstanceUsageParser.java | 57 +++++++++++++------ 8 files changed, 161 insertions(+), 26 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/response/UsageRecordResponse.java b/api/src/org/apache/cloudstack/api/response/UsageRecordResponse.java index 5e2e85dea4..87a085c2a5 100644 --- a/api/src/org/apache/cloudstack/api/response/UsageRecordResponse.java +++ b/api/src/org/apache/cloudstack/api/response/UsageRecordResponse.java @@ -101,6 +101,18 @@ public class UsageRecordResponse extends BaseResponse implements ControlledEntit @Param(description = "virtual size of resource") private Long virtualSize; + @SerializedName(ApiConstants.CPU_NUMBER) + @Param(description = "number of cpu of resource") + private Long cpuNumber; + + @SerializedName(ApiConstants.CPU_SPEED) + @Param(description = "speed of each cpu of resource") + private Long cpuSpeed; + + @SerializedName(ApiConstants.MEMORY) + @Param(description = "memory allocated for the resource") + private Long memory; + @SerializedName(ApiConstants.START_DATE) @Param(description = "start date of the usage record") private String startDate; @@ -229,4 +241,16 @@ public void setDefault(Boolean isDefault) { public void setVirtualSize(Long virtualSize) { this.virtualSize = virtualSize; } + + public void setCpuNumber(Long cpuNumber) { + this.cpuNumber = cpuNumber; + } + + public void setCpuSpeed(Long cpuSpeed) { + this.cpuSpeed = cpuSpeed; + } + + public void setMemory(Long memory) { + this.memory = memory; + } } diff --git a/api/src/org/apache/cloudstack/usage/Usage.java b/api/src/org/apache/cloudstack/usage/Usage.java index 20dc189ae1..fe35390dd4 100644 --- a/api/src/org/apache/cloudstack/usage/Usage.java +++ b/api/src/org/apache/cloudstack/usage/Usage.java @@ -40,6 +40,12 @@ public interface Usage { public String getVmName(); + public Long getCpuCores(); + + public Long getCpuSpeed(); + + public Long getMemory(); + public Long getOfferingId(); public Long getTemplateId(); diff --git a/engine/schema/src/com/cloud/usage/UsageVMInstanceVO.java b/engine/schema/src/com/cloud/usage/UsageVMInstanceVO.java index 06d4876c1b..1e7b424050 100644 --- a/engine/schema/src/com/cloud/usage/UsageVMInstanceVO.java +++ b/engine/schema/src/com/cloud/usage/UsageVMInstanceVO.java @@ -86,6 +86,23 @@ public UsageVMInstanceVO(int usageType, long zoneId, long accountId, long vmInst this.endDate = endDate; } + public UsageVMInstanceVO(int usageType, long zoneId, long accountId, long vmInstanceId, String vmName, long serviceOfferingId, long templateId, + Long cpuSpeed, Long cpuCores, Long memory, String hypervisorType, Date startDate, Date endDate) { + this.usageType = usageType; + this.zoneId = zoneId; + this.accountId = accountId; + this.vmInstanceId = vmInstanceId; + this.vmName = vmName; + this.serviceOfferingId = serviceOfferingId; + this.templateId = templateId; + this.cpuSpeed = cpuSpeed; + this.cpuCores = cpuCores; + this.memory = memory; + this.hypervisorType = hypervisorType; + this.startDate = startDate; + this.endDate = endDate; + } + public int getUsageType() { return usageType; } diff --git a/engine/schema/src/com/cloud/usage/UsageVO.java b/engine/schema/src/com/cloud/usage/UsageVO.java index 67014ef4fd..c46abb3a9b 100644 --- a/engine/schema/src/com/cloud/usage/UsageVO.java +++ b/engine/schema/src/com/cloud/usage/UsageVO.java @@ -65,6 +65,15 @@ public class UsageVO implements Usage, InternalIdentity { @Column(name = "vm_name") private String vmName = null; + @Column(name = "cpu_cores") + private Long cpuCores = null; + + @Column(name = "memory") + private Long memory = null; + + @Column(name = "cpu_speed") + private Long cpuSpeed = null; + @Column(name = "offering_id") private Long offeringId = null; @@ -171,6 +180,28 @@ public UsageVO(Long zoneId, Long accountId, Long domainId, String description, S this.endDate = endDate; } + public UsageVO(Long zoneId, Long accountId, Long domainId, String description, String usageDisplay, int usageType, Double rawUsage, Long vmId, String vmName, + Long cpuCores, Long cpuSpeed, Long memory, Long offeringId, Long templateId, Long usageId, Date startDate, Date endDate, String type) { + this.zoneId = zoneId; + this.accountId = accountId; + this.domainId = domainId; + this.description = description; + this.usageDisplay = usageDisplay; + this.usageType = usageType; + this.rawUsage = rawUsage; + this.vmInstanceId = vmId; + this.vmName = vmName; + this.cpuCores = cpuCores; + this.cpuSpeed = cpuSpeed; + this.memory = memory; + this.offeringId = offeringId; + this.templateId = templateId; + this.usageId = usageId; + this.type = type; + this.startDate = startDate; + this.endDate = endDate; + } + //IPAddress Usage public UsageVO(Long zoneId, Long accountId, Long domainId, String description, String usageDisplay, int usageType, Double rawUsage, Long usageId, long size, String type, Date startDate, Date endDate) { @@ -238,6 +269,21 @@ public String getVmName() { return vmName; } + @Override + public Long getCpuCores() { + return cpuCores; + } + + @Override + public Long getCpuSpeed() { + return cpuSpeed; + } + + @Override + public Long getMemory() { + return memory; + } + @Override public Long getOfferingId() { return offeringId; diff --git a/engine/schema/src/com/cloud/usage/dao/UsageVMInstanceDaoImpl.java b/engine/schema/src/com/cloud/usage/dao/UsageVMInstanceDaoImpl.java index b94e12f9c5..930ad89999 100644 --- a/engine/schema/src/com/cloud/usage/dao/UsageVMInstanceDaoImpl.java +++ b/engine/schema/src/com/cloud/usage/dao/UsageVMInstanceDaoImpl.java @@ -42,8 +42,8 @@ public class UsageVMInstanceDaoImpl extends GenericDaoBase= ?)))"; public UsageVMInstanceDaoImpl() { @@ -113,11 +113,23 @@ public List getUsageRecords(long accountId, Date startDate, D long r_accountId = rs.getLong(3); long r_vmId = rs.getLong(4); String r_vmName = rs.getString(5); - long r_soId = rs.getLong(6); - long r_tId = rs.getLong(7); - String hypervisorType = rs.getString(8); - String r_startDate = rs.getString(9); - String r_endDate = rs.getString(10); + Long r_cpuSpeed = rs.getLong(6); + if (rs.wasNull()) { + r_cpuSpeed = null; + } + Long r_cpuCores = rs.getLong(7); + if (rs.wasNull()) { + r_cpuCores = null; + } + Long r_memory = rs.getLong(8); + if (rs.wasNull()) { + r_memory = null; + } + long r_soId = rs.getLong(9); + long r_tId = rs.getLong(10); + String hypervisorType = rs.getString(11); + String r_startDate = rs.getString(12); + String r_endDate = rs.getString(13); Date instanceStartDate = null; Date instanceEndDate = null; if (r_startDate != null) { @@ -127,7 +139,7 @@ public List getUsageRecords(long accountId, Date startDate, D instanceEndDate = DateUtil.parseDateString(s_gmtTimeZone, r_endDate); } UsageVMInstanceVO usageInstance = - new UsageVMInstanceVO(r_usageType, r_zoneId, r_accountId, r_vmId, r_vmName, r_soId, r_tId, hypervisorType, instanceStartDate, instanceEndDate); + new UsageVMInstanceVO(r_usageType, r_zoneId, r_accountId, r_vmId, r_vmName, r_soId, r_tId, r_cpuSpeed, r_cpuCores, r_memory, hypervisorType, instanceStartDate, instanceEndDate); usageInstances.add(usageInstance); } } catch (Exception ex) { diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index 119f56d32f..a47f62d718 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -3306,6 +3306,10 @@ public UsageRecordResponse createUsageResponse(Usage usageRecord) { } //Hypervisor Type usageRecResponse.setType(usageRecord.getType()); + //Dynamic compute offerings details + usageRecResponse.setCpuNumber(usageRecord.getCpuCores()); + usageRecResponse.setCpuSpeed(usageRecord.getCpuSpeed()); + usageRecResponse.setMemory(usageRecord.getMemory()); } else if (usageRecord.getUsageType() == UsageTypes.IP_ADDRESS) { //isSourceNAT diff --git a/setup/db/db/schema-430to440.sql b/setup/db/db/schema-430to440.sql index adcd833699..150d072743 100644 --- a/setup/db/db/schema-430to440.sql +++ b/setup/db/db/schema-430to440.sql @@ -461,6 +461,11 @@ CREATE VIEW `cloud`.`user_vm_view` AS left join `cloud`.`user_vm_details` `custom_ram_size` ON (((`custom_ram_size`.`vm_id` = `cloud`.`vm_instance`.`id`) and (`custom_ram_size`.`name` = 'memory'))); +ALTER TABLE `cloud_usage`.`cloud_usage` ADD COLUMN `cpu_speed` INT(10) UNSIGNED NULL COMMENT 'speed per core in Mhz', + ADD COLUMN `cpu_cores` INT(10) UNSIGNED NULL COMMENT 'number of cpu cores', + ADD COLUMN `memory` INT(10) UNSIGNED NULL COMMENT 'memory in MB'; + + -- ACL DB schema CREATE TABLE `cloud`.`iam_group` ( `id` bigint unsigned NOT NULL UNIQUE auto_increment, diff --git a/usage/src/com/cloud/usage/parser/VMInstanceUsageParser.java b/usage/src/com/cloud/usage/parser/VMInstanceUsageParser.java index ba0d4bf9cd..684412f045 100644 --- a/usage/src/com/cloud/usage/parser/VMInstanceUsageParser.java +++ b/usage/src/com/cloud/usage/parser/VMInstanceUsageParser.java @@ -27,7 +27,6 @@ import org.apache.log4j.Logger; import org.springframework.stereotype.Component; - import org.apache.cloudstack.usage.UsageTypes; import com.cloud.usage.UsageVMInstanceVO; @@ -36,6 +35,7 @@ import com.cloud.usage.dao.UsageVMInstanceDao; import com.cloud.user.AccountVO; import com.cloud.utils.Pair; +import com.cloud.utils.StringUtils; @Component public class VMInstanceUsageParser { @@ -75,7 +75,7 @@ public static boolean parse(AccountVO account, Date startDate, Date endDate) { Map> usageVMUptimeMap = new HashMap>(); Map> allocatedVMMap = new HashMap>(); - Map vmServiceOfferingMap = new HashMap(); + Map vmInfosMap = new HashMap(); // loop through all the usage instances, create a usage record for each for (UsageVMInstanceVO usageInstance : usageInstances) { @@ -84,10 +84,13 @@ public static boolean parse(AccountVO account, Date startDate, Date endDate) { long zoneId = usageInstance.getZoneId(); long tId = usageInstance.getTemplateId(); int usageType = usageInstance.getUsageType(); - String key = vmId + "-" + soId + "-" + usageType; + Long cpuCores = usageInstance.getCpuCores(); + Long cpuSpeed = usageInstance.getCpuSpeed(); + Long memory = usageInstance.getMemory(); + String key = StringUtils.join("-", vmId, soId, usageType, cpuCores, cpuSpeed, memory); - // store the info in the service offering map - vmServiceOfferingMap.put(key, new VMInfo(vmId, zoneId, soId, tId, usageInstance.getHypervisorType())); + // store the info in the VMs map + vmInfosMap.put(key, new VMInfo(vmId, zoneId, soId, tId, usageInstance.getHypervisorType(), cpuCores, cpuSpeed, memory)); Date vmStartDate = usageInstance.getStartDate(); Date vmEndDate = usageInstance.getEndDate(); @@ -119,9 +122,9 @@ public static boolean parse(AccountVO account, Date startDate, Date endDate) { // Only create a usage record if we have a runningTime of bigger than zero. if (runningTime > 0L) { - VMInfo info = vmServiceOfferingMap.get(vmIdKey); + VMInfo info = vmInfosMap.get(vmIdKey); createUsageRecord(UsageTypes.RUNNING_VM, runningTime, startDate, endDate, account, info.getVirtualMachineId(), vmUptimeInfo.first(), info.getZoneId(), - info.getServiceOfferingId(), info.getTemplateId(), info.getHypervisorType()); + info.getServiceOfferingId(), info.getTemplateId(), info.getHypervisorType(), info.getCpuCores(), info.getCpuSpeed(), info.getMemory()); } } @@ -131,9 +134,9 @@ public static boolean parse(AccountVO account, Date startDate, Date endDate) { // Only create a usage record if we have a runningTime of bigger than zero. if (allocatedTime > 0L) { - VMInfo info = vmServiceOfferingMap.get(vmIdKey); + VMInfo info = vmInfosMap.get(vmIdKey); createUsageRecord(UsageTypes.ALLOCATED_VM, allocatedTime, startDate, endDate, account, info.getVirtualMachineId(), vmAllocInfo.first(), info.getZoneId(), - info.getServiceOfferingId(), info.getTemplateId(), info.getHypervisorType()); + info.getServiceOfferingId(), info.getTemplateId(), info.getHypervisorType(), info.getCpuCores(), info.getCpuSpeed(), info.getMemory()); } } @@ -153,7 +156,7 @@ private static void updateVmUsageData(Map> usageDataM } private static void createUsageRecord(int type, long runningTime, Date startDate, Date endDate, AccountVO account, long vmId, String vmName, long zoneId, - long serviceOfferingId, long templateId, String hypervisorType) { + long serviceOfferingId, long templateId, String hypervisorType, Long cpuCores, Long cpuSpeed, Long memory) { // Our smallest increment is hourly for now if (s_logger.isDebugEnabled()) { s_logger.debug("Total running time " + runningTime + "ms"); @@ -179,23 +182,29 @@ private static void createUsageRecord(int type, long runningTime, Date startDate usageDesc += " (ServiceOffering: " + serviceOfferingId + ") (Template: " + templateId + ")"; UsageVO usageRecord = new UsageVO(Long.valueOf(zoneId), account.getId(), account.getDomainId(), usageDesc, usageDisplay + " Hrs", type, new Double(usage), Long.valueOf(vmId), - vmName, Long.valueOf(serviceOfferingId), Long.valueOf(templateId), Long.valueOf(vmId), startDate, endDate, hypervisorType); + vmName, cpuCores, cpuSpeed, memory, Long.valueOf(serviceOfferingId), Long.valueOf(templateId), Long.valueOf(vmId), startDate, endDate, hypervisorType); s_usageDao.persist(usageRecord); } private static class VMInfo { - private long virtualMachineId; - private long zoneId; - private long serviceOfferingId; - private long templateId; - private String hypervisorType; - - public VMInfo(long vmId, long zId, long soId, long tId, String hypervisorType) { + private final long virtualMachineId; + private final long zoneId; + private final long serviceOfferingId; + private final long templateId; + private final String hypervisorType; + private final Long cpuCores; + private final Long cpuSpeed; + private final Long memory; + + public VMInfo(long vmId, long zId, long soId, long tId, String hypervisorType, Long cpuCores, Long cpuSpeed, Long memory) { virtualMachineId = vmId; zoneId = zId; serviceOfferingId = soId; templateId = tId; this.hypervisorType = hypervisorType; + this.cpuCores = cpuCores; + this.cpuSpeed = cpuSpeed; + this.memory = memory; } public long getZoneId() { @@ -217,5 +226,17 @@ public long getTemplateId() { private String getHypervisorType() { return hypervisorType; } + + public Long getCpuCores() { + return cpuCores; + } + + public Long getCpuSpeed() { + return cpuSpeed; + } + + public Long getMemory() { + return memory; + } } } From 390e498dc58a89f0b060c50e5b796061bc97342e Mon Sep 17 00:00:00 2001 From: Rajani Karuturi Date: Tue, 10 Jun 2014 13:52:43 +0530 Subject: [PATCH 557/683] Fixed issues reported by coverity NPEs, unwritten field access and self assignment Signed-off-by: Koushik Das --- .../cloud/vm/VirtualMachineManagerImpl.java | 49 ++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java index 9b63043b90..45023658a0 100755 --- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -775,8 +775,9 @@ public void advanceStart(String vmUuid, Map try { orchestrateStart(vmUuid, params, planToDeploy, planner); } finally { - if (VmJobEnabled.value()) + if (placeHolder != null) { _workJobDao.expunge(placeHolder.getId()); + } } } else { Outcome outcome = startVmThroughJobQueue(vmUuid, params, planToDeploy, planner); @@ -1352,8 +1353,9 @@ public void advanceStop(String vmUuid, boolean cleanUpEvenIfUnableToStop) try { orchestrateStop(vmUuid, cleanUpEvenIfUnableToStop); } finally { - if (VmJobEnabled.value()) + if (placeHolder != null) { _workJobDao.expunge(placeHolder.getId()); + } } } else { @@ -1451,7 +1453,7 @@ private void advanceStop(VMInstanceVO vm, boolean cleanUpEvenIfUnableToStop) thr if (s_logger.isDebugEnabled()) { s_logger.debug("Unable to transition the state but we're moving on because it's forced stop"); } - if (state == State.Starting || state == State.Migrating) { + if ((state == State.Starting) || (state == State.Migrating) || (state == State.Stopping)) { if (work != null) { doCleanup = true; } else { @@ -1460,8 +1462,6 @@ private void advanceStop(VMInstanceVO vm, boolean cleanUpEvenIfUnableToStop) thr } throw new CloudRuntimeException("Work item not found, We cannot stop " + vm + " when it is in state " + vm.getState()); } - } else if (state == State.Stopping) { - doCleanup = true; } if (doCleanup) { @@ -1681,8 +1681,9 @@ public void storageMigration(String vmUuid, StoragePool destPool) { try { orchestrateStorageMigration(vmUuid, destPool); } finally { - if (VmJobEnabled.value()) + if (placeHolder != null) { _workJobDao.expunge(placeHolder.getId()); + } } } else { Outcome outcome = migrateVmStorageThroughJobQueue(vmUuid, destPool); @@ -1775,8 +1776,9 @@ public void migrate(String vmUuid, long srcHostId, DeployDestination dest) try { orchestrateMigrate(vmUuid, srcHostId, dest); } finally { - if (VmJobEnabled.value()) + if (placeHolder != null) { _workJobDao.expunge(placeHolder.getId()); + } } } else { Outcome outcome = migrateVmThroughJobQueue(vmUuid, srcHostId, dest); @@ -2072,8 +2074,9 @@ public void migrateWithStorage(String vmUuid, long srcHostId, long destHostId, M try { orchestrateMigrateWithStorage(vmUuid, srcHostId, destHostId, volumeToPool); } finally { - if (VmJobEnabled.value()) + if (placeHolder != null) { _workJobDao.expunge(placeHolder.getId()); + } } } else { @@ -2418,8 +2421,9 @@ public void advanceReboot(String vmUuid, Map outcome = rebootVmThroughJobQueue(vmUuid, params); @@ -3282,12 +3286,11 @@ protected class AgentVmInfo { public String hostUuid; public VMInstanceVO vm; - @SuppressWarnings("unchecked") public AgentVmInfo(String name, VMInstanceVO vm, State state, String host) { - name = name; - state = state; - vm = vm; - hostUuid = host; + this.name = name; + this.state = state; + this.vm = vm; + this.hostUuid = host; } public AgentVmInfo(String name, VMInstanceVO vm, State state) { @@ -3392,8 +3395,9 @@ public NicProfile addVmToNetwork(VirtualMachine vm, Network network, NicProfile try { return orchestrateAddVmToNetwork(vm, network, requested); } finally { - if (VmJobEnabled.value()) + if (placeHolder != null) { _workJobDao.expunge(placeHolder.getId()); + } } } else { Outcome outcome = addVmToNetworkThroughJobQueue(vm, network, requested); @@ -3403,7 +3407,7 @@ public NicProfile addVmToNetwork(VirtualMachine vm, Network network, NicProfile } catch (InterruptedException e) { throw new RuntimeException("Operation is interrupted", e); } catch (java.util.concurrent.ExecutionException e) { - throw new RuntimeException("Execution excetion", e); + throw new RuntimeException("Execution exception", e); } Object jobException = _jobMgr.unmarshallResultObject(outcome.getJob()); @@ -3506,8 +3510,9 @@ public boolean removeNicFromVm(VirtualMachine vm, Nic nic) try { return orchestrateRemoveNicFromVm(vm, nic); } finally { - if (VmJobEnabled.value()) + if (placeHolder != null) { _workJobDao.expunge(placeHolder.getId()); + } } } else { @@ -3758,8 +3763,9 @@ public void migrateForScale(String vmUuid, long srcHostId, DeployDestination des try { orchestrateMigrateForScale(vmUuid, srcHostId, dest, oldSvcOfferingId); } finally { - if (VmJobEnabled.value()) + if (placeHolder != null) { _workJobDao.expunge(placeHolder.getId()); + } } } else { Outcome outcome = migrateVmForScaleThroughJobQueue(vmUuid, srcHostId, dest, oldSvcOfferingId); @@ -4021,8 +4027,9 @@ public VMInstanceVO reConfigureVm(String vmUuid, ServiceOffering oldServiceOffer try { return orchestrateReConfigureVm(vmUuid, oldServiceOffering, reconfiguringOnExistingHost); } finally { - if (VmJobEnabled.value()) + if (placeHolder != null) { _workJobDao.expunge(placeHolder.getId()); + } } } else { Outcome outcome = reconfigureVmThroughJobQueue(vmUuid, oldServiceOffering, reconfiguringOnExistingHost); @@ -4074,7 +4081,7 @@ private VMInstanceVO orchestrateReConfigureVm(String vmUuid, ServiceOffering old work.setStep(Step.Prepare); work.setResourceType(ItWorkVO.ResourceType.Host); work.setResourceId(vm.getHostId()); - work = _workDao.persist(work); + _workDao.persist(work); boolean success = false; try { if (reconfiguringOnExistingHost) { @@ -4096,8 +4103,6 @@ private VMInstanceVO orchestrateReConfigureVm(String vmUuid, ServiceOffering old } catch (AgentUnavailableException e) { throw e; } finally { - // work.setStep(Step.Done); - //_workDao.update(work.getId(), work); if (!success) { _capacityMgr.releaseVmCapacity(vm, false, false, vm.getHostId()); // release the new capacity vm.setServiceOfferingId(oldServiceOffering.getId()); From c5ee5ad5c828d9f0b128e3d7280a30dcf717e045 Mon Sep 17 00:00:00 2001 From: Saksham Srivastava Date: Mon, 9 Jun 2014 12:24:30 +0530 Subject: [PATCH 558/683] CLOUDSTACK-6864: UploadSSlCert API requires double encoding of URL params --- .../network/lb/CertServiceImpl.java | 25 ++++---- .../network/lb/CertServiceTest.java | 62 +++++++++---------- 2 files changed, 41 insertions(+), 46 deletions(-) diff --git a/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java b/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java index ba71d631a9..c2c155d0b8 100644 --- a/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java +++ b/server/src/org/apache/cloudstack/network/lb/CertServiceImpl.java @@ -18,8 +18,6 @@ import java.io.IOException; import java.io.StringReader; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; import java.security.InvalidAlgorithmParameterException; import java.security.InvalidKeyException; import java.security.KeyPair; @@ -53,18 +51,17 @@ import javax.ejb.Local; import javax.inject.Inject; -import org.apache.commons.io.IOUtils; -import org.apache.log4j.Logger; -import org.bouncycastle.jce.provider.BouncyCastleProvider; -import org.bouncycastle.openssl.PEMReader; -import org.bouncycastle.openssl.PasswordFinder; - import org.apache.cloudstack.acl.SecurityChecker; import org.apache.cloudstack.api.command.user.loadbalancer.DeleteSslCertCmd; import org.apache.cloudstack.api.command.user.loadbalancer.ListSslCertsCmd; import org.apache.cloudstack.api.command.user.loadbalancer.UploadSslCertCmd; import org.apache.cloudstack.api.response.SslCertResponse; import org.apache.cloudstack.context.CallContext; +import org.apache.commons.io.IOUtils; +import org.apache.log4j.Logger; +import org.bouncycastle.jce.provider.BouncyCastleProvider; +import org.bouncycastle.openssl.PEMReader; +import org.bouncycastle.openssl.PasswordFinder; import com.cloud.event.ActionEvent; import com.cloud.event.EventTypes; @@ -109,10 +106,10 @@ public CertServiceImpl() { public SslCertResponse uploadSslCert(UploadSslCertCmd certCmd) { try { - String cert = URLDecoder.decode(certCmd.getCert(), "UTF-8"); - String key = URLDecoder.decode(certCmd.getKey(), "UTF-8"); + String cert = certCmd.getCert(); + String key = certCmd.getKey(); String password = certCmd.getPassword(); - String chain = certCmd.getChain() == null ? null : URLDecoder.decode(certCmd.getChain(), "UTF-8"); + String chain = certCmd.getChain(); validate(cert, key, password, chain); s_logger.debug("Certificate Validation succeeded"); @@ -127,8 +124,8 @@ public SslCertResponse uploadSslCert(UploadSslCertCmd certCmd) { return createCertResponse(certVO, null); - } catch (UnsupportedEncodingException e) { - throw new CloudRuntimeException("Error decoding certificate data"); + } catch (Exception e) { + throw new CloudRuntimeException("Error parsing certificate data " + e.getMessage()); } } @@ -429,7 +426,7 @@ public Certificate parseCertificate(String cert) { try { return (Certificate)certPem.readObject(); } catch (Exception e) { - throw new InvalidParameterValueException("Invalid Certificate format. Expected X509 certificate"); + throw new InvalidParameterValueException("Invalid Certificate format. Expected X509 certificate. Failed due to " + e.getMessage()); } finally { IOUtils.closeQuietly(certPem); } diff --git a/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java b/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java index a67a9abf12..038845d928 100644 --- a/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java +++ b/server/test/org/apache/cloudstack/network/lb/CertServiceTest.java @@ -27,21 +27,19 @@ import java.io.File; import java.io.IOException; import java.lang.reflect.Field; -import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; import java.util.UUID; +import org.apache.cloudstack.api.command.user.loadbalancer.DeleteSslCertCmd; +import org.apache.cloudstack.api.command.user.loadbalancer.UploadSslCertCmd; +import org.apache.cloudstack.context.CallContext; import org.junit.After; import org.junit.Assume; import org.junit.Before; import org.junit.Test; import org.mockito.Mockito; -import org.apache.cloudstack.api.command.user.loadbalancer.DeleteSslCertCmd; -import org.apache.cloudstack.api.command.user.loadbalancer.UploadSslCertCmd; -import org.apache.cloudstack.context.CallContext; - import com.cloud.network.dao.LoadBalancerCertMapDao; import com.cloud.network.dao.LoadBalancerCertMapVO; import com.cloud.network.dao.LoadBalancerVO; @@ -101,9 +99,9 @@ public void runUploadSslCertWithCAChain() throws Exception { String chainFile = getClass().getResource("/certs/root_chain.crt").getFile(); String password = "user"; - String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); - String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); - String chain = URLEncoder.encode(readFileToString(new File(chainFile)), "UTF-8"); + String cert = readFileToString(new File(certFile)); + String key = readFileToString(new File(keyFile)); + String chain = readFileToString(new File(chainFile)); CertServiceImpl certService = new CertServiceImpl(); @@ -153,8 +151,8 @@ public void runUploadSslCertSelfSignedWithPassword() throws Exception { String keyFile = getClass().getResource("/certs/rsa_self_signed_with_pwd.key").getFile(); String password = "test"; - String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); - String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + String cert = readFileToString(new File(certFile)); + String key = readFileToString(new File(keyFile)); CertServiceImpl certService = new CertServiceImpl(); @@ -199,8 +197,8 @@ public void runUploadSslCertSelfSignedNoPassword() throws Exception { String certFile = getClass().getResource("/certs/rsa_self_signed.crt").getFile(); String keyFile = getClass().getResource("/certs/rsa_self_signed.key").getFile(); - String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); - String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + String cert = readFileToString(new File(certFile)); + String key = readFileToString(new File(keyFile)); CertServiceImpl certService = new CertServiceImpl(); @@ -239,9 +237,9 @@ public void runUploadSslCertBadChain() throws IOException, IllegalAccessExceptio String chainFile = getClass().getResource("/certs/rsa_self_signed.crt").getFile(); String password = "user"; - String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); - String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); - String chain = URLEncoder.encode(readFileToString(new File(chainFile)), "UTF-8"); + String cert = readFileToString(new File(certFile)); + String key = readFileToString(new File(keyFile)); + String chain = readFileToString(new File(chainFile)); CertServiceImpl certService = new CertServiceImpl(); @@ -291,9 +289,9 @@ public void runUploadSslCertNoRootCert() throws IOException, IllegalAccessExcept String chainFile = getClass().getResource("/certs/rsa_ca_signed2.crt").getFile(); String password = "user"; - String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); - String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); - String chain = URLEncoder.encode(readFileToString(new File(chainFile)), "UTF-8"); + String cert = readFileToString(new File(certFile)); + String key = readFileToString(new File(keyFile)); + String chain = readFileToString(new File(chainFile)); CertServiceImpl certService = new CertServiceImpl(); @@ -343,8 +341,8 @@ public void runUploadSslCertNoChain() throws IOException, IllegalAccessException String keyFile = getClass().getResource("/certs/rsa_ca_signed.key").getFile(); String password = "user"; - String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); - String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + String cert = readFileToString(new File(certFile)); + String key = readFileToString(new File(keyFile)); CertServiceImpl certService = new CertServiceImpl(); @@ -388,8 +386,8 @@ public void runUploadSslCertBadPassword() throws IOException, IllegalAccessExcep String keyFile = getClass().getResource("/certs/rsa_self_signed_with_pwd.key").getFile(); String password = "bad_password"; - String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); - String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + String cert = readFileToString(new File(certFile)); + String key = readFileToString(new File(keyFile)); CertServiceImpl certService = new CertServiceImpl(); @@ -432,8 +430,8 @@ public void runUploadSslCertBadkeyPair() throws IOException, IllegalAccessExcept String certFile = getClass().getResource("/certs/rsa_self_signed.crt").getFile(); String keyFile = getClass().getResource("/certs/rsa_random_pkey.key").getFile(); - String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); - String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + String cert = readFileToString(new File(certFile)); + String key = readFileToString(new File(keyFile)); CertServiceImpl certService = new CertServiceImpl(); @@ -471,8 +469,8 @@ public void runUploadSslCertBadkeyAlgo() throws IOException, IllegalAccessExcept String certFile = getClass().getResource("/certs/rsa_self_signed.crt").getFile(); String keyFile = getClass().getResource("/certs/dsa_self_signed.key").getFile(); - String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); - String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + String cert = readFileToString(new File(certFile)); + String key = readFileToString(new File(keyFile)); CertServiceImpl certService = new CertServiceImpl(); @@ -511,8 +509,8 @@ public void runUploadSslCertExpiredCert() throws IOException, IllegalAccessExcep String certFile = getClass().getResource("/certs/expired_cert.crt").getFile(); String keyFile = getClass().getResource("/certs/rsa_self_signed.key").getFile(); - String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); - String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + String cert = readFileToString(new File(certFile)); + String key = readFileToString(new File(keyFile)); CertServiceImpl certService = new CertServiceImpl(); @@ -550,8 +548,8 @@ public void runUploadSslCertNotX509() throws IOException, IllegalAccessException String certFile = getClass().getResource("/certs/non_x509_pem.crt").getFile(); String keyFile = getClass().getResource("/certs/rsa_self_signed.key").getFile(); - String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); - String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + String cert = readFileToString(new File(certFile)); + String key = readFileToString(new File(keyFile)); CertServiceImpl certService = new CertServiceImpl(); @@ -590,8 +588,8 @@ public void runUploadSslCertBadFormat() throws IOException, IllegalAccessExcepti String certFile = getClass().getResource("/certs/bad_format_cert.crt").getFile(); String keyFile = getClass().getResource("/certs/rsa_self_signed.key").getFile(); - String cert = URLEncoder.encode(readFileToString(new File(certFile)), "UTF-8"); - String key = URLEncoder.encode(readFileToString(new File(keyFile)), "UTF-8"); + String cert = readFileToString(new File(certFile)); + String key = readFileToString(new File(keyFile)); CertServiceImpl certService = new CertServiceImpl(); From 5bcd017de6f421a6125406120b39fb8602276dc7 Mon Sep 17 00:00:00 2001 From: Saksham Srivastava Date: Tue, 10 Jun 2014 18:27:54 +0530 Subject: [PATCH 559/683] CLOUDSTACK-6654: Configkey parameters are not validated --- .../ConfigurationManagerImpl.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 0dc067a1d3..1549e12d9b 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -701,12 +701,19 @@ private String validateConfigurationValue(String name, String value, String scop return "Invalid scope id provided for the parameter " + name; } } + Class type = null; Config c = Config.getConfig(name); if (c == null) { - s_logger.warn("Did not find configuration " + name + " in Config.java. Perhaps moved to ConfigDepot?"); - return null; + s_logger.warn("Did not find configuration " + name + " in Config.java. Perhaps moved to ConfigDepot"); + ConfigKey configKey = _configDepot.get(name); + if(configKey == null) { + s_logger.warn("Did not find configuration " + name + " in ConfigDepot too."); + return null; + } + type = configKey.type(); + } else { + type = c.getType(); } - Class type = c.getType(); if (value == null) { if (type.equals(Boolean.class)) { @@ -765,6 +772,12 @@ private String validateConfigurationValue(String name, String value, String scop } } + if(c == null ) { + //range validation has to be done per case basis, for now + //return in case of Configkey parameters + return null; + } + String range = c.getRange(); if (range == null) { return null; From af4e868547c215d511fbdd77f70e5e7b0303d3e5 Mon Sep 17 00:00:00 2001 From: Joris van Lieshout Date: Wed, 21 May 2014 15:22:15 +0200 Subject: [PATCH 560/683] By preloading some modules we fix two things. 1. Some sysctl settings like ip_conntrack_max are not set during boot because the module is not loaded at that time. 2. Passive ftp does not work through iptables without these modules. Signed-off-by: Daan Hoogland (cherry picked from commit bfccf439cfe120f5d1380a642e8b798335e1cf2e) --- .../definitions/systemvm64template/postinstall.sh | 11 +++++++++++ .../definitions/systemvmtemplate/postinstall.sh | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/tools/appliance/definitions/systemvm64template/postinstall.sh b/tools/appliance/definitions/systemvm64template/postinstall.sh index f6e6cdd1fe..b1e4430070 100644 --- a/tools/appliance/definitions/systemvm64template/postinstall.sh +++ b/tools/appliance/definitions/systemvm64template/postinstall.sh @@ -188,6 +188,16 @@ fix_vhdutil() { chmod a+x /bin/vhd-util } +# Preload these module otherwise the sysctl settings will not be set, and pasive ftp will not work. +fix_modules() { + cat >> /etc/modules << EOF +nf_conntrack_ipv4 +nf_conntrack +nf_conntrack_ftp +nf_nat_ftp +EOF +} + do_fixes() { fix_nameserver fix_inittab @@ -195,6 +205,7 @@ do_fixes() { fix_hostname fix_locale fix_vhdutil + fix_modules } configure_apache2() { diff --git a/tools/appliance/definitions/systemvmtemplate/postinstall.sh b/tools/appliance/definitions/systemvmtemplate/postinstall.sh index 23e66dd288..b3edeb7852 100644 --- a/tools/appliance/definitions/systemvmtemplate/postinstall.sh +++ b/tools/appliance/definitions/systemvmtemplate/postinstall.sh @@ -178,6 +178,16 @@ fix_vhdutil() { chmod a+x /bin/vhd-util } +# Preload these module otherwise the sysctl settings will not be set, and pasive ftp will not work. +fix_modules() { + cat >> /etc/modules << EOF +nf_conntrack_ipv4 +nf_conntrack +nf_conntrack_ftp +nf_nat_ftp +EOF +} + do_fixes() { fix_nameserver fix_inittab @@ -185,6 +195,7 @@ do_fixes() { fix_hostname fix_locale fix_vhdutil + fix_modules } configure_apache2() { From f94ff4ad041c517b048ce8fc58ef3996b98aa685 Mon Sep 17 00:00:00 2001 From: Joris van Lieshout Date: Wed, 21 May 2014 15:53:00 +0200 Subject: [PATCH 561/683] blacklist pcspkr as cosmetic improvement. aesni_intel blacklisting was not working because the include only works if the file ends with .conf. Signed-off-by: Daan Hoogland (cherry picked from commit 11f532bbecca08b41dd15d1abdf04957c84eebda) --- .../config/etc/modprobe.d/{aesni_intel => aesni_intel.conf} | 0 systemvm/patches/debian/config/etc/modprobe.d/pcspkr.conf | 1 + 2 files changed, 1 insertion(+) rename systemvm/patches/debian/config/etc/modprobe.d/{aesni_intel => aesni_intel.conf} (100%) create mode 100644 systemvm/patches/debian/config/etc/modprobe.d/pcspkr.conf diff --git a/systemvm/patches/debian/config/etc/modprobe.d/aesni_intel b/systemvm/patches/debian/config/etc/modprobe.d/aesni_intel.conf similarity index 100% rename from systemvm/patches/debian/config/etc/modprobe.d/aesni_intel rename to systemvm/patches/debian/config/etc/modprobe.d/aesni_intel.conf diff --git a/systemvm/patches/debian/config/etc/modprobe.d/pcspkr.conf b/systemvm/patches/debian/config/etc/modprobe.d/pcspkr.conf new file mode 100644 index 0000000000..da3dbd9a1a --- /dev/null +++ b/systemvm/patches/debian/config/etc/modprobe.d/pcspkr.conf @@ -0,0 +1 @@ +blacklist pcspkr \ No newline at end of file From 5eb026534929774d468976870979440b88f7a5b8 Mon Sep 17 00:00:00 2001 From: Daan Hoogland Date: Tue, 10 Jun 2014 16:21:06 +0200 Subject: [PATCH 562/683] rats (cherry picked from commit b85dd956f8187ea2810f4fd74728c0a430ce6ef4) --- .../config/etc/modprobe.d/aesni_intel.conf | 16 ++++++++++++++++ .../debian/config/etc/modprobe.d/pcspkr.conf | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/systemvm/patches/debian/config/etc/modprobe.d/aesni_intel.conf b/systemvm/patches/debian/config/etc/modprobe.d/aesni_intel.conf index 1c140f0a9b..2bc7cb15fc 100644 --- a/systemvm/patches/debian/config/etc/modprobe.d/aesni_intel.conf +++ b/systemvm/patches/debian/config/etc/modprobe.d/aesni_intel.conf @@ -1 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. blacklist aesni_intel diff --git a/systemvm/patches/debian/config/etc/modprobe.d/pcspkr.conf b/systemvm/patches/debian/config/etc/modprobe.d/pcspkr.conf index da3dbd9a1a..892b51fef5 100644 --- a/systemvm/patches/debian/config/etc/modprobe.d/pcspkr.conf +++ b/systemvm/patches/debian/config/etc/modprobe.d/pcspkr.conf @@ -1 +1,17 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. blacklist pcspkr \ No newline at end of file From 94bb5c29b293b5eebc21c67124d429a59736f11a Mon Sep 17 00:00:00 2001 From: Joris van Lieshout Date: Wed, 21 May 2014 17:10:07 +0200 Subject: [PATCH 563/683] If for some reason dnsmasq.log does not exist anymore logrotate will create it with nobody as owner. This will prevent dnsmasq deamon from logging to that file. Signed-off-by: Daan Hoogland (cherry picked from commit c54ce3cafbc51febe71fb2a997dbfc8ac9167fb0) --- systemvm/patches/debian/config/etc/logrotate.d/dnsmasq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/systemvm/patches/debian/config/etc/logrotate.d/dnsmasq b/systemvm/patches/debian/config/etc/logrotate.d/dnsmasq index 838415d304..265459077f 100644 --- a/systemvm/patches/debian/config/etc/logrotate.d/dnsmasq +++ b/systemvm/patches/debian/config/etc/logrotate.d/dnsmasq @@ -8,6 +8,6 @@ postrotate [ ! -f /var/run/dnsmasq/dnsmasq.pid ] || kill -USR2 `cat /var/run/dnsmasq/dnsmasq.pid` endscript - create 0640 nobody root + create 0640 dnsmasq root } From ed330d4dcdfbab70230e87654b5f7fb43db6c3ac Mon Sep 17 00:00:00 2001 From: Joris van Lieshout Date: Thu, 22 May 2014 15:25:45 +0200 Subject: [PATCH 564/683] xenstore-utils on debian wheezy does not have /usr/sbin/xenstore so these commands file. It does have xenstore-write and xenstore-rm so by adding a - this is fixed easily. Signed-off-by: Daan Hoogland (cherry picked from commit 2e83baaca2c998cfdda281301dffb09a1a20aa5c) --- systemvm/patches/debian/xe/xe-update-guest-attrs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/systemvm/patches/debian/xe/xe-update-guest-attrs b/systemvm/patches/debian/xe/xe-update-guest-attrs index 30a44980b9..6c605be420 100644 --- a/systemvm/patches/debian/xe/xe-update-guest-attrs +++ b/systemvm/patches/debian/xe/xe-update-guest-attrs @@ -74,7 +74,7 @@ xenstore_write_cached() { fi # try to write and update cache if successfull - if $XENSTORE write "$key" "$newval" ; then + if $XENSTORE-write "$key" "$newval" ; then mkdir -p $(dirname "$cache") echo -n "$newval" > "$cache" XENSTORE_UPDATED=1 @@ -104,7 +104,7 @@ xenstore_rm_cached() { return 1 fi # try to write and update cache if successfull - if $XENSTORE rm "$key" ; then + if $XENSTORE-rm "$key" ; then rm -rf "$cache" XENSTORE_UPDATED=1 return 0 From 64825549d2eb4e6c55b9cc2730e0ac895473f901 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Tue, 10 Jun 2014 14:26:58 -0700 Subject: [PATCH 565/683] CLOUDSTACK-6889: UI - create network offering - remove non-needed parameters from API call whose size might exceed limit in some cases. --- ui/scripts/configuration.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index 3823109134..6a4aa42763 100644 --- a/ui/scripts/configuration.js +++ b/ui/scripts/configuration.js @@ -2848,8 +2848,10 @@ inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = 'internal'; serviceCapabilityIndex++; } - } else if (value != '') { // Normal data - inputData[key] = value; + } else if (value != '') { // normal data (serviceData.length ==1), e.g. "name", "displayText", "networkRate", "guestIpType", "lbType" (unwanted), "availability" (unwated when value is "Optional"), "egresspolicy", "state" (unwanted), "status" (unwanted), "allocationstate" (unwanted) + if (!(key == "lbType" || (key == "availability" && value == "Optional") || key == "state" || key == "status" || key == "allocationstate")) { + inputData[key] = value; + } } }); @@ -2929,10 +2931,7 @@ inputData['serviceProviderList[' + serviceProviderIndex + '].provider'] = value; serviceProviderIndex++; }); - - if (args.$form.find('.form-item[rel=availability]').css("display") == "none") - inputData['availability'] = 'Optional'; - + if (args.$form.find('.form-item[rel=egresspolicy]').is(':visible')) { inputData['egressdefaultpolicy'] = formData.egresspolicy === 'ALLOW' ? true : false; } else { @@ -2947,8 +2946,7 @@ $.ajax({ url: createURL('createNetworkOffering'), data: inputData, - dataType: 'json', - async: true, + type: "POST", //use POST instead of GET since the API call might be overlong and exceed size limit success: function(data) { var item = data.createnetworkofferingresponse.networkoffering; From 09a357fb90b48ed6e2725ea60e632a2ad5529f79 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Tue, 10 Jun 2014 17:23:20 -0700 Subject: [PATCH 566/683] CLOUDSTACK-6890:createVPC invoked by admin does not observe start flag. --- .../api/command/admin/vpc/CreateVPCCmdByAdmin.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java index f063cdbde4..25e6325015 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java +++ b/api/src/org/apache/cloudstack/api/command/admin/vpc/CreateVPCCmdByAdmin.java @@ -19,6 +19,7 @@ import org.apache.log4j.Logger; import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.ResponseObject.ResponseView; import org.apache.cloudstack.api.ServerApiException; @@ -37,10 +38,14 @@ public class CreateVPCCmdByAdmin extends CreateVPCCmd { @Override public void execute() { Vpc vpc = null; + boolean success = true; try { - if (_vpcService.startVpc(getEntityId(), true)) { - vpc = _entityMgr.findById(Vpc.class, getEntityId()); + if (isStart()) { + success = _vpcService.startVpc(getEntityId(), true); + } else { + s_logger.debug("Not starting VPC as " + ApiConstants.START + "=false was passed to the API"); } + vpc = _entityMgr.findById(Vpc.class, getEntityId()); } catch (ResourceUnavailableException ex) { s_logger.warn("Exception: ", ex); throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, ex.getMessage()); From 0190c936689fc252e51b7c412283c128b5386b24 Mon Sep 17 00:00:00 2001 From: Ashutosh K Date: Tue, 27 May 2014 07:02:04 -0700 Subject: [PATCH 567/683] CLOUDSTACK-6780: Resolved cleanup issue in portable ip test cases --- test/integration/component/test_portable_ip.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/test/integration/component/test_portable_ip.py b/test/integration/component/test_portable_ip.py index 847bb4a822..77a5ab6d8c 100644 --- a/test/integration/component/test_portable_ip.py +++ b/test/integration/component/test_portable_ip.py @@ -1103,21 +1103,27 @@ def test_disassociate_ip_address_other_account(self): self.fail("Failed to create portable ip: %s" % e) try: - self.user_account = Account.create( + self.otherAccount = Account.create( self.apiclient, self.services["account"], domainid=self.domain.id ) + self.cleanup.append(self.otherAccount) - self.api_client_user = self.testClient.getUserApiClient( - UserName=self.user_account.name, - DomainName=self.user_account.domain + self.apiclientOtherAccount = self.testClient.getUserApiClient( + UserName=self.otherAccount.name, + DomainName=self.otherAccount.domain ) + # Trying to disassociate portable ip using + # api client of other account than the one + # used to create portable ip with self.assertRaises(Exception): - portableip.delete(self.api_client_user) - except Exception as e: + portableip.delete(self.apiclientOtherAccount) + + # Disassociate IP using api client of account used to create it portableip.delete(self.apiclient) + except Exception as e: self.fail("Exception while disassociating portable ip: %s" % e) return From 06bcc8d9eee802a3f5ada6bb7335ffe0cb7b3008 Mon Sep 17 00:00:00 2001 From: Bharat Kumar Date: Mon, 9 Jun 2014 18:42:43 +0530 Subject: [PATCH 568/683] CLOUDSTACK-6877 Tagged the testcase with the bugId Signed-off-by: Abhinandan Prateek --- test/integration/smoke/test_secondary_storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/smoke/test_secondary_storage.py b/test/integration/smoke/test_secondary_storage.py index 481d907be3..e037593d8d 100644 --- a/test/integration/smoke/test_secondary_storage.py +++ b/test/integration/smoke/test_secondary_storage.py @@ -81,7 +81,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"],BugId="CLOUDSTACK-6877") def test_01_sys_vm_start(self): """Test system VM start """ From c7013c2ca326ad31047fb6bc689dabc2a6912030 Mon Sep 17 00:00:00 2001 From: Bharat Kumar Date: Mon, 9 Jun 2014 18:30:13 +0530 Subject: [PATCH 569/683] CLOUDSTACK-6876 Tagged the test_deploy_vgpu_enabled_vm with the relavent bug id. Signed-off-by: Abhinandan Prateek --- test/integration/smoke/test_deploy_vgpu_enabled_vm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/smoke/test_deploy_vgpu_enabled_vm.py b/test/integration/smoke/test_deploy_vgpu_enabled_vm.py index 13fad61d85..fa33bdcdc7 100644 --- a/test/integration/smoke/test_deploy_vgpu_enabled_vm.py +++ b/test/integration/smoke/test_deploy_vgpu_enabled_vm.py @@ -152,7 +152,7 @@ def setUp(self): self.account ] - @attr(tags = ['advanced', 'simulator', 'basic', 'vgpu', 'provisioning']) + @attr(tags = ['advanced', 'simulator', 'basic', 'vgpu', 'provisioning'], BugId="CLOUDSTACK-6876") def test_deploy_vgpu_enabled_vm(self): """Test Deploy Virtual Machine From 93c692ea289a7e42dbe4d7051ee1aa78fbd51471 Mon Sep 17 00:00:00 2001 From: Bharat Kumar Date: Mon, 9 Jun 2014 18:45:40 +0530 Subject: [PATCH 570/683] CLOUDSTACK-6878 Tagged the testcase test_01_snapshot_root_disk with the bugId Signed-off-by: Abhinandan Prateek --- test/integration/smoke/test_snapshots.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/smoke/test_snapshots.py b/test/integration/smoke/test_snapshots.py index a960e7095b..a9be4e2201 100644 --- a/test/integration/smoke/test_snapshots.py +++ b/test/integration/smoke/test_snapshots.py @@ -99,7 +99,7 @@ def tearDown(self): return @attr(speed = "slow") - @attr(tags = ["advanced", "advancedns", "smoke", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "provisioning"], BugId="CLOUDSTACK-6878") def test_01_snapshot_root_disk(self): """Test Snapshot Root Disk """ From e58cc98c74c1655f5b5da60f75eeeef8269f800d Mon Sep 17 00:00:00 2001 From: Bharat Kumar Date: Mon, 9 Jun 2014 18:39:17 +0530 Subject: [PATCH 571/683] CLOUDSTACK-6875 Tagged the testcase with the bugId. Signed-off-by: Abhinandan Prateek --- test/integration/smoke/test_volumes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index 73c2722d8f..d6db63f56d 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -708,7 +708,7 @@ def test_08_resize_volume(self): time.sleep(30) return - @attr(tags = ["advanced", "advancedns", "smoke","basic", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke","basic", "selfservice"], BugId="CLOUDSTACK-6875") def test_09_delete_detached_volume(self): """Delete a Volume unattached to an VM """ From 06846082515e9524fb6c6a28608c8b0d843aab2f Mon Sep 17 00:00:00 2001 From: Bharat Kumar Date: Mon, 9 Jun 2014 18:47:50 +0530 Subject: [PATCH 572/683] CLOUDSTACK-6879 Tagged the testcase test_vpc_site2site_vpn with the bugId Signed-off-by: Abhinandan Prateek --- test/integration/smoke/test_vpc_vpn.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/smoke/test_vpc_vpn.py b/test/integration/smoke/test_vpc_vpn.py index 03826e95de..1b2844781a 100644 --- a/test/integration/smoke/test_vpc_vpn.py +++ b/test/integration/smoke/test_vpc_vpn.py @@ -159,7 +159,7 @@ def setUpClass(cls): cls.cleanup = [cls.account] - @attr(tags=["advanced", "selfservice"]) + @attr(tags=["advanced", "selfservice"], BugId="CLOUDSTACK-6879") def test_vpc_site2site_vpn(self): """Test VPN in VPC""" From f14f36170e94c0184ade28a50226b17d25ecf57c Mon Sep 17 00:00:00 2001 From: Saksham Srivastava Date: Mon, 9 Jun 2014 18:02:48 +0530 Subject: [PATCH 573/683] CLOUDSTACK-6812: Do not allow edit of storage.overprovision.factor for non supported types --- .../com/cloud/configuration/ConfigurationManagerImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 1549e12d9b..d2f5af3b39 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -38,8 +38,8 @@ import javax.naming.ConfigurationException; import com.cloud.storage.StorageManager; -import org.apache.log4j.Logger; +import org.apache.log4j.Logger; import org.apache.cloudstack.acl.SecurityChecker; import org.apache.cloudstack.affinity.AffinityGroup; import org.apache.cloudstack.affinity.AffinityGroupService; @@ -178,6 +178,7 @@ import com.cloud.service.dao.ServiceOfferingDao; import com.cloud.service.dao.ServiceOfferingDetailsDao; import com.cloud.storage.DiskOfferingVO; +import com.cloud.storage.Storage.StoragePoolType; import com.cloud.storage.dao.DiskOfferingDao; import com.cloud.test.IPRangeConfig; import com.cloud.user.Account; @@ -471,6 +472,11 @@ public String updateConfiguration(long userId, String name, String category, Str if (pool == null) { throw new InvalidParameterValueException("unable to find storage pool by id " + resourceId); } + if(name.equals(CapacityManager.StorageOverprovisioningFactor.key())) { + if(pool.getPoolType() != StoragePoolType.NetworkFilesystem && pool.getPoolType() != StoragePoolType.VMFS) { + throw new InvalidParameterValueException("Unable to update storage pool with id " + resourceId + ". Overprovision not supported for " + pool.getPoolType()); + } + } _storagePoolDetailsDao.addDetail(resourceId, name, value, true); break; From 280d167316d92a8d24d0917f8945b408b87677a8 Mon Sep 17 00:00:00 2001 From: Alex Brett Date: Wed, 4 Jun 2014 15:41:01 +0100 Subject: [PATCH 574/683] Fix for test_01_create_volume to use the correct volume name for KVM Signed-off-by: SrikanteswaraRao Talluri --- test/integration/smoke/test_volumes.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index d6db63f56d..2e41aa7b81 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -207,6 +207,10 @@ def test_01_create_volume(self): volume_name = "/dev/xvd" + chr(ord('a') + int(list_volume_response[0].deviceid)) self.debug(" Using XenServer volume_name: %s" % (volume_name)) ret = checkVolumeSize(ssh_handle=ssh,volume_name=volume_name,size_to_verify=vol_sz) + elif list_volume_response[0].hypervisor.lower() == "kvm": + volume_name = "/dev/vd" + chr(ord('a') + int(list_volume_response[0].deviceid)) + self.debug(" Using KVM volume_name: %s" % (volume_name)) + ret = checkVolumeSize(ssh_handle=ssh,volume_name=volume_name,size_to_verify=vol_sz) else: ret = checkVolumeSize(ssh_handle=ssh,size_to_verify=vol_sz) self.debug(" Volume Size Expected %s Actual :%s" %(vol_sz,ret[1])) From aa75b4388554a502b1073dd78050cd4b364a803e Mon Sep 17 00:00:00 2001 From: Harikrishna Patnala Date: Wed, 11 Jun 2014 16:33:00 +0530 Subject: [PATCH 575/683] CLOUDSTACK-6869: SSH Public key content is overridden by template's meta data when you create a instance --- .../src/com/cloud/template/TemplateManagerImpl.java | 1 + server/src/com/cloud/vm/UserVmManagerImpl.java | 11 ++++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java index 3ebb43aa15..dc076a8f1c 100755 --- a/server/src/com/cloud/template/TemplateManagerImpl.java +++ b/server/src/com/cloud/template/TemplateManagerImpl.java @@ -1656,6 +1656,7 @@ public VMTemplateVO createPrivateTemplateRecord(CreateTemplateCmd cmd, Account t } } if (cmd.getDetails() != null) { + details.remove("Encrypted.Password"); // new password will be generated during vm deployment from password enabled template details.putAll(cmd.getDetails()); } if (!details.isEmpty()) { diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 14d2eefcdc..e5216e3fc5 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -2901,6 +2901,12 @@ public UserVmVO doInTransaction(TransactionStatus status) throws InsufficientCap .getLimitCpuUse(), owner.getDomainId(), owner.getId(), offering.getId(), userData, hostName, diskOfferingId); vm.setUuid(uuidName); vm.setDynamicallyScalable(template.isDynamicallyScalable()); + + Map details = template.getDetails(); + if (details != null && !details.isEmpty()) { + vm.details.putAll(details); + } + if (sshPublicKey != null) { vm.setDetail("SSH.PublicKey", sshPublicKey); } @@ -2974,11 +2980,6 @@ public UserVmVO doInTransaction(TransactionStatus status) throws InsufficientCap } } - Map details = template.getDetails(); - if (details != null && !details.isEmpty()) { - vm.details.putAll(details); - } - _vmDao.persist(vm); if (customParameters != null && customParameters.size() > 0) { for (String key : customParameters.keySet()) { From 63ff5a7cbc3341809884e47796476d47ace03961 Mon Sep 17 00:00:00 2001 From: Wei Zhou Date: Wed, 11 Jun 2014 13:46:12 +0200 Subject: [PATCH 576/683] CLOUDSTACK-6893: fix enum ValueOf issue which causes systemvm fail to start --- .../hypervisor/kvm/resource/LibvirtComputingResource.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index b8f33e5f02..03aa8492ae 100755 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -3977,7 +3977,7 @@ public int compare(DiskTO arg0, DiskTO arg1) { if ((volumeObjectTO.getIopsWriteRate() != null) && (volumeObjectTO.getIopsWriteRate() > 0)) disk.setIopsWriteRate(volumeObjectTO.getIopsWriteRate()); if (volumeObjectTO.getCacheMode() != null) - disk.setCacheMode(DiskDef.diskCacheMode.valueOf(volumeObjectTO.getCacheMode().toString())); + disk.setCacheMode(DiskDef.diskCacheMode.valueOf(volumeObjectTO.getCacheMode().toString().toUpperCase())); } vm.getDevices().addDevice(disk); } @@ -4128,7 +4128,7 @@ protected synchronized String attachOrDetachDisk(Connect conn, diskdef.setIopsWriteRate(iopsWriteRate); if (cacheMode != null) { - diskdef.setCacheMode(DiskDef.diskCacheMode.valueOf(cacheMode)); + diskdef.setCacheMode(DiskDef.diskCacheMode.valueOf(cacheMode.toUpperCase())); } } From 81857d0577bbd9a7febef74a224e06516fadc39f Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 11 Jun 2014 10:50:14 -0700 Subject: [PATCH 577/683] CLOUDSTACK-6889: UI - create network offering - to reduce API call size, not pass any parameter whose value entered on UI happens to be the same as its default value at server-side. --- ui/scripts/configuration.js | 39 +++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js index 6a4aa42763..f56f4e2a2b 100644 --- a/ui/scripts/configuration.js +++ b/ui/scripts/configuration.js @@ -2324,9 +2324,9 @@ } if (args.$form.find('.form-item[rel=\"service.Firewall.isEnabled\"] input[type=checkbox]').is(':checked') == true) { - args.$form.find('.form-item[rel=\"egresspolicy\"]').css('display', 'inline-block'); + args.$form.find('.form-item[rel=\"egressdefaultpolicy\"]').css('display', 'inline-block'); } else { - args.$form.find('.form-item[rel=\"egresspolicy\"]').css('display', 'none'); + args.$form.find('.form-item[rel=\"egressdefaultpolicy\"]').css('display', 'none'); } //show LB Isolation dropdown only when (1)LB Service is checked (2)Service Provider is Netscaler OR F5 @@ -2749,6 +2749,7 @@ conservemode: { label: 'label.conserve.mode', isBoolean: true, + isChecked: true, docID: 'helpNetworkOfferingConserveMode' }, @@ -2773,7 +2774,7 @@ } }, - egresspolicy: { + egressdefaultpolicy: { label: 'label.default.egress.policy', isHidden: true, select: function(args) { @@ -2848,8 +2849,8 @@ inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = 'internal'; serviceCapabilityIndex++; } - } else if (value != '') { // normal data (serviceData.length ==1), e.g. "name", "displayText", "networkRate", "guestIpType", "lbType" (unwanted), "availability" (unwated when value is "Optional"), "egresspolicy", "state" (unwanted), "status" (unwanted), "allocationstate" (unwanted) - if (!(key == "lbType" || (key == "availability" && value == "Optional") || key == "state" || key == "status" || key == "allocationstate")) { + } else if (value != '') { // normal data (serviceData.length ==1), e.g. "name", "displayText", "networkRate", "guestIpType", "lbType" (unwanted), "availability" (unwated when value is "Optional"), "egressdefaultpolicy", "state" (unwanted), "status" (unwanted), "allocationstate" (unwanted) + if (!(key == "lbType" || (key == "availability" && value == "Optional") || key == "state" || key == "status" || key == "allocationstate" || key == "useVpc" )) { inputData[key] = value; } } @@ -2898,28 +2899,28 @@ if (inputData['guestIpType'] == "Shared") { //specifyVlan checkbox is disabled, so inputData won't include specifyVlan inputData['specifyVlan'] = true; //hardcode inputData['specifyVlan'] - inputData['specifyIpRanges'] = true; - inputData['isPersistent'] = false; + inputData['specifyIpRanges'] = true; + delete inputData.isPersistent; //if Persistent checkbox is unchecked, do not pass isPersistent parameter to API call since we need to keep API call's size as small as possible (p.s. isPersistent is defaulted as false at server-side) } else if (inputData['guestIpType'] == "Isolated") { //specifyVlan checkbox is shown - inputData['specifyIpRanges'] = false; - + //inputData['specifyIpRanges'] = false; + delete inputData.specifyIpRanges; //if specifyIpRanges should be false, do not pass specifyIpRanges parameter to API call since we need to keep API call's size as small as possible (p.s. specifyIpRanges is defaulted as false at server-side) + if (inputData['specifyVlan'] == 'on') { //specifyVlan checkbox is checked inputData['specifyVlan'] = true; - } else { //specifyVlan checkbox is unchecked - inputData['specifyVlan'] = false; - + } else { //specifyVlan checkbox is unchecked + delete inputData.specifyVlan; //if specifyVlan checkbox is unchecked, do not pass specifyVlan parameter to API call since we need to keep API call's size as small as possible (p.s. specifyVlan is defaulted as false at server-side) } if (inputData['isPersistent'] == 'on') { //It is a persistent network inputData['isPersistent'] = true; } else { //Isolated Network with Non-persistent network - inputData['isPersistent'] = false; + delete inputData.isPersistent; //if Persistent checkbox is unchecked, do not pass isPersistent parameter to API call since we need to keep API call's size as small as possible (p.s. isPersistent is defaulted as false at server-side) } } if (inputData['conservemode'] == 'on') { - inputData['conservemode'] = true; + delete inputData.conservemode; //if ConserveMode checkbox is checked, do not pass conservemode parameter to API call since we need to keep API call's size as small as possible (p.s. conservemode is defaulted as true at server-side) } else { inputData['conservemode'] = false; } @@ -2932,10 +2933,14 @@ serviceProviderIndex++; }); - if (args.$form.find('.form-item[rel=egresspolicy]').is(':visible')) { - inputData['egressdefaultpolicy'] = formData.egresspolicy === 'ALLOW' ? true : false; + if (args.$form.find('.form-item[rel=egressdefaultpolicy]').is(':visible')) { + if (formData.egressdefaultpolicy === 'ALLOW') { + delete inputData.egressdefaultpolicy; //do not pass egressdefaultpolicy to API call since we need to keep API call's size as small as possible (p.s. egressdefaultpolicy is defaulted as true at server-side) + } else { + inputData['egressdefaultpolicy'] = false; + } } else { - delete inputData.egresspolicy; + delete inputData.egressdefaultpolicy; } if (args.$form.find('.form-item[rel=serviceofferingid]').css("display") == "none") From 8a9092c3cd4e3c034f9f4d0a7491875dc080e9dc Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Wed, 11 Jun 2014 15:22:13 -0700 Subject: [PATCH 578/683] CLOUDSTACK-6895: 1. Populate firstclass entities as uuids in the context instead of dbids for performance. 2. Add ctxDetails in the ParamGenericValidationWorker to avoid warning for api validation 3. Add some missing events. 4. Correcting mapping for ResourceObjectType.NetworkACL and ResourceObjectType.NetworkACLItem --- api/src/com/cloud/event/EventTypes.java | 20 ++++++------ .../apache/cloudstack/api/ApiConstants.java | 1 + .../org/apache/cloudstack/api/BaseCmd.java | 26 +++++++++------ server/src/com/cloud/api/ApiServer.java | 8 +---- .../ParamGenericValidationWorker.java | 1 + .../api/dispatch/ParamProcessWorker.java | 2 +- .../src/com/cloud/event/ActionEventUtils.java | 32 ++++++++++++------- .../network/vpc/NetworkACLManagerImpl.java | 1 - .../network/vpc/NetworkACLServiceImpl.java | 1 + .../network/vpn/Site2SiteVpnManagerImpl.java | 5 +-- .../cloud/tags/TaggedResourceManagerImpl.java | 4 +-- 11 files changed, 58 insertions(+), 43 deletions(-) diff --git a/api/src/com/cloud/event/EventTypes.java b/api/src/com/cloud/event/EventTypes.java index a856bd908d..471b3f652f 100755 --- a/api/src/com/cloud/event/EventTypes.java +++ b/api/src/com/cloud/event/EventTypes.java @@ -20,12 +20,14 @@ import java.util.Map; import com.cloud.network.IpAddress; +import com.cloud.network.Site2SiteCustomerGateway; import com.cloud.network.Site2SiteVpnGateway; import com.cloud.network.rules.FirewallRule; import com.cloud.network.rules.HealthCheckPolicy; import com.cloud.network.rules.StickinessPolicy; import com.cloud.network.vpc.NetworkACL; import com.cloud.network.vpc.NetworkACLItem; +import com.cloud.network.Site2SiteVpnConnection; import com.cloud.server.ResourceTag; import com.cloud.vm.ConsoleProxy; import com.cloud.vm.SecondaryStorageVm; @@ -556,10 +558,10 @@ public class EventTypes { entityEventDetails.put(EVENT_FIREWALL_CLOSE, FirewallRule.class); // Load Balancers - entityEventDetails.put(EVENT_ASSIGN_TO_LOAD_BALANCER_RULE, LoadBalancer.class); - entityEventDetails.put(EVENT_REMOVE_FROM_LOAD_BALANCER_RULE, LoadBalancer.class); + entityEventDetails.put(EVENT_ASSIGN_TO_LOAD_BALANCER_RULE, FirewallRule.class); + entityEventDetails.put(EVENT_REMOVE_FROM_LOAD_BALANCER_RULE, FirewallRule.class); entityEventDetails.put(EVENT_LOAD_BALANCER_CREATE, LoadBalancer.class); - entityEventDetails.put(EVENT_LOAD_BALANCER_DELETE, LoadBalancer.class); + entityEventDetails.put(EVENT_LOAD_BALANCER_DELETE, FirewallRule.class); entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_CREATE, StickinessPolicy.class); entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_UPDATE, StickinessPolicy.class); entityEventDetails.put(EVENT_LB_STICKINESSPOLICY_DELETE, StickinessPolicy.class); @@ -707,12 +709,12 @@ public class EventTypes { entityEventDetails.put(EVENT_VPN_USER_REMOVE, RemoteAccessVpn.class); entityEventDetails.put(EVENT_S2S_VPN_GATEWAY_CREATE, Site2SiteVpnGateway.class); entityEventDetails.put(EVENT_S2S_VPN_GATEWAY_DELETE, Site2SiteVpnGateway.class); - entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_CREATE, RemoteAccessVpn.class); - entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_DELETE, RemoteAccessVpn.class); - entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_UPDATE, RemoteAccessVpn.class); - entityEventDetails.put(EVENT_S2S_VPN_CONNECTION_CREATE, RemoteAccessVpn.class); - entityEventDetails.put(EVENT_S2S_VPN_CONNECTION_DELETE, RemoteAccessVpn.class); - entityEventDetails.put(EVENT_S2S_VPN_CONNECTION_RESET, RemoteAccessVpn.class); + entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_CREATE, Site2SiteCustomerGateway.class); + entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_DELETE, Site2SiteCustomerGateway.class); + entityEventDetails.put(EVENT_S2S_VPN_CUSTOMER_GATEWAY_UPDATE, Site2SiteCustomerGateway.class); + entityEventDetails.put(EVENT_S2S_VPN_CONNECTION_CREATE, Site2SiteVpnConnection.class); + entityEventDetails.put(EVENT_S2S_VPN_CONNECTION_DELETE, Site2SiteVpnConnection.class); + entityEventDetails.put(EVENT_S2S_VPN_CONNECTION_RESET, Site2SiteVpnConnection.class); // Custom certificates entityEventDetails.put(EVENT_UPLOAD_CUSTOM_CERTIFICATE, "Certificate"); diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index 850e67e64b..5e9c973c13 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -58,6 +58,7 @@ public class ApiConstants { public static final String CPU_SPEED = "cpuspeed"; public static final String CREATED = "created"; public static final String CTX_ACCOUNT_ID = "ctxaccountid"; + public static final String CTX_DETAILS = "ctxDetails"; public static final String CTX_USER_ID = "ctxuserid"; public static final String CTXSTARTEVENTID = "ctxstarteventid"; public static final String CTX_START_EVENT_ID = "ctxStartEventId"; diff --git a/api/src/org/apache/cloudstack/api/BaseCmd.java b/api/src/org/apache/cloudstack/api/BaseCmd.java index ed7e983981..ac9a20866a 100644 --- a/api/src/org/apache/cloudstack/api/BaseCmd.java +++ b/api/src/org/apache/cloudstack/api/BaseCmd.java @@ -371,7 +371,7 @@ public boolean isDisplay(){ Object key = entry.getKey(); Class clz = Class.forName((String)key); if(Displayable.class.isAssignableFrom(clz)){ - final Object objVO = _entityMgr.findById(clz, getInternalId(entry.getValue())); + final Object objVO = getEntityVO(clz, entry.getValue()); isDisplay = ((Displayable) objVO).isDisplay(); } @@ -388,17 +388,25 @@ public boolean isDisplay(){ } - private static Long getInternalId(Object internalIdObj){ - Long internalId = null; + private Object getEntityVO(Class entityType, Object entityId){ - // In case its an async job the value would be a string because of json deserialization - if(internalIdObj instanceof String){ - internalId = Long.valueOf((String) internalIdObj); - }else if (internalIdObj instanceof Long){ - internalId = (Long) internalIdObj; + // entityId can be internal db id or UUID so accordingly call findbyId or findByUUID + + if (entityId instanceof Long){ + // Its internal db id - use findById + return _entityMgr.findById(entityType, (Long)entityId); + } else if(entityId instanceof String){ + try{ + // In case its an async job the internal db id would be a string because of json deserialization + Long internalId = Long.valueOf((String) entityId); + return _entityMgr.findById(entityType, internalId); + } catch (NumberFormatException e){ + // It is uuid - use findByUuid` + return _entityMgr.findByUuid(entityType, (String)entityId); + } } - return internalId; + return null; } } diff --git a/server/src/com/cloud/api/ApiServer.java b/server/src/com/cloud/api/ApiServer.java index 18eb4d96f3..4da271487a 100755 --- a/server/src/com/cloud/api/ApiServer.java +++ b/server/src/com/cloud/api/ApiServer.java @@ -617,7 +617,7 @@ private String queueCommand(final BaseCmd cmdObj, final Map para params.put("id", objectId.toString()); Class entityClass = EventTypes.getEntityClassForEvent(createCmd.getEventType()); if (entityClass != null) - ctx.putContextParameter(entityClass.getName(), objectId); + ctx.putContextParameter(entityClass.getName(), objectUuid); } else { // Extract the uuid before params are processed and id reflects internal db id objectUuid = params.get(ApiConstants.ID); @@ -639,12 +639,6 @@ private String queueCommand(final BaseCmd cmdObj, final Map para long startEventId = ctx.getStartEventId(); asyncCmd.setStartEventId(startEventId); - // Add the resource id in the call context, also add some other first class object ids (for now vm) if available. - // TODO - this should be done for all the uuids passed in the cmd - so should be moved where uuid to id conversion happens. - if (EventTypes.getEntityForEvent(asyncCmd.getEventType()) != null) { - ctx.putContextParameter(EventTypes.getEntityForEvent(asyncCmd.getEventType()), objectUuid); - } - // save the scheduled event final Long eventId = ActionEventUtils.onScheduledActionEvent((callerUserId == null) ? User.UID_SYSTEM : callerUserId, asyncCmd.getEntityOwnerId(), asyncCmd.getEventType(), diff --git a/server/src/com/cloud/api/dispatch/ParamGenericValidationWorker.java b/server/src/com/cloud/api/dispatch/ParamGenericValidationWorker.java index d6b0cf26bf..7aaafbb55f 100644 --- a/server/src/com/cloud/api/dispatch/ParamGenericValidationWorker.java +++ b/server/src/com/cloud/api/dispatch/ParamGenericValidationWorker.java @@ -63,6 +63,7 @@ public class ParamGenericValidationWorker implements DispatchWorker { defaultParamNames.add(ApiConstants.CTX_ACCOUNT_ID); defaultParamNames.add(ApiConstants.CTX_START_EVENT_ID); defaultParamNames.add(ApiConstants.CTX_USER_ID); + defaultParamNames.add(ApiConstants.CTX_DETAILS); defaultParamNames.add(ApiConstants.UUID); defaultParamNames.add(ApiConstants.ID); defaultParamNames.add("_"); diff --git a/server/src/com/cloud/api/dispatch/ParamProcessWorker.java b/server/src/com/cloud/api/dispatch/ParamProcessWorker.java index 0bb0220039..1592b93fe2 100644 --- a/server/src/com/cloud/api/dispatch/ParamProcessWorker.java +++ b/server/src/com/cloud/api/dispatch/ParamProcessWorker.java @@ -427,7 +427,7 @@ private Long translateUuidToInternalId(final String uuid, final Parameter annota } // Return on first non-null Id for the uuid entity if (internalId != null){ - CallContext.current().putContextParameter(entity.getName(), internalId); + CallContext.current().putContextParameter(entity.getName(), uuid); break; } } diff --git a/server/src/com/cloud/event/ActionEventUtils.java b/server/src/com/cloud/event/ActionEventUtils.java index 9e8e087e51..90d9b93941 100755 --- a/server/src/com/cloud/event/ActionEventUtils.java +++ b/server/src/com/cloud/event/ActionEventUtils.java @@ -206,8 +206,7 @@ private static void publishOnEventBus(long userId, long accountId, String eventC //Get uuid from id if(context.getContextParameter(entityClass.getName()) != null){ try { - final Object objVO = s_entityMgr.findByIdIncludingRemoved(entityClass, getInternalId(context.getContextParameter(entityClass.getName()))); - entityUuid = ((Identity)objVO).getUuid(); + entityUuid = getEntityUuid(entityClass, context.getContextParameter(entityClass.getName())); } catch (Exception e){ s_logger.debug("Caught exception while finding entityUUID, moving on"); } @@ -250,17 +249,27 @@ private static void publishOnEventBus(long userId, long accountId, String eventC } } - private static Long getInternalId(Object internalIdObj){ - Long internalId = null; + private static String getEntityUuid(Class entityType, Object entityId){ - // In case its an async job the value would be a string because of json deserialization - if(internalIdObj instanceof String){ - internalId = Long.valueOf((String) internalIdObj); - }else if (internalIdObj instanceof Long){ - internalId = (Long) internalIdObj; + // entityId can be internal db id or UUID so accordingly call findbyId or return uuid directly + + if (entityId instanceof Long){ + // Its internal db id - use findById + final Object objVO = s_entityMgr.findById(entityType, (Long)entityId); + return ((Identity)objVO).getUuid(); + } else if(entityId instanceof String){ + try{ + // In case its an async job the internal db id would be a string because of json deserialization + Long internalId = Long.valueOf((String) entityId); + final Object objVO = s_entityMgr.findById(entityType, internalId); + return ((Identity)objVO).getUuid(); + } catch (NumberFormatException e){ + // It is uuid - so return it + return (String)entityId; + } } - return internalId; + return null; } private static long getDomainId(long accountId) { @@ -282,8 +291,7 @@ private static void populateFirstClassEntities(Map eventDescript Object key = entry.getKey(); Class clz = Class.forName((String)key); if(clz instanceof Class && Identity.class.isAssignableFrom(clz)){ - final Object objVO = s_entityMgr.findById(clz, getInternalId(entry.getValue())); - String uuid = ((Identity) objVO).getUuid(); + String uuid = getEntityUuid(clz, entry.getValue()); eventDescription.put(ReflectUtil.getEntityName(clz), uuid); } } catch (Exception e){ diff --git a/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java b/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java index d808c3fbc9..de0465b8e7 100644 --- a/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java +++ b/server/src/com/cloud/network/vpc/NetworkACLManagerImpl.java @@ -271,7 +271,6 @@ public NetworkACLItem getNetworkACLItem(long ruleId) { } @Override - @ActionEvent(eventType = EventTypes.EVENT_NETWORK_ACL_DELETE, eventDescription = "revoking network acl", async = true) public boolean revokeNetworkACLItem(long ruleId) { NetworkACLItemVO rule = _networkACLItemDao.findById(ruleId); diff --git a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java index f871b8ef37..51bb71f7eb 100644 --- a/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java +++ b/server/src/com/cloud/network/vpc/NetworkACLServiceImpl.java @@ -207,6 +207,7 @@ public Pair, Integer> listNetworkACLs(ListNetworkACLL } @Override + @ActionEvent(eventType = EventTypes.EVENT_NETWORK_ACL_DELETE, eventDescription = "Deleting Network ACL List", async = true) public boolean deleteNetworkACL(long id) { Account caller = CallContext.current().getCallingAccount(); NetworkACL acl = _networkACLDao.findById(id); diff --git a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java index e6d0b1233f..8edab62554 100644 --- a/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java +++ b/server/src/com/cloud/network/vpn/Site2SiteVpnManagerImpl.java @@ -119,7 +119,7 @@ public boolean configure(String name, Map params) throws Configu } @Override - @ActionEvent(eventType = EventTypes.EVENT_S2S_VPN_GATEWAY_CREATE, eventDescription = "creating s2s vpn gateway", create = true) + @ActionEvent(eventType = EventTypes.EVENT_S2S_VPN_GATEWAY_CREATE, eventDescription = "creating s2s vpn gateway", async = true) public Site2SiteVpnGateway createVpnGateway(CreateVpnGatewayCmd cmd) { Account caller = CallContext.current().getCallingAccount(); Account owner = _accountMgr.getAccount(cmd.getEntityOwnerId()); @@ -311,6 +311,7 @@ public Site2SiteVpnConnection createVpnConnection(CreateVpnConnectionCmd cmd) th @Override @DB + @ActionEvent(eventType = EventTypes.EVENT_S2S_VPN_CONNECTION_CREATE, eventDescription = "starting s2s vpn connection", async = true) public Site2SiteVpnConnection startVpnConnection(long id) throws ResourceUnavailableException { Site2SiteVpnConnectionVO conn = _vpnConnectionDao.acquireInLockTable(id); if (conn == null) { @@ -387,7 +388,7 @@ protected void doDeleteVpnGateway(Site2SiteVpnGateway gw) { } @Override - @ActionEvent(eventType = EventTypes.EVENT_S2S_VPN_GATEWAY_DELETE, eventDescription = "deleting s2s vpn gateway", create = true) + @ActionEvent(eventType = EventTypes.EVENT_S2S_VPN_GATEWAY_DELETE, eventDescription = "deleting s2s vpn gateway", async = true) public boolean deleteVpnGateway(DeleteVpnGatewayCmd cmd) { CallContext.current().setEventDetails(" Id: " + cmd.getId()); Account caller = CallContext.current().getCallingAccount(); diff --git a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java index 2ccab0bf01..e6f317cd02 100644 --- a/server/src/com/cloud/tags/TaggedResourceManagerImpl.java +++ b/server/src/com/cloud/tags/TaggedResourceManagerImpl.java @@ -106,7 +106,7 @@ public class TaggedResourceManagerImpl extends ManagerBase implements TaggedReso s_typeMap.put(ResourceObjectType.Project, ProjectVO.class); s_typeMap.put(ResourceObjectType.Vpc, VpcVO.class); s_typeMap.put(ResourceObjectType.Nic, NicVO.class); - s_typeMap.put(ResourceObjectType.NetworkACL, NetworkACLVO.class); + s_typeMap.put(ResourceObjectType.NetworkACL, NetworkACLItemVO.class); s_typeMap.put(ResourceObjectType.StaticRoute, StaticRouteVO.class); s_typeMap.put(ResourceObjectType.VMSnapshot, VMSnapshotVO.class); s_typeMap.put(ResourceObjectType.RemoteAccessVpn, RemoteAccessVpnVO.class); @@ -114,7 +114,7 @@ public class TaggedResourceManagerImpl extends ManagerBase implements TaggedReso s_typeMap.put(ResourceObjectType.ServiceOffering, ServiceOfferingVO.class); s_typeMap.put(ResourceObjectType.Storage, StoragePoolVO.class); s_typeMap.put(ResourceObjectType.PrivateGateway, RemoteAccessVpnVO.class); - s_typeMap.put(ResourceObjectType.NetworkACLList, NetworkACLItemVO.class); + s_typeMap.put(ResourceObjectType.NetworkACLList, NetworkACLVO.class); s_typeMap.put(ResourceObjectType.VpnGateway, Site2SiteVpnGatewayVO.class); s_typeMap.put(ResourceObjectType.CustomerGateway, Site2SiteCustomerGatewayVO.class); s_typeMap.put(ResourceObjectType.VpnConnection, Site2SiteVpnConnectionVO.class); From 95b7330d5696aa150f1845b76c6021885c919aea Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 11 Jun 2014 15:37:28 -0700 Subject: [PATCH 579/683] CLOUDSTACK-6602: UI - VPC - createNetworkACL - fix a bug that caused wrong value being passed to action parameter in API call. --- ui/scripts/vpc.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/scripts/vpc.js b/ui/scripts/vpc.js index 020b9d70aa..83c5b834a0 100644 --- a/ui/scripts/vpc.js +++ b/ui/scripts/vpc.js @@ -83,11 +83,11 @@ select: function(args) { args.response.success({ data: [{ - name: 'label.allow', - description: 'label.allow' + name: 'Allow', + description: 'Allow' }, { - name: 'label.deny', - description: 'label.deny' + name: 'Deny', + description: 'Deny' }] }); } From 4c168bf9dbb6b7f3bc9b39fa6f270a4487496a16 Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Wed, 11 Jun 2014 18:34:50 -0700 Subject: [PATCH 580/683] Make CreateVpnGatewayCmd implements BaseAsyncCreateCmd Instead of BaseAsyncCmd. --- .../command/user/vpn/CreateVpnGatewayCmd.java | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java index fb933ba832..3043edcb04 100644 --- a/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/vpn/CreateVpnGatewayCmd.java @@ -16,25 +16,26 @@ // under the License. package org.apache.cloudstack.api.command.user.vpn; -import org.apache.log4j.Logger; - +import com.cloud.event.EventTypes; +import com.cloud.exception.ResourceAllocationException; +import com.cloud.network.Site2SiteVpnGateway; +import com.cloud.network.vpc.Vpc; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.ApiErrorCode; import org.apache.cloudstack.api.BaseAsyncCmd; +import org.apache.cloudstack.api.BaseAsyncCreateCmd; import org.apache.cloudstack.api.Parameter; import org.apache.cloudstack.api.ServerApiException; import org.apache.cloudstack.api.response.Site2SiteVpnGatewayResponse; import org.apache.cloudstack.api.response.VpcResponse; - -import com.cloud.event.EventTypes; -import com.cloud.network.Site2SiteVpnGateway; -import com.cloud.network.vpc.Vpc; +import org.apache.cloudstack.context.CallContext; +import org.apache.log4j.Logger; @APICommand(name = "createVpnGateway", description = "Creates site to site vpn local gateway", responseObject = Site2SiteVpnGatewayResponse.class, entityType = {Site2SiteVpnGateway.class}, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) -public class CreateVpnGatewayCmd extends BaseAsyncCmd { +public class CreateVpnGatewayCmd extends BaseAsyncCreateCmd { public static final Logger s_logger = Logger.getLogger(CreateVpnGatewayCmd.class.getName()); private static final String s_name = "createvpngatewayresponse"; @@ -101,8 +102,8 @@ public String getEventType() { @Override public void execute() { - Site2SiteVpnGateway result; - result = _s2sVpnService.createVpnGateway(this); + CallContext.current().setEventDetails("VPN gateway Id: " + getEntityId()); + Site2SiteVpnGateway result = _s2sVpnService.getVpnGateway(getEntityId()); if (result != null) { Site2SiteVpnGatewayResponse response = _responseGenerator.createSite2SiteVpnGatewayResponse(result); response.setResponseName(getCommandName()); @@ -121,4 +122,15 @@ public String getSyncObjType() { public Long getSyncObjId() { return getVpcId(); } + + @Override + public void create() throws ResourceAllocationException { + Site2SiteVpnGateway result = _s2sVpnService.createVpnGateway(this); + if (result != null) { + setEntityId(result.getId()); + setEntityUuid(result.getUuid()); + } else { + throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create VPN gateway"); + } + } } From 79364afcf59f8317aa211959aa2d7ac0959a8d53 Mon Sep 17 00:00:00 2001 From: Girish Shilamkar Date: Thu, 12 Jun 2014 12:20:05 +0530 Subject: [PATCH 581/683] CLOUDSTACK-6777: Enable testcase as it looks to be env issue --- test/integration/smoke/test_secondary_storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/smoke/test_secondary_storage.py b/test/integration/smoke/test_secondary_storage.py index e037593d8d..ac809562e0 100644 --- a/test/integration/smoke/test_secondary_storage.py +++ b/test/integration/smoke/test_secondary_storage.py @@ -160,7 +160,7 @@ def test_01_sys_vm_start(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"], BugId="CLOUDSTACK-6773, CLOUDSTACK-6777") + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"]) def test_02_sys_template_ready(self): """Test system templates are ready """ From 3ce28f447998ac35307887e3f51425e5539313df Mon Sep 17 00:00:00 2001 From: Milamber Date: Thu, 12 Jun 2014 07:43:50 +0100 Subject: [PATCH 582/683] Update L10N strings from Transifex to repo (before 4.4 next RC) and synchronize 4.4-forward with 4.4 branch --- .../classes/resources/messages.properties | 2 +- .../classes/resources/messages_ar.properties | 2 +- .../classes/resources/messages_ca.properties | 1 + .../resources/messages_de_DE.properties | 16 +- .../classes/resources/messages_es.properties | 303 +++- .../resources/messages_fr_FR.properties | 625 +++++++-- .../resources/messages_it_IT.properties | 4 +- .../resources/messages_ja_JP.properties | 1066 +++++++------- .../resources/messages_ko_KR.properties | 43 +- .../resources/messages_nb_NO.properties | 746 +++++++++- .../resources/messages_nl_NL.properties | 723 +++++++++- .../classes/resources/messages_pl.properties | 5 + .../resources/messages_pt_BR.properties | 299 +++- .../resources/messages_ru_RU.properties | 204 ++- .../resources/messages_zh_CN.properties | 1250 ++++++++--------- 15 files changed, 3920 insertions(+), 1369 deletions(-) diff --git a/client/WEB-INF/classes/resources/messages.properties b/client/WEB-INF/classes/resources/messages.properties index 94b5d7ce55..eff2c3ee81 100644 --- a/client/WEB-INF/classes/resources/messages.properties +++ b/client/WEB-INF/classes/resources/messages.properties @@ -1413,7 +1413,7 @@ label.addes.new.f5=Added new F5 label.f5.details=F5 details label.srx.details=SRX details label.palo.alto.details=Palo Alto details -label.added.nicira.nvp.controller=Added new Nicira NVP Controller\ +label.added.nicira.nvp.controller=Added new Nicira NVP Controller label.nicira.nvp.details=Nicira NVP details label.added.new.bigswitch.vns.controller=Added new BigSwitch VNS Controller label.bigswitch.vns.details=BigSwitch VNS details diff --git a/client/WEB-INF/classes/resources/messages_ar.properties b/client/WEB-INF/classes/resources/messages_ar.properties index bb3fe83643..4f65118820 100644 --- a/client/WEB-INF/classes/resources/messages_ar.properties +++ b/client/WEB-INF/classes/resources/messages_ar.properties @@ -83,6 +83,7 @@ label.endpoint=\u0646\u0642\u0637\u0629 \u0627\u0644\u0646\u0647\u0627\u064a\u06 label.error=\u062e\u0637\u0623 label.ESP.lifetime=\u0639\u0645\u0631 ESP (\u062b\u0627\u0646\u064a\u0629) label.ESP.policy=\u0633\u064a\u0627\u0633\u0629 ESP +label.failed=\u062e\u0637\u0623 label.filterBy=\u062a\u0635\u0641\u064a\u0629 \u062d\u0633\u0628 label.full.path=\u0645\u0633\u0627\u0631 \u0643\u0627\u0645\u0644 label.guest.type=\u0646\u0648\u0639 \u0627\u0644\u0636\u064a\u0641 @@ -262,7 +263,6 @@ message.step.3.desc= message.suspend.project=\u0647\u0644 \u0623\u0646\u062a \u0645\u062a\u0623\u0643\u062f \u0645\u0646 \u0623\u0646\u0643 \u062a\u0631\u064a\u062f \u0625\u064a\u0642\u0627\u0641 \u0647\u0630\u0627 \u0627\u0644\u0645\u0634\u0631\u0648\u0639 \u061f message.update.resource.count=\u0627\u0644\u0631\u062c\u0627\u0621 \u0627\u0644\u062a\u0623\u0643\u064a\u062f \u0628\u0623\u0646\u0643 \u062a\u0631\u063a\u0628 \u0628\u062a\u062d\u062f\u064a\u062b \u0645\u0635\u0627\u062f\u0631 \u0627\u0644\u062d\u0633\u0627\u0628\u0627\u062a \u0644\u0647\u0630\u0627 \u0627\u0644\u062d\u0633\u0627\u0628 message.vm.review.launch=\u064a\u0631\u062c\u0649 \u0645\u0631\u0627\u062c\u0639\u0629 \u0627\u0644\u0645\u0639\u0644\u0648\u0645\u0627\u062a \u0627\u0644\u062a\u0627\u0644\u064a\u0629 \u0648\u062a\u0623\u0643\u062f \u0623\u0646 \u0645\u062b\u0627\u0644\u0643 \u0627\u0644\u0625\u0641\u062a\u0631\u0627\u0636\u064a \u0635\u062d\u064a\u062d \u0642\u0628\u0644 \u0627\u0644\u0625\u0646\u0637\u0644\u0627\u0642 -message.zoneWizard.enable.local.storage=\u062a\u062d\u0630\u064a\u0631\\\: \u0625\u0630\u0627 \u0642\u0645\u062a \u0628\u062a\u0645\u0643\u064a\u0646 \u0627\u0644\u0630\u0627\u0643\u0631\u0629 \u0627\u0644\u0645\u062d\u0644\u064a\u0629 \u0644\u0647\u0630\u0627 \u0627\u0644\u0646\u0637\u0627\u0642 \u064a\u062c\u0628 \u0639\u0644\u064a\u0643 \u0639\u0645\u0644 \u0627\u0644\u0622\u062a\u064a \u060c \u0625\u0639\u062a\u0645\u0627\u062f\u0627 \u0639\u0644\u0649 \u0627\u0644\u0645\u0643\u0627\u0646 \u0627\u0644\u0630\u064a \u062a\u0631\u063a\u0628 \u0623\u0646 \u064a\u0646\u0637\u0644\u0642 \u0645\u0646\u0647 \u0646\u0638\u0627\u0645\u0643 \u0627\u0644\u0625\u0641\u062a\u0631\u0627\u0636\u064a \\\:

1.\u0625\u0630\u0627 \u0643\u0627\u0646 \u0646\u0638\u0627\u0645\u0643 \u0627\u0644\u0625\u0641\u062a\u0631\u0627\u0636\u064a \u064a\u062d\u062a\u0627\u062c \u0625\u0644\u0649 \u062a\u0634\u063a\u064a\u0644 \u0627\u0644\u0630\u0627\u0643\u0631\u0629 \u0627\u0644\u0625\u0628\u062a\u062f\u0627\u0626\u064a\u0629 notification.reboot.instance=\u0625\u0639\u0627\u062f\u0629 \u062a\u0634\u063a\u064a\u0644 \u0627\u0644\u0646\u0645\u0648\u0630\u062c notification.start.instance=\u0628\u062f\u0621 \u0627\u0644\u0646\u0645\u0648\u0630\u062c notification.stop.instance=\u0625\u064a\u0642\u0627\u0641 \u0627\u0644\u0646\u0645\u0648\u0630\u062c diff --git a/client/WEB-INF/classes/resources/messages_ca.properties b/client/WEB-INF/classes/resources/messages_ca.properties index 2d8e953419..3a9c77cd05 100644 --- a/client/WEB-INF/classes/resources/messages_ca.properties +++ b/client/WEB-INF/classes/resources/messages_ca.properties @@ -136,6 +136,7 @@ label.migrate.instance.to.host=Migrar inst\u00e0ncia a un altre amfitri\u00f3 "H label.migrate.instance.to.ps=Migrar inst\u00e0ncia a un altra emmagatzematge primari label.migrate.router.to=Migrar router a label.migrate.systemvm.to=Migrar MV de sistema a\: +label.mode=Mode label.move.down.row=Moure una fila cap a baix label.move.to.top=Moure a dalt label.move.up.row=Moure una fla cap a dalt diff --git a/client/WEB-INF/classes/resources/messages_de_DE.properties b/client/WEB-INF/classes/resources/messages_de_DE.properties index 2f164609d0..4d5852c3c4 100644 --- a/client/WEB-INF/classes/resources/messages_de_DE.properties +++ b/client/WEB-INF/classes/resources/messages_de_DE.properties @@ -224,8 +224,8 @@ label.add.system.service.offering=System-Service-Angebot hinzuf\u00fcgen label.add.template=Vorlage hinzuf\u00fcgen label.add.user=Benutzer hinzuf\u00fcgen label.add.vlan=VLAN hinzuf\u00fcgen -label.add.vxlan=VXLAN hinzuf\u00fcgen label.add.volume=Volume hinzuf\u00fcgen +label.add.vxlan=VXLAN hinzuf\u00fcgen label.add.zone=Zone hinzuf\u00fcgen label.admin.accounts=Administrator-Konten label.admin=Administrator @@ -274,6 +274,7 @@ label.close=Schliessen label.cloud.console=Cloud Management Konsole label.cloud.managed=Geleitet von cloud.com label.cluster=Cluster +label.clusters=Cluster label.cluster.type=Cluster-Typ label.code=Code label.configuration=Konfiguration @@ -341,6 +342,7 @@ label.full=Voll label.gateway=Schnittstelle label.general.alerts=Allgemeine Warnungen label.generating.url=Generieren der URL +label.gluster.volume=Volume label.go.step.2=Gehe zu Schritt 2 label.go.step.3=Weiter zu Schritt 3 label.go.step.4=Weiter mit Schritt 4 @@ -506,6 +508,7 @@ label.PING.dir=PING-Verzeichnis label.PING.storage.IP=IP des externen Speichers anpingen label.please.wait=Bitte warten label.pod=Pod +label.pods=Pod label.PreSetup=Voreinstellung label.primary.allocated=Zugewiesener Hauptspeicher label.primary.network=Hauptnetzwerk @@ -551,6 +554,7 @@ label.sent=Versendet label.server=Server label.service.offering=Service-Angebot label.session.expired=Sitzung abgelaufen +label.setup=Konfiguration label.shared=Gemeinsame label.SharedMountPoint=Geteilter Einh\u00e4ngepunkt label.show.ingress.rule=Zeige Regeln, die den Zutritt steuern @@ -622,9 +626,7 @@ label.virtual.network=Virtuelles Netzwerk label.vlan.id=VLAN ID label.vlan.range=VLAN Reichweite label.vlan=VLAN -label.vxlan.id=VXLAN ID -label.vxlan.range=VXLAN Reichweite -label.vxlan=VXLAN +label.vlan.vni.range=VLAN Reichweite label.vm.add=Instanz hinzuf\u00fcgen label.vm.destroy=Zerst\u00f6ren label.VMFS.datastore=VMFS Datenspeicher @@ -634,11 +636,16 @@ label.vmsnapshot.type=Typ label.vm.start=Start label.vm.stop=Stopp label.vms=VMs +label.vnet.id=VLAN ID +label.vnet=VLAN label.volume.limits=Volume Grenzen label.volume.name=Volume Name label.volumes=Volumes label.volume=Volume label.vpn=VPN +label.vxlan.id=VXLAN ID +label.vxlan.range=VXLAN Reichweite +label.vxlan=VXLAN label.waiting=Warten label.warn=Warnen label.wednesday=Mittwoch @@ -646,6 +653,7 @@ label.weekly=W\u00f6chentlich label.welcome=Willkommen label.yes=Ja label.zone.id=Zone ID +label.zones=Zone label.zone=Zone message.acquire.public.ip=Bitte w\u00e4hlen Sie eine Zone, von der Sie Ihre neue IP erlangen m\u00f6chten. message.action.cancel.maintenance=Ihr Host ist erfolgreich f\u00fcr die Wartung abgebrochen. Dieser Prozess kann ein paar Minuten dauern. diff --git a/client/WEB-INF/classes/resources/messages_es.properties b/client/WEB-INF/classes/resources/messages_es.properties index 6d6e4860cf..f2d754ebc0 100644 --- a/client/WEB-INF/classes/resources/messages_es.properties +++ b/client/WEB-INF/classes/resources/messages_es.properties @@ -15,22 +15,15 @@ # specific language governing permissions and limitations # under the License. -error.installWizard.message=Algo salio mal, debes ir para atr\u00e1s y corregir los error. -error.login=Su nombre de usuario / contrase\u00c3\u00b1a no coincide con nuestros registros. +changed.item.properties=Propiedades del elemento cambiados +error.installWizard.message=Algo salio mal, debes ir para atr\u00e1s y corregir los errores. +error.login=Su nombre de usuario / contrase\u00f1a no coinciden con nuestros registros. error.mgmt.server.inaccessible=El Servidor de Gesti\u00c3\u00b3n es inaccesible. Por favor, int\u00c3\u00a9ntelo de nuevo m\u00c3\u00a1s tarde. +error.password.not.match=Los campos de contrase\u00f1a no coinciden error.session.expired=Su sesi\u00c3\u00b3n ha caducado. error.unresolved.internet.name=El nombre de Internet no se puede resolver. extractable=extra\u00c3\u00adble force.delete.domain.warning=Advertencia\: Si elige esta opci\u00c3\u00b3n, la supresi\u00c3\u00b3n de todos los dominios secundarios y todas las cuentas asociadas y sus recursos. -force.delete=Fuerza Borrar -force.remove=Fuerza Retire -force.remove.host.warning=Advertencia\: Si elige esta opci\u00c3\u00b3n, CloudStack para detener la fuerza todas las m\u00c3\u00a1quinas virtuales en ejecuci\u00c3\u00b3n antes de retirar este host del cl\u00c3\u00baster. -force.stop=Grupo de Alto -force.stop.instance.warning=Advertencia\: Obligar a una parada en este caso deber\u00c3\u00ada ser su \u00c3\u00baltima opci\u00c3\u00b3n. Puede conducir a la p\u00c3\u00a9rdida de datos, as\u00c3\u00ad como un comportamiento incoherente del Estado de la m\u00c3\u00a1quina virtual. -ICMP.code=ICMP C\u00c3\u00b3digo -ICMP.type=Tipo ICMP -image.directory=Directorio de la imagen -inline=en l\u00c3\u00adnea force.delete=Forzar el borrado force.remove=Forzar el retiro force.remove.host.warning=Advertencia\: Si elige esta opci\u00f3n, CloudStack para detener la fuerza todas las m\u00e1quinas virtuales en ejecuci\u00f3n antes de retirar este host del cl\u00faster. @@ -42,6 +35,7 @@ image.directory=Directorio de im\u00e1genes inline=alineado label.about=Acerca de label.about.app=Acerca de CloudStack +label.accept.project.invitation=Aceptar invitaci\u00f3n al proyecto label.account=Cuenta label.account.id=ID de la cuenta label.account.name=Nombre de cuenta @@ -89,6 +83,7 @@ label.action.delete.load.balancer=Eliminar equilibrador de carga label.action.delete.load.balancer.processing=Eliminaci\u00c3\u00b3n del equilibrador de carga .... label.action.delete.network=Eliminar Red label.action.delete.network.processing=Eliminaci\u00c3\u00b3n de red .... +label.action.delete.nexusVswitch=Eliminar Nexus 1000v label.action.delete.pod=Eliminar Pod label.action.delete.pod.processing=Eliminar Pod .... label.action.delete.primary.storage=Almacenamiento primario Eliminar @@ -121,6 +116,7 @@ label.action.disable.account=Desactivar cuenta label.action.disable.account.processing=Deshabilitar cuenta .... label.action.disable.cluster=Deshabilitar cl\u00c3\u00baster label.action.disable.cluster.processing=Desactivaci\u00c3\u00b3n de Cluster Server .... +label.action.disable.nexusVswitch=Deshabilitar Nexus 1000v label.action.disable.pod=Deshabilitar Pod label.action.disable.pod.processing=Deshabilitar Pod .... label.action.disable.static.NAT=Deshabilitar NAT est\u00c3\u00a1tica @@ -155,6 +151,8 @@ label.action.enable.cluster=Habilitar cl\u00c3\u00baster label.action.enable.cluster.processing=Habilitar cl\u00c3\u00baster .... label.action.enable.maintenance.mode=Activar el modo de mantenimiento label.action.enable.maintenance.mode.processing=Habilitaci\u00c3\u00b3n del modo de mantenimiento .... +label.action.enable.nexusVswitch=Habilitar Nexus 1000v +label.action.enable.physical.network=Habilitar red f\u00edsica label.action.enable.pod=Habilitar Pod label.action.enable.pod.processing=Habilitaci\u00c3\u00b3n Pod .... label.action.enable.static.NAT=Habilitar NAT est\u00c3\u00a1tica @@ -167,6 +165,7 @@ label.action.force.reconnect=Fuerza Vuelva a conectar label.action.force.reconnect.processing=Reconectando .... label.action.generate.keys=Generar Claves label.action.generate.keys.processing=Generar claves .... +label.action.list.nexusVswitch=Listar Nexus 1000v label.action.lock.account=Bloqueo de cuenta label.action.lock.account.processing=Bloqueo de cuenta .... label.action.manage.cluster=gestionar racimo @@ -184,6 +183,8 @@ label.action.reboot.router=Reiniciar router label.action.reboot.systemvm.processing=reinicio del sistema VM .... label.action.reboot.systemvm=Reiniciar sistema VM label.action.recurring.snapshot=recurrente instant\u00c3\u00a1neas +label.action.register.iso=Registrar ISO +label.action.register.template=Registrar template label.action.release.ip=estreno IP label.action.release.ip.processing=Liberar IP .... label.action.remove.host.processing=Extracci\u00c3\u00b3n de host .... @@ -214,16 +215,24 @@ label.action.update.OS.preference=Actualizar OS Preferencia label.action.update.OS.preference.processing=Actualizaci\u00c3\u00b3n de sistema operativo preferencia .... label.action.update.resource.count=Actualizaci\u00c3\u00b3n de recursos Conde label.action.update.resource.count.processing=Actualizaci\u00c3\u00b3n de Conde de recursos .... +label.activate.project=Activar Proyecto label.active.sessions=Sesiones activas label.add.account=A\u00c3\u00b1adir cuenta +label.add.accounts=Agregar cuentas +label.add.accounts.to=Agregar cuentas a +label.add.ACL=Agregar ACL label.add=Agregar +label.add.by=A\u00f1adir por label.add.by.cidr=A\u00c3\u00b1adir Por CIDR label.add.by.group=A\u00c3\u00b1adir Por el Grupo de label.add.cluster=A\u00c3\u00b1adir Grupo label.add.direct.iprange=A\u00c3\u00b1adir Direct IP Gama label.add.disk.offering=A\u00c3\u00b1adir disco Ofrenda label.add.domain=Agregar dominio +label.add.egress.rule=Agregar regla de salida +label.add.F5.device=Agregar dispositivo F5 label.add.firewall=Agregar Servidor de seguridad +label.add.guest.network=Agregar red de invitado label.add.host=Agregar host label.adding=Agregar label.adding.cluster=Adici\u00c3\u00b3n de cl\u00c3\u00baster @@ -238,29 +247,48 @@ label.add.ip.range=A\u00c3\u00b1adir Rango de IP label.additional.networks=Redes adicional label.add.load.balancer=A\u00c3\u00b1adir equilibrador de carga label.add.more=A\u00c3\u00b1adir m\u00c3\u00a1s +label.add.netScaler.device=Agregar dispositivo Netscaler label.add.network=Agregar sitios de red label.add.network.device=A\u00c3\u00b1adir dispositivo de red +label.add.new.gateway=Agregar nuevo gateway +label.add.new.SRX=Agregar nuevo SRX label.add.pod=A\u00c3\u00b1adir Pod +label.add.port.forwarding.rule=Agregar regla port forwarding label.add.primary.storage=A\u00c3\u00b1adir Almacenamiento primario +label.add.route=Agregar ruta +label.add.rule=Agregar regla label.add.secondary.storage=A\u00c3\u00b1adir secundaria almacenamiento label.add.security.group=Agregar grupo de seguridad label.add.service.offering=A\u00c3\u00b1adir Servicio de Oferta +label.add.SRX.device=Agregar dispositivo SRX +label.add.static.nat.rule=Agregar regla NAT est\u00e1tica +label.add.static.route=Agregar ruta est\u00e1tica label.add.template=A\u00c3\u00b1adir plantilla label.add.to.group=Agregar al grupo label.add.user=Agregar usuario label.add.vlan=A\u00c3\u00b1adir VLAN -label.add.vxlan=A\u00c3\u00b1adir VXLAN +label.add.vm=Agregar VM +label.add.vms=Agregar VMs +label.add.vms.to.lb=Agregar VM(s) a el balanceador de carga label.add.volume=A\u00c3\u00b1adir volumen +label.add.vpc=Agregar VPC +label.add.VPN.gateway=Agregar Gateway VPN +label.add.vpn.user=Agregar usuario VPN +label.add.vxlan=A\u00c3\u00b1adir VXLAN label.add.zone=A\u00c3\u00b1adir Zona label.admin.accounts=Administrador de Cuentas label.admin=Admin label.advanced=Avanzado label.advanced.mode=Modo avanzado label.advanced.search=B\u00c3\u00basqueda Avanzada +label.agent.password=Password de Agente +label.agent.username=Usuario de Agente +label.agree=De-acuerdo label.alert=Alerta label.algorithm=Algoritmo label.allocated=Asignados label.api.key=clave de API +label.apply=Aplicar label.app.name=CloudStack label.archive.alerts=Archivar alertas label.archive.events=Archivar sucesos @@ -273,6 +301,7 @@ label.availability.zone=Disponibilidad de la zona label.available=Disponible label.available.public.ips=Disponible direcciones IP p\u00c3\u00bablicas label.back=Volver +label.bandwidth=Ancho de banda label.basic.mode=Modo b\u00c3\u00a1sico label.bootable=arranque label.broadcast.domain.type=Tipo de dominio de difusi\u00c3\u00b3n @@ -297,26 +326,46 @@ label.by.type=Por tipo label.by.zone=Por Zona label.cancel=Cancelar label.certificate=Certificado +label.change.value=Cambiar valor label.character=Personaje +label.checksum=suma de verificaci\u00f3n MD5 label.cidr.account=CIDR o de cuenta / Grupo de Seguridad label.cidr=CIDR label.cidr.list=fuente CIDR +label.CIDR.list=Lista CIDR +label.clean.up=Limpiar +label.clear.list=Limpiar lista label.close=Cerrar label.cloud.console=Cloud Management Console label.cloud.managed=Cloud.com Gestionado label.cluster=Grupo +label.cluster.name=Nombre del Cluster +label.clusters=Cluster label.cluster.type=Tipo de Cluster Server label.clvm=CLVM label.code=C\u00c3\u00b3digo +label.community=Comunidad +label.compute.and.storage=Computo y Almacenamiento label.configuration=Configuraci\u00c3\u00b3n +label.configure=Configurar +label.configure.vpc=Configurar VPC label.confirmation=Confirmation +label.confirm.password=Confirmar password label.congratulations=Felicitaciones \! +label.console.proxy=Consola proxy +label.continue.basic.install=Continuar con la instalaci\u00f3n b\u00e1sica +label.continue=Continuar +label.corrections.saved=Correcciones guardadas label.cpu.allocated=CPU asignado label.cpu.allocated.for.VMs=CPU asignado para m\u00c3\u00a1quinas virtuales label.CPU.cap=CPU Cap label.cpu=CPU +label.cpu.mhz=CPU (En MHz) label.cpu.utilized=CPU Utilizado label.created=creaci\u00c3\u00b3n +label.create.project=Crear proyecto +label.create.template=Crear template +label.create.VPN.connection=Crear Conexi\u00f3n VPN label.cross.zones=Cruz Zonas label.custom.disk.iops=IOPS personalizadas label.custom.disk.size=Personal Disk Size @@ -325,19 +374,29 @@ label.data.disk.offering=Datos Disco Offering label.date=Fecha label.day.of.month=D\u00c3\u00ada del mes label.day.of.week=d\u00c3\u00ada de la semana +label.decline.invitation=Declinar invitaci\u00f3n label.default.use=Usar por defecto label.delete.alerts=Eliminar alertas label.delete=Eliminar label.delete.events=Eliminar sucesos +label.delete.F5=Borrar F5 +label.delete.gateway=borrar gateway +label.delete.project=Eliminar proyecto +label.delete.VPN.connection=eliminar conexi\u00f3n VPN +label.delete.VPN.gateway=eliminar Gateway VPN +label.delete.vpn.user=Eliminar usuario VPN label.deleting.failed=No se pudo eliminar label.deleting.processing=Eliminar .... label.description=Descripci\u00c3\u00b3n +label.destination.zone=Zona de destino label.destroy=Destroy label.detaching.disk=Extracci\u00c3\u00b3n del disco label.details=Detalles label.device.id=ID de dispositivo +label.devices=Dispositivos label.DHCP.server.type=Tipo de servidor DHCP label.disabled=personas de movilidad reducida +label.disable.vpn=Deshabilitar VPN label.disabling.vpn.access=Desactivaci\u00c3\u00b3n de VPN de acceso label.disk.allocated=disco asignado label.disk.iops.max=IOPS m\u00e1ximas @@ -351,24 +410,41 @@ label.disk.volume=volumen de disco label.display.text=visualizaci\u00c3\u00b3n de texto label.dns.1=DNS 1 label.dns.2=DNS 2 +label.dns=DNS label.domain.admin=Administrador de dominio label.domain=dominio label.domain.id=ID de dominio label.domain.name=Nombre de dominio label.domain.suffix=DNS sufijo de dominio (es decir, xyz.com) +label.done=Listo label.double.quotes.are.not.allowed=comillas dobles no se permite label.download.progress=Progreso de la descarga label.edit=Editar +label.edit.lb.rule=Edite regla LB +label.edit.network.details=Editar detalles de red +label.edit.project.details=Editar detalles de proyecto +label.edit.tags=Editar etiquetas +label.edit.traffic.type=Edite el tipo de trafico +label.edit.vpc=Editar VPC label.egress.default.policy=Directiva de salida predeterminada +label.egress.rule=Regla de salida +label.egress.rules=Reglas de salida label.email=correo electr\u00c3\u00b3nico +label.enable.swift=Habilitar Swift +label.enable.vpn=Habilitar VPN label.enabling.vpn.access=Habilitaci\u00c3\u00b3n de Acceso VPN label.enabling.vpn=Habilitaci\u00c3\u00b3n VPN label.endpoint.or.operation=punto final o de Operaci\u00c3\u00b3n label.end.port=Puerto final +label.enter.token=Ingrese token label.error.code=C\u00c3\u00b3digo de error label.error=Error +label.ESP.encryption=Encriptaci\u00f3n ESP +label.ESP.hash=Hash +label.ESP.policy=Pol\u00edtica ESP label.esx.host=ESX / ESXi anfitri\u00c3\u00b3n label.example=Ejemplo +label.f5=F5 label.failed=Error label.featured=destacados label.firewall=Servidor de seguridad @@ -376,9 +452,11 @@ label.first.name=Nombre label.format=Formato label.friday=Viernes label.full=completo +label.full.path=Path completo label.gateway=puerta de enlace label.general.alerts=General de Alertas label.generating.url=Generar URL +label.gluster.volume=Volumen label.go.step.2=Ir al paso 2 label.go.step.3=Ir al paso 3 label.go.step.4=Ir al paso 4 @@ -390,32 +468,48 @@ label.guest.gateway=Habitaci\u00c3\u00b3n Gateway label.guest.ip=Habitaci\u00c3\u00b3n direcci\u00c3\u00b3n IP label.guest.ip.range=Habitaci\u00c3\u00b3n Rango de IP label.guest.netmask=Habitaci\u00c3\u00b3n m\u00c3\u00a1scara de red +label.guest.networks=Redes de invitado label.ha.enabled=HA Activado label.help=Ayuda label.hide.ingress.rule=Ocultar el art\u00c3\u00adculo ingreso +label.hints=Sugerencias label.host.alerts=Host Alertas label.host=Ej\u00c3\u00a9rcitos +label.host.MAC=MAC del Host label.host.name=nombre de host label.hosts=Ej\u00c3\u00a9rcitos +label.host.tags=Etiquetas de Host label.hourly=por hora label.hypervisor=Hypervisor label.hypervisors=Hipervisores label.hypervisor.snapshot.reserve=Reserva de instant\u00e1neas de hipervisores label.hypervisor.type=Tipo Hypervisor label.id=ID +label.IKE.DH=IKE DH +label.IKE.encryption=Encriptaci\u00f3n IKE +label.IKE.hash=Hash IKE +label.IKE.policy=Pol\u00edtica IKE label.info=Informaci\u00c3\u00b3n label.ingress.rule=ingreso Regla label.initiated.by=Iniciado por +label.installWizard.addSecondaryStorageIntro.subtitle=Que es almacenamiento secundario? +label.installWizard.addSecondaryStorageIntro.title=A\u00f1adir almacenamiento secundario +label.installWizard.addZone.title=Agregar zona label.installWizard.click.launch=Click en el bot\u00f3n de lanzar. +label.installWizard.title=Hola y Bienvenido a CloudStack&\#8482 label.instance=Instancia label.instance.limits=Instancia L\u00c3\u00admites label.instance.name=Nombre de instancia label.instances=Instancias label.internal.dns.1=DNS interno una label.internal.dns.2=DNS interno 2 +label.internal.name=Nombre interno label.interval.type=Tipo de intervalo +label.introduction.to.cloudstack=Introducci\u00f3n a CloudStack&\#8482 label.invalid.integer=entero no v\u00c3\u00a1lido label.invalid.number=N\u00c3\u00bamero no v\u00c3\u00a1lido +label.invitations=Invitaciones +label.invited.accounts=Cuentas de invitado label.invite=Invitar label.invite.to=Invitar a . label.ip.address=Direcci\u00c3\u00b3n IP @@ -425,35 +519,50 @@ label.ip=IP label.ip.limits=IP p\u00c3\u00bablica L\u00c3\u00admites label.ip.or.fqdn=IP o FQDN label.ip.range=Rango de IP +label.IPsec.preshared.key=IPsec Preshared-Key label.ips=IP label.iscsi=iSCSI label.is.default=Es por defecto label.iso.boot=ISO de arranque label.iso=ISO +label.isolation.method=M\u00e9todo de aislamiento label.isolation.mode=modo de aislamiento label.is.redundant.router=redundante label.is.shared=es compartido label.is.system=es el Sistema +label.item.listing=Listando art\u00edculos label.keep=Mantener +label.keyboard.type=Tipo de teclado +label.key=Llave +label.label=Etiqueta label.lang.chinese=Chino (simplificado) label.lang.english=Ingl\u00c3\u00a9s label.lang.japanese=japon\u00c3\u00a9s label.lang.spanish=Espa\u00c3\u00b1ol label.last.disconnected=\u00c3\u009altima Desconectado label.last.name=Apellido +label.latest.events=\u00daltimos eventos label.launch=Lanzar label.launch.vm=Lanzar maquina virtual label.level=Nivel label.load.balancer=equilibrador de carga +label.load.balancing=Balanceador de Carga +label.load.balancing.policies=Pol\u00edticas del balanceador de carga label.loading=Carga label.local=local +label.local.storage=Almacenamiento Local label.login=Login label.logout=Cerrar sesi\u00c3\u00b3n label.lun=LUN +label.LUN.number=LUN \# label.manage=Administrar +label.manage.resources=Administrar los Recursos label.maximum=m\u00c3\u00a1ximo +label.max.templates=Plantillas M\u00e1ximos label.max.volumes=Maxima cantidad de Volumes +label.may.continue=Ahora puede continuar. label.memory.allocated=memoria asignada +label.memory.mb=Memoria (En MB) label.memory=memoria (en MB) label.memory.total=Total de memoria label.memory.used=memoria usada @@ -472,6 +581,7 @@ label.menu.events=Eventos label.menu.featured.isos=destacados ISO label.menu.featured.templates=destacados plantillas label.menu.global.settings=Configuraci\u00c3\u00b3n global +label.menu.infrastructure=Infraestructura label.menu.instances=Instancias label.menu.ipaddresses=Direcciones IP label.menu.isos=ISO @@ -499,21 +609,31 @@ label.migrate.instance.to=Migraci\u00c3\u00b3n de ejemplo para label.migrate.instance.to.ps=Migrar instancia a otro primary storage. label.migrate.router.to=Router para migrar label.migrate.systemvm.to=Migrar m\u00c3\u00a1quina virtual del sistema para +label.migrate.to.host=Migrar a host +label.migrate.to.storage=Migrar a almacenamiento +label.migrate.volume=Migrar volumen a otro almacenamiento primario label.minimum=M\u00c3\u00adnimo label.minute.past.hour=Minuto (s) despu\u00c3\u00a9s de la hora +label.mode=modo label.monday=lunes label.monthly=mensual label.more.templates=plantillas \= M\u00c3\u00a1s +label.move.down.row=Mover abajo una fila +label.move.to.top=Mover al principio +label.move.up.row=Mover una fila arriba label.my.account=Mi Cuenta +label.my.network=Mi red label.my.templates=Mis plantillas label.name=Nombre label.name.optional=Nombre (Opcional) +label.nat.port.range=Rango puertos NAT label.netmask=m\u00c3\u00a1scara de red label.network.desc=Red de Desc label.network.device=De dispositivos de red label.network.device.type=Tipo de red de dispositivos label.network.domain=red de dominio label.network.id=ID de red +label.networking.and.security=Redes y Seguridad label.network.name=Nombre de red label.network.offering.display.text=Red ofrece visualizaci\u00c3\u00b3n de texto label.network.offering.id=Red ofrece ID @@ -527,14 +647,17 @@ label.network.type=Tipo de red label.network.write=Escribir en la red label.new=Nuevo label.new.password=Nueva contrase\u00c3\u00b1a +label.new.project=Nuevo Proyecto label.new.vm=Nueva maquina virtual label.next=Siguiente label.nfs=NFS label.nfs.server=servidor NFS label.nfs.storage=NFS Almacenamiento +label.nic.adapter.type=Tipo de adaptador NIC label.nics=NIC label.no.actions=No Acciones disponibles label.no.alerts=No alertas recientes +label.no.data=No hay informaci\u00f3n que mostrar label.no.errors=No recientes errores label.no.isos=No ISOs disponibles label.no.items=No art\u00c3\u00adculos disponibles @@ -543,11 +666,18 @@ label.no=No label.no.security.groups=No hay grupos disponibles de Seguridad label.not.found=No se ha encontrado label.no.thanks=No, gracias +label.number.of.clusters=N\u00famero de Clusters +label.number.of.hosts=N\u00famero de Hosts +label.number.of.pods=N\u00famero de Pods +label.number.of.system.vms=N\u00famero de VM\\'s del Systema +label.number.of.virtual.routers=N\u00famero de Routers Virtuales +label.number.of.zones=N\u00famero de Zonas label.num.cpu.cores=n\u00c3\u00bamero de n\u00c3\u00bacleos de CPU label.numretries=N\u00c3\u00bamero de reintentos label.ocfs2=OCFS2 label.offer.ha=Oferta HA label.optional=Opcional +label.order=Ordenar label.os.preference=OS Preferencia label.os.type=tipo de Sistema Operativo label.owned.public.ips=propiedad p\u00c3\u00bablica Direcciones IP @@ -562,6 +692,8 @@ label.PING.dir=PING Directorio label.PING.storage.IP=PING almacenamiento IP label.please.wait=Por favor espere label.pod=Pod +label.pods=Pod +label.port.forwarding.policies=Pol\u00edticas de Port forwarding label.port.forwarding=Port Forwarding label.port.range=rango de puertos label.PreSetup=PreSetup @@ -570,30 +702,47 @@ label.previous=Previo label.primary.allocated=primaria asignado de almacenamiento label.primary.network=Red Primaria label.primary.storage=Almacenamiento Primario +label.primary.storage.count=Pool Almacenamiento Primario label.primary.used=Primaria Almacenado +label.private.Gateway=Gateway Privado label.private.interface=Interfaz privada label.private.ip=direcci\u00c3\u00b3n IP privada label.private.ip.range=IP privada Gama label.private.ips=direcciones IP privadas label.privatekey=PKCS\#8 la clave privada +label.private.network=Red privada label.private.port=Puerto privado label.private.zone=Zona Privada +label.project.dashboard=Tablero del Proyecto +label.project.id=ID proyecto label.project.name=Nombre del Proyecto +label.project=proyecto +label.projects=proyectos label.protocol=Protocolo label.public.interface=interfaz p\u00c3\u00bablica label.public.ip=direcci\u00c3\u00b3n IP p\u00c3\u00bablica label.public.ips=direcciones IP p\u00c3\u00bablicas +label.public.network=Red P\u00fablica label.public.port=Puerto P\u00c3\u00bablico label.public=P\u00c3\u00bablica label.public.zone=Zona P\u00c3\u00bablica label.Pxe.server.type=Tipo de servidor Pxe +label.quickview=Vista R\u00e1pida label.reboot=Reiniciar label.recent.errors=recientes errores label.redundant.router=enrutador redundante label.refresh=Actualizar label.related=relacionados label.remind.later=Recordar mas tarde +label.remove.ACL=Remover ACL +label.remove.egress.rule=Eliminar regla de salida label.remove.from.load.balancer=ejemplo Eliminaci\u00c3\u00b3n de equilibrador de carga +label.remove.ingress.rule=Eliminar regla de entrada +label.remove.pf=Remover regla de port forwarding +label.remove.rule=Remover regla +label.remove.static.nat.rule=Remover regla NAT est\u00e1tica +label.remove.static.route=Remover ruta est\u00e1tica +label.remove.vpc=Remover VPC label.removing=Borrando. label.removing.user=Eliminar usuario label.required=Requerido @@ -601,35 +750,55 @@ label.reserved.system.ip=Reservados sistema de PI label.resource.limits=L\u00c3\u00admites de Recursos label.resource=Recursos label.resources=Recursos +label.resource.state=Estado del recurso +label.restart.network=Reiniciar red +label.restart.required=Reiniciado requerido +label.restart.vpc=Reiniciar VPC +label.restore=Restaurar label.role=Papel label.root.disk.offering=Root Disco Offering +label.round.robin=Round-robin label.routing=Enrutamiento +label.rules=Reglas label.running.vms=Ejecuci\u00c3\u00b3n de m\u00c3\u00a1quinas virtuales +label.s3.access_key=Llave de Acceso +label.s3.connection_timeout=Tiempo de conexi\u00f3n agotado label.s3.nfs.path=Ruta NFS S3 label.s3.nfs.server=Servidor NFS S3 label.s3.secret_key=clave secreta +label.s3.use_https=Use HTTPS label.saturday=s\u00c3\u00a1bado +label.save.and.continue=Guardar y continuar label.save=Guardar label.saving.processing=ahorro .... label.scope=Alcance label.search=Buscar label.secondary.storage=Almacenamiento secundario +label.secondary.storage.count=Pools del Almacenamiento Secundario label.secondary.used=Secundaria Almacenado label.secret.key=clave secreta label.security.group=Grupo de Seguridad label.security.group.name=Nombre de grupo de seguridad label.security.groups.enabled=Los grupos de seguridad habilitado label.security.groups=Grupos de seguridad +label.select.a.template=Seleccione un template label.select.a.zone=Seleccione una zona. +label.select.instance=Seleccione instancia +label.select.iso.or.template=Seleccione una ISO o template +label.select=Seleccione +label.select-view=Seleccione vista +label.select.vm.for.static.nat=Seleccione VM para NAT est\u00e1tica label.sent=Enviados label.server=Servidor label.service.offering=Oferta de Servicio label.service.state=Estado del servicio label.session.expired=Session Caducado +label.setup=Configuraci\u00c3\u00b3n label.shared=compartidas label.SharedMountPoint=SharedMountPoint label.show.ingress.rule=Mostrar la regla del ingreso label.size=Tama\u00c3\u00b1o +label.skip.guide=He utilizado CloudStack anteriormente, saltar esta gu\u00eda label.snapshot=Instant\u00c3\u00a1nea label.snapshot.limits=instant\u00c3\u00a1neas L\u00c3\u00admites label.snapshot.name=Nombre de instant\u00c3\u00a1neas @@ -637,12 +806,15 @@ label.snapshot.schedule=Lista de instant\u00c3\u00a1neas label.snapshot.s=Instant\u00c3\u00a1nea (s) label.snapshots=instant\u00c3\u00a1neas label.sockets=Sockets +label.source=Fuente label.source.nat=NAT Fuente label.specify.vlan=Especifique VLAN label.specify.vxlan=Especifique VXLAN label.SR.name = SR Nombre de etiqueta +label.srx=SRX label.start.port=Iniciar Puerto label.state=Estado +label.static.nat.enabled=NAT est\u00e1tica habilitada label.static.nat=NAT est\u00c3\u00a1tica label.static.nat.to=est\u00c3\u00a1tico NAT para label.statistics=Estad\u00c3\u00adsticas @@ -657,8 +829,15 @@ label.step.4=Paso 4 label.step.4.title=Paso 4\: Red label.step.5=Paso 5 label.step.5.title=Paso 5\: Revisi\u00c3\u00b3n +label.sticky.cookie-name=Nombre de Cookie label.sticky.domain=dominio +label.sticky.expire=Expira +label.sticky.indirect=Indirecto +label.sticky.length=Longitud label.sticky.mode=modo +label.sticky.nocache=No Cache +label.sticky.prefix=Prefijo +label.sticky.tablesize=Tama\u00f1o de tabla label.stop=Detener label.stopped.vms=Detenido m\u00c3\u00a1quinas virtuales label.storage=Almacenamiento @@ -668,6 +847,7 @@ label.submit=Enviar label.submitted.by=[Enviado por\: ] label.succeeded=Sucesor label.sunday=domingo +label.suspend.project=Suspender Proyecto label.switch.type=Cambiar el tipo label.system.capacity=Capacidad de todo el sistema label.system.vm=Sistema de VM @@ -685,12 +865,20 @@ label.theme.grey=Personal - Gris label.theme.lightblue=Personal - Azul label.thursday=Jueves label.timeout.in.second = Tiempo de espera (segundos) +label.timeout=Tiempo de espera label.time=Tiempo label.time.zone=Zona horaria label.timezone=Zona horaria +label.token=Token label.total.cpu=Total CPU label.total.CPU=Total CPU +label.total.hosts=Total de Hosts +label.total.memory=Memoria Total +label.total.of.ip=Total de direcciones IP +label.total.of.vm=Total de VM +label.total.storage=Almacenamiento Total label.total.vms=Total de m\u00c3\u00a1quinas virtuales +label.traffic.label=Etiqueta de trafico label.traffic.type=Tipo de Tr\u00c3\u00a1fico label.tuesday=martes label.type.id=Tipo de identificaci\u00c3\u00b3n @@ -698,7 +886,10 @@ label.type=Tipo label.unavailable=no disponible label.unlimited=Unlimited label.untagged=sin etiquetar +label.update.project.resources=Actualizar recurso del proyecto label.updating=Actualizar +label.upload=Subir +label.upload.volume=Subir volumen label.url=URL label.usage.interface=Interfaz de uso label.used=Usado @@ -706,55 +897,75 @@ label.username=Nombre de usuario label.users=usuario label.user=Usuario label.value=Valor +label.vcdcname=nombre label.vcenter.cluster=vCenter cl\u00c3\u00baster label.vcenter.datacenter=vCenter de centros de datos label.vcenter.datastore=vCenter almac\u00c3\u00a9n de datos label.vcenter.host=vCenter anfitri\u00c3\u00b3n label.vcenter.password=vCenter Contrase\u00c3\u00b1a label.vcenter.username=vCenter Nombre de usuario +label.vcipaddress=Direcci\u00f3n IP de vCenter label.version=Versi\u00c3\u00b3n +label.view.all=Ver todo +label.view.more=Ver mas label.view.secondary.ips=Ver las IP secundarias label.virtual.appliances=Virtual Appliances label.virtual.appliance=Virtual Appliance label.virtual.machines=Maquinas virtuales label.virtual.network=Red Virtual +label.virtual.routers=Routers Virtuales label.vlan.id=ID de VLAN label.vlan.range=VLAN Gama label.vlan=VLAN -label.vxlan.id=ID de VXLAN -label.vxlan.range=VXLAN Gama -label.vxlan=VXLAN +label.vlan.vni.range=VLAN Gama label.vm.add=A\u00c3\u00b1adir Instancia label.vm.destroy=Destroy label.VMFS.datastore=VMFS de datos tienda label.vmfs=VMFS +label.vm.name=Nombre VM label.vm.reboot=Reiniciar label.vmsnapshot.type=Tipo label.vm.start=Inicio +label.vm.state=Estado de VM\\'s label.vm.stop=Detener label.vms=VM +label.vnet.id=ID de VLAN +label.vnet=VLAN label.volgroup=Volume Group label.volume.limits=l\u00c3\u00admites de volumen label.volume.name=Nombre de Volumen label.volumes=Vol\u00c3\u00bamenes label.volume=Volumen +label.vpc.id=ID VPC +label.vpc=VPC +label.VPN.connection=Conexi\u00f3n VPN +label.VPN.gateway=Gateway VPN label.vpn=VPN +label.vsmctrlvlanid=Control VLAN ID label.vsphere.managed=Gestionado \= vSphere +label.vxlan.id=ID de VXLAN +label.vxlan.range=VXLAN Gama +label.vxlan=VXLAN label.waiting=Esperando label.warn=Advertir label.wednesday=mi\u00c3\u00a9rcoles label.weekly=Semanal label.welcome=Bienvenido label.welcome.cloud.console=Bienvenido a la consola de administraci\u00c3\u00b3n +label.what.is.cloudstack=Que es CloudStack&\#8482? label.yes=S\u00c3\u00ad +label.zone.details=Detalles de Zona label.zone.id=Zona de identificaci\u00c3\u00b3n label.zone.step.1.title=Paso 1\: Seleccione una red label.zone.step.2.title=Paso 2\: A\u00c3\u00b1adir una zona label.zone.step.3.title=Paso 3\: A\u00c3\u00b1adir una vaina label.zone.step.4.title=Paso 4\: A\u00c3\u00b1adir un rango de IP +label.zones=Zona label.zone.wide=Zona para todo el label.zone=Zona managed.state=Estado logr\u00c3\u00b3 +message.acquire.new.ip=Por favor confirme que usted quiere adquirir una nueva IP para esta red +message.acquire.new.ip.vpc=Por favor confirme que usted desea adquirir una nueva IP para este VPC. message.acquire.public.ip=Por favor seleccione una zona de la que desea adquirir su nueva IP. message.action.cancel.maintenance.mode=Por favor, confirme que desea cancelar el mantenimiento message.action.cancel.maintenance=Su acogida ha sido cancelado con \u00c3\u00a9xito para el mantenimiento. Este proceso puede tardar hasta varios minutos. @@ -767,6 +978,7 @@ message.action.delete.ingress.rule=Por favor, confirme que desea eliminar la reg message.action.delete.ISO.for.all.zones=La ISO es utilizado por todas las zonas. Por favor, confirme que desea eliminar de todas las zonas. message.action.delete.ISO=Por favor, confirme que desea eliminar la norma ISO message.action.delete.network=Por favor, confirme que desea eliminar de la red +message.action.delete.nexusVswitch=Porfavor confirme que usted quiere eliminar el Nexus 1000v message.action.delete.pod=Por favor, confirme que desea eliminar de la vaina message.action.delete.primary.storage=Por favor, confirme que desea eliminar el almacenamiento primario message.action.delete.secondary.storage=Por favor, confirme que desea eliminar de almacenamiento secundario @@ -780,11 +992,17 @@ message.action.delete.zone=Por favor, confirme que desea eliminar la zona message.action.destroy.instance=Por favor, confirme que desea destruir ejemplo message.action.destroy.systemvm=Por favor, confirme que desea destruir la m\u00c3\u00a1quina virtual del sistema. message.action.disable.cluster=Por favor, confirme que desea desactivar este grupo. +message.action.disable.nexusVswitch=Por favor confirme que usted quiere deshabilitar este nexus 1000v +message.action.disable.physical.network=Por favor confirmar que usted quiere deshabilitar esta red f\u00edsica message.action.disable.pod=Por favor, confirme que desea desactivar esta vaina. message.action.disable.static.NAT=Por favor, confirme que desea desactivar NAT est\u00c3\u00a1tica message.action.disable.zone=Por favor, confirme que desea desactivar esta zona. +message.action.download.iso=Por favor confirme que usted quiere descargar esta ISO +message.action.download.template=Por favor confirme que usted quiere descargar este template message.action.enable.cluster=Por favor, confirme que desea habilitar este grupo. message.action.enable.maintenance=Su acogida ha sido preparado con \u00c3\u00a9xito para el mantenimiento. Este proceso puede tardar hasta varios minutos o m\u00c3\u00a1s dependiendo de c\u00c3\u00b3mo las m\u00c3\u00a1quinas virtuales se encuentran actualmente en este servidor. +message.action.enable.nexusVswitch=por favor confirme que usted quiere habilitar este nexus 1000v +message.action.enable.physical.network=Por favor confirmar que usted quiere habilitar esta red f\u00edsica message.action.enable.pod=Por favor, confirme que desea habilitar esta vaina. message.action.enable.zone=Por favor, confirme que desea habilitar esta zona. message.action.force.reconnect=Por favor, confirme que desea forzar una reconexi\u00c3\u00b3n para el anfitri\u00c3\u00b3n @@ -804,9 +1022,11 @@ message.action.stop.instance=Por favor, confirme que desea detener la instancia message.action.stop.systemvm=Por favor, confirme que desea detener sistema VM message.action.take.snapshot=Por favor, confirme que desea tomar instant\u00c3\u00a1neas message.action.unmanage.cluster=Por favor, confirme que desea unmanage del cl\u00c3\u00baster. +message.activate.project=Usted esta seguro que quiere activar este proyecto? message.add.cluster=A\u00c3\u00b1adir un hipervisor administradas por cl\u00c3\u00baster de zona , la consola de message.add.cluster.zone=A\u00c3\u00b1adir un hipervisor administradas por cl\u00c3\u00baster de zona message.add.disk.offering=Por favor, especifique los par\u00c3\u00a1metros siguientes para agregar un nuevo disco que ofrece +message.add.domain=por favor especifique el subdominio que usted quiere crear bajo este dominio message.add.firewall=A\u00c3\u00b1adir un servidor de seguridad a la zona message.add.host=Por favor, especifique los par\u00c3\u00a1metros siguientes para agregar un nuevo host message.add.ip.range=A\u00c3\u00b1adir un rango de IP a la red p\u00c3\u00bablica en la zona @@ -822,6 +1042,7 @@ message.add.secondary.storage=A\u00c3\u00b1adir un nuevo almacenamiento de z message.add.service.offering=Por favor, rellene los siguientes datos para agregar una nueva oferta de servicio. message.add.template=Por favor ingrese los siguientes datos para crear la nueva plantilla message.add.volume=Por favor, rellene los siguientes datos para agregar un nuevo volumen. +message.add.VPN.gateway=Por favor confirme que usted quiere agregar un VPN Gateway message.advanced.mode.desc=Seleccione este modelo de red si desea habilitar soporte VLAN. Este modelo de red proporciona la m\u00c3\u00a1xima flexibilidad al permitir a los administradores proporcionar ofertas personalizadas de la red como el suministro de firewall, VPN, o el apoyo equilibrador de carga, as\u00c3\u00ad como permitir vs directa de redes virtuales. message.advanced.security.group=Elija esta opci\u00c3\u00b3n si desea utilizar grupos de seguridad para proporcionar resultados de aislamiento VM. message.advanced.virtual=Elija esta opci\u00c3\u00b3n si desea utilizar VLAN toda la zona para proporcionar el aislamiento VM invitado. @@ -831,40 +1052,67 @@ message.attach.iso.confirm=Por favor, confirme que desea conectar el ISO a la in message.attach.volume=Por favor, rellene los siguientes datos para fijar un nuevo volumen. Si est\u00c3\u00a1 colocando un volumen de disco a una m\u00c3\u00a1quina virtual de Windows basado, usted tendr\u00c3\u00a1 que reiniciar la instancia para ver el disco adjunto. message.basic.mode.desc=Seleccione este modelo de red si lo haces * no * desea habilitar cualquier soporte VLAN. Todas las instancias virtuales creados en virtud de este modelo de red se le asignar\u00c3\u00a1 una direcci\u00c3\u00b3n IP directamente desde la red y grupos de seguridad se utilizan para proporcionar la seguridad y la segregaci\u00c3\u00b3n. message.change.offering.confirm=Por favor, confirme que desea cambiar la oferta de servicio de la instancia virtual. +message.change.password=Por favor cambie la contrase\u00f1a. +message.confirm.delete.F5=Por favor confirme que ud quiere eliminar el F5 +message.confirm.join.project=por favor confirme que usted desea unirse a este proyecto. message.copy.iso.confirm=Por favor, confirme que desea copiar el ISO a message.copy.template=Copia plantilla XXX de la zona +message.create.template=Esta seguro que quiere crear un template? message.create.template.vm=Crear VM de la plantilla message.create.template.volume=Por favor, especifique la siguiente informaci\u00c3\u00b3n antes de crear una plantilla de su volumen de disco\: . Creaci\u00c3\u00b3n de la plantilla puede oscilar entre varios minutos m\u00c3\u00a1s, dependiendo del tama\u00c3\u00b1o del volumen. message.delete.account=Por favor, confirme que desea eliminar esta cuenta. +message.delete.gateway=Por favor confirme que usted quiere eliminar este gateway +message.delete.project=Esta seguro que quiere eliminar este proyecto? +message.delete.user=Por favor confirme que usted quiere eliminar este usuario +message.delete.VPN.connection=Por favor confirme que usted quiere eliminar la conexi\u00f3n VPN +message.delete.VPN.gateway=Por favor confirme que usted quiere eliminar este VPN Gateway message.detach.iso.confirm=Por favor, confirme que desea quitar el ISO de la instancia virtual message.disable.snapshot.policy=Ha desactivado su pol\u00c3\u00adtica instant\u00c3\u00a1nea actual. +message.disable.user=Por favor confirme que usted quiere deshabilitar este usuario message.disable.vpn.access=Por favor, confirme que desea desactivar VPN de acceso. +message.disable.vpn=Esta seguro que usted quiere deshabilitar la VPN? +message.download.volume.confirm=Por favor confirme que desea descargar este volumen message.download.volume=Por favor, haga clic 00000 para bajar el volumen +message.edit.account=Editar ("-1" indica que no hay limite a la cantidad de recursos creados) message.edit.confirm=Por favor confirmar los cambios antes de hacer clic en "Guardar" message.edit.limits=Por favor, especifique los l\u00c3\u00admites de los recursos siguientes. A "-1" indica que no hay l\u00c3\u00admite a la cantidad de los recursos de crear. message.enable.account=Por favor, confirme que desea habilitar esta cuenta. message.enabled.vpn.ip.sec=La clave pre-compartida IPSec es message.enabled.vpn=Su acceso a la VPN est\u00c3\u00a1 habilitado y se puede acceder a trav\u00c3\u00a9s de la IP +message.enable.user=Por favor confirme que usted quiere habilitar este usuario message.enable.vpn.access=VPN \= est\u00c3\u00a1 desactivado para esta direcci\u00c3\u00b3n IP. \u00c2\u00bfTe gustar\u00c3\u00ada que permitan el acceso VPN? message.enable.vpn=VPN de acceso actualmente no est\u00c3\u00a1 habilitado. Por favor, haga clic aqu\u00c3\u00ad para habilitar VPN. +message.generate.keys=Por favor confirme que usted quiere generar nueva llave para este usuario. message.installWizard.click.retry=Haz click en el bot\u00f3n para re-intentar el lanzamiento de la instancia. +message.installWizard.copy.whatIsSecondaryStorage=El almacenamiento secundario est\u00e1 asociado a una zona, y almacena lo siguiente\:
  • Plantillas - im\u00e1genes del sistema operativo que se pueden utilizar para arrancar VMs, pueden incluir informaci\u00f3n de configuraci\u00f3n adicional, como las aplicaciones instaladas
  • Im\u00e1genes ISO - im\u00e1genes del Sistema Operativo que pueden ser boteables o no boteables
  • Disco instant\u00e1neas de vol\u00famenes - copias de datos guardadas de VM que se pueden utilizar para la recuperaci\u00f3n de datos o para crear nuevas plantillas
+message.installWizard.now.building=Ahora construyendo su nube... message.installWizard.tooltip.addCluster.name=Nombre del Cluster. Puede ser alfanum\u00e9rico .Este no es usado por CloudStack message.installWizard.tooltip.addHost.hostname=El nombre DNS o direcci\u00f3n IP del host +message.installWizard.tooltip.addHost.password=Este es el password para el nombre de usuario mencionado anteriormente (Desde su Instalaci\u00f3n XenServer) message.installWizard.tooltip.addHost.username=Generalmente root message.installWizard.tooltip.addPod.name=Nombre del POD +message.installWizard.tooltip.addPod.reservedSystemEndIp=Este es el rango de direcciones IP en la red privada que la CloudStack utiliza para administrar las VMs del Almacenamiento Secundario y consola Proxy.\nEstas direcciones IP se han tomado de la misma subred que los servidores inform\u00e1ticos. message.installWizard.tooltip.addPod.reservedSystemGateway=El gateway ,puerta de enlace, para los host en ese pod. +message.installWizard.tooltip.addPod.reservedSystemNetmask=La m\u00e1scara de red en uso en la subred de los hu\u00e9spedes ser\u00e1. +message.installWizard.tooltip.addPod.reservedSystemStartIp=Este es el rango de direcciones IP en la red privada que la CloudStack utiliza para administrar las VMs del Almacenamiento Secundario y consola Proxy.\nEstas direcciones IP se han tomado de la misma subred que los servidores inform\u00e1ticos. message.installWizard.tooltip.addPrimaryStorage.name=\ Nombre para el storage +message.installWizard.tooltip.addPrimaryStorage.path=(para NFS) En NFS este es el directorio exportado desde el servidor. Directorio (por SharedMountPoint). Con KVM este es el directorio de cada host en donde se monta el almacenamiento primario. Por ejemplo, "/mnt/primary". +message.installWizard.tooltip.addPrimaryStorage.server=(para NFS, iSCSI, o PreSetup) La direcci\u00f3n IP o el nombre DNS del dispositivo de almacenamiento. message.installWizard.tooltip.addSecondaryStorage.nfsServer=Direcci\u00f3n IP del servidor NFS que contiene el secondary storage +message.installWizard.tooltip.addSecondaryStorage.path=El path exportado, ubicado en el servidor especificado anteriormente message.installWizard.tooltip.addZone.name=Nombre de la zona. message.installWizard.tooltip.configureGuestTraffic.description=Una breve descripci\u00f3n para su red. message.installWizard.tooltip.configureGuestTraffic.guestGateway=El gatway, puerta de enlace, que las maquinas guest deben usar. +message.installWizard.tooltip.configureGuestTraffic.guestNetmask=La m\u00e1scara de red en uso en la subred que los clientes deben utilizar message.installWizard.tooltip.configureGuestTraffic.name=Nombre de su RED +message.ip.address.changed=Su direcci\u00f3n IP pudo haber cambiado. Le gustar\u00eda actualizar el listado? Tenga en cuenta que en este caso el panel de detalles se cerrar\u00e1. message.lock.account=Por favor, confirme que desea bloquear esta cuenta. Al bloquear la cuenta, todos los usuarios de esta cuenta ya no ser\u00c3\u00a1 capaz de gestionar sus recursos de la nube. Los recursos existentes todav\u00c3\u00ada se puede acceder. message.migrate.instance.confirm=Por favor, confirme el anfitri\u00c3\u00b3n desea migrar la instancia virtual. message.migrate.instance.to.host=Por favor, confirmar que desea mover la instancia a otro host. message.migrate.instance.to.ps=Por favor, confirmar que desea mover la instancia a otro primary storage. message.migrate.router.confirm=Por favor, confirme el hu\u00c3\u00a9sped que desea migrar el router\: message.migrate.systemvm.confirm=Por favor, confirme el hu\u00c3\u00a9sped que desea migrar la m\u00c3\u00a1quina virtual de sistema\: +message.migrate.volume=Por favor confirme que usted quiere migrar el volumen a otro almacenamiento primario message.no.network.support.configuration.not.true=Usted no tiene ninguna zona que ha permitido a grupo de seguridad. Por lo tanto, no hay funciones de red adicionales. Por favor, contin\u00c3\u00bae con el paso 5. message.no.network.support=El hipervisor seleccionado, vSphere, no tiene funciones de red adicionales. Por favor, contin\u00c3\u00bae con el paso 5. message.number.clusters=

\# de Grupos

@@ -872,12 +1120,20 @@ message.number.hosts=

\# de Anfitri\u00c3\u00b3n

message.number.pods=

\# de Las vainas

message.number.storage=

\# de Almacenamiento primario

message.number.zones=

\# de Zonas

+message.please.proceed=Por favor proceda a el siguiente paso. +message.please.select.networks=Por favor seleccione la red para su maquina virtual. +message.remove.vpc=Por favor confirme que usted quiere eliminar el VPC message.remove.vpn.access=Por favor, confirme que desea eliminar el acceso VPN desde el siguiente usuario message.restart.mgmt.server=Por favor, reinicie el servidor de administraci\u00c3\u00b3n (s) para la nueva configuraci\u00c3\u00b3n surta efecto. +message.restart.vpc=Por favor confirme que usted quiere reiniciar el VPC message.security.group.usage=(Uso pulse Ctrl para seleccionar todos los grupos de seguridad se aplica) +message.select.instance=Por favor seleccione una instancia +message.select.iso=Por favor seleccione un ISO para su nueva instancia virtual message.select.item=Por favor, seleccionar un item . +message.select.template=Por favor seleccione un template para su nueva instancia virtual message.setup.successful=La configuraci\u00f3n de la cloud finalizo satisfactoriamente. message.snapshot.schedule=Puede horarios de configuraci\u00c3\u00b3n recurrente instant\u00c3\u00a1neas mediante la selecci\u00c3\u00b3n de las opciones disponibles a continuaci\u00c3\u00b3n y la aplicaci\u00c3\u00b3n de su preferencia pol\u00c3\u00adtica +message.specify.url=Por favor especifique la URL message.step.1.continue=Por favor seleccione una plantilla o ISO para continuar message.step.1.desc=Por favor seleccione una plantilla para la instancia virtual. Tambi\u00c3\u00a9n puede optar por seleccionar una plantilla en blanco desde el que puede ser una imagen ISO instalado en. message.step.2.continue=Por favor seleccione una oferta de servicio para continuar @@ -887,6 +1143,7 @@ message.step.3.desc= message.step.4.continue=Por favor seleccione al menos una red social para continuar message.step.4.desc=Por favor, seleccione la red primaria que la instancia virtual estar\u00c3\u00a1 conectado. message.update.os.preference=Por favor seleccione un sistema operativo de preferencia para este equipo. Todas las instancias virtuales con preferencias similares ser\u00c3\u00a1n los primeros asignados a este equipo antes de elegir otro. +message.update.resource.count=Por favor confirme que usted quiere actualizar los conteos para esta cuenta message.update.ssl=Por favor, env\u00c3\u00ade una nueva X.509 compatible con certificado SSL que se actualizar\u00c3\u00a1 a cada instancia virtual de la consola del servidor proxy\: message.validate.invalid.characters=Se han hallado caracteres no v\u00e1lidos. Por favor, corr\u00edjalos. message.virtual.network.desc=Una red dedicada virtualizados para su cuenta. El dominio de difusi\u00c3\u00b3n est\u00c3\u00a1 contenida dentro de una VLAN y todos los acceso a la red p\u00c3\u00bablica se encamina a cabo por un router virtual. @@ -896,6 +1153,22 @@ message.zone.step.1.desc=Por favor seleccione un modelo de red para su zona. mode=modo network.rate=Tasa de Red side.by.side=Juntos +state.Accepted=Aceptado +state.Active=Activo state.Allocated=Asignados +state.BackedUp=Respaldado +state.BackingUp=Realizando Backup +state.Completed=Completado +state.Creating=Creando +state.Declined=Declinado state.Disabled=personas de movilidad reducida +state.enabled=Habilitado +state.Enabled=Habilitado state.Error=Error +state.Migrating=Migrando +state.Pending=pendiente +state.ready=Listo +state.Ready=Listo +state.Starting=Iniciando +state.Stopping=Parando +state.Suspended=Suspendido diff --git a/client/WEB-INF/classes/resources/messages_fr_FR.properties b/client/WEB-INF/classes/resources/messages_fr_FR.properties index 42335bc7b4..004187f69b 100644 --- a/client/WEB-INF/classes/resources/messages_fr_FR.properties +++ b/client/WEB-INF/classes/resources/messages_fr_FR.properties @@ -18,6 +18,7 @@ changed.item.properties=Propri\u00e9t\u00e9s de l\\'\u00e9l\u00e9ment modifi\u00e9es confirm.enable.s3=Remplir les informations suivantes pour activer le support de stockage secondaire S3 confirm.enable.swift=Remplir les informations suivantes pour activer Swift +error.could.not.change.your.password.because.ldap.is.enabled=Erreur\: impossible de changer votre mot de passe car le mode LDAP est activ\u00e9. error.could.not.enable.zone=Impossible d\\'activer la zone error.installWizard.message=Une erreur s\\'est produite ; vous pouvez retourner en arri\u00e8re et corriger les erreurs error.invalid.username.password=Utilisateur ou mot de passe invalide @@ -42,15 +43,20 @@ ICMP.type=Type ICMP image.directory=R\u00e9pertoire d\\'images inline=Align\u00e9 instances.actions.reboot.label=Red\u00e9marrer l\\'instance +label.about.app=A propos de CloudStack +label.about=A propos de label.accept.project.invitation=Accepter l\\'invitation au projet label.account.and.security.group=Compte, groupe de s\u00e9curit\u00e9 label.account=Compte label.account.id=ID du Compte +label.account.lower=compte label.account.name=Nom du compte label.accounts=Comptes label.account.specific=Sp\u00e9cifique au compte +label.acl=ACL label.acquire.new.ip=Acqu\u00e9rir une nouvelle adresse IP label.acquire.new.secondary.ip=Acqu\u00e9rir une nouvelle IP secondaire +label.action=Action label.action.attach.disk.processing=Rattachement du Disque... label.action.attach.disk=Rattacher un disque label.action.attach.iso.processing=Rattachement de l\\'image ISO @@ -77,7 +83,7 @@ label.action.delete.account=Supprimer un compte label.action.delete.cluster.processing=Suppression du Cluster... label.action.delete.cluster=Supprimer le Cluster label.action.delete.disk.offering.processing=Suppression de l\\'offre Disque... -label.action.delete.disk.offering=Supprimer l\\'offre Disque +label.action.delete.disk.offering=Supprimer Offre Disque label.action.delete.domain.processing=Suppression du domaine... label.action.delete.domain=Supprimer le domaine label.action.delete.firewall.processing=Suppression du Pare-feu... @@ -97,17 +103,17 @@ label.action.delete.nic=Supprimer carte NIC label.action.delete.physical.network=Supprimer le r\u00e9seau physique label.action.delete.pod.processing=Suppression du pod... label.action.delete.pod=Supprimer le Pod -label.action.delete.primary.storage.processing=Suppression du stockage principal... -label.action.delete.primary.storage=Supprimer le stockage principal +label.action.delete.primary.storage.processing=Suppression du stockage primaire... +label.action.delete.primary.storage=Supprimer le stockage primaire label.action.delete.secondary.storage.processing=Suppression du stockage secondaire... label.action.delete.secondary.storage=Supprimer le stockage secondaire label.action.delete.security.group.processing=Suppression du groupe de s\u00e9curit\u00e9 label.action.delete.security.group=Supprimer le groupe de s\u00e9curit\u00e9 label.action.delete.service.offering.processing=Suppression de l\\'offre de service... -label.action.delete.service.offering=Supprimer l\\'offre de service +label.action.delete.service.offering=Supprimer Offre Service label.action.delete.snapshot.processing=Suppression de l\\'instantan\u00e9... label.action.delete.snapshot=Supprimer l\\'instantan\u00e9 -label.action.delete.system.service.offering=Supprimer l\\'offre syst\u00e8me +label.action.delete.system.service.offering=Supprimer Offre de Service Syst\u00e8me label.action.delete.template.processing=Suppression du mod\u00e8le... label.action.delete.template=Supprimer le mod\u00e8le label.action.delete.user.processing=Suppression de l\\'utilisateur... @@ -119,7 +125,7 @@ label.action.delete.zone=Supprimer la zone label.action.destroy.instance.processing=Suppression de l\\'instance... label.action.destroy.instance=Supprimer l\\'instance label.action.destroy.systemvm.processing=Suppression de la VM Syst\u00e8me... -label.action.destroy.systemvm=Supprimer la VM Syst\u00e8me +label.action.destroy.systemvm=Supprimer VM Syst\u00e8me label.action.detach.disk=D\u00e9tacher le disque label.action.detach.disk.processing=D\u00e9tachement du disque... label.action.detach.iso=D\u00e9tacher l\\'image ISO @@ -143,19 +149,19 @@ label.action.download.template=T\u00e9l\u00e9charger un mod\u00e8le label.action.download.volume.processing=T\u00e9l\u00e9chargement du volume... label.action.download.volume=T\u00e9l\u00e9charger un volume label.action.edit.account=Modifier le Compte -label.action.edit.disk.offering=Modifier l\\'offre de disque +label.action.edit.disk.offering=Modifier Offre Disque label.action.edit.domain=Modifier le domaine label.action.edit.global.setting=Modifier la configuration globale label.action.edit.host=Modifier l\\'h\u00f4te label.action.edit.instance=Modifier l\\'instance label.action.edit.ISO=Modifier l\\'image ISO label.action.edit.network=Modifier le r\u00e9seau -label.action.edit.network.offering=Modifier l\\'offre de service r\u00e9seau +label.action.edit.network.offering=Modifier Offre R\u00e9seau label.action.edit.network.processing=Modification du R\u00e9seau... label.action.edit.pod=Modifier le pod -label.action.edit.primary.storage=Modifier le stockage principal +label.action.edit.primary.storage=Modifier le stockage primaire label.action.edit.resource.limits=Modifier les limites de ressources -label.action.edit.service.offering=Modifier l\\'offre de service +label.action.edit.service.offering=Modifier Offre Service label.action.edit.template=Modifier le mod\u00e8le label.action.edit.user=Modifier l\\'utilisateur label.action.edit.zone=Modifier la zone @@ -175,6 +181,8 @@ label.action.enable.user=Activer l\\'utilisateur label.action.enable.user.processing=Activation de l\\'utilisateur... label.action.enable.zone=Activer la zone label.action.enable.zone.processing=Activation de la zone... +label.action.expunge.instance.processing=Purge de l\\'Instance... +label.action.expunge.instance=Purger Instance label.action.force.reconnect=Forcer la reconnexion label.action.force.reconnect.processing=Reconnexion en cours... label.action.generate.keys=G\u00e9n\u00e9rer les cl\u00e9s @@ -188,14 +196,14 @@ label.action.migrate.instance=Migrer l\\'instance label.action.migrate.instance.processing=Migration de l\\'instance... label.action.migrate.router=Migration routeur label.action.migrate.router.processing=Migration routeur en cours... -label.action.migrate.systemvm=Migration VM syst\u00e8me +label.action.migrate.systemvm=Migrer VM Syst\u00e8me label.action.migrate.systemvm.processing=Migration VM syst\u00e8me en cours ... label.action.reboot.instance.processing=Red\u00e9marrage de l\\'instance... label.action.reboot.instance=Red\u00e9marrer l\\'instance label.action.reboot.router.processing=Red\u00e9marrage du routeur... label.action.reboot.router=Red\u00e9marrer le routeur label.action.reboot.systemvm.processing=Red\u00e9marrage de la VM Syst\u00e8me... -label.action.reboot.systemvm=Red\u00e9marrer la VM Syst\u00e8me +label.action.reboot.systemvm=Red\u00e9marrer VM Syst\u00e8me label.action.recurring.snapshot=Instantan\u00e9s r\u00e9currents label.action.register.iso=Enregistrer ISO label.action.register.template=Enregistrer mod\u00e8le @@ -210,6 +218,8 @@ label.action.resize.volume=Redimensionner Volume label.action.resource.limits=Limites de ressources label.action.restore.instance.processing=Restauration de l\\'instance... label.action.restore.instance=Restaurer l\\'instance +label.action.revert.snapshot.processing=Retour \u00e0 l\\'instantan\u00e9... +label.action.revert.snapshot=R\u00e9tablir Instantan\u00e9 label.actions=Actions label.action.start.instance=D\u00e9marrer l\\'instance label.action.start.instance.processing=D\u00e9marrage de l\\'instance... @@ -221,7 +231,7 @@ label.action.stop.instance=Arr\u00eater l\\'Instance label.action.stop.instance.processing=Arr\u00eat de l\\'Instance... label.action.stop.router=Arr\u00eater le routeur label.action.stop.router.processing=Arr\u00eat du routeur... -label.action.stop.systemvm=Arr\u00eater la VM syst\u00e8me +label.action.stop.systemvm=Arr\u00eater VM Syst\u00e8me label.action.stop.systemvm.processing=Arr\u00eat de la VM syst\u00e8me... label.action.take.snapshot=Prendre un instantan\u00e9 label.action.take.snapshot.processing=Prise de l\\'instantan\u00e9... @@ -233,7 +243,7 @@ label.action.update.resource.count=Mettre \u00e0 jour le compteur des ressources label.action.update.resource.count.processing=Mise \u00e0 jour du compteur... label.action.vmsnapshot.create=Prendre un instantan\u00e9 VM label.action.vmsnapshot.delete=Supprimer l\\'instantan\u00e9 VM -label.action.vmsnapshot.revert=Revenir \u00e0 un instantan\u00e9 VM +label.action.vmsnapshot.revert=R\u00e9tablir Instantan\u00e9 VM label.activate.project=Activer projet label.active.sessions=Sessions actives label.add.account=Ajouter un compte @@ -243,18 +253,23 @@ label.add.account.to.project=Ajouter un compte au projet label.add.ACL=Ajouter r\u00e8gle ACL label.add.affinity.group=Ajouter nouveau groupe d\\'affinit\u00e9 label.add=Ajouter +label.add.baremetal.dhcp.device=Ajouter un DHCP Baremetal label.add.BigSwitchVns.device=Ajouter contr\u00f4leur BigSwitch Vns label.add.by=Ajout\u00e9 par label.add.by.cidr=Ajouter par CIDR label.add.by.group=Ajouter par groupe label.add.cluster=Ajouter un cluster -label.add.compute.offering=Ajouter une offre de calcul +label.add.compute.offering=Ajouter Offre Calcul label.add.direct.iprange=Ajouter une plage d\\'adresse IP directe -label.add.disk.offering=Ajouter une offre disque +label.add.disk.offering=Ajouter Offre Disque label.add.domain=Ajouter un domaine +label.added.new.bigswitch.vns.controller=Ajout du nouveau contr\u00f4leur BigSwitch VNS +label.added.nicira.nvp.controller=Ajout d\\'un nouveau contr\u00f4leur Nicira NVP label.add.egress.rule=Ajouter la r\u00e8gle sortante +label.addes.new.f5=Ajout d\\'un nouveau F5 label.add.F5.device=Ajouter un F5 label.add.firewall=Ajouter une r\u00e8gle de pare-feu +label.add.gslb=Ajouter GSLB label.add.guest.network=Ajouter un r\u00e9seau d\\'invit\u00e9 label.add.host=Ajouter un h\u00f4te label.adding=Ajout @@ -267,6 +282,7 @@ label.adding.succeeded=Ajout r\u00e9ussi label.adding.user=Ajout de l\\'utilisateur label.adding.zone=Ajout de la zone label.add.ip.range=Ajouter une plage IP +label.add.isolated.network=Ajouter un r\u00e9seau isol\u00e9 label.additional.networks=R\u00e9seaux additionnels label.add.load.balancer=Ajouter un r\u00e9partiteur de charge label.add.more=Ajouter plus @@ -274,42 +290,52 @@ label.add.netScaler.device=Ajouter un Netscaler label.add.network.ACL=Ajouter une r\u00e8gle d\\'acc\u00e8s r\u00e9seau ACL label.add.network=Ajouter un r\u00e9seau label.add.network.device=Ajouter un \u00e9quipement r\u00e9seau -label.add.network.offering=Ajouter une offre r\u00e9seau +label.add.network.offering=Ajouter Offre R\u00e9seau label.add.new.F5=Ajouter un F5 label.add.new.gateway=Ajouter une nouvelle passerelle label.add.new.NetScaler=Ajouter un Netscaler +label.add.new.PA=Ajouter nouveau Palo Alto label.add.new.SRX=Ajouter un SRX label.add.new.tier=Ajouter un nouveau tiers +label.add.nfs.secondary.staging.store=Ajouter un Stockage Secondaire Interm\u00e9diaire NFS label.add.NiciraNvp.device=Ajouter un contr\u00f4leur Nvp +label.add.OpenDaylight.device=Ajouter contr\u00f4leur OpenDaylight +label.add.PA.device=Ajouter p\u00e9riph\u00e9rique Palo Alto label.add.physical.network=Ajouter un r\u00e9seau physique label.add.pod=Ajouter un pod +label.add.portable.ip.range=Ajouter Plage IP portable label.add.port.forwarding.rule=Ajouter une r\u00e8gle de transfert de port -label.add.primary.storage=Ajouter un stockage principal +label.add.primary.storage=Ajouter un stockage primaire label.add.region=Ajouter R\u00e9gion label.add.resources=Ajouter ressources label.add.route=Ajouter route label.add.rule=Ajouter r\u00e8gle label.add.secondary.storage=Ajouter un stockage secondaire label.add.security.group=Ajouter un groupe de s\u00e9curit\u00e9 -label.add.service.offering=Ajouter une offre de service +label.add.service.offering=Ajouter Offre Service label.add.SRX.device=Ajouter un SRX label.add.static.nat.rule=Ajouter une r\u00e8gle de NAT statique label.add.static.route=Ajouter une route statique -label.add.system.service.offering=Ajouter une offre de service syst\u00e8me +label.add.system.service.offering=Ajouter Offre Service Syst\u00e8me label.add.template=Ajouter un mod\u00e8le label.add.to.group=Ajouter au groupe +label.add.ucs.manager=Ajouter Gestionnaire UCS label.add.user=Ajouter un utilisateur label.add.vlan=Ajouter un VLAN -label.add.vxlan=Ajouter un VXLAN label.add.vm=Ajouter VM label.add.vms=Ajouter VMs label.add.vms.to.lb=Ajouter une/des VM(s) \u00e0 la r\u00e8gle de r\u00e9partition de charge label.add.VM.to.tier=Ajouter une machine virtuelle au tiers +label.add.vmware.datacenter=Ajouter un datacenter VMware +label.add.vnmc.device=Ajouter un VNMC +label.add.vnmc.provider=Ajouter fournisseur VNMC label.add.volume=Ajouter un volume label.add.vpc=Ajouter un VPC +label.add.vpc.offering=Ajouter Offre VPC label.add.vpn.customer.gateway=Ajouter une passerelle VPN cliente label.add.VPN.gateway=Ajouter une passerelle VPN label.add.vpn.user=Ajouter un utilisateur VPN +label.add.vxlan=Ajouter un VXLAN label.add.zone=Ajouter une zone label.admin.accounts=Comptes Administrateur label.admin=Administrateur @@ -326,35 +352,57 @@ label.alert=Alerte label.algorithm=Algorithme label.allocated=Allou\u00e9 label.allocation.state=\u00c9tat +label.allow=Autoriser label.anti.affinity=Anti-affinit\u00e9 label.anti.affinity.group=Groupe d\\'Anti-affinit\u00e9 label.anti.affinity.groups=Groupes d\\'Anti-affinit\u00e9 label.api.key=Cl\u00e9 d\\'API label.apply=Appliquer +label.app.name=CloudStack +label.archive.alerts=Archiver alertes +label.archive.events=Archiver \u00e9v\u00e9nements label.assign=Assigner +label.assign.instance.another=Assigner l\\'instance \u00e0 un autre compte label.assign.to.load.balancer=Assigner l\\'instance au r\u00e9partiteur de charge label.associated.network.id=ID du r\u00e9seau associ\u00e9 label.associated.network=R\u00e9seau associ\u00e9 +label.associated.profile=Profil associ\u00e9 +label.associate.public.ip=Associer IP Publique label.attached.iso=Image ISO attach\u00e9e label.author.email=Email auteur label.author.name=Nom auteur +label.autoscale=AutoScale label.availability=Disponibilit\u00e9 label.availability.zone=Zone de disponibilit\u00e9 label.available=Disponible label.available.public.ips=Adresses IP publiques disponibles label.back=Retour label.bandwidth=Bande passante +label.baremetal.dhcp.devices=\u00c9quipements DHCP Baremetal +label.baremetal.dhcp.provider=Fournisseur DHCP Baremetal +label.baremetal.pxe.device=Ajouter un PXE Baremetal +label.baremetal.pxe.devices=\u00c9quipements PXE Baremetal +label.baremetal.pxe.provider=Fournisseur PXE Baremetal label.basic=Basique label.basic.mode=Mode basique label.bigswitch.controller.address=Adresse du contr\u00f4leur BigSwitch Vns +label.bigswitch.vns.details=D\u00e9tails BigSwitch VNS +label.blade.id=ID Lame +label.blades=Lames label.bootable=Amor\u00e7able label.broadcast.domain.range=Plage du domaine multi-diffusion label.broadcast.domain.type=Type de domaine de multi-diffusion +label.broadcasturi=broadcasturi label.broadcast.uri=URI multi-diffusion +label.broadcat.uri=URI multi-diffusion label.by.account=Par compte +label.by.alert.type=Par type d\\'alerte label.by.availability=Par disponibilit\u00e9 +label.by.date.end=par date (fin) +label.by.date.start=Par date (d\u00e9but) label.by.domain=Par domaine label.by.end.date=Par date de fin +label.by.event.type=Par type d\\'\u00e9v\u00e9nement label.by.level=Par niveau label.by.pod=Par Pod label.by.role=Par r\u00f4le @@ -366,18 +414,25 @@ label.by.traffic.type=Par type de trafic label.by.type.id=Par type d\\'ID label.by.type=Par type label.by.zone=Par zone +label.cache.mode=Type Write-cache label.cancel=Annuler label.capacity=Capacit\u00e9 label.certificate=Certificat -label.change.service.offering=Modifier l\\'offre de service +label.change.affinity=Changer Affinit\u00e9 +label.change.service.offering=Modifier Offre Service label.change.value=Modifier la valeur label.character=Caract\u00e8re +label.chassis=Ch\u00e2ssis label.checksum=Somme de contr\u00f4le MD5 label.cidr.account=CIDR ou Compte/Groupe de s\u00e9curit\u00e9 label.cidr=CIDR label.cidr.list=CIDR Source label.CIDR.list=Liste CIDR label.CIDR.of.destination.network=CIDR du r\u00e9seau de destination +label.cisco.nexus1000v.ip.address=Adresse IP Nexus 1000v +label.cisco.nexus1000v.password=Mot de passe Nexus 1000v +label.cisco.nexus1000v.username=Identifiant Nexus 1000v +label.ciscovnmc.resource.details=D\u00e9tails ressource CiscoVNMC label.clean.up=Nettoyage label.clear.list=Purger la liste label.close=Fermer @@ -392,9 +447,11 @@ label.code=Code label.community=Communaut\u00e9 label.compute.and.storage=Calcul et Stockage label.compute.offering=Offre de calcul +label.compute.offerings=Offres de Calcul label.compute=Processeur label.configuration=Configuration label.configure=Configurer +label.configure.ldap=Configurer LDAP label.configure.network.ACLs=Configurer les r\u00e8gles d\\'acc\u00e8s r\u00e9seau ACL label.configure.vpc=Configurer le VPC label.confirmation=Confirmation @@ -402,6 +459,7 @@ label.confirm.password=Confirmer le mot de passe label.congratulations=F\u00e9licitations \! label.conserve.mode=Conserver le mode label.console.proxy=Console proxy +label.console.proxy.vm=VM Console Proxy label.continue.basic.install=Continuer avec l\\'installation basique label.continue=Continuer label.corrections.saved=Modifications enregistr\u00e9es @@ -414,42 +472,67 @@ label.cpu.mhz=CPU (en MHz) label.cpu.utilized=CPU utilis\u00e9e label.created.by.system=Cr\u00e9\u00e9 par le syst\u00e8me label.created=Cr\u00e9\u00e9 +label.create.nfs.secondary.staging.storage=Cr\u00e9er le Stockage Secondaire Interm\u00e9diaire NFS +label.create.nfs.secondary.staging.store=Cr\u00e9er le stockage secondaire interm\u00e9diaire NFS label.create.project=Cr\u00e9er un projet label.create.template=Cr\u00e9er un mod\u00e8le label.create.VPN.connection=Cr\u00e9er une connexion VPN label.cross.zones=Multi Zones +label.custom.disk.iops=IOPS personnalis\u00e9s label.custom.disk.size=Taille de disque personnalis\u00e9e +label.custom=Personnalis\u00e9 label.daily=Quotidien label.data.disk.offering=Offre de disque de donn\u00e9es label.date=Date label.day.of.month=Jour du mois label.day.of.week=Jour de la semaine +label.dc.name=Nom DC label.dead.peer.detection=D\u00e9tection de pair mort label.decline.invitation=Refuser l\\'invitation +label.dedicate.cluster=D\u00e9dier Cluster label.dedicated=D\u00e9di\u00e9 +label.dedicate=D\u00e9dier +label.dedicated.vlan.vni.ranges=Plages VLAN/VNI d\u00e9di\u00e9es +label.dedicate.host=D\u00e9dier H\u00f4te +label.dedicate.pod=D\u00e9dier Pod +label.dedicate.vlan.vni.range=Plage VLAN/VNI d\u00e9di\u00e9e +label.dedicate.zone=D\u00e9dier Zone +label.default.egress.policy=Politique Egress par d\u00e9faut label.default=Par d\u00e9faut label.default.use=Utilisation par d\u00e9faut label.default.view=Vue par d\u00e9faut label.delete.affinity.group=Supprimer le groupe d\\'affinit\u00e9 +label.delete.alerts=Supprimer alertes label.delete.BigSwitchVns=Supprimer contr\u00f4leur BigSwitch Vns +label.delete.ciscovnmc.resource=Supprimer ressource CiscoVNMC +label.delete.events=Supprimer \u00e9v\u00e9nements label.delete.F5=Supprimer F5 label.delete.gateway=Supprimer la passerelle label.delete.NetScaler=Supprimer Netscaler label.delete.NiciraNvp=Supprimer un contr\u00f4leur Nvp +label.delete.OpenDaylight.device=Supprimer contr\u00f4leur OpenDaylight +label.delete.PA=Supprimer Palo Alto +label.delete.portable.ip.range=Supprimer Plage IP portable +label.delete.profile=Supprimer Profil label.delete.project=Supprimer projet +label.delete.secondary.staging.store=Supprimer Stockage Secondaire Interm\u00e9diaire label.delete.SRX=Supprimer SRX label.delete=Supprimer +label.delete.ucs.manager=Supprimer Gestionnaire UCS label.delete.VPN.connection=Supprimer la connexion VPN label.delete.VPN.customer.gateway=Supprimer la passerelle VPN client label.delete.VPN.gateway=Supprimer la passerelle VPN label.delete.vpn.user=Supprimer l\\'utilisateur VPN label.deleting.failed=Suppression \u00e9chou\u00e9e label.deleting.processing=Suppression... +label.deny=Interdire +label.deployment.planner=Planning d\u00e9ploiement label.description=Description label.destination.physical.network.id=Identifiant du r\u00e9seau physique de destination label.destination.zone=Zone de destination label.destroy=D\u00e9truire label.destroy.router=Supprimer le routeur +label.destroy.vm.graceperiod=D\u00e9truire P\u00e9riode de gr\u00e2ce VM label.detaching.disk=D\u00e9tacher le disque label.details=D\u00e9tails label.device.id=ID du p\u00e9riph\u00e9rique @@ -457,11 +540,24 @@ label.devices=Machines label.dhcp=DHCP label.DHCP.server.type=Serveur DHCP label.direct.ips=Adresses IP du r\u00e9seau partag\u00e9 +label.disable.autoscale=D\u00e9sactiver Autoscale label.disabled=D\u00e9sactiv\u00e9 +label.disable.network.offering=D\u00e9sactiver Offre de r\u00e9seau label.disable.provider=D\u00e9sactiver ce fournisseur +label.disable.vnmc.provider=D\u00e9sactiver fournisseur VNMC +label.disable.vpc.offering=D\u00e9sactiver offre VPC label.disable.vpn=D\u00e9sactiver le VPN label.disabling.vpn.access=D\u00e9sactiver l\\'acc\u00e8s VPN +label.disassociate.profile.blade=D\u00e9-associer le Profil de la Lame +label.disbale.vnmc.device=D\u00e9sactiver VNMC label.disk.allocated=Disque Allou\u00e9 +label.disk.bytes.read.rate=D\u00e9bit lecture disque (BPS) +label.disk.bytes.write.rate=D\u00e9bit \u00e9criture disque (BPS) +label.disk.iops.max=IOPS maximum +label.disk.iops.min=IOPS minimum +label.disk.iops.read.rate=D\u00e9bit lecture disque (IOPS) +label.disk.iops.total=IOPS Total +label.disk.iops.write.rate=D\u00e9bit \u00e9criture disque (IOPS) label.disk.offering=Offre de Disque label.disk.read.bytes=Lecture Disque (Octets) label.disk.read.io=Lecture Disque (IO) @@ -473,6 +569,7 @@ label.disk.write.bytes=\u00c9criture Disque (Octets) label.disk.write.io=\u00c9criture Disque (IO) label.display.name=Nom commun label.display.text=Texte affich\u00e9 +label.distributedrouter=Routeur Distribu\u00e9 label.dns.1=DNS 1 label.dns.2=DNS 2 label.dns=DNS @@ -480,6 +577,7 @@ label.DNS.domain.for.guest.networks=Domaine DNS pour les r\u00e9seaux invit\u00e label.domain.admin=Administrateur du domaine label.domain=Domaine label.domain.id=ID du domaine +label.domain.lower=domaine label.domain.name=Nom de domaine label.domain.router=Routeur du domaine label.domain.suffix=Suffixe de domaine DNS (i.e., xyz.com) @@ -487,23 +585,32 @@ label.done=Termin\u00e9 label.double.quotes.are.not.allowed=Les guillemets ne sont pas autoris\u00e9es label.download.progress=Progression du t\u00e9l\u00e9chargement label.drag.new.position=D\u00e9placer sur une autre position +label.dynamically.scalable=Dimensionnement dynamique label.edit.affinity.group=Modifier le groupe d\\'affinit\u00e9 label.edit.lb.rule=Modifier la r\u00e8gle LB label.edit=Modifier label.edit.network.details=Modifier les param\u00e8tres r\u00e9seau label.edit.project.details=Modifier les d\u00e9tails du projet +label.edit.region=\u00c9diter R\u00e9gion label.edit.tags=Modifier les balises label.edit.traffic.type=Modifier le type de trafic label.edit.vpc=Modifier le VPC +label.egress.default.policy=Politique par d\u00e9faut Egress label.egress.rule=R\u00e8gle sortante label.egress.rules=R\u00e8gles de sortie label.elastic.IP=IP extensible label.elastic.LB=R\u00e9partition de charge extensible label.elastic=\u00c9lastique label.email=Email +label.email.lower=email +label.enable.autoscale=Activer Autoscale +label.enable.network.offering=Activer Offre de r\u00e9seau label.enable.provider=Activer le fournisseur label.enable.s3=Activer le stockage secondaire de type S3 label.enable.swift=Activer Swift +label.enable.vnmc.device=Activer VNMC +label.enable.vnmc.provider=Activer fournisseur VNMC +label.enable.vpc.offering=Activer offre VPC label.enable.vpn=Activer VPN label.enabling.vpn.access=Activation de l\\'acc\u00e8s VPN label.enabling.vpn=Activation du VPN @@ -523,13 +630,16 @@ label.ESP.lifetime=Dur\u00e9e de vie ESP (secondes) label.ESP.policy=Mode ESP label.esx.host=H\u00f4te ESX/ESXi label.example=Exemple +label.expunge=Purger label.external.link=Lien externe +label.f5.details=D\u00e9tails F5 label.f5=F5 label.failed=\u00c9chou\u00e9 label.featured=Sponsoris\u00e9 label.fetch.latest=Rafra\u00eechir label.filterBy=Filtre label.firewall=Pare-feu +label.firstname.lower=pr\u00e9nom label.first.name=Pr\u00e9nom label.format=Format label.friday=Vendredi @@ -538,12 +648,30 @@ label.full.path=Chemin complet label.gateway=Passerelle label.general.alerts=Alertes g\u00e9n\u00e9rales label.generating.url=G\u00e9n\u00e9ration de l\\'URL +label.gluster.volume=Volume label.go.step.2=Aller \u00e0 l\\'\u00e9tape 2 label.go.step.3=Aller \u00e0 l\\'\u00e9tape 3 label.go.step.4=Aller \u00e0 l\\'\u00e9tape 4 label.go.step.5=Aller \u00e0 l\\'\u00e9tape 5 +label.gpu=GPU +label.group.by.account=Regrouper par compte +label.group.by.cluster=Regrouper par cluster +label.group.by.pod=Regrouper par pod +label.group.by.zone=Regrouper par zone label.group=Groupe label.group.optional=Groupe (optionnel) +label.gslb.assigned.lb.more=Assigner plus de r\u00e9partition de charge +label.gslb.assigned.lb=R\u00e9partition de charge assign\u00e9e +label.gslb.delete=Supprimer GSLB +label.gslb.details=D\u00e9tails GSLB +label.gslb.domain.name=Nom de domaine GSLB +label.gslb.lb.details=D\u00e9tails r\u00e9partition de charge +label.gslb.lb.remove=Supprimer r\u00e9partition de charge depuis ce GSLB +label.gslb.lb.rule=R\u00e8gle de r\u00e9partition de charge +label.gslb.service.private.ip=IP priv\u00e9e service GSLB +label.gslb.service.public.ip=IP publique service GSLB +label.gslb.service=Service GSLB +label.gslb.servicetype=Type service label.guest.cidr=CIDR invit\u00e9 label.guest.end.ip=Adresse IP de fin pour les invit\u00e9s label.guest.gateway=Passerelle pour les invit\u00e9s @@ -551,14 +679,19 @@ label.guest=Invit\u00e9 label.guest.ip=Adresse IP des invit\u00e9s label.guest.ip.range=Plage d\\'adresses IP des invit\u00e9s label.guest.netmask=Masque de r\u00e9seau des invit\u00e9s +label.guest.network.details=D\u00e9tails r\u00e9seau invit\u00e9 label.guest.networks=R\u00e9seaux d\\'invit\u00e9 label.guest.start.ip=Adresse IP de d\u00e9but pour les invit\u00e9s label.guest.traffic=Trafic invit\u00e9 +label.guest.traffic.vswitch.name=Nom Trafic Invit\u00e9 vSwitch +label.guest.traffic.vswitch.type=Type Trafic Invit\u00e9 vSwitch label.guest.type=Type d\\'invit\u00e9 label.ha.enabled=Haute disponibilit\u00e9 activ\u00e9e +label.health.check=V\u00e9rification statut label.help=Aide label.hide.ingress.rule=Cacher la r\u00e8gle d\\'entr\u00e9e label.hints=Astuces +label.home=Accueil label.host.alerts=Alertes des h\u00f4tes label.host=H\u00f4te label.host.MAC=Adresse MAC h\u00f4te @@ -568,8 +701,11 @@ label.host.tags=\u00c9tiquettes d\\'h\u00f4te label.hourly=Chaque heure label.hypervisor.capabilities=Fonctions hyperviseur label.hypervisor=Hyperviseur +label.hypervisors=Hyperviseurs +label.hypervisor.snapshot.reserve=R\u00e9serve d\\'instantan\u00e9e de l\\'Hyperviseur label.hypervisor.type=Type d\\'hyperviseur label.hypervisor.version=Version hyperviseur +label.hyperv.traffic.label=Libell\u00e9 trafic HyperV label.id=ID label.IKE.DH=DH IKE label.IKE.encryption=Chiffrement IKE @@ -585,8 +721,8 @@ label.installWizard.addHostIntro.subtitle=Qu\\'est ce qu\\'un h\u00f4te ? label.installWizard.addHostIntro.title=Ajoutons un h\u00f4te label.installWizard.addPodIntro.subtitle=Qu\\'est ce qu\\'un pod ? label.installWizard.addPodIntro.title=Ajoutons un pod -label.installWizard.addPrimaryStorageIntro.subtitle=Qu\\'est ce que le stockage principal ? -label.installWizard.addPrimaryStorageIntro.title=Ajoutons du stockage principal +label.installWizard.addPrimaryStorageIntro.subtitle=Qu\\'est ce que le stockage primaire ? +label.installWizard.addPrimaryStorageIntro.title=Ajoutons du stockage primaire label.installWizard.addSecondaryStorageIntro.subtitle=Qu\\'est ce que le stockage secondaire ? label.installWizard.addSecondaryStorageIntro.title=Ajoutons du stockage secondaire label.installWizard.addZoneIntro.subtitle=Qu\\'est ce qu\\'une zone ? @@ -598,7 +734,9 @@ label.installWizard.title=Bonjour et bienvenue dans CloudStack&\#8482; label.instance=Instance label.instance.limits=Limites des instances label.instance.name=Nom de l\\'instance +label.instance.scaled.up=Instance agrandie label.instances=Instances +label.instanciate.template.associate.profile.blade=Instancier Mod\u00e8le et Profil associ\u00e9 \u00e0 la Lame label.internal.dns.1=DNS interne 1 label.internal.dns.2=DNS interne 2 label.internal.name=Nom interne @@ -620,6 +758,18 @@ label.ip.range=Plage IP label.ip.ranges=Plages IP label.IPsec.preshared.key=Cl\u00e9 partag\u00e9e IPsec label.ips=IPs +label.ipv4.cidr=CIDR IPv4 +label.ipv4.end.ip=IP fin IPv4 +label.ipv4.gateway=Passerelle IPv4 +label.ipv4.netmask=Masque de r\u00e9seau IPv4 +label.ipv4.start.ip=IP d\u00e9but IPv4 +label.ipv6.address=Adresse IPv6 +label.ipv6.CIDR=CIDR IPv6 +label.ipv6.dns1=DNS1 IPv6 +label.ipv6.dns2=DNS2 IPv6 +label.ipv6.end.ip=IP fin IPv6 +label.ipv6.gateway=Passerelle IPv6 +label.ipv6.start.ip=IP d\u00e9but IPv6 label.iscsi=iSCSI label.is.default=Est par d\u00e9faut label.iso.boot=D\u00e9marrage par ISO @@ -635,7 +785,7 @@ label.item.listing=Liste des \u00e9l\u00e9ments label.keep=Conserver label.keyboard.type=Type de clavier label.key=Clef -label.kvm.traffic.label=Libell\u00e9 pour le trafic KVM +label.kvm.traffic.label=Libell\u00e9 trafic KVM label.label=Libell\u00e9 label.lang.arabic=Arabe label.lang.brportugese=Portuguais Br\u00e9sil @@ -653,14 +803,19 @@ label.lang.polish=Polonais label.lang.russian=Russe label.lang.spanish=Espagnol label.last.disconnected=Derni\u00e8re D\u00e9connexion +label.lastname.lower=nom label.last.name=Nom label.latest.events=Derniers \u00e9v\u00e9nements label.launch=D\u00e9marrer label.launch.vm=D\u00e9marrer VM label.launch.zone=D\u00e9marrer la zone label.LB.isolation=R\u00e9partition de charge isol\u00e9e +label.ldap.configuration=Configuration LDAP +label.ldap.group.name=Groupe LDAP +label.ldap.port=Port LDAP label.least.connections=Le moins de connexions label.level=Niveau +label.linklocal.ip=Adresse IP lien local label.load.balancer=R\u00e9partiteur de charge label.load.balancing.policies=R\u00e8gles de r\u00e9partition de charge label.load.balancing=R\u00e9partition de charge @@ -672,6 +827,7 @@ label.login=Connexion label.logout=D\u00e9connexion label.lun=LUN label.LUN.number=N\u00b0 LUN +label.lxc.traffic.label=Libell\u00e9 trafic LXC label.make.project.owner=Devenir propri\u00e9taire du projet label.manage=G\u00e9r\u00e9 label.management=Administration @@ -680,6 +836,7 @@ label.manage.resources=G\u00e9rer les ressources label.max.cpus=Nombre coeurs CPU max. label.max.guest.limit=Nombre maximum d\\'invit\u00e9s label.maximum=Maximum +label.max.instances=Instance Max. label.max.memory=M\u00e9moire max. (Mo) label.max.networks=R\u00e9seaux Max. label.max.primary.storage=Principal max. (Go) @@ -706,7 +863,7 @@ label.menu.community.templates=Mod\u00e8les de la communaut\u00e9 label.menu.configuration=Configuration label.menu.dashboard=Tableau de bord label.menu.destroyed.instances=Instances d\u00e9truites -label.menu.disk.offerings=Offres de disque +label.menu.disk.offerings=Offres de Disque label.menu.domains=Domaines label.menu.events=\u00c9v\u00e9nements label.menu.featured.isos=ISOs Sponsoris\u00e9es @@ -720,7 +877,7 @@ label.menu.my.accounts=Mes comptes label.menu.my.instances=Mes instances label.menu.my.isos=Mes ISOs label.menu.my.templates=Mes mod\u00e8les -label.menu.network.offerings=Offres de Service R\u00e9seau +label.menu.network.offerings=Offres de R\u00e9seau label.menu.network=R\u00e9seau label.menu.physical.resources=Ressources physiques label.menu.regions=R\u00e9gions @@ -730,23 +887,27 @@ label.menu.service.offerings=Offres de Service label.menu.snapshots=Instantan\u00e9s label.menu.stopped.instances=Instances Arr\u00eat\u00e9es label.menu.storage=Stockage -label.menu.system.service.offerings=Offres syst\u00e8me +label.menu.system.service.offerings=Offres Syst\u00e8me label.menu.system=Syst\u00e8me label.menu.system.vms=\ VMs Syst\u00e8mes label.menu.templates=Mod\u00e8les label.menu.virtual.appliances=Appliances Virtuelles label.menu.virtual.resources=Ressources Virtuelles label.menu.volumes=Volumes +label.menu.vpc.offerings=Offres VPC label.migrate.instance.to.host=Migration de l\\'instance sur un autre h\u00f4te label.migrate.instance.to=Migrer l\\'instance vers -label.migrate.instance.to.ps=Migration de l\\'instance sur un autre stockage principal +label.migrate.instance.to.ps=Migration de l\\'instance sur un autre stockage primaire +label.migrate.lb.vm=Migrer LB VM label.migrate.router.to=Migrer le routeur vers label.migrate.systemvm.to=Migrer la VM syst\u00e8me vers label.migrate.to.host=Migrer vers un h\u00f4te label.migrate.to.storage=Migrer vers un stockage -label.migrate.volume=Migration du volume vers un autre stockage principal +label.migrate.volume=Migration du volume vers un autre stockage primaire label.minimum=Minimum +label.min.instances=Instances Min. label.minute.past.hour=minute(s) +label.mode=Mode label.monday=Lundi label.monthly=Mensuel label.more.templates=Plus de mod\u00e8les @@ -757,14 +918,18 @@ label.move.up.row=Monter d\\'un cran label.my.account=Mon compte label.my.network=Mon r\u00e9seau label.my.templates=Mes mod\u00e8les +label.name.lower=name label.name=Nom label.name.optional=Nom (optionnel) label.nat.port.range=Plage de port NAT label.netmask=Masque de r\u00e9seau +label.netscaler.details=D\u00e9tails NetScaler label.netScaler=NetScaler label.network.ACL=R\u00e8gles d\\'acc\u00e8s r\u00e9seau ACL label.network.ACLs=R\u00e8gles d\\'acc\u00e8s r\u00e9seau label.network.ACL.total=Total R\u00e8gles d\\'acc\u00e8s r\u00e9seau +label.network.addVM=Ajouter r\u00e9seau \u00e0 la VM +label.network.cidr=CIDR r\u00e9seau label.network.desc=Description r\u00e9seau label.network.device.type=Type d\\'\u00e9quipement r\u00e9seau label.network.device=\u00c9quipement R\u00e9seau @@ -773,11 +938,12 @@ label.network.domain.text=Domaine r\u00e9seau label.network.id=ID r\u00e9seau label.networking.and.security=R\u00e9seau et s\u00e9curit\u00e9 label.network.label.display.for.blank.value=Utiliser la passerelle par d\u00e9faut +label.network.limits=Limites r\u00e9seau label.network.name=Nom du r\u00e9seau -label.network.offering.display.text=Texte affich\u00e9 d\\'Offre de R\u00e9seau -label.network.offering.id=ID de l\\'Offre de Service R\u00e9seau -label.network.offering.name=Nom de l\\'Offre de Service R\u00e9seau -label.network.offering=Offre de Service R\u00e9seau +label.network.offering.display.text=Texte affich\u00e9 Offre R\u00e9seau +label.network.offering.id=ID Offre R\u00e9seau +label.network.offering.name=Nom Offre R\u00e9seau +label.network.offering=Offre de R\u00e9seau label.network.rate=D\u00e9bit R\u00e9seau label.network.rate.megabytes=D\u00e9bit r\u00e9seau (Mo/s) label.network.read=Lecture r\u00e9seau @@ -798,12 +964,14 @@ label.nfs.storage=Stockage NFS label.nic.adapter.type=Type de carte r\u00e9seau label.nicira.controller.address=Adresse du contr\u00f4leur label.nicira.l3gatewayserviceuuid=Uuid du service passerelle L3 +label.nicira.nvp.details=D\u00e9tails Nicira NVP label.nicira.transportzoneuuid=Uuid de la Zone Transport label.nics=Cartes NIC label.no.actions=Aucune action disponible label.no.alerts=Aucune alerte r\u00e9cente label.no.data=Aucune donn\u00e9e label.no.errors=Aucune erreur r\u00e9cente +label.no.grouping=(pas de groupement) label.no.isos=Aucun ISOs disponible label.no.items=Aucun \u00e9l\u00e9ment disponible label.none=Aucun @@ -813,6 +981,7 @@ label.not.found=Introuvable label.no.thanks=Non merci label.notifications=Messages label.number.of.clusters=Nombre de clusters +label.number.of.cpu.sockets=Le nombre de sockets CPU label.number.of.hosts=Nombre d\\'H\u00f4tes label.number.of.pods=Nombre de Pods label.number.of.system.vms=Nombre de VM Syst\u00e8me @@ -823,43 +992,65 @@ label.numretries=Nombre de tentatives label.ocfs2=OCFS2 label.offer.ha=Offrir la haute disponibilit\u00e9 label.ok=OK +label.opendaylight.controller=Contr\u00f4leur OpenDaylight +label.opendaylight.controllerdetail=D\u00e9tails Contr\u00f4leur OpenDaylight +label.opendaylight.controllers=Contr\u00f4leurs OpenDaylight +label.openDaylight=OpenDaylight label.optional=Facultatif label.order=Ordre label.os.preference=Pr\u00e9f\u00e9rence OS label.os.type=Type du OS +label.override.guest.traffic=Remplacer Trafic-invit\u00e9 +label.override.public.traffic=Remplacer Trafic-public +label.ovm.traffic.label=Libell\u00e9 trafic OVM +label.ovs=OVS label.owned.public.ips=Adresses IP Publiques d\u00e9tenues label.owner.account=Propri\u00e9taire label.owner.domain=Propri\u00e9taire +label.palo.alto.details=D\u00e9tails Palo Alto +label.PA.log.profile=Profil Journal Palo Alto +label.PA=Palo Alto label.parent.domain=Parent du Domaine label.password.enabled=Mot de passe activ\u00e9 +label.password.lower=mot de passe label.password=Mot de passe +label.password.reset.confirm=Le mot de passe a \u00e9t\u00e9 r\u00e9-initialis\u00e9 en label.path=Chemin +label.PA.threat.profile=Profil menace Palo Alto label.perfect.forward.secrecy=Confidentialit\u00e9 persistante +label.persistent=Persistant label.physical.network.ID=Identifiant du r\u00e9seau physique label.physical.network=R\u00e9seau physique label.PING.CIFS.password=Mot de passe CIFS PING label.PING.CIFS.username=Identifiant CIFS PING label.PING.dir=R\u00e9pertoire PING label.PING.storage.IP=IP stockage PING +label.planner.mode=Mode planification label.please.specify.netscaler.info=Renseigner les informations sur le Netscaler label.please.wait=Patientez s\\'il vous plait label.plugin.details=D\u00e9tails extension label.plugins=Extensions +label.pod.dedicated=Pod D\u00e9di\u00e9 label.pod.name=Nom du pod label.pod=Pod label.pods=Pods +label.polling.interval.sec=Intervalle d\\'appel (en sec) +label.portable.ip.range.details=D\u00e9tails Plages IP portables +label.portable.ip.ranges=Plages IP portables +label.portable.ips=IPs portables label.port.forwarding.policies=R\u00e8gles de transfert de port label.port.forwarding=Redirection de port +label.port=Port label.port.range=Plage de ports label.PreSetup=PreSetup label.previous=Retour label.prev=Pr\u00e9c\u00e9dent -label.primary.allocated=Stockage principal allou\u00e9 +label.primary.allocated=Stockage primaire allou\u00e9 label.primary.network=R\u00e9seau principal -label.primary.storage.count=Groupes de stockage principal -label.primary.storage.limits=Limites stockage principal (Go) -label.primary.storage=Premier stockage -label.primary.used=Stockage principal utilis\u00e9 +label.primary.storage.count=Groupes de stockage primaire +label.primary.storage.limits=Limites stockage primaire (Go) +label.primary.storage=Stockages primaires +label.primary.used=Stockage primaire utilis\u00e9 label.private.Gateway=Passerelle priv\u00e9e label.private.interface=Interface priv\u00e9e label.private.ip=Adresse IP Priv\u00e9e @@ -869,6 +1060,7 @@ label.privatekey=Cl\u00e9 priv\u00e9e PKCS\#8 label.private.network=R\u00e9seau priv\u00e9 label.private.port=Port priv\u00e9 label.private.zone=Zone Priv\u00e9e +label.profile=Profil label.project.dashboard=Tableau de bord projet label.project.id=ID projet label.project.invite=Inviter sur le projet @@ -877,32 +1069,57 @@ label.project=Projet label.projects=Projets label.project.view=Vue projet label.protocol=Protocole +label.provider=Fournisseur label.providers=Fournisseurs label.public.interface=Interface publique label.public.ip=Adresse IP publique label.public.ips=Adresses IP publiques +label.public.load.balancer.provider=Fournisseur r\u00e9partition de charge public label.public.network=R\u00e9seau public label.public.port=Port public label.public=Publique label.public.traffic=Trafic public +label.public.traffic.vswitch.name=Nom Trafic Public vSwitch +label.public.traffic.vswitch.type=Type Trafic Public vSwitch label.public.zone=Zone publique label.purpose=R\u00f4le label.Pxe.server.type=Serveur PXE +label.qos.type=Type de QoS label.quickview=Aper\u00e7u +label.quiesce.vm=Mettre en veille VM +label.quiet.time.sec=Quiet Time (en sec) +label.rbd.id=Utilisateur Cephx +label.rbd.monitor=Superviseur Ceph +label.rbd.pool=Pool Ceph +label.rbd=RBD +label.rbd.secret=Secret Cephx label.reboot=Red\u00e9marrer label.recent.errors=Erreurs r\u00e9centes +label.recover.vm=Restaurer VM label.redundant.router.capability=Router redondant label.redundant.router=Routeur redondant label.redundant.state=\u00c9tat de la redondance label.refresh=Actualiser +label.refresh.blades=Rafra\u00eechir Lames +label.regionlevelvpc=VPC niveau r\u00e9gion label.region=R\u00e9gion +label.reinstall.vm=R\u00e9-installer VM label.related=Connexes +label.release.account=Lib\u00e9rer compte +label.release.account.lowercase=lib\u00e9rer compte +label.release.dedicated.cluster=Lib\u00e9ration du cluster d\u00e9die +label.release.dedicated.host=Lib\u00e9ration de l\\'h\u00f4te d\u00e9di\u00e9 +label.release.dedicated.pod=Lib\u00e9ration du pod d\u00e9di\u00e9 +label.release.dedicated.vlan.range=Lib\u00e9rer plage VLAN d\u00e9di\u00e9e +label.release.dedicated.zone=Lib\u00e9rer la zone d\u00e9di\u00e9e label.remind.later=Rappeler moi plus tard label.remove.ACL=Supprimer une r\u00e8gle ACL label.remove.egress.rule=Supprimer la r\u00e8gle sortante label.remove.from.load.balancer=Supprimer l\\'instance du r\u00e9partiteur de charge label.remove.ingress.rule=Supprimer la r\u00e8gle entrante label.remove.ip.range=Supprimer la plage IP +label.remove.ldap=Supprimer LDAP +label.remove.network.offering=Supprimer Offre de r\u00e9seau label.remove.pf=Supprimer la r\u00e8gle de transfert de port label.remove.project.account=Supprimer le compte projet label.remove.region=Supprimer r\u00e9gion @@ -911,18 +1128,25 @@ label.remove.static.nat.rule=Supprimer le NAT statique label.remove.static.route=Supprimer une route statique label.remove.tier=Supprimer le tiers label.remove.vm.from.lb=Supprimer la VM de la r\u00e8gle de r\u00e9partition de charge +label.remove.vmware.datacenter=Supprimer un datacenter VMware +label.remove.vpc.offering=Supprimer offre VPC label.remove.vpc=Supprimer le VPC label.removing=Suppression label.removing.user=Retrait de l\\'utilisateur +label.reource.id=ID Ressource label.required=Requis +label.requires.upgrade=Mise \u00e0 niveau n\u00e9cessaire +label.reserved.ip.range=Plage IP r\u00e9serv\u00e9e label.reserved.system.gateway=Passerelle r\u00e9serv\u00e9e Syst\u00e8me label.reserved.system.ip=Adresse IP Syst\u00e8me r\u00e9serv\u00e9e label.reserved.system.netmask=Masque de sous-r\u00e9seau r\u00e9serv\u00e9 Syst\u00e8me +label.resetVM=R\u00e9-initialiser VM label.reset.VPN.connection=R\u00e9-initialiser la connexion VPN label.resize.new.offering.id=Nouvelle Offre label.resize.new.size=Nouvelle Taille (Go) label.resize.shrink.ok=R\u00e9duction OK label.resource.limits=Limite des ressources +label.resource.name=Nom Ressource label.resource=Ressource label.resources=Ressources label.resource.state=\u00c9tat des ressources @@ -935,7 +1159,11 @@ label.revoke.project.invite=R\u00e9voquer l\\'invitation label.role=R\u00f4le label.root.disk.controller=Contr\u00f4leur de disque principal label.root.disk.offering=Offre de disque racine +label.root.disk.size=Taille disque principal label.round.robin=Al\u00e9atoire +label.router.vm.scaled.up=VM Routeur agrandi +label.routing=Routage +label.rule.number=Num\u00e9ro r\u00e8gle label.rules=R\u00e8gles label.running.vms=VMs actives label.s3.access_key=Cl\u00e9 d\\'Acc\u00e8s @@ -943,6 +1171,8 @@ label.s3.bucket=Seau label.s3.connection_timeout=D\u00e9lai d\\'expiration de connexion label.s3.endpoint=Terminaison label.s3.max_error_retry=Nombre d\\'essai en erreur max. +label.s3.nfs.path=S3 Chemin NFS +label.s3.nfs.server=S3 Serveur NFS label.s3.secret_key=Cl\u00e9 Priv\u00e9e label.s3.socket_timeout=D\u00e9lai d\\'expiration de la socket label.s3.use_https=Utiliser HTTPS @@ -952,9 +1182,13 @@ label.save=Sauvegarder label.saving.processing=Sauvegarde en cours... label.scope=Port\u00e9e label.search=Rechercher +label.secondary.isolated.vlan.id=VLAN ID isol\u00e9 secondaire +label.secondary.staging.store.details=D\u00e9tails Stockage Secondaire Interm\u00e9diaire +label.secondary.staging.store=Stockage Secondaire Interm\u00e9diaire label.secondary.storage.count=Groupes de stockage secondaire +label.secondary.storage.details=D\u00e9tails Stockage Secondaire label.secondary.storage.limits=Limites stockage secondaire (Go) -label.secondary.storage=Stockage secondaire +label.secondary.storage=Stockages secondaires label.secondary.storage.vm=VM stockage secondaire label.secondary.used=Stockage secondaire utilis\u00e9 label.secret.key=Cl\u00e9 priv\u00e9e @@ -970,6 +1204,7 @@ label.select.iso.or.template=S\u00e9lectionner un ISO ou un mod\u00e8le label.select.offering=S\u00e9lectionner une offre label.select.project=S\u00e9lectionner un projet label.select=S\u00e9lectionner +label.select.template=S\u00e9lectionner Mod\u00e8le label.select.tier=S\u00e9lectionner le tiers label.select-view=S\u00e9lectionner la vue label.select.vm.for.static.nat=S\u00e9lectionner une VM pour le NAT statique @@ -977,32 +1212,45 @@ label.sent=Envoy\u00e9 label.server=Serveur label.service.capabilities=Fonctions disponibles label.service.offering=Offre de Service +label.services=Services +label.service.state=\u00c9tat du service label.session.expired=Session expir\u00e9e +label.set.default.NIC=D\u00e9finir NIC par d\u00e9faut +label.settings=Param\u00e8tres label.setup=Configuration label.setup.network=Configurer le r\u00e9seau label.setup.zone=Configurer la zone label.set.up.zone.type=Configurer le type de zone label.shared=En partage label.SharedMountPoint=Point de montage partag\u00e9 +label.show.advanced.settings=Voir param\u00e8tres avanc\u00e9s label.show.ingress.rule=Montrer la r\u00e8gle d\\'entr\u00e9e label.shutdown.provider=\u00c9teindre ce fournisseur label.site.to.site.VPN=VPN Site-\u00e0-Site label.size=Taille label.skip.guide=J\\'ai d\u00e9j\u00e0 utilis\u00e9 CloudStack avant, passer ce tutoriel +label.smb.domain=Domaine SMB +label.smb.password=Mot de passe SMB +label.smb.username=Identifiant SMB label.snapshot=Instantan\u00e9 label.snapshot.limits=Limites d\\'instantan\u00e9s label.snapshot.name=Nom Instantan\u00e9 label.snapshot.schedule=Configurer un instantan\u00e9 r\u00e9current label.snapshot.s=Instantan\u00e9(s) label.snapshots=Instantan\u00e9s +label.SNMP.community=Communaut\u00e9 SNMP +label.SNMP.port=Port SNMP +label.sockets=Sockets label.source.nat=NAT Source label.source=Origine label.specify.IP.ranges=Sp\u00e9cifier des plages IP label.specify.vlan=Pr\u00e9ciser le VLAN label.specify.vxlan=Pr\u00e9ciser le VXLAN label.SR.name = Nom du point de montage +label.srx.details=D\u00e9tails SRX label.srx=SRX label.start.IP=Plage de d\u00e9but IP +label.start.lb.vm=D\u00e9marrer LB VM label.start.port=Port de d\u00e9but label.start.reserved.system.IP=Adresse IP de d\u00e9but r\u00e9serv\u00e9e Syst\u00e8me label.start.vlan=VLAN de d\u00e9part @@ -1038,6 +1286,7 @@ label.sticky.prefix=Pr\u00e9fixe label.sticky.request-learn=Apprendre la requ\u00eate label.sticky.tablesize=Taille du tableau label.stop=Arr\u00eater +label.stop.lb.vm=Arr\u00eater LB VM label.stopped.vms=VMs arr\u00eat\u00e9es label.storage=Stockage label.storage.tags=\u00c9tiquettes de stockage @@ -1051,21 +1300,29 @@ label.sunday=Dimanche label.super.cidr.for.guest.networks=Super CIDR pour les r\u00e9seaux invit\u00e9s label.supported.services=Services support\u00e9s label.supported.source.NAT.type=Type de NAT support\u00e9 +label.supportsstrechedl2subnet=Sous-r\u00e9seau Streched L2 support\u00e9 label.suspend.project=Suspendre projet +label.switch.type=Type commutateur label.system.capacity=Capacit\u00e9 syst\u00e8me +label.system.offering.for.router=Offre Syst\u00e8me pour Routeur label.system.offering=Offre de syst\u00e8me label.system.service.offering=Offre de Service Syst\u00e8me +label.system.vm.details=D\u00e9tails VM Syst\u00e8me +label.system.vm.scaled.up=VM Syst\u00e8me agrandie label.system.vms=\ VMs Syst\u00e8mes label.system.vm.type=Type de VM syst\u00e8me label.system.vm=VM Syst\u00e8me label.system.wide.capacity=Capacit\u00e9 globale label.tagged=\u00c9tiquet\u00e9 +label.tag.key=Cl\u00e9 Tag label.tags=\u00c9tiquette +label.tag.value=Valeur Tag label.target.iqn=Cible IQN label.task.completed=T\u00e2che termin\u00e9e label.template.limits=Limites de mod\u00e8le label.template=Mod\u00e8le label.TFTP.dir=R\u00e9pertoire TFTP +label.tftp.root.directory=R\u00e9pertoire racine TFTP label.theme.default=Th\u00e8me par d\u00e9faut label.theme.grey=Personnalis\u00e9 - Gris label.theme.lightblue=Personnalis\u00e9 - Bleu clair @@ -1085,13 +1342,17 @@ label.total.memory=Total m\u00e9moire label.total.of.ip=Total adresses IP label.total.of.vm=Total VM label.total.storage=Total stockage +label.total.virtual.routers=Total des Routeurs virtuels +label.total.virtual.routers.upgrade=Total des routeurs virtuels avec mise \u00e0 niveau n\u00e9cessaire label.total.vms=Nombre total de VMs -label.traffic.label=Libell\u00e9 de trafic +label.traffic.label=Libell\u00e9 trafic label.traffic.types=Types de trafic -label.traffic.type=Type de Trafic +label.traffic.type=Type Trafic label.tuesday=Mardi label.type.id=ID du Type +label.type.lower=type label.type=Type +label.ucs=UCS label.unavailable=Indisponible label.unlimited=Illimit\u00e9 label.untagged=Non Tagg\u00e9 @@ -1099,14 +1360,19 @@ label.update.project.resources=Mettre \u00e0 jour les ressources du projet label.update.ssl.cert= Certificat SSL label.update.ssl= Certificat SSL label.updating=Mise \u00e0 jour +label.upgrade.required=Mise \u00e0 niveau n\u00e9cessaire +label.upgrade.router.newer.template=Mette \u00e0 jour le routeur pour utiliser le mod\u00e8le le plus r\u00e9cent label.upload=Charger label.upload.volume=Charger un volume label.url=URL label.usage.interface=Interface Utilisation label.used=Utilis\u00e9 +label.user.data=Donn\u00e9es utilisateur +label.username.lower=nom d\\'utilisateur label.username=Nom d\\'Utilisateur label.users=Utilisateurs label.user=Utilisateur +label.use.vm.ips=Utiliser IP VMs label.use.vm.ip=Utiliser IP VM \: label.value=Valeur label.vcdcname=Nom du DC vCenter @@ -1116,8 +1382,14 @@ label.vcenter.datastore=Datastore vCenter label.vcenter.host=H\u00f4te vCenter label.vcenter.password=Mot de passe vCenter label.vcenter.username=Nom d\\'utilisateur vCenter +label.vcenter=vcenter label.vcipaddress=Adresse IP vCenter label.version=Version +label.vgpu.max.resolution=R\u00e9solution Max. +label.vgpu.max.vgpu.per.gpu=vGPUs par GPU +label.vgpu.remaining.capacity=Capacit\u00e9 restante +label.vgpu.type=vGPU type +label.vgpu.video.ram=M\u00e9moire Vid\u00e9o label.view.all=Voir tout label.view.console=Voir la console label.viewing=Consultation en cours @@ -1125,23 +1397,31 @@ label.view.more=Voir plus label.view.secondary.ips=Voir IPs secondaires label.view=Voir label.virtual.appliance=Appliance Virtuelle +label.virtual.appliance.details=D\u00e9tails Appliance Virtuelle label.virtual.appliances=Appliances Virtuelles label.virtual.machines=Machines virtuelles +label.virtual.networking=Mise en r\u00e9seau virtuelle label.virtual.network=R\u00e9seau virtuel label.virtual.router=Routeur Virtuel +label.virtual.routers.group.account=Routeurs virtuels group\u00e9s par compte +label.virtual.routers.group.cluster=Routeurs virtuels group\u00e9s par cluster +label.virtual.routers.group.pod=Routeurs virtuels group\u00e9s par pod +label.virtual.routers.group.zone=Routeurs virtuels group\u00e9s par zone label.virtual.routers=Routeurs virtuels label.vlan.id=ID du VLAN +label.vlan.range.details=D\u00e9tails plage VLAN label.vlan.range=Plage du VLAN +label.vlan.ranges=Plage(s) VLAN label.vlan=VLAN -label.vxlan.id=VXLAN ID -label.vxlan.range=Plage du VXLAN -label.vxlan=VXLAN +label.vlan.vni.range=Plage du VLAN +label.vlan.vni.ranges=Plage(s) VLAN/VNI label.vm.add=Ajouter une instance label.vm.destroy=D\u00e9truire label.vm.display.name=Nom commun VM label.VMFS.datastore=Magasin de donn\u00e9es VMFS label.vmfs=VMFS label.vm.name=Nom de la VM +label.vm.password=Le mot de passe de cette VM est label.vm.reboot=Red\u00e9marrer label.VMs.in.tier=Machines virtuelles dans le tiers label.vmsnapshot.current=estCourant @@ -1153,14 +1433,27 @@ label.vm.start=D\u00e9marrer label.vm.state=\u00c9tat VM label.vm.stop=Arr\u00eater label.vms=VMs -label.vmware.traffic.label=Libell\u00e9 pour le trafic VMware +label.vmware.datacenter.id=ID datacenter VMware +label.vmware.datacenter.name=Nom datacenter VMware +label.vmware.datacenter.vcenter=vcenter datacenter VMware +label.vmware.traffic.label=Libell\u00e9 trafic VMware +label.vnet.id=ID VLAN/VNI +label.vnet=VLAN/VNI +label.vnmc.devices=\u00c9quipement VNMC +label.volatile=Volatile label.volgroup=Groupe de Volume label.volume.limits=Limites des volumes label.volume.name=Nom du volume label.volumes=Volumes label.volume=Volume +label.vpc.distributedvpcrouter=Routeur VPC Distribu\u00e9 label.vpc.id=ID VPC +label.VPC.limits=Limites VPC +label.vpc.offering.details=D\u00e9tails offre VPC +label.vpc.offering=Offre VPC label.VPC.router.details=D\u00e9tails routeur VPC +label.vpc.supportsregionlevelvpc=VPC niveau R\u00e9gion support\u00e9 +label.vpc.virtual.router=Routeur virtuel VPC label.vpc=VPC label.VPN.connection=Connexion VPN label.vpn.customer.gateway=Passerelle VPN client @@ -1171,6 +1464,9 @@ label.vsmctrlvlanid=\ ID VLAN Contr\u00f4le label.vsmpktvlanid=ID VLAN Paquet label.vsmstoragevlanid=VLAN ID Stockage label.vsphere.managed=G\u00e9r\u00e9e par vSphere +label.vxlan.id=VXLAN ID +label.vxlan.range=Plage du VXLAN +label.vxlan=VXLAN label.waiting=En attente label.warn=Avertissement label.wednesday=Mercredi @@ -1178,10 +1474,14 @@ label.weekly=Hebdomadaire label.welcome=Bienvenue label.welcome.cloud.console=Bienvenue dans la Console d\\'Administration label.what.is.cloudstack=Qu\\'est-ce-que CloudStack&\#8482; ? -label.xen.traffic.label=Libell\u00e9 pour le trafic XenServer +label.xenserver.tools.version.61.plus=XenServer Tools Version 6.1\\+ +label.Xenserver.Tools.Version61plus=XenServer Tools Version 6.1\\+ +label.xen.traffic.label=Libell\u00e9 trafic XenServer label.yes=Oui +label.zone.dedicated=Zone d\u00e9di\u00e9e label.zone.details=D\u00e9tails de la zone label.zone.id=ID de la zone +label.zone.lower=zone label.zone.name=Nom de zone label.zone.step.1.title=\u00c9tape 1 \: S\u00e9lectionnez un r\u00e9seau label.zone.step.2.title=\u00c9tape 2 \: Ajoutez une zone @@ -1191,7 +1491,7 @@ label.zones=Zones label.zone.type=Type de zone label.zone.wide=Transverse \u00e0 la zone label.zoneWizard.trafficType.guest=Invit\u00e9 \: Trafic entre les machines virtuelles utilisateurs -label.zoneWizard.trafficType.management=Administration \: Trafic entre les ressources internes de CloudStack, incluant tous les composants qui communiquent avec le serveur d\\'administration, tels que les h\u00f4tes and les machines virtuelles Syst\u00e8mes CloudStack +label.zoneWizard.trafficType.management=Administration \: Trafic entre les ressources internes de CloudStack, incluant tous les composants qui communiquent avec le serveur d\\'administration, tels que les h\u00f4tes et les machines virtuelles Syst\u00e8mes CloudStack label.zoneWizard.trafficType.public=Public \: Trafic entre Internet et les machines virtuelles dans le nuage label.zoneWizard.trafficType.storage=Stockage \: Trafic entre les serveurs de stockages principaux et secondaires, tel que le transfert de machines virtuelles mod\u00e8les et des instantan\u00e9s de disques label.zone=Zone @@ -1205,68 +1505,71 @@ message.action.cancel.maintenance=Votre h\u00f4te a quitt\u00e9 la maintenance. message.action.change.service.warning.for.instance=Votre instance doit \u00eatre arr\u00eat\u00e9e avant d\\'essayer de changer son offre de service. message.action.change.service.warning.for.router=Votre routeur doit \u00eatre arr\u00eat\u00e9 avant d\\'essayer de changer son offre de service. message.action.delete.cluster=\u00cates-vous s\u00fbr que vous voulez supprimer ce cluster. -message.action.delete.disk.offering=\u00cates-vous s\u00fbr que vous souhaitez supprimer cette offre de disque. +message.action.delete.disk.offering=Supprimer cette offre de disque ? message.action.delete.domain=\u00cates-vous s\u00fbr que vous voulez supprimer ce domaine. -message.action.delete.external.firewall=\u00cates-vous s\u00fbr que vous souhaitez supprimer ce pare-feu externe. Attention \: Si vous pr\u00e9voyez de rajouter le m\u00eame pare-feu externe de nouveau, vous devez r\u00e9-initialiser les donn\u00e9es d\\'utilisation sur l\\'appareil. -message.action.delete.external.load.balancer=\u00cates-vous s\u00fbr que vous souhaitez supprimer ce r\u00e9partiteur de charge externe. Attention \: Si vous pensez ajouter le m\u00eame r\u00e9partiteur de charge plus tard, vous devez remettre \u00e0 z\u00e9ro les statistiques d\\'utilisation de cet \u00e9quipement. -message.action.delete.ingress.rule=\u00cates-vous s\u00fbr que vous souhaitez supprimer cette r\u00e8gle d\\'entr\u00e9e. +message.action.delete.external.firewall=Supprimer ce pare-feu externe ? Attention \: Si vous pr\u00e9voyez de rajouter le m\u00eame pare-feu externe de nouveau, vous devez r\u00e9-initialiser les donn\u00e9es d\\'utilisation sur l\\'appareil. +message.action.delete.external.load.balancer=Supprimer ce r\u00e9partiteur de charge externe ? Attention \: Si vous pensez ajouter le m\u00eame r\u00e9partiteur de charge plus tard, vous devez remettre \u00e0 z\u00e9ro les statistiques d\\'utilisation de cet \u00e9quipement. +message.action.delete.ingress.rule=Supprimer cette r\u00e8gle de flux entrant ? message.action.delete.ISO.for.all.zones=L\\'ISO est utilis\u00e9 par toutes les zones. S\\'il vous pla\u00eet confirmer que vous voulez le supprimer de toutes les zones. -message.action.delete.ISO=\u00cates-vous s\u00fbr que vous souhaitez supprimer cette ISO. +message.action.delete.ISO=Supprimer cet ISO ? message.action.delete.network=\u00cates-vous s\u00fbr que vous voulez supprimer ce r\u00e9seau. message.action.delete.nexusVswitch=Confirmer la suppession de ce Nexus 1000v message.action.delete.nic=Veuillez confirmer que vous souhaitez supprimer cette carte NIC, ce qui supprimera \u00e9galement le r\u00e9seau associ\u00e9 sur la machine virtuelle. message.action.delete.physical.network=Confirmer la suppression du r\u00e9seau physique -message.action.delete.pod=\u00cates-vous s\u00fbr que vous souhaitez supprimer ce pod. -message.action.delete.primary.storage=\u00cates-vous s\u00fbr que vous voulez supprimer ce stockage principal. -message.action.delete.secondary.storage=\u00cates-vous s\u00fbr que vous souhaitez supprimer ce stockage secondaire. -message.action.delete.security.group=\u00cates-vous s\u00fbr que vous souhaitez supprimer ce groupe de s\u00e9curit\u00e9. -message.action.delete.service.offering=\u00cates-vous s\u00fbr que vous souhaitez supprimer cette offre de service. -message.action.delete.snapshot=\u00cates-vous s\u00fbr que vous souhaitez supprimer cet instantan\u00e9 +message.action.delete.pod=Supprimer ce pod ? +message.action.delete.primary.storage=\u00cates-vous s\u00fbr que vous voulez supprimer ce stockage primaire. +message.action.delete.secondary.storage=Supprimer ce stockage secondaire ? +message.action.delete.security.group=Supprimer ce groupe de s\u00e9curit\u00e9 ? +message.action.delete.service.offering=Supprimer cette offre de service ? +message.action.delete.snapshot=Supprimer cet instantan\u00e9 ? message.action.delete.system.service.offering=\u00cates-vous s\u00fbr que vous voulez supprimer l\\'offre syst\u00e8me. -message.action.delete.template.for.all.zones=Ce mod\u00e8le est utilis\u00e9 par toutes les zones. \u00cates-vous s\u00fbr que vous souhaitez le supprimer de toutes les zones. -message.action.delete.template=\u00cates-vous s\u00fbr que vous souhaitez supprimer ce mod\u00e8le. -message.action.delete.volume=\u00cates-vous s\u00fbr que vous souhaitez supprimer ce volume. -message.action.delete.zone=\u00cates-vous s\u00fbr que vous souhaitez supprimer cette zone. -message.action.destroy.instance=\u00cates-vous s\u00fbr que vous souhaitez supprimer cette instance. -message.action.destroy.systemvm=\u00cates-vous s\u00fbr que vous souhaitez supprimer cette VM Syst\u00e8me. -message.action.disable.cluster=\u00cates-vous s\u00fbr que vous souhaitez d\u00e9sactiver ce cluster +message.action.delete.template.for.all.zones=Ce mod\u00e8le est utilis\u00e9 par toutes les zones. Supprimer de toutes les zones ? +message.action.delete.template=Supprimer ce mod\u00e8le ? +message.action.delete.volume=Supprimer ce volume ? +message.action.delete.zone=Supprimer cette zone ? +message.action.destroy.instance=Supprimer cette instance ? +message.action.destroy.systemvm=Supprimer cette VM Syst\u00e8me ? +message.action.disable.cluster=D\u00e9sactiver ce cluster ? message.action.disable.nexusVswitch=Confirmer la d\u00e9sactivation de ce Nexus 1000v message.action.disable.physical.network=Confirmer l\\'activation de ce r\u00e9seau physique. -message.action.disable.pod=\u00cates-vous s\u00fbr que vous souhaitez d\u00e9sactiver ce Pod -message.action.disable.static.NAT=\u00cates-vous s\u00fbr que vous souhaitez d\u00e9sactiver le NAT statique. -message.action.disable.zone=\u00cates-vous s\u00fbr que vous souhaitez d\u00e9sactiver cette zone +message.action.disable.pod=D\u00e9sactiver ce pod ? +message.action.disable.static.NAT=D\u00e9sactiver le NAT statique ? +message.action.disable.zone=D\u00e9sactiver cette zone ? +message.action.downloading.template=T\u00e9l\u00e9chargement mod\u00e8le. message.action.download.iso=Confirmer le t\u00e9l\u00e9chargement de cet ISO message.action.download.template=Confirmer le t\u00e9l\u00e9chargement de ce mod\u00e8le -message.action.enable.cluster=\u00cates-vous s\u00fbr que vous souhaitez activer ce cluster +message.action.enable.cluster=Activer ce cluster ? message.action.enable.maintenance=Votre h\u00f4te a \u00e9t\u00e9 mis en mode maintenance avec succ\u00e8s. Ce processus peut durer plusieurs minutes ou plus, suivant le nombre de VMs actives sur cet h\u00f4te. message.action.enable.nexusVswitch=Confirmer l\\'activation de ce Nexus 1000v message.action.enable.physical.network=Confirmer l\\'activation de ce r\u00e9seau physique. -message.action.enable.pod=\u00cates-vous s\u00fbr que vous souhaitez activer ce Pod -message.action.enable.zone=\u00cates-vous s\u00fbr que vous souhaitez activer cette zone +message.action.enable.pod=Activer ce pod ? +message.action.enable.zone=Activer cette zone ? +message.action.expunge.instance=Confirmez que vous souhaitez oruger cette instance. message.action.force.reconnect=Votre h\u00f4te a \u00e9t\u00e9 forc\u00e9e \u00e0 se reconnecter avec succ\u00e8s. Ce processus peut prendre jusqu\\'\u00e0 plusieurs minutes. message.action.host.enable.maintenance.mode=Activer le mode maintenance va causer la migration \u00e0 chaud de l\\'ensemble des instances de cet h\u00f4te sur les autres h\u00f4tes disponibles. message.action.instance.reset.password=Confirmer le changement du mot de passe ROOT pour cette machine virtuelle. -message.action.manage.cluster=\u00cates-vous s\u00fbr que vous souhaitez g\u00e9rer le cluster -message.action.primarystorage.enable.maintenance.mode=Attention \: placer ce stockage principal en mode maintenance va provoquer l\\'arr\u00eat de l\\'ensemble des VMs utilisant des volumes sur ce stockage. Souhaitez-vous continuer ? -message.action.reboot.instance=\u00cates-vous s\u00fbr que vous souhaitez red\u00e9marrer cette instance. +message.action.manage.cluster=G\u00e9rer le cluster ? +message.action.primarystorage.enable.maintenance.mode=Attention \: placer ce stockage primaire en mode maintenance va provoquer l\\'arr\u00eat de l\\'ensemble des VMs utilisant des volumes sur ce stockage. Souhaitez-vous continuer ? +message.action.reboot.instance=Red\u00e9marrer cette instance ? message.action.reboot.router=Tous les services fournit par ce routeur virtuel vont \u00eatre interrompus. Confirmer le r\u00e9-amor\u00e7age de ce routeur. -message.action.reboot.systemvm=\u00cates-vous s\u00fbr que vous souhaitez red\u00e9marrer cette VM Syst\u00e8me -message.action.release.ip=\u00cates-vous s\u00fbr que vous souhaitez lib\u00e9rer cette IP. +message.action.reboot.systemvm=Red\u00e9marrer cette VM Syst\u00e8me ? +message.action.release.ip=Lib\u00e9rer cette adresse IP ? message.action.remove.host=\u00cates-vous s\u00fbr que vous voulez supprimer cet h\u00f4te. message.action.reset.password.off=Votre instance ne supporte pas pour le moment cette fonctionnalit\u00e9. message.action.reset.password.warning=Votre instance doit \u00eatre arr\u00eat\u00e9e avant d\\'essayer de changer son mot de passe. -message.action.restore.instance=\u00cates-vous s\u00fbr que vous souhaitez restaurer cette instance. -message.action.start.instance=\u00cates-vous s\u00fbr que vous souhaitez d\u00e9marrer cette instance. -message.action.start.router=\u00cates-vous s\u00fbr que vous souhaitez d\u00e9marrer ce routeur. -message.action.start.systemvm=\u00cates-vous s\u00fbr que vous souhaitez red\u00e9marrer cette VM syst\u00e8me. -message.action.stop.instance=\u00cates-vous s\u00fbr que vous souhaitez arr\u00eater cette instance. +message.action.restore.instance=Restaurer cette instance ? +message.action.revert.snapshot=Confirmez que vous souhaitez r\u00e9tablir ce volume pour cet instantan\u00e9 +message.action.start.instance=D\u00e9marrer cette instance ? +message.action.start.router=D\u00e9marrer ce routeur ? +message.action.start.systemvm=Red\u00e9marrer cette VM syst\u00e8me ? +message.action.stop.instance=Arr\u00eater cette instance ? message.action.stop.router=Tous les services fournit par ce routeur virtuel vont \u00eatre interrompus. Confirmer l\\'arr\u00eat de ce routeur. -message.action.stop.systemvm=\u00cates-vous s\u00fbr que vous souhaitez arr\u00eater cette VM. +message.action.stop.systemvm=Arr\u00eater cette VM ? message.action.take.snapshot=Confirmer la prise d\\'un instantan\u00e9 pour ce volume. message.action.unmanage.cluster=Confirmez que vous ne voulez plus g\u00e9rer le cluster message.action.vmsnapshot.delete=Confirmez que vous souhaitez supprimer cet instantan\u00e9 VM. -message.action.vmsnapshot.revert=Revenir \u00e0 un instantan\u00e9 VM -message.activate.project=\u00cates-vous s\u00fbr de vouloir activer ce projet ? +message.action.vmsnapshot.revert=R\u00e9tablir l\\'instantan\u00e9 VM +message.activate.project=Voulez-vous activer ce projet ? message.add.cluster=Ajouter un cluster d\\'hyperviseurs g\u00e9r\u00e9 pour cette zone , pod message.add.cluster.zone=Ajouter un cluster d\\'hyperviseurs g\u00e9r\u00e9 pour cette zone message.add.disk.offering=Renseignez les param\u00e8tres suivants pour ajouter un offre de service de disques @@ -1287,8 +1590,8 @@ message.add.network=Ajouter un nouveau r\u00e9seau \u00e0 la zone\: message.add.pod.during.zone.creation=Chaque zone doit contenir un ou plusieurs pods, et le premier pod sera ajout\u00e9 maintenant. Une pod contient les h\u00f4tes et les serveurs de stockage primaire, qui seront ajout\u00e9s dans une \u00e9tape ult\u00e9rieure. Configurer une plage d\\'adresses IP r\u00e9serv\u00e9es pour le trafic de gestion interne de CloudStack. La plage d\\'IP r\u00e9serv\u00e9e doit \u00eatre unique pour chaque zone dans le nuage. -message.add.primary=Renseignez les param\u00e8tres suivants pour ajouter un stockage principal -message.add.primary.storage=Ajouter un nouveau stockage principal \u00e0 la zone , pod +message.add.primary=Renseignez les param\u00e8tres suivants pour ajouter un stockage primaire +message.add.primary.storage=Ajouter un nouveau stockage primaire \u00e0 la zone , pod message.add.region=Renseigner les informations suivantes pour ajouter une nouvelle r\u00e9gion. message.add.secondary.storage=Ajouter un nouveau stockage pour la zone message.add.service.offering=Renseigner les informations suivantes pour ajouter une nouvelle offre de service de calcul. @@ -1296,6 +1599,7 @@ message.add.system.service.offering=Ajouter les informations suivantes pour cr\u message.add.template=Renseignez les informations suivantes pour cr\u00e9er votre nouveau mod\u00e8le message.add.volume=Renseignez les informations suivantes pour ajouter un nouveau volume message.add.VPN.gateway=Confirmer l\\'ajout d\\'une passerelle VPN +message.admin.guide.read=Pour les VMs VMware, veuillez lire le paragraphe "dynamic scaling" dans le guide d\\'administration avant d\\'op\u00e9rer un dimensionnement. Voulez-vous continuer ?\\, message.advanced.mode.desc=Choisissez ce mod\u00e8le de r\u00e9seau si vous souhaitez b\u00e9n\u00e9ficier du support des VLANs. Ce mode de r\u00e9seau donne le plus de flexibilit\u00e9 aux administrateurs pour fournir des offres de service r\u00e9seau personnalis\u00e9es comme fournir des pare-feux, VPN, r\u00e9partiteurs de charge ou \u00e9galement activer des r\u00e9seaux virtuels ou directs. message.advanced.security.group=Choisissez ceci si vous souhaitez utiliser les groupes de s\u00e9curit\u00e9 pour fournir l\\'isolation des VMs invit\u00e9es. message.advanced.virtual=Choisissez ceci si vous souhaitez utiliser des VLANs pour fournir l\\'isolation des VMs invit\u00e9es. @@ -1304,61 +1608,104 @@ message.after.enable.swift=Swift configur\u00e9. Remarque \: une fois que vous q message.alert.state.detected=\u00c9tat d\\'alerte d\u00e9tect\u00e9 message.allow.vpn.access=Entrez un nom d\\'utilisateur et un mot de passe pour l\\'utilisateur que vous souhaitez autoriser \u00e0 utiliser l\\'acc\u00e8s VPN. message.apply.snapshot.policy=Vous avez mis \u00e0 jour votre politique d\\'instantan\u00e9s avec succ\u00e8s. -message.attach.iso.confirm=\u00cates-vous s\u00fbr que vous souhaitez attacher l\\'image ISO \u00e0 cette instance. +message.attach.iso.confirm=Attacher l\\'image ISO \u00e0 cette instance ? message.attach.volume=Renseignez les donn\u00e9es suivantes pour attacher un nouveau volume. Si vous attachez un volume disque \u00e0 une machine virtuelle sous Windows, vous aurez besoin de red\u00e9marrer l\\'instance pour voir le nouveau disque. message.basic.mode.desc=Choisissez ce mod\u00e8le de r\u00e9seau si vous *ne voulez pas* activer le support des VLANs. Toutes les instances cr\u00e9\u00e9es avec ce mod\u00e8le de r\u00e9seau se verront assigner une adresse IP et les groupes de s\u00e9curit\u00e9 seront utilis\u00e9s pour fournir l\\'isolation entre les VMs. -message.change.offering.confirm=\u00cates-vous s\u00fbr que vous souhaitez changer l\\'offre de service de cette instance. +message.change.offering.confirm=Changer l\\'offre de service de cette instance ? message.change.password=Merci de modifier votre mot de passe. +message.cluster.dedicated=Cluster d\u00e9di\u00e9e +message.cluster.dedication.released=Lib\u00e9ration de cluster d\u00e9di\u00e9 message.configure.all.traffic.types=Vous avez de multiples r\u00e9seaux physiques ; veuillez configurer les libell\u00e9s pour chaque type de trafic en cliquant sur le bouton Modifier. +message.configure.ldap=Confirmer la configuration LDAP message.configuring.guest.traffic=Configuration du r\u00e9seau VM message.configuring.physical.networks=Configuration des r\u00e9seaux physiques message.configuring.public.traffic=Configuration du r\u00e9seau public message.configuring.storage.traffic=Configuration du r\u00e9seau de stockage message.confirm.action.force.reconnect=Confirmer la re-connexion forc\u00e9e de cet h\u00f4te. +message.confirm.add.vnmc.provider=Confirmer l\\'ajout du fournisseur VNMC. +message.confirm.dedicate.cluster.domain.account=D\u00e9dier ce cluster \u00e0 un domaine/compte ? +message.confirm.dedicate.host.domain.account=D\u00e9dier cet h\u00f4te \u00e0 un domaine/compte ? +message.confirm.dedicate.pod.domain.account=D\u00e9dier ce pod \u00e0 un domaine/compte ? +message.confirm.dedicate.zone=\u00cates-vous s\u00fbr de d\u00e9dier cette zone \u00e0 un domaine/compte ? +message.confirm.delete.ciscovnmc.resource=Confirmer la suppression de la ressource CiscoVNMC message.confirm.delete.F5=Confirmer la suppression du F5 message.confirm.delete.NetScaler=Confirmer la suppression du Netscaler +message.confirm.delete.PA=Confirmer la suppression du Palo Alto +message.confirm.delete.secondary.staging.store=Confirmer que vous voulez supprimer le Stockage Secondaire Interm\u00e9diaire. message.confirm.delete.SRX=Confirmer la suppression du SRX +message.confirm.delete.ucs.manager=Confirmez que vous voulez supprimer le gestionnaire UCS message.confirm.destroy.router=\u00cates-vous s\u00fbr que vous voulez supprimer ce routeur +message.confirm.disable.network.offering=Voulez-vous d\u00e9sactiver cette offre r\u00e9seau ? message.confirm.disable.provider=Confirmer la d\u00e9sactivation de ce fournisseur +message.confirm.disable.vnmc.provider=Confirmer la d\u00e9sactivation du fournisseur VNMC. +message.confirm.disable.vpc.offering=Voulez-vous d\u00e9sactiver cette offre VPC ? +message.confirm.enable.network.offering=Voulez-vous activer cette offre r\u00e9seau ? message.confirm.enable.provider=Confirmer l\\'activation de ce fournisseur -message.confirm.join.project=\u00cates-vous s\u00fbr que vous souhaitez rejoindre ce projet. +message.confirm.enable.vnmc.provider=Confirmer l\\'activation du fournisseur VNMC. +message.confirm.enable.vpc.offering=Voulez-vous activer cette offre VPC ? +message.confirm.join.project=Rejoindre ce projet ? +message.confirm.refresh.blades=Confirmer que vous voulez rafra\u00eechr les lames. +message.confirm.release.dedicated.cluster=Lib\u00e9rer ce cluster d\u00e9di\u00e9 ? +message.confirm.release.dedicated.host=Lib\u00e9rer cet h\u00f4te d\u00e9di\u00e9e ? +message.confirm.release.dedicated.pod=Lib\u00e9rer ce pod d\u00e9di\u00e9 ? +message.confirm.release.dedicated.zone=Lib\u00e9rer cette zone d\u00e9di\u00e9e ? +message.confirm.release.dedicate.vlan.range=Confirmez que vous souhaitez lib\u00e9rer cette plage VLAN d\u00e9di\u00e9e. message.confirm.remove.IP.range=\u00cates-vous s\u00fbr que vous voulez supprimer cette plage d\\'adresses IP +message.confirm.remove.network.offering=Voulez-vous supprimer cette offre r\u00e9seau ? +message.confirm.remove.vmware.datacenter=Veuillez confirmer que vous voulez supprimer le datacenter VMware +message.confirm.remove.vpc.offering=Voulez-vous supprimer cette offre VPC ? +message.confirm.scale.up.router.vm=Agrandir la VM Routeur ? +message.confirm.scale.up.system.vm=Agrandir la VM Syst\u00e8me ? message.confirm.shutdown.provider=Confirmer l\\'arr\u00eat de ce fournisseur -message.copy.iso.confirm=\u00cates-vous s\u00fbr que vous souhaitez copier votre image ISO vers +message.confirm.start.lb.vm=Confirmez que vous souhaitez d\u00e9marrer ce LB VM. +message.confirm.stop.lb.vm=Confirmez que vous souhaitez arr\u00eater ce LB VM. +message.confirm.upgrade.router.newer.template=Confirmez que vous souhaitez mettre \u00e0 jour le routeur avec un mod\u00e8le plus r\u00e9cent. +message.confirm.upgrade.routers.account.newtemplate=Confirmez que vous souhaitez mettre \u00e0 jour tous les routeurs dans ce compte avec un mod\u00e8le plus r\u00e9cent. +message.confirm.upgrade.routers.cluster.newtemplate=Confirmez que vous souhaitez mettre \u00e0 jour tous les routeurs dans ce cluster avec un mod\u00e8le plus r\u00e9cent. +message.confirm.upgrade.routers.newtemplate=Confirmez que vous souhaitez mettre \u00e0 jour tous les routeurs dans cette zone avec un mod\u00e8le plus r\u00e9cent. +message.confirm.upgrade.routers.pod.newtemplate=Confirmez que vous souhaitez mettre \u00e0 jour tous les routeurs dans ce pod avec un mod\u00e8le plus r\u00e9cent. +message.copy.iso.confirm=Copier votre image ISO vers +message.copy.template.confirm=Voulez-vous copier le mod\u00e8le ? message.copy.template=Copier le mod\u00e8le XXX de la zone vers message.create.template.vm=Cr\u00e9er la VM depuis le mod\u00e8le message.create.template.volume=Renseignez les informations suivantes avec de cr\u00e9er un mod\u00e8le \u00e0 partir de votre volume de disque\:. La cr\u00e9ation du mod\u00e8le peut prendre plusieurs minutes suivant la taille du volume. -message.create.template=Voulez vous cr\u00e9er un mod\u00e8le ? +message.create.template=Voulez-vous cr\u00e9er un mod\u00e8le ? message.creating.cluster=Cr\u00e9ation du cluster message.creating.guest.network=Cr\u00e9ation du r\u00e9seau pour les invit\u00e9s message.creating.physical.networks=Cr\u00e9ation des r\u00e9seaux physiques message.creating.pod=Cr\u00e9ation d\\'un pod -message.creating.primary.storage=Cr\u00e9ation du stockage principal +message.creating.primary.storage=Cr\u00e9ation du stockage primaire message.creating.secondary.storage=Cr\u00e9ation du stockage secondaire +message.creating.systemVM=Cr\u00e9ation des VMs Syst\u00e8mes (peut prendre du temps)... message.creating.zone=Cr\u00e9ation de la zone message.decline.invitation=Voulez-vous refuser cette invitation au projet ? -message.delete.account=\u00cates-vous s\u00fbr que vous souhaitez supprimer ce compte. +message.dedicated.zone.released=Lib\u00e9ration de zone d\u00e9di\u00e9e +message.dedicate.zone=Zone d\u00e9di\u00e9e +message.delete.account=Supprimer ce compte ? message.delete.affinity.group=Confirmer la supression de ce groupe d\\'affinit\u00e9. message.delete.gateway=\u00cates-vous s\u00fbr que vous voulez supprimer cette passerelle -message.delete.project=\u00cates-vous s\u00fbr de vouloir supprimer ce projet ? +message.delete.project=Voulez-vous supprimer ce projet ? message.delete.user=\u00cates-vous s\u00fbr que vous voulez supprimer cet utilisateur. message.delete.VPN.connection=\u00cates-vous s\u00fbr que vous voulez supprimer la connexion VPN message.delete.VPN.customer.gateway=\u00cates-vous s\u00fbr que vous voulez supprimer cette passerelle VPN client message.delete.VPN.gateway=\u00cates-vous s\u00fbr que vous voulez supprimer cette passerelle VPN message.desc.advanced.zone=Pour des topologies de r\u00e9seau plus sophistiqu\u00e9es. Ce mod\u00e8le de r\u00e9seau permet plus de flexibilit\u00e9 dans la d\u00e9finition des r\u00e9seaux d\\'invit\u00e9s et propose des offres personnalis\u00e9es telles que le support de pare-feu, VPN ou d\\'\u00e9quilibrage de charge. message.desc.basic.zone=Fournit un r\u00e9seau unique o\u00f9 chaque instance de machine virtuelle se voit attribuer une adresse IP directement depuis le r\u00e9seau. L\\'isolation des invit\u00e9s peut \u00eatre assur\u00e9 au niveau de la couche r\u00e9seau-3 tels que les groupes de s\u00e9curit\u00e9 (filtrage d\\'adresse IP source). -message.desc.cluster=Chaque pod doit contenir un ou plusieurs clusters, et le premier cluster sera ajout\u00e9 tout de suite. Un cluster est un regroupement pour h\u00f4tes. Les h\u00f4tes d\\'un cluster ont tous un mat\u00e9riel identique, ex\u00e9cutent le m\u00eame hyperviseur, sont dans le m\u00eame sous-r\u00e9seau, et acc\u00e8dent au m\u00eame stockage partag\u00e9. Chaque cluster comprend une ou plusieurs h\u00f4tes et un ou plusieurs serveurs de stockage principal. +message.desc.cluster=Chaque pod doit contenir un ou plusieurs clusters, et le premier cluster sera ajout\u00e9 tout de suite. Un cluster est un regroupement pour h\u00f4tes. Les h\u00f4tes d\\'un cluster ont tous un mat\u00e9riel identique, ex\u00e9cutent le m\u00eame hyperviseur, sont dans le m\u00eame sous-r\u00e9seau, et acc\u00e8dent au m\u00eame stockage partag\u00e9. Chaque cluster comprend une ou plusieurs h\u00f4tes et un ou plusieurs serveurs de stockage primaire. message.desc.host=Chaque cluster doit contenir au moins un h\u00f4te (machine) pour ex\u00e9ctuer des machines virtuelles invit\u00e9es, et le premier h\u00f4te sera ajout\u00e9e maintenant. Pour un h\u00f4te fonctionnant dans CloudStack, vous devez installer un logiciel hyperviseur sur l\\'h\u00f4te, attribuer une adresse IP \u00e0 l\\'h\u00f4te, et s\\'assurer que l\\'h\u00f4te est connect\u00e9 au serveur d\\'administration CloudStack.

Indiquer le nom de l\\'h\u00f4te ou son adresse IP, l\\'identifiant de connexion (g\u00e9n\u00e9ralement root) et le mot de passe ainsi que toutes les \u00e9tiquettes permettant de classer les h\u00f4tes. -message.desc.primary.storage=Chaque cluster doit contenir un ou plusieurs serveurs de stockage principal, et le premier sera ajout\u00e9 tout de suite. Le stockage principal contient les volumes de disque pour les machines virtuelles s\\'ex\u00e9cutant sur les h\u00f4tes dans le cluster. Utiliser les protocoles standards pris en charge par l\\'hyperviseur sous-jacent. +message.desc.primary.storage=Chaque cluster doit contenir un ou plusieurs serveurs de stockage primaire, et le premier sera ajout\u00e9 tout de suite. Le stockage principal contient les volumes de disque pour les machines virtuelles s\\'ex\u00e9cutant sur les h\u00f4tes dans le cluster. Utiliser les protocoles standards pris en charge par l\\'hyperviseur sous-jacent. message.desc.secondary.storage=Chaque zone doit avoir au moins un serveur NFS ou un serveur de stockage secondaire, et sera ajout\u00e9 en premier tout de suite. Le stockage secondaire entrepose les mod\u00e8les de machines virtuelles, les images ISO et les images disques des volumes des machines virtuelles. Ce serveur doit \u00eatre accessible pour toutes les machines h\u00f4tes dans la zone.

Saisir l\\'adresse IP et le chemin d\\'export. -message.desc.zone=Une zone est la plus grande unit\u00e9 organisationnelle dans CloudStack, et correspond typiquement \u00e0 un centre de donn\u00e9es. Les zones fournissent un isolement physique et de la redondance. Une zone est constitu\u00e9e d\\'un ou plusieurs pods (dont chacun contient les h\u00f4tes et les serveurs de stockage principal) et un serveur de stockage secondaire qui est partag\u00e9e par tous les pods dans la zone. +message.desc.zone=Une zone est la plus grande unit\u00e9 organisationnelle dans CloudStack, et correspond typiquement \u00e0 un centre de donn\u00e9es. Les zones fournissent un isolement physique et de la redondance. Une zone est constitu\u00e9e d\\'un ou plusieurs pods (dont chacun contient les h\u00f4tes et les serveurs de stockage primaire) et un serveur de stockage secondaire qui est partag\u00e9e par tous les pods dans la zone. message.detach.disk=Voulez-vous d\u00e9tacher ce disque ? -message.detach.iso.confirm=\u00cates-vous s\u00fbr que vous souhaitez d\u00e9tacher l\\'image ISO de cette instance. +message.detach.iso.confirm=D\u00e9tacher l\\'image ISO de cette instance ? message.disable.account=Veuillez confirmer que vous voulez d\u00e9sactiver ce compte. En d\u00e9sactivant le compte, tous les utilisateurs pour ce compte n\\'auront plus acc\u00e8s \u00e0 leurs ressources sur le cloud. Toutes les machines virtuelles vont \u00eatre arr\u00eat\u00e9es imm\u00e9diatement. message.disable.snapshot.policy=Vous avez d\u00e9sactiv\u00e9 votre politique d\\'instantan\u00e9 avec succ\u00e8s. message.disable.user=Confirmer la d\u00e9sactivation de cet utilisateur. -message.disable.vpn.access=\u00cates-vous s\u00fbr que vous souhaitez d\u00e9sactiver l\\'acc\u00e8s VPN. -message.disable.vpn=\u00cates-vous s\u00fbr de vouloir d\u00e9sactiver le VPN ? +message.disable.vpn.access=D\u00e9sactiver l\\'acc\u00e8s VPN ? +message.disable.vpn=Voulez-vous d\u00e9sactiver le VPN ? +message.disabling.network.offering=D\u00e9sactivation de l\\'offre r\u00e9seau +message.disabling.vpc.offering=D\u00e9sactivation de l\\'offre VPC +message.disallowed.characters=Caract\u00e8res non autoris\u00e9s \: \\<\\,\\> message.download.ISO=Cliquer 00000 pour t\u00e9l\u00e9charger une image ISO message.download.template=Cliquer sur 00000 pour t\u00e9l\u00e9charger le mod\u00e8le message.download.volume=Cliquer sur 00000 pour t\u00e9l\u00e9charger le volume @@ -1367,25 +1714,33 @@ message.edit.account=Modifier ("-1" signifie pas de limite de ressources) message.edit.confirm=Confirmer les changements avant de cliquer sur "Enregistrer". message.edit.limits=Renseignez les limites pour les ressources suivantes. "-1" indique qu\\'il n\\'y a pas de limites pour la cr\u00e9ation de ressources. message.edit.traffic.type=Sp\u00e9cifier le libell\u00e9 de trafic associ\u00e9 avec ce type de trafic. -message.enable.account=\u00cates-vous s\u00fbr que vous souhaitez activer ce compte. +message.enable.account=Activer ce compte ? message.enabled.vpn.ip.sec=Votre cl\u00e9 partag\u00e9e IPSec est message.enabled.vpn=Votre acc\u00e8s VPN est activ\u00e9 et peut \u00eatre acc\u00e9d\u00e9 par l\\'IP message.enable.user=Confirmer l\\'activation de cet utilisateur. message.enable.vpn.access=Le VPN est d\u00e9sactiv\u00e9 pour cette adresse IP. Voulez vous activer l\\'acc\u00e8s VPN ? message.enable.vpn=Confirmer l\\'activation de l\\'acc\u00e8s VPN pour cette adresse IP. +message.enabling.network.offering=Activation de l\\'offre r\u00e9seau message.enabling.security.group.provider=Activation du fournisseur de groupe de s\u00e9curit\u00e9 +message.enabling.vpc.offering=Activation de l\\'offre VPC message.enabling.zone=Activation de la zone +message.enabling.zone.dots=Activation de la zone... +message.enter.seperated.list.multiple.cidrs=Veuillez entrer une liste de CIDRs s\u00e9par\u00e9s par des virgules si plusieurs message.enter.token=Entrer le jeton unique re\u00e7u dans le message d\\'invitation. message.generate.keys=Confirmer la g\u00e9n\u00e9ration de nouvelles clefs pour cet utilisateur. +message.gslb.delete.confirm=Confirmer la suppression de ce GSLB +message.gslb.lb.remove.confirm=Enlever la r\u00e9partition de charge du GSLB ? message.guest.traffic.in.advanced.zone=Le trafic r\u00e9seau d\\'invit\u00e9 est la communication entre les machines virtuelles utilisateur. Sp\u00e9cifier une plage d\\'identifiant VLAN pour le trafic des invit\u00e9s pour chaque r\u00e9seau physique. message.guest.traffic.in.basic.zone=Le trafic r\u00e9seau d\\'invit\u00e9 est la communication entre les machines virtuelles utilisateur. Sp\u00e9cifier une plage d\\'adresses IP que CloudStack peut assigner aux machines virtuelles Invit\u00e9. S\\'assurer que cette plage n\\'empi\u00e8te pas sur la plage r\u00e9serv\u00e9e aux adresses IP Syst\u00e8me. +message.host.dedicated=H\u00f4te d\u00e9di\u00e9e +message.host.dedication.released=Lib\u00e9ration de l\\'h\u00f4te d\u00e9di\u00e9 message.installWizard.click.retry=Appuyer sur le bouton pour essayer \u00e0 nouveau le d\u00e9marrage. message.installWizard.copy.whatIsACluster=Un cluster permet de grouper les h\u00f4tes. Les h\u00f4tes d\\'un cluster ont un mat\u00e9riel identique, ex\u00e9cutent le m\u00eame hyperviseur, sont sur le m\u00eame sous-r\u00e9seau, et acc\u00e8dent au m\u00eame stockage partag\u00e9. Les instances de machines virtuelles (VM) peuvent \u00eatre migr\u00e9es \u00e0 chaud d\\'un h\u00f4te \u00e0 un autre au sein du m\u00eame groupe, sans interrompre les services utilisateur. Un cluster est la trois \u00e8me plus large unit\u00e9 organisationnelle dans un d\u00e9ploiement CloudStack&\#8482;. Les clusters sont contenus dans les pods et les pods sont contenus dans les zones.

CloudStack&\#8482; permet d\\'avoir plusieurs clusters dans un d\u00e9ploiement en nuage, mais pour une installation basique, il n\\'y a qu\\'un seul cluster. message.installWizard.copy.whatIsAHost=Un h\u00f4te est une machine. Les h\u00f4tes fournissent les ressources informatiques qui ex\u00e9cutent les machines virtuelles invit\u00e9es. Chaque h\u00f4te a un logiciel hyperviseur install\u00e9 pour g\u00e9rer les machines virtuelles invit\u00e9es (sauf pour les h\u00f4tes de type \\'bare-metal\\', qui sont un cas particulier d\u00e9taill\u00e9 dans le Guide d\\'installation avanc\u00e9e). Par exemple, un serveur Linux avec KVM, un serveur Citrix XenServer, et un serveur ESXi sont des h\u00f4tes. Dans une installation basique, un seul h\u00f4te ex\u00e9cutant XenServer ou KVM est utilis\u00e9.

L\\'h\u00f4te est la plus petite unit\u00e9 organisation au sein d\\'un d\u00e9ploiement CloudStack&\#8482;. Les h\u00f4tes sont contenus dans les clusters, les clusters sont contenus dans les pods et les pods sont contenus dans les zones. message.installWizard.copy.whatIsAPod=Un pod repr\u00e9sente souvent un seul rack. Les h\u00f4tes dans le m\u00eame pod sont dans le m\u00eame sous-r\u00e9seau.
Un pod est la deuxi\u00e8me plus grande unit\u00e9 organisationnelle au sein d\\'un d\u00e9ploiement CloudStack&\#8482;. Les pods sont contenus dans les zones. Chaque zone peut contenir un ou plusieurs pods ; dans l\\'Installation Basique, vous aurez juste un pod dans votre zone. message.installWizard.copy.whatIsAZone=Une zone est la plus grande unit\u00e9 organisationnelle au sein d\\'un d\u00e9ploiement CloudStack&\#8482;. Une zone correspond typiquement \u00e0 un centre de donn\u00e9es, mais il est permis d\\'avoir plusieurs zones dans un centre de donn\u00e9es. L\\'avantage d\\'organiser une infrastructure en zones est de fournir une isolation physique et de la redondance. Par exemple, chaque zone peut avoir sa propre alimentation et de liaison avec le r\u00e9seau, et les zones peuvent \u00eatre tr\u00e8s \u00e9loign\u00e9es g\u00e9ographiquement (m\u00eame si ce n\\'est pas une obligation). message.installWizard.copy.whatIsCloudStack=CloudStack&\#8482; est une plate-forme logicielle de pools de ressources informatiques pour construire des infrastructures publiques, priv\u00e9es et hybrides en tant que services (IaaS) dans les nuages. CloudStack&\#8482; g\u00e8re le r\u00e9seau, le stockage et les noeuds de calcul qui composent une infrastructure dans les nuages. Utilisez CloudStack&\#8482; pour d\u00e9ployer, g\u00e9rer et configurer les environnements d\\'informatiques dans les nuages.

S\\'\u00e9tendant au-del\u00e0 des machines virtuelles individuelles fonctionnant sur du mat\u00e9riel standard, CloudStack&\#8482; offre une solution d\\'informatique en nuage cl\u00e9 en main pour fournir des centres de donn\u00e9es virtuels comme service - fournissant tous les composants essentiels pour construire, d\u00e9ployer et g\u00e9rer des applications \\'cloud\\' multi-niveaux et multi-locataire. Les versions libre et Premium sont disponibles, la version Libre offrant des caract\u00e9ristiques presque identiques. -message.installWizard.copy.whatIsPrimaryStorage=Une infrastructure CloudStack&\#8482; utilise deux types de stockage \: stockage principal et stockage secondaire. Les deux peuvent \u00eatre des serveurs iSCSI ou NFS, ou sur disque local.

Le stockage principal est associ\u00e9 \u00e0 un cluster, et stocke les volumes disques de chaque machine virtuelle pour toutes les VMs s\\'ex\u00e9cutant sur les h\u00f4tes dans le cluster. Le serveur de stockage principal est typiquement proche des h\u00f4tes. +message.installWizard.copy.whatIsPrimaryStorage=Une infrastructure CloudStack&\#8482; utilise deux types de stockage \: stockage primaire et stockage secondaire. Les deux peuvent \u00eatre des serveurs iSCSI ou NFS, ou sur disque local.

Le stockage principal est associ\u00e9 \u00e0 un cluster, et stocke les volumes disques de chaque machine virtuelle pour toutes les VMs s\\'ex\u00e9cutant sur les h\u00f4tes dans le cluster. Le serveur de stockage primaire est typiquement proche des h\u00f4tes. message.installWizard.copy.whatIsSecondaryStorage=Le stockage secondaire est associ\u00e9 \u00e0 une zone, et il stocke les \u00e9l\u00e9ments suivants\:
  • Mod\u00e8les - images de syst\u00e8mes d\\'exploitation qui peuvent \u00eatre utilis\u00e9es pour d\u00e9marrer les machines virtuelles et peuvent inclure des informations de configuration suppl\u00e9mentaires, telles que les applications pr\u00e9-install\u00e9es
  • Images ISO - images de syst\u00e8me d\\'exploitation ou d\\'installation d\\'OS qui peuvent \u00eatre amor\u00e7able ou non-amor\u00e7able
  • Images de volume disque - capture des donn\u00e9es de machines virtuelles qui peuvent \u00eatre utilis\u00e9es pour la r\u00e9cup\u00e9ration des donn\u00e9es ou cr\u00e9er des mod\u00e8les
message.installWizard.now.building=Construction de votre Cloud en cours message.installWizard.tooltip.addCluster.name=Un nom pour le cluster. Ce choix est libre et n\\'est pas utilis\u00e9 par CloudStack. @@ -1398,7 +1753,7 @@ message.installWizard.tooltip.addPod.reservedSystemGateway=Passerelle pour les s message.installWizard.tooltip.addPod.reservedSystemNetmask=Le masque r\u00e9seau que les instances utiliseront sur le r\u00e9seau message.installWizard.tooltip.addPod.reservedSystemStartIp=Ceci est la plage d\\'adresses IP dans le r\u00e9seau priv\u00e9 que CloudStack utilise la gestion des VMs du stockage secondaire et les VMs Console Proxy. Ces adresses IP sont prises dans le m\u00eame sous-r\u00e9seau que les serveurs h\u00f4tes. message.installWizard.tooltip.addPrimaryStorage.name=Nom pour ce stockage -message.installWizard.tooltip.addPrimaryStorage.path=(pour NFS) Dans NFS, ceci est le chemin d\\'export depuis le serveur. (pour SharedMountPoint) Le chemin. Avec KVM, c\\'est le chemin sur chaque h\u00f4te o\u00f9 ce stockage principal est mont\u00e9. Par exemple, "/mnt/primary". +message.installWizard.tooltip.addPrimaryStorage.path=(pour NFS) Dans NFS, ceci est le chemin d\\'export depuis le serveur. (pour SharedMountPoint) Le chemin. Avec KVM, c\\'est le chemin sur chaque h\u00f4te o\u00f9 ce stockage primaire est mont\u00e9. Par exemple, "/mnt/primary". message.installWizard.tooltip.addPrimaryStorage.server=(pour NFS, iSCSI ou PreSetup) Adresse IP ou nom DNS du stockage message.installWizard.tooltip.addSecondaryStorage.nfsServer=Adresse IP du serveur NFS supportant le stockage secondaire message.installWizard.tooltip.addSecondaryStorage.path=Le chemin export\u00e9, situ\u00e9 sur le serveur sp\u00e9cifi\u00e9 pr\u00e9c\u00e9demment @@ -1413,21 +1768,26 @@ message.installWizard.tooltip.configureGuestTraffic.guestGateway=La passerelle q message.installWizard.tooltip.configureGuestTraffic.guestNetmask=Le masque r\u00e9seau que les instances devrait utiliser sur le r\u00e9seau message.installWizard.tooltip.configureGuestTraffic.guestStartIp=La plage d\\'adresses IP qui sera disponible en allocation pour les machines invit\u00e9es dans cette zone. Si une carte r\u00e9seau est utilis\u00e9e, ces adresses IP peuvent \u00eatre dans le m\u00eame CIDR que le CIDR du pod. message.installWizard.tooltip.configureGuestTraffic.name=Nom pour ce r\u00e9seau +message.instance.scaled.up.confirm=\u00cates-vous s\u00fbr de vouloir agrandir votre instance ? message.instanceWizard.noTemplates=Vous n\\'avez pas de image disponible ; Ajouter un mod\u00e8le compatible puis relancer l\\'assistant de cr\u00e9ation d\\'instance. message.ip.address.changed=Vos adresses IP ont peut \u00eatre chang\u00e9es ; Voulez vous rafra\u00eechir la liste ? Dans ce cas, le panneau de d\u00e9tail se fermera. message.iso.desc=Image disque contenant des donn\u00e9es ou un support amor\u00e7able pour OS message.join.project=Vous avez rejoint un projet. S\u00e9lectionnez la vue Projet pour le voir. message.launch.vm.on.private.network=Souhaitez vous d\u00e9marrer cette instance sur votre propre r\u00e9seau priv\u00e9 ? message.launch.zone=La zone est pr\u00eate \u00e0 d\u00e9marrer ; passer \u00e0 l\\'\u00e9tape suivante. -message.lock.account=\u00cates-vous s\u00fbr que vous souhaitez verrouiller ce compte. En le verrouillant, les utilisateurs de ce compte ne seront plus capables de g\u00e9rer leurs ressources. Les ressources existantes resteront toutefois accessibles. +message.listView.subselect.multi=(Ctrl/Cmd-clic) +message.lock.account=Verrouiller ce compte ? En le verrouillant, les utilisateurs de ce compte ne seront plus capables de g\u00e9rer leurs ressources. Les ressources existantes resteront toutefois accessibles. message.migrate.instance.confirm=Confirmez l\\'h\u00f4te vers lequel vous souhaitez migrer cette instance message.migrate.instance.to.host=Confirmer la migration de l\\'instance vers un autre h\u00f4te -message.migrate.instance.to.ps=Confirmer la migration de l\\'instance vers un autre stockage principal +message.migrate.instance.to.ps=Confirmer la migration de l\\'instance vers un autre stockage primaire message.migrate.router.confirm=Confirmer la migration du routeur vers \: message.migrate.systemvm.confirm=Confirmer la migration de la VM syst\u00e8me vers \: -message.migrate.volume=Confirmer la migration du volume vers un autre stockage principal. +message.migrate.volume=Confirmer la migration du volume vers un autre stockage primaire. +message.network.addVM.desc=Veuillez sp\u00e9cifier le r\u00e9seau que vous souhaitez ajouter \u00e0 cette VM. Une nouvelle interface NIC sera ajout\u00e9e pour ce r\u00e9seau. +message.network.addVMNIC=Confirmer l\\'ajout d\\'une nouvelle NIC VM pour ce r\u00e9seau. message.new.user=Renseigner les informations suivantes pour ajouter un nouveau compte utilisateur message.no.affinity.groups=Vous n\\'avez pas de groupes d\\'affinit\u00e9. Continuer vers la prochaine \u00e9tape. +message.no.host.available=Aucun h\u00f4te n\\'est disponible pour la migration message.no.network.support.configuration.not.true=Il n\\'y a pas de zone avec la fonction groupe de s\u00e9curit\u00e9 active. D\u00e8s lors, pas de fonction r\u00e9seau suppl\u00e9mentaires disponibles. Continuer \u00e0 l\\'\u00e9tape 5. message.no.network.support=S\u00e9lectionnez l\\'hyperviseur. vSphere, n\\'a pas de fonctionnalit\u00e9s suppl\u00e9mentaires pour le r\u00e9seau. Continuez \u00e0 l\\'\u00e9tape 5. message.no.projects.adminOnly=Vous n\\'avez pas de projet.
Contacter votre administrateur pour ajouter un projet. @@ -1435,7 +1795,7 @@ message.no.projects=Vous n\\'avez pas de projet.
Vous pouvez en cr\u00e9er u message.number.clusters=

\# de Clusters

message.number.hosts=

\# d\\' H\u00f4tes

message.number.pods=

\# de Pods

-message.number.storage=

\# de Volumes de Stockage Principal

+message.number.storage=

\# de Volumes de Stockage Primaire

message.number.zones=

\# de Zones

message.pending.projects.1=Vous avez des invitations projet en attente \: message.pending.projects.2=Pour les visualiser, aller dans la section projets, puis s\u00e9lectionner invitation dans la liste d\u00e9roulante. @@ -1445,13 +1805,19 @@ message.please.select.a.configuration.for.your.zone=S\u00e9lectionner une config message.please.select.a.different.public.and.management.network.before.removing=S\u00e9lectionner un r\u00e9seau public et d\\'administration diff\u00e9rent avant de supprimer message.please.select.networks=S\u00e9lectionner les r\u00e9seaux pour votre machine virtuelle. message.please.wait.while.zone.is.being.created=Patienter pendant la cr\u00e9ation de la zone, cela peut prendre du temps... +message.pod.dedication.released=Lib\u00e9ration du pod d\u00e9di\u00e9 +message.portable.ip.delete.confirm=Supprimer la plage IP portable ? message.project.invite.sent=Invitation envoy\u00e9e ; les utilisateurs seront ajout\u00e9s apr\u00e8s acceptation de l\\'invitation message.public.traffic.in.advanced.zone=Le trafic public est g\u00e9n\u00e9r\u00e9 lorsque les machines virtuelles dans le nuage acc\u00e8dent \u00e0 Internet. Des adresses IP publiquement accessibles doivent \u00eatre pr\u00e9vues \u00e0 cet effet. Les utilisateurs peuvent utiliser l\\'interface d\\'administration de CloudStack pour acqu\u00e9rir ces adresses IP qui impl\u00e9menteront une translation d\\'adresse NAT entre le r\u00e9seau d\\'invit\u00e9 et le r\u00e9seau public.

Fournir au moins une plage d\\'adresses IP pour le trafic Internet. message.public.traffic.in.basic.zone=Le trafic public est g\u00e9n\u00e9r\u00e9 lorsque les machines virtuelles dans le nuage acc\u00e8dent \u00e0 Internet ou fournissent des services \u00e0 des utilisateurs sur Internet. Des adresses IP publiquement accessibles doivent \u00eatre pr\u00e9vus \u00e0 cet effet. Quand une instance est cr\u00e9\u00e9e, une adresse IP publique depuis un ensemble d\\'adresses IP publiques sera allou\u00e9e \u00e0 l\\'instance, en plus de l\\'adresse IP de l\\'invit\u00e9. La translation d\\'adresses statique NAT 1-1 sera mises en place automatiquement entre l\\'adresse IP publique et l\\'adresse IP de l\\'invit\u00e9. Les utilisateurs peuvent \u00e9galement utiliser l\\'interface d\\'administration CloudStack pour acqu\u00e9rir des adresses IP suppl\u00e9mentaires pour ajouter une translation d\\'adresse statique NAT entre leurs instances et le r\u00e9seau d\\'adresses IP publiques. +message.read.admin.guide.scaling.up=Veuillez lire le paragraphe "dynamic scaling" dans le guide d\\'administration avant d\\'op\u00e9rer un dimensionnement dynamique. +message.recover.vm=Confirmer la restauration de cette VM. message.redirecting.region=Redirection vers r\u00e9gion... -message.remove.region=Confirmer que vous souhaitez supprimer cette r\u00e9gion depuis ce serveur d\\'administration ? +message.reinstall.vm=NOTE\: Proc\u00e9dez avec prudence. Cela entra\u00eenera la r\u00e9-installation de la VM \u00e0 partir du mod\u00e8le; les donn\u00e9es sur le disque ROOT seront perdues. Les volumes de donn\u00e9es suppl\u00e9mentaires, le cas \u00e9ch\u00e9ant, ne seront pas touch\u00e9s. +message.remove.ldap=Voulez-vous supprimer la configuration LDAP ? +message.remove.region=Voulez-vous supprimer cette r\u00e9gion depuis ce serveur d\\'administration ? message.remove.vpc=Confirmer la suppression du VPC -message.remove.vpn.access=\u00cates-vous s\u00fbr que vous souhaitez supprimer l\\'acc\u00e8s VPN \u00e0 l\\'utilisateur suivant. +message.remove.vpn.access=Supprimer l\\'acc\u00e8s VPN de cet utilisateur ? message.reset.password.warning.notPasswordEnabled=Le mod\u00e8le de cette instance a \u00e9t\u00e9 cr\u00e9\u00e9 sans la gestion de mot de passe message.reset.password.warning.notStopped=Votre instance doit \u00eatre arr\u00eat\u00e9e avant de changer son mot de passe message.reset.VPN.connection=Confirmer le r\u00e9-initialisation de la connexion VPN @@ -1459,6 +1825,7 @@ message.restart.mgmt.server=Red\u00e9marrez votre(vos) serveur(s) de management message.restart.mgmt.usage.server=Red\u00e9marrer le ou les serveur(s) de gestion et le ou les serveur(s) de consommation pour que les nouveaux param\u00e8tres soient pris en compte. message.restart.network=Tous les services fournit par ce routeur virtuel vont \u00eatre interrompus. Confirmer le red\u00e9marrage de ce routeur. message.restart.vpc=Confirmer le red\u00e9marrage du VPC +message.restoreVM=Voulez-vous restaurer la VM ? message.security.group.usage=(Utilisez Ctrl-clic pour s\u00e9lectionner les groupes de s\u00e9curit\u00e9 vis\u00e9s) message.select.affinity.groups=S\u00e9lectionner les groupes d\\'affinit\u00e9 qui appartiendront \u00e0 cette machine virtuelle \: message.select.a.zone=Une zone correspond typiquement \u00e0 un seul centre de donn\u00e9es. Des zones multiples peuvent permettre de rendre votre cloud plus fiable en apportant une isolation physique et de la redondance. @@ -1467,10 +1834,14 @@ message.select.iso=S\u00e9lectionner un ISO pour votre nouvelle instance virtuel message.select.item=Merci de s\u00e9lectionner un \u00e9l\u00e9ment. message.select.security.groups=Merci de s\u00e9lectionner un(des) groupe(s) de s\u00e9curit\u00e9 pour la nouvelle VM message.select.template=S\u00e9lectionner un mod\u00e8le pour votre nouvelle instance virtuelle. +message.select.tier=Veuillez selectionner un tiers +message.set.default.NIC=Confirmer la mise par d\u00e9faut de cette NIC pour cette VM. +message.set.default.NIC.manual=Veuillez mettre \u00e0 jour manuellement la NIC par d\u00e9faut sur la VM maintenant. message.setup.physical.network.during.zone.creation.basic=Quand vous ajoutez une zone basique, vous pouvez param\u00e9trer un seul r\u00e9seau physique, correspondant \u00e0 une carte r\u00e9seau sur l\\'hyperviseur. Ce r\u00e9seau comportera plusieurs types de trafic.

Vous pouvez \u00e9galement glisser et d\u00e9poser d\\'autres types de trafic sur le r\u00e9seau physique. message.setup.physical.network.during.zone.creation=Lorsque vous ajoutez une zone avanc\u00e9e, vous avez besoin de d\u00e9finir un ou plusieurs r\u00e9seaux physiques. Chaque r\u00e9seau correspond \u00e0 une carte r\u00e9seau sur l\\'hyperviseur. Chaque r\u00e9seau physique peut supporter un ou plusieurs types de trafic, avec certaines restrictions sur la fa\u00e7on dont ils peuvent \u00eatre combin\u00e9s.

Glisser et d\u00e9poser un ou plusieurs types de trafic sur chaque r\u00e9seau physique. message.setup.successful=Installation du Cloud r\u00e9ussie \! message.snapshot.schedule=Vous pouvez mettre en place les politiques de g\u00e9n\u00e9ration d\\'instantan\u00e9s en s\u00e9lectionnant les options disponibles ci-dessous et en appliquant votre politique. +message.specifiy.tag.key.value=Sp\u00e9cifier une cl\u00e9 et valeur de tag message.specify.url=Renseigner l\\'URL message.step.1.continue=S\u00e9lectionnez un mod\u00e8le ou une image ISO pour continuer message.step.1.desc=S\u00e9lectionnez un mod\u00e8le pour votre nouvelle instance virtuelle. Vous pouvez \u00e9galement choisir un mod\u00e8le vierge sur lequel une image ISO pourra \u00eatre install\u00e9e. @@ -1481,8 +1852,11 @@ message.step.3.desc= message.step.4.continue=S\u00e9lectionnez au moins un r\u00e9seau pour continuer message.step.4.desc=S\u00e9lectionnez le r\u00e9seau principal auquel votre instance va \u00eatre connect\u00e9. message.storage.traffic=Trafic entre les ressources internes de CloudStack, incluant tous les composants qui communiquent avec le serveur d\\'administration, tels que les h\u00f4tes et les machines virtuelles Syst\u00e8mes CloudStack. Veuillez configurer le trafic de stockage ici. -message.suspend.project=\u00cates-vous s\u00fbr de vouloir suspendre ce projet ? +message.suspend.project=Voulez-vous suspendre ce projet ? +message.systems.vms.ready=VMs Syst\u00e8mes pr\u00eats. +message.template.copying=Le mod\u00e8le est copi\u00e9. message.template.desc=Image OS pouvant \u00eatre utilis\u00e9e pour d\u00e9marrer une VM +message.tier.required=Le tiers est obligatoire message.tooltip.dns.1=Nom d\\'un serveur DNS utilis\u00e9 par les VM de la zone. Les adresses IP publiques de cette zone doivent avoir une route vers ce serveur. message.tooltip.dns.2=Nom d\\'un serveur DNS secondaire utilis\u00e9 par les VM de la zone. Les adresses IP publiques de cette zone doivent avoir une route vers ce serveur. message.tooltip.internal.dns.1=Nom d\\'un serveur DNS que CloudStack peut utiliser pour les VM syst\u00e8me dans cette zone. Les adresses IP priv\u00e9es des pods doivent avoir une route vers ce serveur. @@ -1494,20 +1868,43 @@ message.tooltip.reserved.system.netmask=Le pr\u00e9fixe r\u00e9seau utilis\u00e9 message.tooltip.zone.name=Nom pour cette zone. message.update.os.preference=Choisissez votre OS pr\u00e9f\u00e9r\u00e9 pour cet h\u00f4te. Toutes les instances avec des pr\u00e9f\u00e9rences similaires seront d\\'abord allou\u00e9es \u00e0 cet h\u00f4te avant d\\'en choisir un autre. message.update.resource.count=Confirmer la mise \u00e0 jour des ressources pour ce compte. -message.update.ssl=Soumettez un nouveau certificat SSL compatible X.509 qui sera mis \u00e0 jour sur l\\'ensemble de instance de proxy console. +message.update.ssl=Soumettez un nouveau certificat SSL compatible X.509 qui sera mis \u00e0 jour sur chaque VM console proxy et VM sockage secondaire \: +message.validate.accept=Veuillez entrer une valeur avec une extension valide. +message.validate.creditcard=Veuillez entrer un num\u00e9ro de carte de cr\u00e9dit valide. +message.validate.date.ISO=Veuillez entrer une date (ISO) valide. +message.validate.date=Veuillez entrer une date valide. +message.validate.digits=Veuillez entrer uniquement des chiffres. +message.validate.email.address=Veuillez entrer une adresse email valide. +message.validate.equalto=Veuillez entrer de nouveau la m\u00eame valeur. +message.validate.fieldrequired=Ce champ est obligatoire. +message.validate.fixfield=Veuillez corriger ce champ. message.validate.instance.name=Le nom de l\\'instance ne peut d\u00e9passer 63 caract\u00e8res. Seuls les lettres de a \u00e0 z, les chiffres de 0 \u00e0 9 et les tirets sont accept\u00e9s. Le nom doit commencer par une lettre et se terminer par une lettre ou un chiffre. +message.validate.invalid.characters=Caract\u00e8res invalides trouv\u00e9s ; veuillez corriger. +message.validate.maxlength=Veuillez entrer uniquement {0} caract\u00e8res. +message.validate.max=Veuillez entrer une valeur inf\u00e9rieure ou \u00e9gale \u00e0 {0}. +message.validate.minlength=Veuillez entrer au moins {0} caract\u00e8res. +message.validate.number=Veuillez entrer un nombre valide. +message.validate.range.length=Veuillez entrer une valeur de {0} \u00e0 {1} caract\u00e8res. +message.validate.range=Veuillez entrer une valeur de {0} \u00e0 {1}. +message.validate.URL=Veuillez entrer une URL valide. message.virtual.network.desc=Un r\u00e9seau virtuel d\u00e9di\u00e9 pour votre compte. Ce domaine de multi-diffusion est contenu dans un VLAN et l\\'ensemble des r\u00e9seaux d\\'acc\u00e8s publique sont rout\u00e9s par un routeur virtuel. message.vm.create.template.confirm=Cr\u00e9er un mod\u00e8le va red\u00e9marrer la VM automatiquement message.vm.review.launch=Merci de v\u00e9rifier les informations suivantes et de confirmer que votre instance virtuelle est correcte avant de la d\u00e9marrer. -message.volume.create.template.confirm=\u00cates-vous s\u00fbr que vous souhaitez cr\u00e9er un mod\u00e8le pour ce disque. La cr\u00e9ation peut prendre plusieurs minutes, voire plus, selon la taille du volume. +message.vnmc.available.list=VNMC n\\'est pas disponible dans la liste des fournisseurs. +message.vnmc.not.available.list=VNMC n\\'est pas disponible dans la liste des fournisseurs. +message.volume.create.template.confirm=Cr\u00e9er un mod\u00e8le pour ce disque ? La cr\u00e9ation peut prendre plusieurs minutes, voir plus, selon la taille du volume. +message.waiting.for.builtin.templates.to.load=Attendre le chargement des mod\u00e8les pr\u00e9-construit... +message.XSTools61plus.update.failed=\u00c9chec de mise \u00e0 jour champ XenServer Tools Version 6.1\\+. Erreur \: message.you.must.have.at.least.one.physical.network=Vous devez avoir au moins un r\u00e9seau physique +message.your.cloudstack.is.ready=Votre CloudStack est pr\u00eat \! message.Zone.creation.complete=Cr\u00e9ation de la zone termin\u00e9e message.zone.creation.complete.would.you.like.to.enable.this.zone=Cr\u00e9ation de la zone termin\u00e9e. Voulez-vous l\\'activer ? message.zone.no.network.selection=La zone s\u00e9lectionn\u00e9e ne propose pas le r\u00e9seau choisi message.zone.step.1.desc=S\u00e9lectionnez un mod\u00e8le de r\u00e9seau pour votre zone. message.zone.step.2.desc=Renseigner les informations suivantes pour ajouter une nouvelle zone message.zone.step.3.desc=Renseigner les informations suivantes pour ajouter un nouveau pod -message.zoneWizard.enable.local.storage=ATTENTION \: si vous activez le stockage local pour cette zone, vous devez effectuer les op\u00e9rations suivantes, selon l\\'endroit o\u00f9 vous souhaitez lancer vos machines virtuelles Syst\u00e8mes \:

1. Si les machines virtuelles Syst\u00e8mes doivent \u00eatre lanc\u00e9es depuis le stockage principal, ce dernier doit \u00eatre ajout\u00e9 \u00e0 la zone apr\u00e8s la cr\u00e9ation. Vous devez \u00e9galement d\u00e9marrer la zone dans un \u00e9tat d\u00e9sactiv\u00e9.

2. Si les machines virtuelles Syst\u00e8mes doivent \u00eatre lanc\u00e9es depuis le stockage local, le param\u00e8tre system.vm.use.local.storage doit \u00eatre d\u00e9fini \u00e0 \\'true\\' avant d\\'activer la zone.


Voulez-vous continuer ? +message.zoneWizard.enable.local.storage=ATTENTION \: si vous activez le stockage local pour cette zone, vous devez effectuer les op\u00e9rations suivantes, selon l\\'endroit o\u00f9 vous souhaitez lancer vos machines virtuelles Syst\u00e8mes \:

1. Si les machines virtuelles Syst\u00e8mes doivent \u00eatre lanc\u00e9es depuis le stockage primaire, ce dernier doit \u00eatre ajout\u00e9 \u00e0 la zone apr\u00e8s la cr\u00e9ation. Vous devez \u00e9galement d\u00e9marrer la zone dans un \u00e9tat d\u00e9sactiv\u00e9.

2. Si les machines virtuelles Syst\u00e8mes doivent \u00eatre lanc\u00e9es depuis le stockage local, le param\u00e8tre system.vm.use.local.storage doit \u00eatre d\u00e9fini \u00e0 \\'true\\' avant d\\'activer la zone.


Voulez-vous continuer ? +messgae.validate.min=Veuillez entrer une valeur sup\u00e9rieure ou \u00e9gale \u00e0 {0}. mode=Mode network.rate=D\u00e9bit R\u00e9seau notification.reboot.instance=Red\u00e9marrer l\\'instance diff --git a/client/WEB-INF/classes/resources/messages_it_IT.properties b/client/WEB-INF/classes/resources/messages_it_IT.properties index eab29b9b99..e2f3f0b5aa 100644 --- a/client/WEB-INF/classes/resources/messages_it_IT.properties +++ b/client/WEB-INF/classes/resources/messages_it_IT.properties @@ -354,6 +354,7 @@ label.ESP.encryption=Encryption di ESP label.ESP.hash=Hash di ESP label.ESP.policy=Policy di ESP label.f5=F5 +label.failed=Errore label.full.path=Path completo label.guest.end.ip=Indirizzo IP guest finale label.guest=Guest @@ -435,6 +436,7 @@ label.migrate.instance.to.ps=Migrare instance verso un altro primary storage label.migrate.to.host=Migrare verso un host label.migrate.to.storage=Migrare verso uno storage label.migrate.volume=Migrare un volume verso un altro primary storage +label.mode=Modalit\u00e0 label.move.down.row=Sposta gi\u00f9 di una riga label.move.to.bottom=Sposta gi\u00f9 alla fine label.move.to.top=Sposta in su all\\'inizio @@ -606,6 +608,7 @@ label.VMs.in.tier=VM nei livelli label.vm.state=Stato VM label.vm.stop=Stop label.vmware.traffic.label=Etichetta del traffico via VMware +label.vnet=VLAN label.vpc.id=ID del VPC label.VPC.router.details=Dettagli del router VPC label.vpc=VPC @@ -783,7 +786,6 @@ message.you.must.have.at.least.one.physical.network=E\\' necessario disporre di message.Zone.creation.complete=Creazione zona completata message.zone.creation.complete.would.you.like.to.enable.this.zone=Creazione zona completata. Si desidera abilitare questa zona? message.zone.no.network.selection=La zona selezionata non contiene opzioni per la selezione della rete. -message.zoneWizard.enable.local.storage=ATTENZIONE\: Se si abilita lo storage locale per questa zona, \u00e8 necessario procedere come segue, a seconda di dove si intende avviare le VM di sistema\:

1. Se le VM di sistema devono essere avviate dal primary storage, questo deve essere aggiunto alla zona dopo la sua creazione. E\\' anche necessario avviare la zona in uno stato disabilitato.

2. Se le VM di sistema devono essere avviate dallo storage locale, system.vm.use.local.storage deve essere impostato a true prima di abilitare la zona.


Si intende procedere? mode=Modalit\u00e0 notification.reboot.instance=Riavviare una instanza notification.start.instance=Avviare una instanza diff --git a/client/WEB-INF/classes/resources/messages_ja_JP.properties b/client/WEB-INF/classes/resources/messages_ja_JP.properties index d3d50f0e88..2fa3cb641a 100644 --- a/client/WEB-INF/classes/resources/messages_ja_JP.properties +++ b/client/WEB-INF/classes/resources/messages_ja_JP.properties @@ -14,56 +14,11 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -label.port=\u30dd\u30fc\u30c8 -label.remove.ldap=LDAP \u306e\u524a\u9664 -label.configure.ldap=LDAP \u306e\u69cb\u6210 -label.ldap.configuration=LDAP \u69cb\u6210 -label.ldap.port=LDAP \u30dd\u30fc\u30c8 -label.create.nfs.secondary.staging.store=NFS \u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2\u3092\u4f5c\u6210\u3059\u308b -label.volatile=\u63ee\u767a\u6027 -label.planner.mode=\u30d7\u30e9\u30f3\u30ca\u30fc \u30e2\u30fc\u30c9 -label.deployment.planner=\u5c55\u958b\u30d7\u30e9\u30f3\u30ca\u30fc -label.quiesce.vm=VM \u3092\u4f11\u6b62\u3059\u308b -label.smb.username=SMB \u30e6\u30fc\u30b6\u30fc\u540d -label.smb.password=SMB \u30d1\u30b9\u30ef\u30fc\u30c9 -label.smb.domain=SMB \u30c9\u30e1\u30a4\u30f3 -label.hypervisors=\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc -label.home=\u30db\u30fc\u30e0 -label.sockets=CPU \u30bd\u30b1\u30c3\u30c8 -label.root.disk.size=\u30eb\u30fc\u30c8 \u30c7\u30a3\u30b9\u30af \u30b5\u30a4\u30ba -label.s3.nfs.server=S3 NFS \u30b5\u30fc\u30d0\u30fc -label.s3.nfs.path=S3 NFS \u30d1\u30b9 -label.delete.events=\u30a4\u30d9\u30f3\u30c8\u306e\u524a\u9664 -label.delete.alerts=\u30a2\u30e9\u30fc\u30c8\u306e\u524a\u9664 -label.archive.alerts=\u30a2\u30e9\u30fc\u30c8\u306e\u30a2\u30fc\u30ab\u30a4\u30d6 -label.archive.events=\u30a4\u30d9\u30f3\u30c8\u306e\u30a2\u30fc\u30ab\u30a4\u30d6 -label.by.alert.type=\u30a2\u30e9\u30fc\u30c8\u306e\u7a2e\u985e -label.by.event.type=\u30a4\u30d9\u30f3\u30c8\u306e\u7a2e\u985e -label.by.date.start=\u65e5\u4ed8 (\u958b\u59cb) -label.by.date.end=\u65e5\u4ed8 (\u7d42\u4e86) -label.switch.type=\u30b9\u30a4\u30c3\u30c1\u306e\u7a2e\u985e -label.service.state=\u30b5\u30fc\u30d3\u30b9\u306e\u72b6\u614b -label.egress.default.policy=\u9001\u4fe1\u306e\u30c7\u30d5\u30a9\u30eb\u30c8 \u30dd\u30ea\u30b7\u30fc -label.routing=\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0 -label.about=\u30d0\u30fc\u30b8\u30e7\u30f3\u60c5\u5831 -label.app.name=CloudStack -label.about.app=CloudStack \u306b\u3064\u3044\u3066 -label.custom.disk.iops=\u30ab\u30b9\u30bf\u30e0 IOPS -label.disk.iops.min=\u6700\u5c0f IOPS -label.disk.iops.max=\u6700\u5927 IOPS -label.disk.iops.total=IOPS \u5408\u8a08 -label.hypervisor.snapshot.reserve=\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u4e88\u7d04 -label.view.secondary.ips=\u30bb\u30ab\u30f3\u30c0\u30ea IP \u30a2\u30c9\u30ec\u30b9\u306e\u8868\u793a -message.validate.invalid.characters=\u7121\u52b9\u306a\u6587\u5b57\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002\u4fee\u6574\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.acquire.ip.nic=\u3053\u306e NIC \u306e\u305f\u3081\u306b\u65b0\u3057\u3044\u30bb\u30ab\u30f3\u30c0\u30ea IP \u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b?
\u6ce8: \u65b0\u3057\u304f\u53d6\u5f97\u3057\u305f\u30bb\u30ab\u30f3\u30c0\u30ea IP \u30a2\u30c9\u30ec\u30b9\u306f\u4eee\u60f3\u30de\u30b7\u30f3\u5185\u3067\u624b\u52d5\u3067\u69cb\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 -message.select.affinity.groups=\u3053\u306e VM \u3092\u8ffd\u52a0\u3059\u308b\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.no.affinity.groups=\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u6b21\u306e\u624b\u9806\u306b\u9032\u3093\u3067\u304f\u3060\u3055\u3044\u3002 -label.action.delete.nic=NIC \u306e\u524a\u9664 -message.action.delete.nic=\u3053\u306e NIC \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? \u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3082 VM \u304b\u3089\u524a\u9664\u3055\u308c\u307e\u3059\u3002 + changed.item.properties=\u9805\u76ee\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u5909\u66f4 confirm.enable.s3=S3 \u30d9\u30fc\u30b9\u306e\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u30b5\u30dd\u30fc\u30c8\u3092\u6709\u52b9\u306b\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u60c5\u5831\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 confirm.enable.swift=Swift \u306e\u30b5\u30dd\u30fc\u30c8\u3092\u6709\u52b9\u306b\u3059\u308b\u306b\u306f\u3001\u6b21\u306e\u60c5\u5831\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -error.could.not.change.your.password.because.ldap.is.enabled=\u30a8\u30e9\u30fc\u3002LDAP \u304c\u6709\u52b9\u306a\u305f\u3081\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5909\u66f4\u3067\u304d\u307e\u305b\u3093\u3002 +error.could.not.change.your.password.because.ldap.is.enabled=LDAP \u304c\u6709\u52b9\u306a\u305f\u3081\u3001\u30a8\u30e9\u30fc\u306b\u3088\u3063\u3066\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u5909\u66f4\u3055\u308c\u307e\u305b\u3093\u3067\u3057\u305f\u3002 error.could.not.enable.zone=\u30be\u30fc\u30f3\u3092\u6709\u52b9\u306b\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f error.installWizard.message=\u554f\u984c\u304c\u767a\u751f\u3057\u307e\u3057\u305f\u3002\u623b\u3063\u3066\u30a8\u30e9\u30fc\u3092\u4fee\u6b63\u3067\u304d\u307e\u3059\u3002 error.invalid.username.password=\u7121\u52b9\u306a\u30e6\u30fc\u30b6\u30fc\u540d\u307e\u305f\u306f\u30d1\u30b9\u30ef\u30fc\u30c9\u3067\u3059\u3002 @@ -88,26 +43,30 @@ ICMP.type=ICMP \u306e\u7a2e\u985e image.directory=\u753b\u50cf\u30c7\u30a3\u30ec\u30af\u30c8\u30ea inline=\u76f4\u5217 instances.actions.reboot.label=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u518d\u8d77\u52d5 +label.about.app=CloudStack \u306b\u3064\u3044\u3066 +label.about=\u30d0\u30fc\u30b8\u30e7\u30f3\u60c5\u5831 label.accept.project.invitation=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3078\u306e\u62db\u5f85\u306e\u627f\u8afe label.account.and.security.group=\u30a2\u30ab\u30a6\u30f3\u30c8\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7 label.account.id=\u30a2\u30ab\u30a6\u30f3\u30c8 ID +label.account.lower=\u30a2\u30ab\u30a6\u30f3\u30c8 label.account.name=\u30a2\u30ab\u30a6\u30f3\u30c8\u540d label.account.specific=\u30a2\u30ab\u30a6\u30f3\u30c8\u56fa\u6709 -label.account=\u30a2\u30ab\u30a6\u30f3\u30c8 label.accounts=\u30a2\u30ab\u30a6\u30f3\u30c8 +label.account=\u30a2\u30ab\u30a6\u30f3\u30c8 +label.acl=ACL label.acquire.new.ip=\u65b0\u3057\u3044 IP \u30a2\u30c9\u30ec\u30b9\u306e\u53d6\u5f97 label.acquire.new.secondary.ip=\u30bb\u30ab\u30f3\u30c0\u30ea IP \u30a2\u30c9\u30ec\u30b9\u306e\u53d6\u5f97 label.action.attach.disk.processing=\u30c7\u30a3\u30b9\u30af\u3092\u30a2\u30bf\u30c3\u30c1\u3057\u3066\u3044\u307e\u3059... label.action.attach.disk=\u30c7\u30a3\u30b9\u30af\u306e\u30a2\u30bf\u30c3\u30c1 -label.action.attach.iso.processing=ISO \u3092\u30a2\u30bf\u30c3\u30c1\u3057\u3066\u3044\u307e\u3059... label.action.attach.iso=ISO \u306e\u30a2\u30bf\u30c3\u30c1 +label.action.attach.iso.processing=ISO \u3092\u30a2\u30bf\u30c3\u30c1\u3057\u3066\u3044\u307e\u3059... label.action.cancel.maintenance.mode.processing=\u4fdd\u5b88\u30e2\u30fc\u30c9\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3057\u3066\u3044\u307e\u3059... label.action.cancel.maintenance.mode=\u4fdd\u5b88\u30e2\u30fc\u30c9\u306e\u30ad\u30e3\u30f3\u30bb\u30eb label.action.change.password=\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u5909\u66f4 label.action.change.service.processing=\u30b5\u30fc\u30d3\u30b9\u3092\u5909\u66f4\u3057\u3066\u3044\u307e\u3059... label.action.change.service=\u30b5\u30fc\u30d3\u30b9\u306e\u5909\u66f4 -label.action.copy.ISO.processing=ISO \u3092\u30b3\u30d4\u30fc\u3057\u3066\u3044\u307e\u3059... label.action.copy.ISO=ISO \u306e\u30b3\u30d4\u30fc +label.action.copy.ISO.processing=ISO \u3092\u30b3\u30d4\u30fc\u3057\u3066\u3044\u307e\u3059... label.action.copy.template.processing=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30b3\u30d4\u30fc\u3057\u3066\u3044\u307e\u3059... label.action.copy.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30b3\u30d4\u30fc label.action.create.template.from.vm=VM \u304b\u3089\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u4f5c\u6210 @@ -130,15 +89,16 @@ label.action.delete.firewall.processing=\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30 label.action.delete.firewall=\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u898f\u5247\u306e\u524a\u9664 label.action.delete.ingress.rule.processing=\u53d7\u4fe1\u898f\u5247\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059... label.action.delete.ingress.rule=\u53d7\u4fe1\u898f\u5247\u306e\u524a\u9664 -label.action.delete.IP.range.processing=IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059... label.action.delete.IP.range=IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u306e\u524a\u9664 -label.action.delete.ISO.processing=ISO \u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059... +label.action.delete.IP.range.processing=IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059... label.action.delete.ISO=ISO \u306e\u524a\u9664 +label.action.delete.ISO.processing=ISO \u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059... label.action.delete.load.balancer.processing=\u8ca0\u8377\u5206\u6563\u88c5\u7f6e\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059... label.action.delete.load.balancer=\u8ca0\u8377\u5206\u6563\u898f\u5247\u306e\u524a\u9664 label.action.delete.network.processing=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059... label.action.delete.network=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u524a\u9664 label.action.delete.nexusVswitch=Nexus 1000V \u306e\u524a\u9664 +label.action.delete.nic=NIC \u306e\u524a\u9664 label.action.delete.physical.network=\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u524a\u9664 label.action.delete.pod.processing=\u30dd\u30c3\u30c9\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059... label.action.delete.pod=\u30dd\u30c3\u30c9\u306e\u524a\u9664 @@ -167,8 +127,8 @@ label.action.destroy.systemvm.processing=\u30b7\u30b9\u30c6\u30e0 VM \u3092\u783 label.action.destroy.systemvm=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u7834\u68c4 label.action.detach.disk.processing=\u30c7\u30a3\u30b9\u30af\u3092\u30c7\u30bf\u30c3\u30c1\u3057\u3066\u3044\u307e\u3059... label.action.detach.disk=\u30c7\u30a3\u30b9\u30af\u306e\u30c7\u30bf\u30c3\u30c1 -label.action.detach.iso.processing=ISO \u3092\u30c7\u30bf\u30c3\u30c1\u3057\u3066\u3044\u307e\u3059... label.action.detach.iso=ISO \u306e\u30c7\u30bf\u30c3\u30c1 +label.action.detach.iso.processing=ISO \u3092\u30c7\u30bf\u30c3\u30c1\u3057\u3066\u3044\u307e\u3059... label.action.disable.account.processing=\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u7121\u52b9\u306b\u3057\u3066\u3044\u307e\u3059... label.action.disable.account=\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u7121\u52b9\u5316 label.action.disable.cluster.processing=\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u7121\u52b9\u306b\u3057\u3066\u3044\u307e\u3059... @@ -220,8 +180,8 @@ label.action.enable.user.processing=\u30e6\u30fc\u30b6\u30fc\u3092\u6709\u52b9\u label.action.enable.user=\u30e6\u30fc\u30b6\u30fc\u306e\u6709\u52b9\u5316 label.action.enable.zone.processing=\u30be\u30fc\u30f3\u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u307e\u3059... label.action.enable.zone=\u30be\u30fc\u30f3\u306e\u6709\u52b9\u5316 -label.action.expunge.instance=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u62b9\u6d88 label.action.expunge.instance.processing=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u62b9\u6d88\u3057\u3066\u3044\u307e\u3059... +label.action.expunge.instance=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u62b9\u6d88 label.action.force.reconnect.processing=\u518d\u63a5\u7d9a\u3057\u3066\u3044\u307e\u3059... label.action.force.reconnect=\u5f37\u5236\u518d\u63a5\u7d9a label.action.generate.keys.processing=\u30ad\u30fc\u3092\u751f\u6210\u3057\u3066\u3044\u307e\u3059... @@ -246,8 +206,8 @@ label.action.reboot.systemvm=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u518d\u8d77\u52d label.action.recurring.snapshot=\u5b9a\u671f\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8 label.action.register.iso=ISO \u306e\u767b\u9332 label.action.register.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u767b\u9332 -label.action.release.ip.processing=IP \u30a2\u30c9\u30ec\u30b9\u3092\u89e3\u653e\u3057\u3066\u3044\u307e\u3059... label.action.release.ip=IP \u30a2\u30c9\u30ec\u30b9\u306e\u89e3\u653e +label.action.release.ip.processing=IP \u30a2\u30c9\u30ec\u30b9\u3092\u89e3\u653e\u3057\u3066\u3044\u307e\u3059... label.action.remove.host.processing=\u30db\u30b9\u30c8\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059... label.action.remove.host=\u30db\u30b9\u30c8\u306e\u524a\u9664 label.action.reset.password.processing=\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u30ea\u30bb\u30c3\u30c8\u3057\u3066\u3044\u307e\u3059... @@ -257,6 +217,8 @@ label.action.resize.volume=\u30dc\u30ea\u30e5\u30fc\u30e0 \u30b5\u30a4\u30ba\u30 label.action.resource.limits=\u30ea\u30bd\u30fc\u30b9\u5236\u9650 label.action.restore.instance.processing=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5fa9\u5143\u3057\u3066\u3044\u307e\u3059... label.action.restore.instance=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u5fa9\u5143 +label.action.revert.snapshot.processing=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306b\u623b\u3057\u3066\u3044\u307e\u3059... +label.action.revert.snapshot=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306b\u623b\u3059 label.action.start.instance.processing=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8d77\u52d5\u3057\u3066\u3044\u307e\u3059... label.action.start.instance=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u8d77\u52d5 label.action.start.router.processing=\u30eb\u30fc\u30bf\u30fc\u3092\u8d77\u52d5\u3057\u3066\u3044\u307e\u3059... @@ -269,28 +231,28 @@ label.action.stop.router.processing=\u30eb\u30fc\u30bf\u30fc\u3092\u505c\u6b62\u label.action.stop.router=\u30eb\u30fc\u30bf\u30fc\u306e\u505c\u6b62 label.action.stop.systemvm.processing=\u30b7\u30b9\u30c6\u30e0 VM \u3092\u505c\u6b62\u3057\u3066\u3044\u307e\u3059... label.action.stop.systemvm=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u505c\u6b62 +label.actions=\u64cd\u4f5c label.action.take.snapshot.processing=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059.... label.action.take.snapshot=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306e\u4f5c\u6210 -label.action.revert.snapshot.processing=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306b\u623b\u3057\u3066\u3044\u307e\u3059... -label.action.revert.snapshot=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306b\u623b\u3059 +label.action=\u64cd\u4f5c label.action.unmanage.cluster.processing=\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u975e\u7ba1\u7406\u5bfe\u8c61\u306b\u3057\u3066\u3044\u307e\u3059... label.action.unmanage.cluster=\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u975e\u7ba1\u7406\u5bfe\u8c61\u5316 -label.action.update.OS.preference.processing=OS \u57fa\u672c\u8a2d\u5b9a\u3092\u66f4\u65b0\u3057\u3066\u3044\u307e\u3059... label.action.update.OS.preference=OS \u57fa\u672c\u8a2d\u5b9a\u306e\u66f4\u65b0 +label.action.update.OS.preference.processing=OS \u57fa\u672c\u8a2d\u5b9a\u3092\u66f4\u65b0\u3057\u3066\u3044\u307e\u3059... label.action.update.resource.count.processing=\u30ea\u30bd\u30fc\u30b9\u6570\u3092\u66f4\u65b0\u3057\u3066\u3044\u307e\u3059... label.action.update.resource.count=\u30ea\u30bd\u30fc\u30b9\u6570\u306e\u66f4\u65b0 label.action.vmsnapshot.create=VM \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306e\u4f5c\u6210 label.action.vmsnapshot.delete=VM \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306e\u524a\u9664 label.action.vmsnapshot.revert=VM \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306b\u623b\u3059 -label.actions=\u64cd\u4f5c label.activate.project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30a2\u30af\u30c6\u30a3\u30d6\u5316 label.active.sessions=\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u30bb\u30c3\u30b7\u30e7\u30f3 +label.add.accounts.to=\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u8ffd\u52a0\u5148\: +label.add.accounts=\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u8ffd\u52a0 label.add.account.to.project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3078\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u8ffd\u52a0 label.add.account=\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u8ffd\u52a0 -label.add.accounts.to=\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u8ffd\u52a0\u5148: -label.add.accounts=\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u8ffd\u52a0 label.add.ACL=ACL \u306e\u8ffd\u52a0 label.add.affinity.group=\u65b0\u3057\u3044\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u306e\u8ffd\u52a0 +label.add.baremetal.dhcp.device=\u30d9\u30a2\u30e1\u30bf\u30eb DHCP \u30c7\u30d0\u30a4\u30b9\u306e\u8ffd\u52a0 label.add.BigSwitchVns.device=Big Switch VNS \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u8ffd\u52a0 label.add.by.cidr=CIDR \u3067\u8ffd\u52a0 label.add.by.group=\u30b0\u30eb\u30fc\u30d7\u3067\u8ffd\u52a0 @@ -300,13 +262,26 @@ label.add.compute.offering=\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b label.add.direct.iprange=\u76f4\u63a5 IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u306e\u8ffd\u52a0 label.add.disk.offering=\u30c7\u30a3\u30b9\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u8ffd\u52a0 label.add.domain=\u30c9\u30e1\u30a4\u30f3\u306e\u8ffd\u52a0 +label.added.new.bigswitch.vns.controller=\u65b0\u3057\u3044 Big Switch VNS \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f label.add.egress.rule=\u9001\u4fe1\u898f\u5247\u306e\u8ffd\u52a0 +label.addes.new.f5=\u65b0\u3057\u3044 F5 \u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f label.add.F5.device=F5 \u30c7\u30d0\u30a4\u30b9\u306e\u8ffd\u52a0 label.add.firewall=\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u898f\u5247\u306e\u8ffd\u52a0 +label.add.gslb=GSLB \u306e\u8ffd\u52a0 label.add.guest.network=\u30b2\u30b9\u30c8 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8ffd\u52a0 label.add.host=\u30db\u30b9\u30c8\u306e\u8ffd\u52a0 +label.adding.cluster=\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 +label.adding.failed=\u8ffd\u52a0\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f +label.adding.pod=\u30dd\u30c3\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 +label.adding.processing=\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059... label.add.ingress.rule=\u53d7\u4fe1\u898f\u5247\u306e\u8ffd\u52a0 +label.adding.succeeded=\u8ffd\u52a0\u3057\u307e\u3057\u305f +label.adding=\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 +label.adding.user=\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 +label.adding.zone=\u30be\u30fc\u30f3\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 label.add.ip.range=IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u306e\u8ffd\u52a0 +label.add.isolated.network=\u5206\u96e2\u3055\u308c\u305f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8ffd\u52a0 +label.additional.networks=\u8ffd\u52a0\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af label.add.load.balancer=\u8ca0\u8377\u5206\u6563\u88c5\u7f6e\u306e\u8ffd\u52a0 label.add.more=\u305d\u306e\u307b\u304b\u306e\u9805\u76ee\u306e\u8ffd\u52a0 label.add.netScaler.device=Netscaler \u30c7\u30d0\u30a4\u30b9\u306e\u8ffd\u52a0 @@ -317,15 +292,19 @@ label.add.network=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8ffd\u52a0 label.add.new.F5=\u65b0\u3057\u3044 F5 \u306e\u8ffd\u52a0 label.add.new.gateway=\u65b0\u3057\u3044\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u306e\u8ffd\u52a0 label.add.new.NetScaler=\u65b0\u3057\u3044 NetScaler \u306e\u8ffd\u52a0 -label.add.new.SRX=\u65b0\u3057\u3044 SRX \u306e\u8ffd\u52a0 label.add.new.PA=\u65b0\u3057\u3044 Palo Alto \u306e\u8ffd\u52a0 +label.add.new.SRX=\u65b0\u3057\u3044 SRX \u306e\u8ffd\u52a0 label.add.new.tier=\u65b0\u3057\u3044\u968e\u5c64\u306e\u8ffd\u52a0 +label.add.nfs.secondary.staging.store=NFS \u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2\u306e\u8ffd\u52a0 label.add.NiciraNvp.device=NVP \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u8ffd\u52a0 +label.add.OpenDaylight.device=OpenDaylight \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u8ffd\u52a0 +label.add.PA.device=Palo Alto \u30c7\u30d0\u30a4\u30b9\u306e\u8ffd\u52a0 label.add.physical.network=\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8ffd\u52a0 label.add.pod=\u30dd\u30c3\u30c9\u306e\u8ffd\u52a0 +label.add.portable.ip.range=\u30dd\u30fc\u30bf\u30d6\u30eb IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u306e\u8ffd\u52a0 label.add.port.forwarding.rule=\u30dd\u30fc\u30c8\u8ee2\u9001\u898f\u5247\u306e\u8ffd\u52a0 label.add.primary.storage=\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u8ffd\u52a0 -label.add.region=\u9818\u57df\u306e\u8ffd\u52a0 +label.add.region=\u30ea\u30fc\u30b8\u30e7\u30f3\u306e\u8ffd\u52a0 label.add.resources=\u30ea\u30bd\u30fc\u30b9\u306e\u8ffd\u52a0 label.add.route=\u30eb\u30fc\u30c8\u306e\u8ffd\u52a0 label.add.rule=\u898f\u5247\u306e\u8ffd\u52a0 @@ -333,42 +312,37 @@ label.add.secondary.storage=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u3 label.add.security.group=\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u306e\u8ffd\u52a0 label.add.service.offering=\u30b5\u30fc\u30d3\u30b9 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u8ffd\u52a0 label.add.SRX.device=SRX \u30c7\u30d0\u30a4\u30b9\u306e\u8ffd\u52a0 -label.add.PA.device=Palo Alto \u30c7\u30d0\u30a4\u30b9\u306e\u8ffd\u52a0 label.add.static.nat.rule=\u9759\u7684 NAT \u898f\u5247\u306e\u8ffd\u52a0 label.add.static.route=\u9759\u7684\u30eb\u30fc\u30c8\u306e\u8ffd\u52a0 label.add.system.service.offering=\u30b7\u30b9\u30c6\u30e0 \u30b5\u30fc\u30d3\u30b9 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u8ffd\u52a0 label.add.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u8ffd\u52a0 label.add.to.group=\u8ffd\u52a0\u5148\u30b0\u30eb\u30fc\u30d7 +label.add=\u8ffd\u52a0 +label.add.ucs.manager=UCS Manager \u306e\u8ffd\u52a0 label.add.user=\u30e6\u30fc\u30b6\u30fc\u306e\u8ffd\u52a0 label.add.vlan=VLAN \u306e\u8ffd\u52a0 -label.add.vxlan=VXLAN \u306e\u8ffd\u52a0 -label.add.VM.to.tier=\u968e\u5c64\u3078\u306e VM \u306e\u8ffd\u52a0 -label.add.vm=VM \u306e\u8ffd\u52a0 label.add.vms.to.lb=\u8ca0\u8377\u5206\u6563\u898f\u5247\u3078\u306e VM \u306e\u8ffd\u52a0 label.add.vms=VM \u306e\u8ffd\u52a0 +label.add.VM.to.tier=\u968e\u5c64\u3078\u306e VM \u306e\u8ffd\u52a0 +label.add.vm=VM \u306e\u8ffd\u52a0 +label.add.vmware.datacenter=VMware \u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u306e\u8ffd\u52a0 +label.add.vnmc.device=VNMC \u30c7\u30d0\u30a4\u30b9\u306e\u8ffd\u52a0 +label.add.vnmc.provider=VNMC \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u306e\u8ffd\u52a0 label.add.volume=\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u8ffd\u52a0 +label.add.vpc.offering=VPC \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u8ffd\u52a0 label.add.vpc=VPC \u306e\u8ffd\u52a0 label.add.vpn.customer.gateway=VPN \u30ab\u30b9\u30bf\u30de\u30fc \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u306e\u8ffd\u52a0 label.add.VPN.gateway=VPN \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u306e\u8ffd\u52a0 label.add.vpn.user=VPN \u30e6\u30fc\u30b6\u30fc\u306e\u8ffd\u52a0 +label.add.vxlan=VXLAN \u306e\u8ffd\u52a0 label.add.zone=\u30be\u30fc\u30f3\u306e\u8ffd\u52a0 -label.add=\u8ffd\u52a0 -label.adding.cluster=\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 -label.adding.failed=\u8ffd\u52a0\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f -label.adding.pod=\u30dd\u30c3\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 -label.adding.processing=\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059... -label.adding.succeeded=\u8ffd\u52a0\u3057\u307e\u3057\u305f -label.adding.user=\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 -label.adding.zone=\u30be\u30fc\u30f3\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 -label.adding=\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 -label.additional.networks=\u8ffd\u52a0\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af label.admin.accounts=\u7ba1\u7406\u8005\u30a2\u30ab\u30a6\u30f3\u30c8 label.admin=\u7ba1\u7406\u8005 label.advanced.mode=\u62e1\u5f35\u30e2\u30fc\u30c9 label.advanced.search=\u9ad8\u5ea6\u306a\u691c\u7d22 label.advanced=\u62e1\u5f35 -label.affinity.group=\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7 label.affinity.groups=\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7 +label.affinity.group=\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7 label.affinity=\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 label.agent.password=\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8 \u30d1\u30b9\u30ef\u30fc\u30c9 label.agent.username=\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8 \u30e6\u30fc\u30b6\u30fc\u540d @@ -377,152 +351,211 @@ label.alert=\u30a2\u30e9\u30fc\u30c8 label.algorithm=\u30a2\u30eb\u30b4\u30ea\u30ba\u30e0 label.allocated=\u5272\u308a\u5f53\u3066\u6e08\u307f label.allocation.state=\u5272\u308a\u5f53\u3066\u72b6\u614b -label.anti.affinity.group=\u30a2\u30f3\u30c1\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7 +label.allow=\u8a31\u53ef label.anti.affinity.groups=\u30a2\u30f3\u30c1\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7 +label.anti.affinity.group=\u30a2\u30f3\u30c1\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7 label.anti.affinity=\u30a2\u30f3\u30c1\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 label.api.key=API \u30ad\u30fc label.apply=\u9069\u7528 +label.app.name=CloudStack +label.archive.alerts=\u30a2\u30e9\u30fc\u30c8\u306e\u30a2\u30fc\u30ab\u30a4\u30d6 +label.archive.events=\u30a4\u30d9\u30f3\u30c8\u306e\u30a2\u30fc\u30ab\u30a4\u30d6 +label.assign.instance.another=\u307b\u304b\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3078\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u5272\u308a\u5f53\u3066 label.assign.to.load.balancer=\u8ca0\u8377\u5206\u6563\u88c5\u7f6e\u306b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5272\u308a\u5f53\u3066\u3066\u3044\u307e\u3059 label.assign=\u5272\u308a\u5f53\u3066 -label.associated.network.id=\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af ID -label.associated.network=\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af +label.associated.network.id=\u95a2\u9023\u3065\u3051\u3089\u308c\u305f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af ID +label.associated.network=\u95a2\u9023\u3065\u3051\u3089\u308c\u305f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af +label.associated.profile=\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb +label.associate.public.ip=\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9\u306e\u95a2\u9023\u4ed8\u3051 label.attached.iso=\u30a2\u30bf\u30c3\u30c1\u3055\u308c\u305f ISO label.author.email=\u4f5c\u6210\u8005\u306e\u96fb\u5b50\u30e1\u30fc\u30eb label.author.name=\u4f5c\u6210\u8005\u306e\u540d\u524d -label.availability.zone=\u30a2\u30d9\u30a4\u30e9\u30d3\u30ea\u30c6\u30a3 \u30be\u30fc\u30f3 +label.autoscale=\u81ea\u52d5\u30b5\u30a4\u30ba\u8a2d\u5b9a label.availability=\u53ef\u7528\u6027 +label.availability.zone=\u5229\u7528\u53ef\u80fd\u30be\u30fc\u30f3 label.available.public.ips=\u4f7f\u7528\u3067\u304d\u308b\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9 label.available=\u4f7f\u7528\u53ef\u80fd label.back=\u623b\u308b label.bandwidth=\u5e2f\u57df\u5e45 +label.baremetal.dhcp.devices=\u30d9\u30a2\u30e1\u30bf\u30eb DHCP \u30c7\u30d0\u30a4\u30b9 +label.baremetal.dhcp.provider=\u30d9\u30a2\u30e1\u30bf\u30eb DHCP \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc +label.baremetal.pxe.devices=\u30d9\u30a2\u30e1\u30bf\u30eb PXE \u30c7\u30d0\u30a4\u30b9 +label.baremetal.pxe.device=\u30d9\u30a2\u30e1\u30bf\u30eb PXE \u30c7\u30d0\u30a4\u30b9\u306e\u8ffd\u52a0 +label.baremetal.pxe.provider=\u30d9\u30a2\u30e1\u30bf\u30eb PXE \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc label.basic.mode=\u57fa\u672c\u30e2\u30fc\u30c9 label.basic=\u57fa\u672c label.bigswitch.controller.address=Big Switch VNS \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u30a2\u30c9\u30ec\u30b9 +label.bigswitch.vns.details=Big Switch VNS \u306e\u8a73\u7d30 +label.blade.id=\u30d6\u30ec\u30fc\u30c9 ID +label.blades=\u30d6\u30ec\u30fc\u30c9 label.bootable=\u8d77\u52d5\u53ef\u80fd label.broadcast.domain.range=\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8 \u30c9\u30e1\u30a4\u30f3\u306e\u7bc4\u56f2 label.broadcast.domain.type=\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8 \u30c9\u30e1\u30a4\u30f3\u306e\u7a2e\u985e label.broadcast.uri=\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8 URI +label.broadcasturi=\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8 URI +label.broadcat.uri=\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8 URI label.by.account=\u30a2\u30ab\u30a6\u30f3\u30c8 +label.by.alert.type=\u30a2\u30e9\u30fc\u30c8\u306e\u7a2e\u985e label.by.availability=\u53ef\u7528\u6027 +label.by.date.end=\u65e5\u4ed8 (\u7d42\u4e86) +label.by.date.start=\u65e5\u4ed8 (\u958b\u59cb) label.by.domain=\u30c9\u30e1\u30a4\u30f3 label.by.end.date=\u7d42\u4e86\u65e5 +label.by.event.type=\u30a4\u30d9\u30f3\u30c8\u306e\u7a2e\u985e label.by.level=\u30ec\u30d9\u30eb label.by.pod=\u30dd\u30c3\u30c9 label.by.role=\u5f79\u5272 label.by.start.date=\u958b\u59cb\u65e5 label.by.state=\u72b6\u614b +label.bytes.received=\u53d7\u4fe1\u30d0\u30a4\u30c8 +label.bytes.sent=\u9001\u4fe1\u30d0\u30a4\u30c8 label.by.traffic.type=\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u7a2e\u985e label.by.type.id=\u7a2e\u985e ID label.by.type=\u7a2e\u985e label.by.zone=\u30be\u30fc\u30f3 -label.bytes.received=\u53d7\u4fe1\u30d0\u30a4\u30c8 -label.bytes.sent=\u9001\u4fe1\u30d0\u30a4\u30c8 +label.cache.mode=\u66f8\u304d\u8fbc\u307f\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u7a2e\u985e label.cancel=\u30ad\u30e3\u30f3\u30bb\u30eb label.capacity=\u51e6\u7406\u80fd\u529b label.certificate=\u8a3c\u660e\u66f8 +label.change.affinity=\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3\u306e\u5909\u66f4 label.change.service.offering=\u30b5\u30fc\u30d3\u30b9 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u5909\u66f4 label.change.value=\u5024\u306e\u5909\u66f4 label.character=\u6587\u5b57 +label.chassis=\u30b7\u30e3\u30fc\u30b7 label.checksum=MD5 \u30c1\u30a7\u30c3\u30af\u30b5\u30e0 label.cidr.account=CIDR \u307e\u305f\u306f\u30a2\u30ab\u30a6\u30f3\u30c8/\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7 +label.cidr=CIDR label.CIDR.list=CIDR \u4e00\u89a7 label.cidr.list=\u9001\u4fe1\u5143 CIDR label.CIDR.of.destination.network=\u5b9b\u5148\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e CIDR -label.cidr=CIDR +label.cisco.nexus1000v.ip.address=Nexus 1000V \u306e IP \u30a2\u30c9\u30ec\u30b9 +label.cisco.nexus1000v.password=Nexus 1000V \u306e\u30d1\u30b9\u30ef\u30fc\u30c9 +label.cisco.nexus1000v.username=Nexus 1000V \u306e\u30e6\u30fc\u30b6\u30fc\u540d +label.ciscovnmc.resource.details=Cisco VNMC \u30ea\u30bd\u30fc\u30b9\u306e\u8a73\u7d30 label.clean.up=\u30af\u30ea\u30fc\u30f3 \u30a2\u30c3\u30d7\u3059\u308b label.clear.list=\u4e00\u89a7\u306e\u6d88\u53bb label.close=\u9589\u3058\u308b label.cloud.console=\u30af\u30e9\u30a6\u30c9\u7ba1\u7406\u30b3\u30f3\u30bd\u30fc\u30eb label.cloud.managed=Cloud.com \u306b\u3088\u308b\u7ba1\u7406 label.cluster.name=\u30af\u30e9\u30b9\u30bf\u30fc\u540d +label.clusters=\u30af\u30e9\u30b9\u30bf\u30fc label.cluster.type=\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u7a2e\u985e label.cluster=\u30af\u30e9\u30b9\u30bf\u30fc -label.clusters=\u30af\u30e9\u30b9\u30bf\u30fc label.clvm=CLVM -label.rbd=RBD -label.rbd.monitor=Ceph \u30e2\u30cb\u30bf\u30fc -label.rbd.pool=Ceph \u30d7\u30fc\u30eb -label.rbd.id=Cephx \u30e6\u30fc\u30b6\u30fc -label.rbd.secret=Cephx \u30b7\u30fc\u30af\u30ec\u30c3\u30c8 label.code=\u30b3\u30fc\u30c9 label.community=\u30b3\u30df\u30e5\u30cb\u30c6\u30a3 label.compute.and.storage=\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0\u3068\u30b9\u30c8\u30ec\u30fc\u30b8 -label.compute.offering=\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 label.compute.offerings=\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 +label.compute.offering=\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 label.compute=\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0 label.configuration=\u69cb\u6210 +label.configure.ldap=LDAP \u306e\u69cb\u6210 label.configure.network.ACLs=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af ACL \u306e\u69cb\u6210 -label.configure.vpc=VPC \u306e\u69cb\u6210 label.configure=\u69cb\u6210 -label.confirm.password=\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u78ba\u8a8d\u5165\u529b +label.configure.vpc=VPC \u306e\u69cb\u6210 label.confirmation=\u78ba\u8a8d +label.confirm.password=\u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u78ba\u8a8d\u5165\u529b label.congratulations=\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306f\u3053\u308c\u3067\u5b8c\u4e86\u3067\u3059\u3002 label.conserve.mode=\u7bc0\u7d04\u30e2\u30fc\u30c9 label.console.proxy=\u30b3\u30f3\u30bd\u30fc\u30eb \u30d7\u30ed\u30ad\u30b7 +label.console.proxy.vm=\u30b3\u30f3\u30bd\u30fc\u30eb \u30d7\u30ed\u30ad\u30b7 VM label.continue.basic.install=\u57fa\u672c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u7d9a\u884c\u3059\u308b label.continue=\u7d9a\u884c label.corrections.saved=\u63a5\u7d9a\u304c\u4fdd\u5b58\u3055\u308c\u307e\u3057\u305f label.cpu.allocated.for.VMs=VM \u306b\u5272\u308a\u5f53\u3066\u6e08\u307f\u306e CPU label.cpu.allocated=\u5272\u308a\u5f53\u3066\u6e08\u307f\u306e CPU -label.CPU.cap=CPU \u30ad\u30e3\u30c3\u30d7 +label.CPU.cap=CPU \u4e0a\u9650 +label.cpu=CPU label.cpu.limits=CPU \u5236\u9650 label.cpu.mhz=CPU (MHz) label.cpu.utilized=CPU \u4f7f\u7528\u7387 -label.cpu=CPU +label.created.by.system=\u30b7\u30b9\u30c6\u30e0\u4f5c\u6210 +label.created=\u4f5c\u6210\u65e5\u6642 +label.create.nfs.secondary.staging.storage=NFS \u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2\u3092\u4f5c\u6210\u3059\u308b +label.create.nfs.secondary.staging.store=NFS \u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2\u3092\u4f5c\u6210\u3059\u308b label.create.project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210 label.create.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u4f5c\u6210 label.create.VPN.connection=VPN \u63a5\u7d9a\u306e\u4f5c\u6210 -label.created.by.system=\u30b7\u30b9\u30c6\u30e0\u4f5c\u6210 -label.created=\u4f5c\u6210\u65e5\u6642 label.cross.zones=\u30af\u30ed\u30b9 \u30be\u30fc\u30f3 +label.custom.disk.iops=\u30ab\u30b9\u30bf\u30e0 IOPS label.custom.disk.size=\u30ab\u30b9\u30bf\u30e0 \u30c7\u30a3\u30b9\u30af \u30b5\u30a4\u30ba +label.custom=\u30ab\u30b9\u30bf\u30e0 label.daily=\u6bce\u65e5 label.data.disk.offering=\u30c7\u30fc\u30bf \u30c7\u30a3\u30b9\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 label.date=\u65e5\u6642 label.day.of.month=\u6bce\u6708\u6307\u5b9a\u65e5 label.day.of.week=\u6bce\u9031\u6307\u5b9a\u65e5 +label.dc.name=DC \u540d label.dead.peer.detection=\u505c\u6b62\u30d4\u30a2\u3092\u691c\u51fa\u3059\u308b label.decline.invitation=\u62db\u5f85\u306e\u8f9e\u9000 +label.dedicate.cluster=\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u5c02\u7528\u306b\u8a2d\u5b9a label.dedicated=\u5c02\u7528 +label.dedicated.vlan.vni.ranges=\u5c02\u7528 VLAN/VNI \u306e\u7bc4\u56f2 +label.dedicate.host=\u30db\u30b9\u30c8\u3092\u5c02\u7528\u306b\u8a2d\u5b9a +label.dedicate.pod=\u30dd\u30c3\u30c9\u3092\u5c02\u7528\u306b\u8a2d\u5b9a +label.dedicate=\u5c02\u7528\u306b\u8a2d\u5b9a +label.dedicate.vlan.vni.range=VLAN/VNI \u306e\u7bc4\u56f2\u3092\u5c02\u7528\u306b\u8a2d\u5b9a +label.dedicate.zone=\u30be\u30fc\u30f3\u3092\u5c02\u7528\u306b\u8a2d\u5b9a +label.default.egress.policy=\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u9001\u4fe1\u30dd\u30ea\u30b7\u30fc +label.default=\u30c7\u30d5\u30a9\u30eb\u30c8 label.default.use=\u30c7\u30d5\u30a9\u30eb\u30c8\u4f7f\u7528 label.default.view=\u30c7\u30d5\u30a9\u30eb\u30c8 \u30d3\u30e5\u30fc -label.default=\u30c7\u30d5\u30a9\u30eb\u30c8 label.delete.affinity.group=\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u306e\u524a\u9664 +label.delete.alerts=\u30a2\u30e9\u30fc\u30c8\u306e\u524a\u9664 label.delete.BigSwitchVns=Big Switch VNS \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u524a\u9664 +label.delete.ciscovnmc.resource=Cisco VNMC \u30ea\u30bd\u30fc\u30b9\u306e\u524a\u9664 +label.delete.events=\u30a4\u30d9\u30f3\u30c8\u306e\u524a\u9664 label.delete.F5=F5 \u306e\u524a\u9664 label.delete.gateway=\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u306e\u524a\u9664 label.delete.NetScaler=NetScaler \u306e\u524a\u9664 label.delete.NiciraNvp=NVP \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u524a\u9664 +label.delete.OpenDaylight.device=OpenDaylight \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u524a\u9664 +label.delete.PA=Palo Alto \u306e\u524a\u9664 +label.delete.portable.ip.range=\u30dd\u30fc\u30bf\u30d6\u30eb IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u306e\u524a\u9664 +label.delete.profile=\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664 label.delete.project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u524a\u9664 +label.delete.secondary.staging.store=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2\u306e\u524a\u9664 label.delete.SRX=SRX \u306e\u524a\u9664 -label.delete.PA=Palo Alto \u306e\u524a\u9664 +label.delete=\u524a\u9664 +label.delete.ucs.manager=UCS Manager \u306e\u524a\u9664 label.delete.VPN.connection=VPN \u63a5\u7d9a\u306e\u524a\u9664 label.delete.VPN.customer.gateway=VPN \u30ab\u30b9\u30bf\u30de\u30fc \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u306e\u524a\u9664 label.delete.VPN.gateway=VPN \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u306e\u524a\u9664 label.delete.vpn.user=VPN \u30e6\u30fc\u30b6\u30fc\u306e\u524a\u9664 -label.delete=\u524a\u9664 label.deleting.failed=\u524a\u9664\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f label.deleting.processing=\u524a\u9664\u3057\u3066\u3044\u307e\u3059... +label.deny=\u62d2\u5426 +label.deployment.planner=\u5c55\u958b\u30d7\u30e9\u30f3\u30ca\u30fc label.description=\u8aac\u660e label.destination.physical.network.id=\u30d6\u30ea\u30c3\u30b8\u5148\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af ID label.destination.zone=\u30b3\u30d4\u30fc\u5148\u30be\u30fc\u30f3 label.destroy.router=\u30eb\u30fc\u30bf\u30fc\u306e\u7834\u68c4 label.destroy=\u7834\u68c4 +label.destroy.vm.graceperiod=VM \u7834\u68c4\u306e\u7336\u4e88\u671f\u9593 label.detaching.disk=\u30c7\u30a3\u30b9\u30af\u3092\u30c7\u30bf\u30c3\u30c1\u3057\u3066\u3044\u307e\u3059 label.details=\u8a73\u7d30 label.device.id=\u30c7\u30d0\u30a4\u30b9 ID label.devices=\u30c7\u30d0\u30a4\u30b9 -label.DHCP.server.type=DHCP \u30b5\u30fc\u30d0\u30fc\u306e\u7a2e\u985e label.dhcp=DHCP +label.DHCP.server.type=DHCP \u30b5\u30fc\u30d0\u30fc\u306e\u7a2e\u985e label.direct.ips=\u5171\u6709\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e IP \u30a2\u30c9\u30ec\u30b9 +label.disable.autoscale=\u81ea\u52d5\u30b5\u30a4\u30ba\u8a2d\u5b9a\u306e\u7121\u52b9\u5316 +label.disabled=\u7121\u52b9 +label.disable.network.offering=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u7121\u52b9\u5316 label.disable.provider=\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u306e\u7121\u52b9\u5316 +label.disable.vnmc.provider=VNMC \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u306e\u7121\u52b9\u5316 +label.disable.vpc.offering=VPC \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u7121\u52b9\u5316 label.disable.vpn=VPN \u306e\u7121\u52b9\u5316 -label.disabled=\u7121\u52b9 label.disabling.vpn.access=VPN \u30a2\u30af\u30bb\u30b9\u3092\u7121\u52b9\u306b\u3057\u3066\u3044\u307e\u3059 +label.disassociate.profile.blade=\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3068\u30d6\u30ec\u30fc\u30c9\u306e\u95a2\u9023\u4ed8\u3051\u306e\u89e3\u9664 +label.disbale.vnmc.device=VNMC \u30c7\u30d0\u30a4\u30b9\u306e\u7121\u52b9\u5316 label.disk.allocated=\u5272\u308a\u5f53\u3066\u6e08\u307f\u306e\u30c7\u30a3\u30b9\u30af label.disk.bytes.read.rate=\u30c7\u30a3\u30b9\u30af\u8aad\u307f\u53d6\u308a\u901f\u5ea6 (BPS) label.disk.bytes.write.rate=\u30c7\u30a3\u30b9\u30af\u66f8\u304d\u8fbc\u307f\u901f\u5ea6 (BPS) +label.disk.iops.max=\u6700\u5927 IOPS +label.disk.iops.min=\u6700\u5c0f IOPS label.disk.iops.read.rate=\u30c7\u30a3\u30b9\u30af\u8aad\u307f\u53d6\u308a\u901f\u5ea6 (IOPS) +label.disk.iops.total=IOPS \u5408\u8a08 label.disk.iops.write.rate=\u30c7\u30a3\u30b9\u30af\u66f8\u304d\u8fbc\u307f\u901f\u5ea6 (IOPS) label.disk.offering=\u30c7\u30a3\u30b9\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 label.disk.read.bytes=\u30c7\u30a3\u30b9\u30af\u8aad\u307f\u53d6\u308a (\u30d0\u30a4\u30c8) @@ -535,47 +568,58 @@ label.disk.write.bytes=\u30c7\u30a3\u30b9\u30af\u66f8\u304d\u8fbc\u307f (\u30d0\ label.disk.write.io=\u30c7\u30a3\u30b9\u30af\u66f8\u304d\u8fbc\u307f (IO) label.display.name=\u8868\u793a\u540d label.display.text=\u8868\u793a\u30c6\u30ad\u30b9\u30c8 +label.distributedrouter=\u5206\u6563\u30eb\u30fc\u30bf\u30fc label.dns.1=DNS 1 label.dns.2=DNS 2 -label.DNS.domain.for.guest.networks=\u30b2\u30b9\u30c8 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e DNS \u30c9\u30e1\u30a4\u30f3 label.dns=DNS +label.DNS.domain.for.guest.networks=\u30b2\u30b9\u30c8 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e DNS \u30c9\u30e1\u30a4\u30f3 label.domain.admin=\u30c9\u30e1\u30a4\u30f3\u7ba1\u7406\u8005 label.domain.id=\u30c9\u30e1\u30a4\u30f3 ID +label.domain.lower=\u30c9\u30e1\u30a4\u30f3 label.domain.name=\u30c9\u30e1\u30a4\u30f3\u540d label.domain.router=\u30c9\u30e1\u30a4\u30f3 \u30eb\u30fc\u30bf\u30fc -label.domain.suffix=DNS \u30c9\u30e1\u30a4\u30f3 \u30b5\u30d5\u30a3\u30c3\u30af\u30b9 (\u4f8b: xyz.com) +label.domain.suffix=DNS \u30c9\u30e1\u30a4\u30f3 \u30b5\u30d5\u30a3\u30c3\u30af\u30b9 (\u4f8b\: xyz.com) label.domain=\u30c9\u30e1\u30a4\u30f3 label.done=\u5b8c\u4e86 label.double.quotes.are.not.allowed=\u4e8c\u91cd\u5f15\u7528\u7b26\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093 label.download.progress=\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306e\u9032\u6357\u72b6\u6cc1 label.drag.new.position=\u65b0\u3057\u3044\u4f4d\u7f6e\u306b\u30c9\u30e9\u30c3\u30b0 +label.dynamically.scalable=\u52d5\u7684\u306b\u30b5\u30a4\u30ba\u8a2d\u5b9a\u3059\u308b label.edit.affinity.group=\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u306e\u7de8\u96c6 label.edit.lb.rule=\u8ca0\u8377\u5206\u6563\u898f\u5247\u306e\u7de8\u96c6 label.edit.network.details=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8a73\u7d30\u306e\u7de8\u96c6 label.edit.project.details=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u8a73\u7d30\u306e\u7de8\u96c6 +label.edit.region=\u30ea\u30fc\u30b8\u30e7\u30f3\u306e\u7de8\u96c6 label.edit.tags=\u30bf\u30b0\u306e\u7de8\u96c6 label.edit.traffic.type=\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u7a2e\u985e\u306e\u7de8\u96c6 -label.edit.vpc=VPC \u306e\u7de8\u96c6 label.edit=\u7de8\u96c6 -label.egress.rule=\u9001\u4fe1\u898f\u5247 +label.edit.vpc=VPC \u306e\u7de8\u96c6 +label.egress.default.policy=\u9001\u4fe1\u306e\u30c7\u30d5\u30a9\u30eb\u30c8 \u30dd\u30ea\u30b7\u30fc label.egress.rules=\u9001\u4fe1\u898f\u5247 +label.egress.rule=\u9001\u4fe1\u898f\u5247 label.elastic.IP=\u30a8\u30e9\u30b9\u30c6\u30a3\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9 label.elastic.LB=\u30a8\u30e9\u30b9\u30c6\u30a3\u30c3\u30af\u8ca0\u8377\u5206\u6563 label.elastic=\u30a8\u30e9\u30b9\u30c6\u30a3\u30c3\u30af +label.email.lower=\u96fb\u5b50\u30e1\u30fc\u30eb label.email=\u96fb\u5b50\u30e1\u30fc\u30eb +label.enable.autoscale=\u81ea\u52d5\u30b5\u30a4\u30ba\u8a2d\u5b9a\u306e\u6709\u52b9\u5316 +label.enable.network.offering=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u6709\u52b9\u5316 label.enable.provider=\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u306e\u6709\u52b9\u5316 label.enable.s3=S3 \u30d9\u30fc\u30b9\u306e\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u6709\u52b9\u5316 label.enable.swift=Swift \u306e\u6709\u52b9\u5316 +label.enable.vnmc.device=VNMC \u30c7\u30d0\u30a4\u30b9\u306e\u6709\u52b9\u5316 +label.enable.vnmc.provider=VNMC \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u306e\u6709\u52b9\u5316 +label.enable.vpc.offering=VPC \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u6709\u52b9\u5316 label.enable.vpn=VPN \u306e\u6709\u52b9\u5316 label.enabling.vpn.access=VPN \u30a2\u30af\u30bb\u30b9\u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u307e\u3059 label.enabling.vpn=VPN \u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u307e\u3059 label.end.IP=\u7d42\u4e86 IP \u30a2\u30c9\u30ec\u30b9 +label.endpoint.or.operation=\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u307e\u305f\u306f\u64cd\u4f5c +label.endpoint=\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8 label.end.port=\u7d42\u4e86\u30dd\u30fc\u30c8 label.end.reserved.system.IP=\u4e88\u7d04\u6e08\u307f\u7d42\u4e86\u30b7\u30b9\u30c6\u30e0 IP \u30a2\u30c9\u30ec\u30b9 label.end.vlan=\u7d42\u4e86 VLAN label.end.vxlan=\u7d42\u4e86 VXLAN -label.endpoint.or.operation=\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u307e\u305f\u306f\u64cd\u4f5c -label.endpoint=\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8 label.enter.token=\u30c8\u30fc\u30af\u30f3\u306e\u5165\u529b label.error.code=\u30a8\u30e9\u30fc \u30b3\u30fc\u30c9 label.error=\u30a8\u30e9\u30fc @@ -587,12 +631,14 @@ label.esx.host=ESX/ESXi \u30db\u30b9\u30c8 label.example=\u4f8b label.expunge=\u62b9\u6d88 label.external.link=\u5916\u90e8\u30ea\u30f3\u30af +label.f5.details=F5 \u306e\u8a73\u7d30 label.f5=F5 label.failed=\u5931\u6557 label.featured=\u304a\u3059\u3059\u3081 label.fetch.latest=\u6700\u65b0\u60c5\u5831\u306e\u53d6\u5f97 label.filterBy=\u30d5\u30a3\u30eb\u30bf\u30fc label.firewall=\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb +label.firstname.lower=\u540d label.first.name=\u540d label.format=\u5f62\u5f0f label.friday=\u91d1\u66dc\u65e5 @@ -606,34 +652,59 @@ label.go.step.2=\u624b\u9806 2 \u306b\u9032\u3080 label.go.step.3=\u624b\u9806 3 \u306b\u9032\u3080 label.go.step.4=\u624b\u9806 4 \u306b\u9032\u3080 label.go.step.5=\u624b\u9806 5 \u306b\u9032\u3080 +label.gpu=GPU +label.group.by.account=\u30a2\u30ab\u30a6\u30f3\u30c8\u5225\u30b0\u30eb\u30fc\u30d7 +label.group.by.cluster=\u30af\u30e9\u30b9\u30bf\u30fc\u5225\u30b0\u30eb\u30fc\u30d7 +label.group.by.pod=\u30dd\u30c3\u30c9\u5225\u30b0\u30eb\u30fc\u30d7 +label.group.by.zone=\u30be\u30fc\u30f3\u5225\u30b0\u30eb\u30fc\u30d7 label.group.optional=\u30b0\u30eb\u30fc\u30d7 (\u30aa\u30d7\u30b7\u30e7\u30f3) label.group=\u30b0\u30eb\u30fc\u30d7 +label.gslb.assigned.lb.more=\u8ca0\u8377\u5206\u6563\u306e\u8ffd\u52a0\u5272\u308a\u5f53\u3066 +label.gslb.assigned.lb=\u5272\u308a\u5f53\u3066\u6e08\u307f\u8ca0\u8377\u5206\u6563 +label.gslb.delete=GSLB \u306e\u524a\u9664 +label.gslb.details=GSLB \u306e\u8a73\u7d30 +label.gslb.domain.name=GSLB \u30c9\u30e1\u30a4\u30f3\u540d +label.gslb.lb.details=\u8ca0\u8377\u5206\u6563\u306e\u8a73\u7d30 +label.gslb.lb.remove=\u3053\u306e GSLB \u304b\u3089\u8ca0\u8377\u5206\u6563\u3092\u524a\u9664 +label.gslb.lb.rule=\u8ca0\u8377\u5206\u6563\u898f\u5247 +label.gslb.service=GSLB \u30b5\u30fc\u30d3\u30b9 +label.gslb.service.private.ip=GSLB \u30b5\u30fc\u30d3\u30b9\u306e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8 IP \u30a2\u30c9\u30ec\u30b9 +label.gslb.service.public.ip=GSLB \u30b5\u30fc\u30d3\u30b9\u306e\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9 +label.gslb.servicetype=\u30b5\u30fc\u30d3\u30b9\u306e\u7a2e\u985e label.guest.cidr=\u30b2\u30b9\u30c8 CIDR label.guest.end.ip=\u30b2\u30b9\u30c8\u306e\u7d42\u4e86 IP \u30a2\u30c9\u30ec\u30b9 label.guest.gateway=\u30b2\u30b9\u30c8 \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4 label.guest.ip.range=\u30b2\u30b9\u30c8 IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2 label.guest.ip=\u30b2\u30b9\u30c8 IP \u30a2\u30c9\u30ec\u30b9 label.guest.netmask=\u30b2\u30b9\u30c8 \u30cd\u30c3\u30c8\u30de\u30b9\u30af +label.guest.network.details=\u30b2\u30b9\u30c8 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8a73\u7d30 label.guest.networks=\u30b2\u30b9\u30c8 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af label.guest.start.ip=\u30b2\u30b9\u30c8\u306e\u958b\u59cb IP \u30a2\u30c9\u30ec\u30b9 label.guest.traffic=\u30b2\u30b9\u30c8 \u30c8\u30e9\u30d5\u30a3\u30c3\u30af +label.guest.traffic.vswitch.name=\u30b2\u30b9\u30c8 \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e vSwitch \u540d +label.guest.traffic.vswitch.type=\u30b2\u30b9\u30c8 \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e vSwitch \u306e\u7a2e\u985e label.guest.type=\u30b2\u30b9\u30c8\u306e\u7a2e\u985e label.guest=\u30b2\u30b9\u30c8 label.ha.enabled=\u9ad8\u53ef\u7528\u6027\u6709\u52b9 +label.health.check=\u30d8\u30eb\u30b9 \u30c1\u30a7\u30c3\u30af label.help=\u30d8\u30eb\u30d7 label.hide.ingress.rule=\u53d7\u4fe1\u898f\u5247\u3092\u96a0\u3059 label.hints=\u30d2\u30f3\u30c8 +label.home=\u30db\u30fc\u30e0 label.host.alerts=\u30db\u30b9\u30c8 \u30a2\u30e9\u30fc\u30c8 label.host.MAC=\u30db\u30b9\u30c8\u306e MAC label.host.name=\u30db\u30b9\u30c8\u540d +label.hosts=\u30db\u30b9\u30c8 label.host.tags=\u30db\u30b9\u30c8 \u30bf\u30b0 label.host=\u30db\u30b9\u30c8 -label.hosts=\u30db\u30b9\u30c8 label.hourly=\u6bce\u6642 label.hypervisor.capabilities=\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc\u306e\u6a5f\u80fd +label.hypervisor.snapshot.reserve=\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u4e88\u7d04 +label.hypervisors=\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc label.hypervisor.type=\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc\u306e\u7a2e\u985e -label.hypervisor.version=\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc\u306e\u30d0\u30fc\u30b8\u30e7\u30f3 label.hypervisor=\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc +label.hypervisor.version=\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc\u306e\u30d0\u30fc\u30b8\u30e7\u30f3 +label.hyperv.traffic.label=Hyper-V \u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb label.id=ID label.IKE.DH=IKE DH label.IKE.encryption=IKE \u6697\u53f7\u5316 @@ -653,16 +724,18 @@ label.installWizard.addPrimaryStorageIntro.subtitle=\u30d7\u30e9\u30a4\u30de\u30 label.installWizard.addPrimaryStorageIntro.title=\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046 label.installWizard.addSecondaryStorageIntro.subtitle=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u3064\u3044\u3066 label.installWizard.addSecondaryStorageIntro.title=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046 -label.installWizard.addZone.title=\u30be\u30fc\u30f3\u306e\u8ffd\u52a0 label.installWizard.addZoneIntro.subtitle=\u30be\u30fc\u30f3\u306b\u3064\u3044\u3066 label.installWizard.addZoneIntro.title=\u30be\u30fc\u30f3\u3092\u8ffd\u52a0\u3057\u307e\u3057\u3087\u3046 +label.installWizard.addZone.title=\u30be\u30fc\u30f3\u306e\u8ffd\u52a0 label.installWizard.click.launch=[\u8d77\u52d5] \u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002 label.installWizard.subtitle=\u3053\u306e\u30ac\u30a4\u30c9 \u30c4\u30a2\u30fc\u306f CloudStack&\#8482; \u74b0\u5883\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u5f79\u7acb\u3061\u307e\u3059 label.installWizard.title=CloudStack&\#8482; \u3078\u3088\u3046\u3053\u305d label.instance.limits=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5236\u9650 label.instance.name=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u540d -label.instance=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9 +label.instance.scaled.up=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30b5\u30a4\u30ba\u304c\u62e1\u5927\u3055\u308c\u307e\u3057\u305f label.instances=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9 +label.instance=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9 +label.instanciate.template.associate.profile.blade=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4f5c\u6210\u304a\u3088\u3073\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3068\u30d6\u30ec\u30fc\u30c9\u306e\u95a2\u9023\u4ed8\u3051 label.internal.dns.1=\u5185\u90e8 DNS 1 label.internal.dns.2=\u5185\u90e8 DNS 2 label.internal.name=\u5185\u90e8\u540d @@ -671,34 +744,46 @@ label.introduction.to.cloudstack=CloudStack&\#8482; \u306e\u7d39\u4ecb label.invalid.integer=\u7121\u52b9\u306a\u6574\u6570 label.invalid.number=\u7121\u52b9\u306a\u6570 label.invitations=\u62db\u5f85\u72b6 -label.invite.to=\u62db\u5f85\u3059\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8: -label.invite=\u62db\u5f85 label.invited.accounts=\u62db\u5f85\u6e08\u307f\u30a2\u30ab\u30a6\u30f3\u30c8 +label.invite.to=\u62db\u5f85\u3059\u308b\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\: +label.invite=\u62db\u5f85 label.ip.address=IP \u30a2\u30c9\u30ec\u30b9 +label.ipaddress=IP \u30a2\u30c9\u30ec\u30b9 label.ip.allocations=IP \u30a2\u30c9\u30ec\u30b9\u306e\u5272\u308a\u5f53\u3066 +label.ip=IP label.ip.limits=\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9\u306e\u5236\u9650 label.ip.or.fqdn=IP \u30a2\u30c9\u30ec\u30b9\u307e\u305f\u306f FQDN label.ip.range=IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2 label.ip.ranges=IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2 -label.ip=IP -label.ipaddress=IP \u30a2\u30c9\u30ec\u30b9 -label.ips=IP \u30a2\u30c9\u30ec\u30b9 label.IPsec.preshared.key=IPsec \u4e8b\u524d\u5171\u6709\u30ad\u30fc -label.is.default=\u30c7\u30d5\u30a9\u30eb\u30c8 -label.is.redundant.router=\u5197\u9577 -label.is.shared=\u5171\u6709 -label.is.system=\u30b7\u30b9\u30c6\u30e0 +label.ips=IP \u30a2\u30c9\u30ec\u30b9 +label.ipv4.cidr=IPv4 CIDR +label.ipv4.end.ip=IPv4 \u7d42\u4e86 IP \u30a2\u30c9\u30ec\u30b9 +label.ipv4.gateway=IPv4 \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4 +label.ipv4.netmask=IPv4 \u30cd\u30c3\u30c8\u30de\u30b9\u30af +label.ipv4.start.ip=IPv4 \u958b\u59cb IP \u30a2\u30c9\u30ec\u30b9 +label.ipv6.address=IPv6 IP \u30a2\u30c9\u30ec\u30b9 +label.ipv6.CIDR=IPv6 CIDR +label.ipv6.dns1=IPv6 DNS 1 +label.ipv6.dns2=IPv6 DNS 2 +label.ipv6.end.ip=IPv6 \u7d42\u4e86 IP \u30a2\u30c9\u30ec\u30b9 +label.ipv6.gateway=IPv6 \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4 +label.ipv6.start.ip=IPv6 \u958b\u59cb IP \u30a2\u30c9\u30ec\u30b9 label.iscsi=iSCSI +label.is.default=\u30c7\u30d5\u30a9\u30eb\u30c8 label.iso.boot=ISO \u8d77\u52d5 label.iso=ISO label.isolated.networks=\u5206\u96e2\u3055\u308c\u305f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af label.isolation.method=\u5206\u96e2\u65b9\u6cd5 label.isolation.mode=\u5206\u96e2\u30e2\u30fc\u30c9 label.isolation.uri=\u5206\u96e2 URI +label.is.redundant.router=\u5197\u9577 +label.is.shared=\u5171\u6709 +label.is.system=\u30b7\u30b9\u30c6\u30e0 label.item.listing=\u9805\u76ee\u4e00\u89a7 label.keep=\u7dad\u6301 -label.key=\u30ad\u30fc label.keyboard.type=\u30ad\u30fc\u30dc\u30fc\u30c9\u306e\u7a2e\u985e +label.key=\u30ad\u30fc label.kvm.traffic.label=KVM \u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb label.label=\u30e9\u30d9\u30eb label.lang.arabic=\u30a2\u30e9\u30d3\u30a2\u8a9e @@ -717,12 +802,16 @@ label.lang.polish=\u30dd\u30fc\u30e9\u30f3\u30c9\u8a9e label.lang.russian=\u30ed\u30b7\u30a2\u8a9e label.lang.spanish=\u30b9\u30da\u30a4\u30f3\u8a9e label.last.disconnected=\u6700\u7d42\u5207\u65ad\u65e5\u6642 +label.lastname.lower=\u59d3 label.last.name=\u59d3 label.latest.events=\u6700\u65b0\u30a4\u30d9\u30f3\u30c8 +label.launch=\u8d77\u52d5 label.launch.vm=VM \u306e\u8d77\u52d5 label.launch.zone=\u30be\u30fc\u30f3\u306e\u8d77\u52d5 -label.launch=\u8d77\u52d5 label.LB.isolation=\u8ca0\u8377\u5206\u6563\u5206\u96e2 +label.ldap.configuration=LDAP \u69cb\u6210 +label.ldap.group.name=LDAP \u30b0\u30eb\u30fc\u30d7 +label.ldap.port=LDAP \u30dd\u30fc\u30c8 label.least.connections=\u6700\u5c0f\u63a5\u7d9a label.level=\u30ec\u30d9\u30eb label.linklocal.ip=\u30ea\u30f3\u30af \u30ed\u30fc\u30ab\u30eb IP \u30a2\u30c9\u30ec\u30b9 @@ -735,15 +824,18 @@ label.local.storage=\u30ed\u30fc\u30ab\u30eb \u30b9\u30c8\u30ec\u30fc\u30b8 label.local=\u30ed\u30fc\u30ab\u30eb label.login=\u30ed\u30b0\u30aa\u30f3 label.logout=\u30ed\u30b0\u30aa\u30d5 -label.LUN.number=LUN \u756a\u53f7 label.lun=LUN +label.LUN.number=LUN \u756a\u53f7 +label.lxc.traffic.label=LXC \u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb label.make.project.owner=\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u6240\u6709\u8005\u5316 -label.manage.resources=\u30ea\u30bd\u30fc\u30b9\u306e\u7ba1\u7406 -label.manage=\u7ba1\u7406 label.management.ips=\u7ba1\u7406 IP \u30a2\u30c9\u30ec\u30b9 label.management=\u7ba1\u7406 +label.manage.resources=\u30ea\u30bd\u30fc\u30b9\u306e\u7ba1\u7406 +label.manage=\u7ba1\u7406 label.max.cpus=\u6700\u5927 CPU \u30b3\u30a2\u6570 label.max.guest.limit=\u6700\u5927\u30b2\u30b9\u30c8\u5236\u9650 +label.maximum=\u6700\u5927 +label.max.instances=\u6700\u5927\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u6570 label.max.memory=\u6700\u5927\u30e1\u30e2\u30ea (MiB) label.max.networks=\u6700\u5927\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u6570 label.max.primary.storage=\u6700\u5927\u30d7\u30e9\u30a4\u30de\u30ea (GiB) @@ -754,14 +846,13 @@ label.max.templates=\u6700\u5927\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u6570 label.max.vms=\u6700\u5927\u30e6\u30fc\u30b6\u30fc VM \u6570 label.max.volumes=\u6700\u5927\u30dc\u30ea\u30e5\u30fc\u30e0\u6570 label.max.vpcs=\u6700\u5927 VPC \u6570 -label.maximum=\u6700\u5927 label.may.continue=\u7d9a\u884c\u3067\u304d\u307e\u3059\u3002 label.memory.allocated=\u5272\u308a\u5f53\u3066\u6e08\u307f\u306e\u30e1\u30e2\u30ea label.memory.limits=\u30e1\u30e2\u30ea\u5236\u9650 (MiB) label.memory.mb=\u30e1\u30e2\u30ea (MB) label.memory.total=\u30e1\u30e2\u30ea\u5408\u8a08 -label.memory.used=\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf label.memory=\u30e1\u30e2\u30ea +label.memory.used=\u30e1\u30e2\u30ea\u4f7f\u7528\u91cf label.menu.accounts=\u30a2\u30ab\u30a6\u30f3\u30c8 label.menu.alerts=\u30a2\u30e9\u30fc\u30c8 label.menu.all.accounts=\u3059\u3079\u3066\u306e\u30a2\u30ab\u30a6\u30f3\u30c8 @@ -788,7 +879,7 @@ label.menu.my.templates=\u30de\u30a4 \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 label.menu.network.offerings=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 label.menu.network=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af label.menu.physical.resources=\u7269\u7406\u30ea\u30bd\u30fc\u30b9 -label.menu.regions=\u9818\u57df +label.menu.regions=\u30ea\u30fc\u30b8\u30e7\u30f3 label.menu.running.instances=\u5b9f\u884c\u4e2d\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9 label.menu.security.groups=\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7 label.menu.service.offerings=\u30b5\u30fc\u30d3\u30b9 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 @@ -796,22 +887,26 @@ label.menu.snapshots=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8 label.menu.stopped.instances=\u505c\u6b62\u3055\u308c\u305f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9 label.menu.storage=\u30b9\u30c8\u30ec\u30fc\u30b8 label.menu.system.service.offerings=\u30b7\u30b9\u30c6\u30e0 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 -label.menu.system.vms=\u30b7\u30b9\u30c6\u30e0 VM label.menu.system=\u30b7\u30b9\u30c6\u30e0 +label.menu.system.vms=\u30b7\u30b9\u30c6\u30e0 VM label.menu.templates=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 label.menu.virtual.appliances=\u4eee\u60f3\u30a2\u30d7\u30e9\u30a4\u30a2\u30f3\u30b9 label.menu.virtual.resources=\u4eee\u60f3\u30ea\u30bd\u30fc\u30b9 label.menu.volumes=\u30dc\u30ea\u30e5\u30fc\u30e0 +label.menu.vpc.offerings=VPC \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 label.migrate.instance.to.host=\u5225\u306e\u30db\u30b9\u30c8\u3078\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u79fb\u884c label.migrate.instance.to.ps=\u5225\u306e\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u3078\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u79fb\u884c -label.migrate.instance.to=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u79fb\u884c\u5148: -label.migrate.router.to=\u30eb\u30fc\u30bf\u30fc\u306e\u79fb\u884c\u5148: -label.migrate.systemvm.to=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u79fb\u884c\u5148: +label.migrate.instance.to=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u79fb\u884c\u5148\: +label.migrate.lb.vm=LB VM \u306e\u79fb\u884c +label.migrate.router.to=\u30eb\u30fc\u30bf\u30fc\u306e\u79fb\u884c\u5148\: +label.migrate.systemvm.to=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u79fb\u884c\u5148\: label.migrate.to.host=\u30db\u30b9\u30c8\u3078\u79fb\u884c label.migrate.to.storage=\u30b9\u30c8\u30ec\u30fc\u30b8\u3078\u79fb\u884c label.migrate.volume=\u5225\u306e\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u3078\u306e\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u79fb\u884c label.minimum=\u6700\u5c0f +label.min.instances=\u6700\u5c0f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u6570 label.minute.past.hour=\u5206 (\u6bce\u6642) +label.mode=\u30e2\u30fc\u30c9 label.monday=\u6708\u66dc\u65e5 label.monthly=\u6bce\u6708 label.more.templates=\u305d\u306e\u307b\u304b\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 @@ -822,20 +917,25 @@ label.move.up.row=1 \u884c\u4e0a\u306b\u79fb\u52d5 label.my.account=\u30de\u30a4 \u30a2\u30ab\u30a6\u30f3\u30c8 label.my.network=\u30de\u30a4 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af label.my.templates=\u30de\u30a4 \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 +label.name.lower=\u540d\u524d label.name.optional=\u540d\u524d (\u30aa\u30d7\u30b7\u30e7\u30f3) label.name=\u540d\u524d label.nat.port.range=NAT \u30dd\u30fc\u30c8\u306e\u7bc4\u56f2 label.netmask=\u30cd\u30c3\u30c8\u30de\u30b9\u30af +label.netscaler.details=NetScaler \u306e\u8a73\u7d30 label.netScaler=NetScaler +label.network.ACLs=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af ACL label.network.ACL.total=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af ACL \u5408\u8a08 label.network.ACL=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af ACL -label.network.ACLs=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af ACL +label.network.addVM=VM \u3078\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8ffd\u52a0 +label.network.cidr=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af CIDR label.network.desc=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8aac\u660e label.network.device.type=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30c7\u30d0\u30a4\u30b9\u306e\u7a2e\u985e label.network.device=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30c7\u30d0\u30a4\u30b9 label.network.domain.text=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30c9\u30e1\u30a4\u30f3 label.network.domain=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30c9\u30e1\u30a4\u30f3 label.network.id=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af ID +label.networking.and.security=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 label.network.label.display.for.blank.value=\u30c7\u30d5\u30a9\u30eb\u30c8 \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3092\u4f7f\u7528 label.network.limits=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5236\u9650 label.network.name=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u540d @@ -847,20 +947,19 @@ label.network.rate.megabytes=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u901f\u5ea6 (M label.network.rate=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u901f\u5ea6 (MB/\u79d2) label.network.read=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u8aad\u307f\u53d6\u308a label.network.service.providers=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30b5\u30fc\u30d3\u30b9 \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc +label.networks=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af label.network.type=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u7a2e\u985e -label.network.write=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u66f8\u304d\u8fbc\u307f label.network=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af -label.networking.and.security=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3068\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 -label.networks=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af +label.network.write=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u66f8\u304d\u8fbc\u307f label.new.password=\u65b0\u3057\u3044\u30d1\u30b9\u30ef\u30fc\u30c9 label.new.project=\u65b0\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 -label.new.vm=\u65b0\u3057\u3044 VM label.new=\u65b0\u898f +label.new.vm=\u65b0\u3057\u3044 VM label.next=\u6b21\u3078 label.nexusVswitch=Nexus 1000V +label.nfs=NFS label.nfs.server=NFS \u30b5\u30fc\u30d0\u30fc label.nfs.storage=NFS \u30b9\u30c8\u30ec\u30fc\u30b8 -label.nfs=NFS label.nic.adapter.type=NIC \u30a2\u30c0\u30d7\u30bf\u30fc\u306e\u7a2e\u985e label.nicira.controller.address=\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc \u30a2\u30c9\u30ec\u30b9 label.nicira.l3gatewayserviceuuid=L3 \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4 \u30b5\u30fc\u30d3\u30b9\u306e UUID @@ -870,58 +969,80 @@ label.no.actions=\u5b9f\u884c\u3067\u304d\u308b\u64cd\u4f5c\u306f\u3042\u308a\u3 label.no.alerts=\u6700\u8fd1\u306e\u30a2\u30e9\u30fc\u30c8\u306f\u3042\u308a\u307e\u305b\u3093 label.no.data=\u8868\u793a\u3059\u308b\u30c7\u30fc\u30bf\u304c\u3042\u308a\u307e\u305b\u3093 label.no.errors=\u6700\u8fd1\u306e\u30a8\u30e9\u30fc\u306f\u3042\u308a\u307e\u305b\u3093 +label.no.grouping=(\u30b0\u30eb\u30fc\u30d7\u306a\u3057) label.no.isos=\u4f7f\u7528\u3067\u304d\u308b ISO \u306f\u3042\u308a\u307e\u305b\u3093 label.no.items=\u4f7f\u7528\u3067\u304d\u308b\u9805\u76ee\u306f\u3042\u308a\u307e\u305b\u3093 -label.no.security.groups=\u4f7f\u7528\u3067\u304d\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u306f\u3042\u308a\u307e\u305b\u3093 -label.no.thanks=\u8a2d\u5b9a\u3057\u306a\u3044 -label.no=\u3044\u3044\u3048 label.none=\u306a\u3057 +label.no.security.groups=\u4f7f\u7528\u3067\u304d\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u306f\u3042\u308a\u307e\u305b\u3093 label.not.found=\u898b\u3064\u304b\u308a\u307e\u305b\u3093 +label.no.thanks=\u8a2d\u5b9a\u3057\u306a\u3044 label.notifications=\u901a\u77e5 -label.num.cpu.cores=CPU \u30b3\u30a2\u6570 +label.no=\u3044\u3044\u3048 label.number.of.clusters=\u30af\u30e9\u30b9\u30bf\u30fc\u6570 +label.number.of.cpu.sockets=CPU \u30bd\u30b1\u30c3\u30c8\u6570 label.number.of.hosts=\u30db\u30b9\u30c8\u6570 label.number.of.pods=\u30dd\u30c3\u30c9\u6570 label.number.of.system.vms=\u30b7\u30b9\u30c6\u30e0 VM \u6570 label.number.of.virtual.routers=\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc\u6570 label.number.of.zones=\u30be\u30fc\u30f3\u6570 +label.num.cpu.cores=CPU \u30b3\u30a2\u6570 label.numretries=\u518d\u8a66\u884c\u56de\u6570 label.ocfs2=OCFS2 label.offer.ha=\u9ad8\u53ef\u7528\u6027\u3092\u63d0\u4f9b\u3059\u308b label.ok=OK +label.opendaylight.controllerdetail=OpenDaylight \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u8a73\u7d30 +label.opendaylight.controller=OpenDaylight \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc +label.opendaylight.controllers=OpenDaylight \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc +label.openDaylight=OpenDaylight label.optional=\u30aa\u30d7\u30b7\u30e7\u30f3 label.order=\u9806\u5e8f label.os.preference=OS \u57fa\u672c\u8a2d\u5b9a label.os.type=OS \u306e\u7a2e\u985e +label.override.guest.traffic=\u30b2\u30b9\u30c8 \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b +label.override.public.traffic=\u30d1\u30d6\u30ea\u30c3\u30af \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b +label.ovm.traffic.label=OVM \u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb +label.ovs=OVS label.owned.public.ips=\u6240\u6709\u3059\u308b\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9 label.owner.account=\u6240\u6709\u8005\u30a2\u30ab\u30a6\u30f3\u30c8 label.owner.domain=\u6240\u6709\u8005\u30c9\u30e1\u30a4\u30f3 +label.palo.alto.details=Palo Alto \u306e\u8a73\u7d30 label.PA.log.profile=Palo Alto \u30ed\u30b0 \u30d7\u30ed\u30d5\u30a1\u30a4\u30eb -label.PA.threat.profile=Palo Alto \u8105\u5a01\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb +label.PA=Palo Alto label.parent.domain=\u89aa\u30c9\u30e1\u30a4\u30f3 label.password.enabled=\u30d1\u30b9\u30ef\u30fc\u30c9\u7ba1\u7406\u6709\u52b9 +label.password.lower=\u30d1\u30b9\u30ef\u30fc\u30c9 +label.password.reset.confirm=\u6b21\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u306b\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u307e\u3057\u305f\: label.password=\u30d1\u30b9\u30ef\u30fc\u30c9 +label.PA.threat.profile=Palo Alto \u8105\u5a01\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb label.path=\u30d1\u30b9 label.perfect.forward.secrecy=Perfect Forward Secrecy +label.persistent=\u6c38\u7d9a label.physical.network.ID=\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af ID label.physical.network=\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af label.PING.CIFS.password=PING CIFS \u30d1\u30b9\u30ef\u30fc\u30c9 label.PING.CIFS.username=PING CIFS \u30e6\u30fc\u30b6\u30fc\u540d label.PING.dir=PING \u30c7\u30a3\u30ec\u30af\u30c8\u30ea label.PING.storage.IP=PING \u5bfe\u8c61\u306e\u30b9\u30c8\u30ec\u30fc\u30b8 IP \u30a2\u30c9\u30ec\u30b9 +label.planner.mode=\u30d7\u30e9\u30f3\u30ca\u30fc \u30e2\u30fc\u30c9 label.please.specify.netscaler.info=Netscaler \u60c5\u5831\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044 label.please.wait=\u304a\u5f85\u3061\u304f\u3060\u3055\u3044 label.plugin.details=\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u8a73\u7d30 label.plugins=\u30d7\u30e9\u30b0\u30a4\u30f3 +label.pod.dedicated=\u30dd\u30c3\u30c9\u3092\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u305f label.pod.name=\u30dd\u30c3\u30c9\u540d -label.pod=\u30dd\u30c3\u30c9 label.pods=\u30dd\u30c3\u30c9 +label.pod=\u30dd\u30c3\u30c9 +label.polling.interval.sec=\u30dd\u30fc\u30ea\u30f3\u30b0\u9593\u9694 (\u79d2) +label.portable.ip.range.details=\u30dd\u30fc\u30bf\u30d6\u30eb IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u306e\u8a73\u7d30 +label.portable.ip.ranges=\u30dd\u30fc\u30bf\u30d6\u30eb IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2 +label.portable.ips=\u30dd\u30fc\u30bf\u30d6\u30eb IP \u30a2\u30c9\u30ec\u30b9 label.port.forwarding.policies=\u30dd\u30fc\u30c8\u8ee2\u9001\u30dd\u30ea\u30b7\u30fc label.port.forwarding=\u30dd\u30fc\u30c8\u8ee2\u9001 label.port.range=\u30dd\u30fc\u30c8\u306e\u7bc4\u56f2 +label.port=\u30dd\u30fc\u30c8 label.PreSetup=PreSetup -label.prev=\u623b\u308b label.previous=\u623b\u308b +label.prev=\u623b\u308b label.primary.allocated=\u5272\u308a\u5f53\u3066\u6e08\u307f\u306e\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8 label.primary.network=\u30d7\u30e9\u30a4\u30de\u30ea \u30cd\u30c3\u30c8\u30ef\u30fc\u30af label.primary.storage.count=\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8 \u30d7\u30fc\u30eb @@ -931,69 +1052,102 @@ label.primary.used=\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8 label.private.Gateway=\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8 \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4 label.private.interface=\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8 \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9 label.private.ip.range=\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8 IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2 -label.private.ip=\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8 IP \u30a2\u30c9\u30ec\u30b9 label.private.ips=\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8 IP \u30a2\u30c9\u30ec\u30b9 +label.private.ip=\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8 IP \u30a2\u30c9\u30ec\u30b9 +label.privatekey=PKCS\#8 \u79d8\u5bc6\u30ad\u30fc label.private.network=\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af label.private.port=\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8 \u30dd\u30fc\u30c8 label.private.zone=\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8 \u30be\u30fc\u30f3 -label.privatekey=PKCS\#8 \u79d8\u5bc6\u30ad\u30fc +label.profile=\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb label.project.dashboard=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 \u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9 label.project.id=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 ID label.project.invite=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3078\u306e\u62db\u5f85 label.project.name=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d -label.project.view=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 \u30d3\u30e5\u30fc -label.project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 label.projects=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 +label.project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 +label.project.view=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 \u30d3\u30e5\u30fc label.protocol=\u30d7\u30ed\u30c8\u30b3\u30eb label.providers=\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc +label.provider=\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc label.public.interface=\u30d1\u30d6\u30ea\u30c3\u30af \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9 -label.public.ip=\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9 label.public.ips=\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9 +label.public.ip=\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9 +label.public.load.balancer.provider=\u30d1\u30d6\u30ea\u30c3\u30af\u8ca0\u8377\u5206\u6563\u88c5\u7f6e\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc label.public.network=\u30d1\u30d6\u30ea\u30c3\u30af \u30cd\u30c3\u30c8\u30ef\u30fc\u30af label.public.port=\u30d1\u30d6\u30ea\u30c3\u30af \u30dd\u30fc\u30c8 label.public.traffic=\u30d1\u30d6\u30ea\u30c3\u30af \u30c8\u30e9\u30d5\u30a3\u30c3\u30af -label.public.zone=\u30d1\u30d6\u30ea\u30c3\u30af \u30be\u30fc\u30f3 +label.public.traffic.vswitch.name=\u30d1\u30d6\u30ea\u30c3\u30af \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e vSwitch \u540d +label.public.traffic.vswitch.type=\u30d1\u30d6\u30ea\u30c3\u30af \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e vSwitch \u306e\u7a2e\u985e label.public=\u30d1\u30d6\u30ea\u30c3\u30af +label.public.zone=\u30d1\u30d6\u30ea\u30c3\u30af \u30be\u30fc\u30f3 label.purpose=\u76ee\u7684 label.Pxe.server.type=PXE \u30b5\u30fc\u30d0\u30fc\u306e\u7a2e\u985e +label.qos.type=QoS \u306e\u7a2e\u985e label.quickview=\u30af\u30a4\u30c3\u30af\u30d3\u30e5\u30fc +label.quiesce.vm=VM \u3092\u4f11\u6b62\u3059\u308b +label.quiet.time.sec=\u5f85\u3061\u6642\u9593 (\u79d2) +label.rbd.id=Cephx \u30e6\u30fc\u30b6\u30fc +label.rbd.monitor=Ceph \u30e2\u30cb\u30bf\u30fc +label.rbd.pool=Ceph \u30d7\u30fc\u30eb +label.rbd=RBD +label.rbd.secret=Cephx \u30b7\u30fc\u30af\u30ec\u30c3\u30c8 label.reboot=\u518d\u8d77\u52d5 label.recent.errors=\u6700\u8fd1\u306e\u30a8\u30e9\u30fc +label.recover.vm=VM \u3092\u4fee\u5fa9\u3059\u308b label.redundant.router.capability=\u5197\u9577\u30eb\u30fc\u30bf\u30fc\u6a5f\u80fd label.redundant.router=\u5197\u9577\u30eb\u30fc\u30bf\u30fc label.redundant.state=\u5197\u9577\u72b6\u614b +label.refresh.blades=\u30d6\u30ec\u30fc\u30c9\u306e\u66f4\u65b0 label.refresh=\u66f4\u65b0 -label.region=\u9818\u57df +label.regionlevelvpc=\u30ea\u30fc\u30b8\u30e7\u30f3\u30ec\u30d9\u30eb VPC +label.region=\u30ea\u30fc\u30b8\u30e7\u30f3 +label.reinstall.vm=VM \u3092\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b label.related=\u95a2\u9023 +label.release.account.lowercase=\u30a2\u30ab\u30a6\u30f3\u30c8\u304b\u3089\u89e3\u653e +label.release.account=\u30a2\u30ab\u30a6\u30f3\u30c8\u304b\u3089\u89e3\u653e +label.release.dedicated.cluster=\u5c02\u7528\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u89e3\u653e +label.release.dedicated.host=\u5c02\u7528\u30db\u30b9\u30c8\u306e\u89e3\u653e +label.release.dedicated.pod=\u5c02\u7528\u30dd\u30c3\u30c9\u306e\u89e3\u653e +label.release.dedicated.vlan.range=\u5c02\u7528 VLAN \u306e\u7bc4\u56f2\u306e\u89e3\u653e +label.release.dedicated.zone=\u5c02\u7528\u30be\u30fc\u30f3\u306e\u89e3\u653e label.remind.later=\u30a2\u30e9\u30fc\u30e0\u3092\u8868\u793a\u3059\u308b label.remove.ACL=ACL \u306e\u524a\u9664 label.remove.egress.rule=\u9001\u4fe1\u898f\u5247\u306e\u524a\u9664 label.remove.from.load.balancer=\u8ca0\u8377\u5206\u6563\u88c5\u7f6e\u304b\u3089\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059 label.remove.ingress.rule=\u53d7\u4fe1\u898f\u5247\u306e\u524a\u9664 label.remove.ip.range=IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u306e\u524a\u9664 +label.remove.ldap=LDAP \u306e\u524a\u9664 +label.remove.network.offering=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u524a\u9664 label.remove.pf=\u30dd\u30fc\u30c8\u8ee2\u9001\u898f\u5247\u306e\u524a\u9664 label.remove.project.account=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304b\u3089\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u524a\u9664 -label.remove.region=\u9818\u57df\u306e\u524a\u9664 +label.remove.region=\u30ea\u30fc\u30b8\u30e7\u30f3\u306e\u524a\u9664 label.remove.rule=\u898f\u5247\u306e\u524a\u9664 label.remove.static.nat.rule=\u9759\u7684 NAT \u898f\u5247\u306e\u524a\u9664 label.remove.static.route=\u9759\u7684\u30eb\u30fc\u30c8\u306e\u524a\u9664 label.remove.tier=\u968e\u5c64\u306e\u524a\u9664 label.remove.vm.from.lb=\u8ca0\u8377\u5206\u6563\u898f\u5247\u304b\u3089\u306e VM \u306e\u524a\u9664 +label.remove.vmware.datacenter=VMware \u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u306e\u524a\u9664 +label.remove.vpc.offering=VPC \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u524a\u9664 label.remove.vpc=VPC \u306e\u524a\u9664 -label.removing.user=\u30e6\u30fc\u30b6\u30fc\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059 label.removing=\u524a\u9664\u3057\u3066\u3044\u307e\u3059 +label.removing.user=\u30e6\u30fc\u30b6\u30fc\u3092\u524a\u9664\u3057\u3066\u3044\u307e\u3059 +label.reource.id=\u30ea\u30bd\u30fc\u30b9 ID label.required=\u5fc5\u9808\u3067\u3059 +label.requires.upgrade=\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u304c\u5fc5\u8981 +label.reserved.ip.range=\u4e88\u7d04\u6e08\u307f IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2 label.reserved.system.gateway=\u4e88\u7d04\u6e08\u307f\u30b7\u30b9\u30c6\u30e0 \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4 label.reserved.system.ip=\u4e88\u7d04\u6e08\u307f\u30b7\u30b9\u30c6\u30e0 IP \u30a2\u30c9\u30ec\u30b9 label.reserved.system.netmask=\u4e88\u7d04\u6e08\u307f\u30b7\u30b9\u30c6\u30e0 \u30cd\u30c3\u30c8\u30de\u30b9\u30af +label.resetVM=VM \u306e\u30ea\u30bb\u30c3\u30c8 label.reset.VPN.connection=VPN \u63a5\u7d9a\u306e\u30ea\u30bb\u30c3\u30c8 label.resize.new.offering.id=\u65b0\u3057\u3044\u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 label.resize.new.size=\u65b0\u3057\u3044\u30b5\u30a4\u30ba (GB) label.resize.shrink.ok=\u7e2e\u5c0f\u53ef\u80fd\u306b\u3059\u308b label.resource.limits=\u30ea\u30bd\u30fc\u30b9\u5236\u9650 +label.resource.name=\u30ea\u30bd\u30fc\u30b9\u540d label.resource.state=\u30ea\u30bd\u30fc\u30b9\u306e\u72b6\u614b -label.resource=\u30ea\u30bd\u30fc\u30b9 label.resources=\u30ea\u30bd\u30fc\u30b9 +label.resource=\u30ea\u30bd\u30fc\u30b9 label.restart.network=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u518d\u8d77\u52d5 label.restart.required=\u518d\u8d77\u52d5\u304c\u5fc5\u8981 label.restart.vpc=VPC \u306e\u518d\u8d77\u52d5 @@ -1003,7 +1157,11 @@ label.revoke.project.invite=\u62db\u5f85\u306e\u53d6\u308a\u6d88\u3057 label.role=\u5f79\u5272 label.root.disk.controller=\u30eb\u30fc\u30c8 \u30c7\u30a3\u30b9\u30af \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc label.root.disk.offering=\u30eb\u30fc\u30c8 \u30c7\u30a3\u30b9\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 +label.root.disk.size=\u30eb\u30fc\u30c8 \u30c7\u30a3\u30b9\u30af \u30b5\u30a4\u30ba label.round.robin=\u30e9\u30a6\u30f3\u30c9\u30ed\u30d3\u30f3 +label.router.vm.scaled.up=\u30eb\u30fc\u30bf\u30fc VM \u306e\u30b5\u30a4\u30ba\u304c\u62e1\u5927\u3055\u308c\u307e\u3057\u305f +label.routing=\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0 +label.rule.number=\u898f\u5247\u756a\u53f7 label.rules=\u898f\u5247 label.running.vms=\u5b9f\u884c\u4e2d\u306e VM label.s3.access_key=\u30a2\u30af\u30bb\u30b9 \u30ad\u30fc @@ -1011,26 +1169,31 @@ label.s3.bucket=\u30d0\u30b1\u30c3\u30c8 label.s3.connection_timeout=\u63a5\u7d9a\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8 label.s3.endpoint=\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8 label.s3.max_error_retry=\u6700\u5927\u30a8\u30e9\u30fc\u518d\u8a66\u884c\u6570 +label.s3.nfs.path=S3 NFS \u30d1\u30b9 +label.s3.nfs.server=S3 NFS \u30b5\u30fc\u30d0\u30fc label.s3.secret_key=\u79d8\u5bc6\u30ad\u30fc label.s3.socket_timeout=\u30bd\u30b1\u30c3\u30c8 \u30bf\u30a4\u30e0\u30a2\u30a6\u30c8 -label.s3.use_https=HTTPS \u3092\u4f7f\u7528\u3059\u308b +label.s3.use_https=HTTPS \u3092\u4f7f\u7528 label.saturday=\u571f\u66dc\u65e5 label.save.and.continue=\u4fdd\u5b58\u3057\u3066\u7d9a\u884c label.save=\u4fdd\u5b58 label.saving.processing=\u4fdd\u5b58\u3057\u3066\u3044\u307e\u3059... label.scope=\u30b9\u30b3\u30fc\u30d7 label.search=\u691c\u7d22 +label.secondary.isolated.vlan.id=\u5206\u96e2\u3055\u308c\u305f\u30bb\u30ab\u30f3\u30c0\u30ea VLAN ID +label.secondary.staging.store.details=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2\u306e\u8a73\u7d30 +label.secondary.staging.store=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2 label.secondary.storage.count=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8 \u30d7\u30fc\u30eb +label.secondary.storage.details=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u8a73\u7d30 label.secondary.storage.limits=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u5236\u9650 (GiB) -label.secondary.storage.vm=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8 VM label.secondary.storage=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8 +label.secondary.storage.vm=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8 VM label.secondary.used=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u4f7f\u7528\u91cf label.secret.key=\u79d8\u5bc6\u30ad\u30fc label.security.group.name=\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u540d -label.security.group=\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7 label.security.groups.enabled=\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u6709\u52b9 label.security.groups=\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7 -label.select-view=\u30d3\u30e5\u30fc\u306e\u9078\u629e +label.security.group=\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7 label.select.a.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u9078\u629e label.select.a.zone=\u30be\u30fc\u30f3\u306e\u9078\u629e label.select.instance.to.attach.volume.to=\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u30a2\u30bf\u30c3\u30c1\u3059\u308b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044 @@ -1038,49 +1201,63 @@ label.select.instance=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u9078\u629e label.select.iso.or.template=ISO \u307e\u305f\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u9078\u629e label.select.offering=\u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u9078\u629e label.select.project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u9078\u629e +label.select.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u9078\u629e label.select.tier=\u968e\u5c64\u306e\u9078\u629e -label.select.vm.for.static.nat=\u9759\u7684 NAT \u7528 VM \u306e\u9078\u629e label.select=\u9078\u629e +label.select-view=\u30d3\u30e5\u30fc\u306e\u9078\u629e +label.select.vm.for.static.nat=\u9759\u7684 NAT \u7528 VM \u306e\u9078\u629e label.sent=\u9001\u4fe1\u6e08\u307f label.server=\u30b5\u30fc\u30d0\u30fc label.service.capabilities=\u30b5\u30fc\u30d3\u30b9\u306e\u6a5f\u80fd label.service.offering=\u30b5\u30fc\u30d3\u30b9 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 +label.service.state=\u30b5\u30fc\u30d3\u30b9\u306e\u72b6\u614b +label.services=\u30b5\u30fc\u30d3\u30b9 label.session.expired=\u30bb\u30c3\u30b7\u30e7\u30f3\u306e\u6709\u52b9\u671f\u9650\u304c\u5207\u308c\u307e\u3057\u305f -label.set.up.zone.type=\u30be\u30fc\u30f3\u306e\u7a2e\u985e\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7 +label.set.default.NIC=\u30c7\u30d5\u30a9\u30eb\u30c8 NIC \u306e\u8a2d\u5b9a +label.settings=\u8a2d\u5b9a label.setup.network=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7 -label.setup.zone=\u30be\u30fc\u30f3\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7 label.setup=\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7 -label.shared=\u5171\u6709 +label.set.up.zone.type=\u30be\u30fc\u30f3\u306e\u7a2e\u985e\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7 +label.setup.zone=\u30be\u30fc\u30f3\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7 label.SharedMountPoint=SharedMountPoint +label.shared=\u5171\u6709 +label.show.advanced.settings=\u8a73\u7d30\u8a2d\u5b9a\u306e\u8868\u793a label.show.ingress.rule=\u53d7\u4fe1\u898f\u5247\u306e\u8868\u793a label.shutdown.provider=\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u306e\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3 label.site.to.site.VPN=\u30b5\u30a4\u30c8\u9593 VPN label.size=\u30b5\u30a4\u30ba label.skip.guide=CloudStack \u3092\u4f7f\u7528\u3057\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3001\u3053\u306e\u30ac\u30a4\u30c9\u3092\u30b9\u30ad\u30c3\u30d7\u3059\u308b +label.smb.domain=SMB \u30c9\u30e1\u30a4\u30f3 +label.smb.password=SMB \u30d1\u30b9\u30ef\u30fc\u30c9 +label.smb.username=SMB \u30e6\u30fc\u30b6\u30fc\u540d label.snapshot.limits=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u5236\u9650 label.snapshot.name=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u540d -label.snapshot.s=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8 label.snapshot.schedule=\u5b9a\u671f\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7 -label.snapshot=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8 +label.snapshot.s=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8 label.snapshots=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8 +label.snapshot=\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8 +label.SNMP.community=SNMP \u30b3\u30df\u30e5\u30cb\u30c6\u30a3 +label.SNMP.port=SNMP \u30dd\u30fc\u30c8 +label.sockets=\u30bd\u30b1\u30c3\u30c8 label.source.nat=\u9001\u4fe1\u5143 NAT label.source=\u9001\u4fe1\u5143 label.specify.IP.ranges=IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u306e\u6307\u5b9a label.specify.vlan=VLAN \u3092\u6307\u5b9a\u3059\u308b label.specify.vxlan=VXLAN \u3092\u6307\u5b9a\u3059\u308b -label.SR.name=SR \u540d\u30e9\u30d9\u30eb +label.SR.name = SR \u540d\u30e9\u30d9\u30eb +label.srx.details=SRX \u306e\u8a73\u7d30 label.srx=SRX -label.PA=Palo Alto label.start.IP=\u958b\u59cb IP \u30a2\u30c9\u30ec\u30b9 +label.start.lb.vm=LB VM \u306e\u8d77\u52d5 label.start.port=\u958b\u59cb\u30dd\u30fc\u30c8 label.start.reserved.system.IP=\u4e88\u7d04\u6e08\u307f\u958b\u59cb\u30b7\u30b9\u30c6\u30e0 IP \u30a2\u30c9\u30ec\u30b9 label.start.vlan=\u958b\u59cb VLAN label.start.vxlan=\u958b\u59cb VXLAN label.state=\u72b6\u614b label.static.nat.enabled=\u9759\u7684 NAT \u6709\u52b9 -label.static.nat.to=\u9759\u7684 NAT \u306e\u8a2d\u5b9a\u5148: -label.static.nat.vm.details=\u9759\u7684 NAT VM \u306e\u8a73\u7d30 +label.static.nat.to=\u9759\u7684 NAT \u306e\u8a2d\u5b9a\u5148\: label.static.nat=\u9759\u7684 NAT +label.static.nat.vm.details=\u9759\u7684 NAT VM \u306e\u8a73\u7d30 label.statistics=\u7d71\u8a08 label.status=\u72b6\u6cc1 label.step.1.title=\u624b\u9806 1\: \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u9078\u629e @@ -1106,79 +1283,95 @@ label.sticky.postonly=\u30dd\u30b9\u30c8\u306e\u307f label.sticky.prefix=\u30d7\u30ec\u30d5\u30a3\u30c3\u30af\u30b9 label.sticky.request-learn=\u30e9\u30fc\u30cb\u30f3\u30b0\u306e\u8981\u6c42 label.sticky.tablesize=\u30c6\u30fc\u30d6\u30eb \u30b5\u30a4\u30ba -label.stop=\u505c\u6b62 +label.stop.lb.vm=LB VM \u306e\u505c\u6b62 label.stopped.vms=\u505c\u6b62\u4e2d\u306e VM +label.stop=\u505c\u6b62 label.storage.tags=\u30b9\u30c8\u30ec\u30fc\u30b8 \u30bf\u30b0 label.storage.traffic=\u30b9\u30c8\u30ec\u30fc\u30b8 \u30c8\u30e9\u30d5\u30a3\u30c3\u30af label.storage.type=\u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u7a2e\u985e -label.qos.type=QoS \u306e\u7a2e\u985e -label.cache.mode=\u66f8\u304d\u8fbc\u307f\u30ad\u30e3\u30c3\u30b7\u30e5\u306e\u7a2e\u985e label.storage=\u30b9\u30c8\u30ec\u30fc\u30b8 label.subdomain.access=\u30b5\u30d6\u30c9\u30e1\u30a4\u30f3 \u30a2\u30af\u30bb\u30b9 -label.submit=\u9001\u4fe1 label.submitted.by=[\u9001\u4fe1\u30e6\u30fc\u30b6\u30fc\: ] +label.submit=\u9001\u4fe1 label.succeeded=\u6210\u529f label.sunday=\u65e5\u66dc\u65e5 label.super.cidr.for.guest.networks=\u30b2\u30b9\u30c8 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u30b9\u30fc\u30d1\u30fc CIDR label.supported.services=\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u30b5\u30fc\u30d3\u30b9 label.supported.source.NAT.type=\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u308b\u9001\u4fe1\u5143 NAT \u306e\u7a2e\u985e +label.supportsstrechedl2subnet=\u30b9\u30c8\u30ec\u30c3\u30c1\u30c9 L2 \u30b5\u30d6\u30cd\u30c3\u30c8\u306e\u30b5\u30dd\u30fc\u30c8 label.suspend.project=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4e00\u6642\u505c\u6b62 +label.switch.type=\u30b9\u30a4\u30c3\u30c1\u306e\u7a2e\u985e label.system.capacity=\u30b7\u30b9\u30c6\u30e0\u306e\u51e6\u7406\u80fd\u529b +label.system.offering.for.router=\u30eb\u30fc\u30bf\u30fc\u7528\u30b7\u30b9\u30c6\u30e0 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 label.system.offering=\u30b7\u30b9\u30c6\u30e0 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 label.system.service.offering=\u30b7\u30b9\u30c6\u30e0 \u30b5\u30fc\u30d3\u30b9 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 +label.system.vm.details=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u8a73\u7d30 +label.system.vm.scaled.up=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u30b5\u30a4\u30ba\u304c\u62e1\u5927\u3055\u308c\u307e\u3057\u305f +label.system.vms=\u30b7\u30b9\u30c6\u30e0 VM label.system.vm.type=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u7a2e\u985e label.system.vm=\u30b7\u30b9\u30c6\u30e0 VM -label.system.vms=\u30b7\u30b9\u30c6\u30e0 VM label.system.wide.capacity=\u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u306e\u51e6\u7406\u80fd\u529b label.tagged=\u30bf\u30b0\u3042\u308a +label.tag.key=\u30bf\u30b0 \u30ad\u30fc label.tags=\u30bf\u30b0 +label.tag.value=\u30bf\u30b0\u5024 label.target.iqn=\u30bf\u30fc\u30b2\u30c3\u30c8 IQN label.task.completed=\u30bf\u30b9\u30af\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f label.template.limits=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u5236\u9650 label.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 label.TFTP.dir=TFTP \u30c7\u30a3\u30ec\u30af\u30c8\u30ea +label.tftp.root.directory=TFTP \u30eb\u30fc\u30c8 \u30c7\u30a3\u30ec\u30af\u30c8\u30ea label.theme.default=\u30c7\u30d5\u30a9\u30eb\u30c8 \u30c6\u30fc\u30de label.theme.grey=\u30ab\u30b9\u30bf\u30e0 - \u30b0\u30ec\u30fc label.theme.lightblue=\u30ab\u30b9\u30bf\u30e0 - \u30e9\u30a4\u30c8 \u30d6\u30eb\u30fc label.thursday=\u6728\u66dc\u65e5 label.tier.details=\u968e\u5c64\u306e\u8a73\u7d30 label.tier=\u968e\u5c64 -label.time.zone=\u30bf\u30a4\u30e0\u30be\u30fc\u30f3 -label.time=\u6642\u523b -label.timeout.in.second=\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8 (\u79d2) +label.timeout.in.second = \u30bf\u30a4\u30e0\u30a2\u30a6\u30c8 (\u79d2) label.timeout=\u30bf\u30a4\u30e0\u30a2\u30a6\u30c8 +label.time=\u6642\u523b +label.time.zone=\u30bf\u30a4\u30e0\u30be\u30fc\u30f3 label.timezone=\u30bf\u30a4\u30e0\u30be\u30fc\u30f3 label.token=\u30c8\u30fc\u30af\u30f3 -label.total.CPU=CPU \u5408\u8a08 label.total.cpu=CPU \u5408\u8a08 +label.total.CPU=CPU \u5408\u8a08 label.total.hosts=\u30db\u30b9\u30c8\u5408\u8a08 label.total.memory=\u30e1\u30e2\u30ea\u5408\u8a08 label.total.of.ip=IP \u30a2\u30c9\u30ec\u30b9\u5408\u8a08 label.total.of.vm=VM \u5408\u8a08 label.total.storage=\u30b9\u30c8\u30ec\u30fc\u30b8\u5408\u8a08 +label.total.virtual.routers=\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc\u5408\u8a08 +label.total.virtual.routers.upgrade=\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u304c\u5fc5\u8981\u306a\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc\u5408\u8a08 label.total.vms=VM \u5408\u8a08 label.traffic.label=\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb -label.traffic.type=\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u7a2e\u985e label.traffic.types=\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u7a2e\u985e +label.traffic.type=\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u7a2e\u985e label.tuesday=\u706b\u66dc\u65e5 label.type.id=\u7a2e\u985e ID +label.type.lower=\u7a2e\u985e label.type=\u7a2e\u985e +label.ucs=UCS label.unavailable=\u4f7f\u7528\u4e0d\u80fd label.unlimited=\u7121\u5236\u9650 label.untagged=\u30bf\u30b0\u306a\u3057 label.update.project.resources=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 \u30ea\u30bd\u30fc\u30b9\u306e\u66f4\u65b0 -label.update.ssl.cert=SSL \u8a3c\u660e\u66f8 -label.update.ssl=SSL \u8a3c\u660e\u66f8 +label.update.ssl.cert= SSL \u8a3c\u660e\u66f8 +label.update.ssl= SSL \u8a3c\u660e\u66f8 label.updating=\u66f4\u65b0\u3057\u3066\u3044\u307e\u3059 -label.upload.volume=\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 +label.upgrade.required=\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u304c\u5fc5\u8981\u3067\u3059 +label.upgrade.router.newer.template=\u30eb\u30fc\u30bf\u30fc\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3066\u65b0\u3057\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u7528\u3059\u308b label.upload=\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 +label.upload.volume=\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u30a2\u30c3\u30d7\u30ed\u30fc\u30c9 label.url=URL label.usage.interface=\u4f7f\u7528\u72b6\u6cc1\u6e2c\u5b9a\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9 -label.use.vm.ip=\u6b21\u306e VM IP \u30a2\u30c9\u30ec\u30b9\u3092\u4f7f\u7528\: label.used=\u4f7f\u7528\u4e2d -label.user=\u30e6\u30fc\u30b6\u30fc +label.user.data=\u30e6\u30fc\u30b6\u30fc \u30c7\u30fc\u30bf +label.username.lower=\u30e6\u30fc\u30b6\u30fc\u540d label.username=\u30e6\u30fc\u30b6\u30fc\u540d label.users=\u30e6\u30fc\u30b6\u30fc +label.user=\u30e6\u30fc\u30b6\u30fc +label.use.vm.ips=VM \u306e IP \u3092\u5229\u7528\u3059\u308b\u3002 +label.use.vm.ip=\u6b21\u306e VM IP \u30a2\u30c9\u30ec\u30b9\u3092\u4f7f\u7528\: label.value=\u5024 label.vcdcname=vCenter DC \u540d label.vcenter.cluster=vCenter \u30af\u30e9\u30b9\u30bf\u30fc @@ -1187,62 +1380,91 @@ label.vcenter.datastore=vCenter \u30c7\u30fc\u30bf\u30b9\u30c8\u30a2 label.vcenter.host=vCenter \u30db\u30b9\u30c8 label.vcenter.password=vCenter \u30d1\u30b9\u30ef\u30fc\u30c9 label.vcenter.username=vCenter \u30e6\u30fc\u30b6\u30fc\u540d +label.vcenter=vCenter label.vcipaddress=vCenter IP \u30a2\u30c9\u30ec\u30b9 label.version=\u30d0\u30fc\u30b8\u30e7\u30f3 +label.vgpu.max.resolution=\u6700\u5927\u89e3\u50cf\u5ea6 +label.vgpu.max.vgpu.per.gpu=GPU \u6bce\u306e vGPU\u6570 +label.vgpu.remaining.capacity=\u6b8b\u308a\u5bb9\u91cf +label.vgpu.type=vGPU \u30bf\u30a4\u30d7 +label.vgpu.video.ram=\u30d3\u30c7\u30aa RAM label.view.all=\u3059\u3079\u3066\u8868\u793a label.view.console=\u30b3\u30f3\u30bd\u30fc\u30eb\u306e\u8868\u793a +label.viewing=\u8868\u793a\u9805\u76ee\: label.view.more=\u8a73\u7d30\u8868\u793a +label.view.secondary.ips=\u30bb\u30ab\u30f3\u30c0\u30ea IP \u30a2\u30c9\u30ec\u30b9\u306e\u8868\u793a label.view=\u8868\u793a - -label.viewing=\u8868\u793a\u9805\u76ee: -label.virtual.appliance=\u4eee\u60f3\u30a2\u30d7\u30e9\u30a4\u30a2\u30f3\u30b9 +label.virtual.appliance.details=\u4eee\u60f3\u30a2\u30d7\u30e9\u30a4\u30a2\u30f3\u30b9\u306e\u8a73\u7d30 label.virtual.appliances=\u4eee\u60f3\u30a2\u30d7\u30e9\u30a4\u30a2\u30f3\u30b9 +label.virtual.appliance=\u4eee\u60f3\u30a2\u30d7\u30e9\u30a4\u30a2\u30f3\u30b9 label.virtual.machines=\u4eee\u60f3\u30de\u30b7\u30f3 +label.virtual.networking=\u4eee\u60f3\u30cd\u30c3\u30c8\u30ef\u30fc\u30af label.virtual.network=\u4eee\u60f3\u30cd\u30c3\u30c8\u30ef\u30fc\u30af -label.virtual.router=\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc +label.virtual.routers.group.account=\u30a2\u30ab\u30a6\u30f3\u30c8\u5225\u306e\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc \u30b0\u30eb\u30fc\u30d7 +label.virtual.routers.group.cluster=\u30af\u30e9\u30b9\u30bf\u30fc\u5225\u306e\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc \u30b0\u30eb\u30fc\u30d7 +label.virtual.routers.group.pod=\u30dd\u30c3\u30c9\u5225\u306e\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc \u30b0\u30eb\u30fc\u30d7 +label.virtual.routers.group.zone=\u30be\u30fc\u30f3\u5225\u306e\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc \u30b0\u30eb\u30fc\u30d7 label.virtual.routers=\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc +label.virtual.router=\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc label.vlan.id=VLAN/VNI ID +label.vlan.range.details=VLAN \u306e\u7bc4\u56f2\u306e\u8a73\u7d30 +label.vlan.ranges=VLAN \u306e\u7bc4\u56f2 label.vlan.range=VLAN/VNI \u306e\u7bc4\u56f2 label.vlan=VLAN/VNI -label.vnet=VLAN/VNI -label.vnet.id=VLAN/VNI ID -label.vxlan.id=VXLAN ID -label.vxlan.range=VXLAN \u306e\u7bc4\u56f2 -label.vxlan=VXLAN +label.vlan.vni.ranges=VLAN/VNI \u306e\u7bc4\u56f2 +label.vlan.vni.range=VLAN/VNI \u306e\u7bc4\u56f2 label.vm.add=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u8ffd\u52a0 label.vm.destroy=\u7834\u68c4 label.vm.display.name=VM \u8868\u793a\u540d -label.vm.name=VM \u540d -label.vm.reboot=\u518d\u8d77\u52d5 -label.vm.start=\u8d77\u52d5 -label.vm.state=VM \u306e\u72b6\u614b -label.vm.stop=\u505c\u6b62 label.VMFS.datastore=VMFS \u30c7\u30fc\u30bf\u30b9\u30c8\u30a2 label.vmfs=VMFS +label.vm.name=VM \u540d +label.vm.password=VM \u306e\u30d1\u30b9\u30ef\u30fc\u30c9\: +label.vm.reboot=\u518d\u8d77\u52d5 label.VMs.in.tier=\u968e\u5c64\u5185\u306e VM -label.vms=VM label.vmsnapshot.current=\u4f7f\u7528\u4e2d label.vmsnapshot.memory=\u30e1\u30e2\u30ea\u3082\u542b\u3081\u308b label.vmsnapshot.parentname=\u89aa label.vmsnapshot.type=\u7a2e\u985e label.vmsnapshot=VM \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8 +label.vm.start=\u8d77\u52d5 +label.vm.state=VM \u306e\u72b6\u614b +label.vm.stop=\u505c\u6b62 +label.vms=VM +label.vmware.datacenter.id=VMware \u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc ID +label.vmware.datacenter.name=VMware \u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u540d +label.vmware.datacenter.vcenter=VMware \u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u306e vCenter label.vmware.traffic.label=VMware \u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb +label.vnet.id=VLAN/VNI ID +label.vnet=VLAN/VNI +label.vnmc.devices=VNMC \u30c7\u30d0\u30a4\u30b9 +label.volatile=\u63ee\u767a\u6027 label.volgroup=\u30dc\u30ea\u30e5\u30fc\u30e0 \u30b0\u30eb\u30fc\u30d7 label.volume.limits=\u30dc\u30ea\u30e5\u30fc\u30e0\u5236\u9650 label.volume.name=\u30dc\u30ea\u30e5\u30fc\u30e0\u540d -label.volume=\u30dc\u30ea\u30e5\u30fc\u30e0 label.volumes=\u30dc\u30ea\u30e5\u30fc\u30e0 +label.volume=\u30dc\u30ea\u30e5\u30fc\u30e0 +label.vpc.distributedvpcrouter=\u5206\u6563 VPC \u30eb\u30fc\u30bf\u30fc label.vpc.id=VPC ID +label.VPC.limits=VPC \u5236\u9650 +label.vpc.offering.details=VPC \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u8a73\u7d30 +label.vpc.offering=VPC \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 label.VPC.router.details=VPC \u30eb\u30fc\u30bf\u30fc\u306e\u8a73\u7d30 +label.vpc.supportsregionlevelvpc=\u30ea\u30fc\u30b8\u30e7\u30f3\u30ec\u30d9\u30eb VPC \u3092\u30b5\u30dd\u30fc\u30c8\u3059\u308b +label.vpc.virtual.router=VPC \u4eee\u60f3\u30eb\u30fc\u30bf\u30fc label.vpc=VPC label.VPN.connection=VPN \u63a5\u7d9a -label.VPN.customer.gateway=VPN \u30ab\u30b9\u30bf\u30de\u30fc \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4 label.vpn.customer.gateway=VPN \u30ab\u30b9\u30bf\u30de\u30fc \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4 +label.VPN.customer.gateway=VPN \u30ab\u30b9\u30bf\u30de\u30fc \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4 label.VPN.gateway=VPN \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4 label.vpn=VPN label.vsmctrlvlanid=\u30b3\u30f3\u30c8\u30ed\u30fc\u30eb VLAN ID label.vsmpktvlanid=\u30d1\u30b1\u30c3\u30c8 VLAN ID label.vsmstoragevlanid=\u30b9\u30c8\u30ec\u30fc\u30b8 VLAN ID label.vsphere.managed=vSphere \u306b\u3088\u308b\u7ba1\u7406 +label.vxlan.id=VXLAN ID +label.vxlan.range=VXLAN \u306e\u7bc4\u56f2 +label.vxlan=VXLAN label.waiting=\u5f85\u6a5f\u3057\u3066\u3044\u307e\u3059 label.warn=\u8b66\u544a label.wednesday=\u6c34\u66dc\u65e5 @@ -1250,239 +1472,31 @@ label.weekly=\u6bce\u9031 label.welcome.cloud.console=\u7ba1\u7406\u30b3\u30f3\u30bd\u30fc\u30eb\u3078\u3088\u3046\u3053\u305d label.welcome=\u3088\u3046\u3053\u305d label.what.is.cloudstack=CloudStack&\#8482; \u306b\u3064\u3044\u3066 +label.xenserver.tools.version.61.plus=XenServer Tools Version 6.1 \u4ee5\u964d +label.Xenserver.Tools.Version61plus=XenServer Tools Version 6.1 \u4ee5\u964d label.xen.traffic.label=XenServer \u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb label.yes=\u306f\u3044 +label.zone.dedicated=\u5c02\u7528\u30be\u30fc\u30f3 label.zone.details=\u30be\u30fc\u30f3\u306e\u8a73\u7d30 label.zone.id=\u30be\u30fc\u30f3 ID +label.zone.lower=\u30be\u30fc\u30f3 label.zone.name=\u30be\u30fc\u30f3\u540d label.zone.step.1.title=\u624b\u9806 1\: \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u9078\u629e label.zone.step.2.title=\u624b\u9806 2\: \u30be\u30fc\u30f3\u306e\u8ffd\u52a0 label.zone.step.3.title=\u624b\u9806 3\: \u30dd\u30c3\u30c9\u306e\u8ffd\u52a0 label.zone.step.4.title=\u624b\u9806 4\: IP \u30a2\u30c9\u30ec\u30b9\u7bc4\u56f2\u306e\u8ffd\u52a0 +label.zones=\u30be\u30fc\u30f3 label.zone.type=\u30be\u30fc\u30f3\u306e\u7a2e\u985e -label.zone.wide=\u30be\u30fc\u30f3\u5168\u4f53 label.zone=\u30be\u30fc\u30f3 -label.zones=\u30be\u30fc\u30f3 +label.zone.wide=\u30be\u30fc\u30f3\u5168\u4f53 label.zoneWizard.trafficType.guest=\u30b2\u30b9\u30c8\: \u30a8\u30f3\u30c9 \u30e6\u30fc\u30b6\u30fc\u306e\u4eee\u60f3\u30de\u30b7\u30f3\u306e\u9593\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3067\u3059\u3002 label.zoneWizard.trafficType.management=\u7ba1\u7406\: \u30db\u30b9\u30c8\u3084 CloudStack \u30b7\u30b9\u30c6\u30e0 VM \u306a\u3069\u3001\u7ba1\u7406\u30b5\u30fc\u30d0\u30fc\u3068\u901a\u4fe1\u3059\u308b CloudStack \u306e\u5185\u90e8\u30ea\u30bd\u30fc\u30b9\u9593\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3067\u3059\u3002 label.zoneWizard.trafficType.public=\u30d1\u30d6\u30ea\u30c3\u30af\: \u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u3068\u30af\u30e9\u30a6\u30c9\u5185\u306e\u4eee\u60f3\u30de\u30b7\u30f3\u306e\u9593\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3067\u3059\u3002 label.zoneWizard.trafficType.storage=\u30b9\u30c8\u30ec\u30fc\u30b8\: VM \u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3084\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306a\u3069\u3001\u30d7\u30e9\u30a4\u30de\u30ea\u304a\u3088\u3073\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8 \u30b5\u30fc\u30d0\u30fc\u9593\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3067\u3059\u3002 -label.ldap.group.name=LDAP \u30b0\u30eb\u30fc\u30d7 -label.password.reset.confirm=\u6b21\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u306b\u30ea\u30bb\u30c3\u30c8\u3055\u308c\u307e\u3057\u305f: -label.provider=\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc -label.resetVM=VM \u306e\u30ea\u30bb\u30c3\u30c8 -label.openDaylight=OpenDaylight -label.assign.instance.another=\u307b\u304b\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3078\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u5272\u308a\u5f53\u3066 -label.network.addVM=VM \u3078\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8ffd\u52a0 -label.set.default.NIC=\u30c7\u30d5\u30a9\u30eb\u30c8 NIC \u306e\u8a2d\u5b9a -label.Xenserver.Tools.Version61plus=XenServer Tools Version 6.1 \u4ee5\u964d -label.dynamically.scalable=\u52d5\u7684\u306b\u30b5\u30a4\u30ba\u8a2d\u5b9a\u3059\u308b -label.instance.scaled.up=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30b5\u30a4\u30ba\u304c\u62e1\u5927\u3055\u308c\u307e\u3057\u305f -label.tag.key=\u30bf\u30b0 \u30ad\u30fc -label.tag.value=\u30bf\u30b0\u5024 -label.ipv6.address=IPv6 IP \u30a2\u30c9\u30ec\u30b9 -label.ipv6.gateway=IPv6 \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4 -label.ipv6.CIDR=IPv6 CIDR -label.VPC.limits=VPC \u5236\u9650 -label.edit.region=\u9818\u57df\u306e\u7de8\u96c6 -label.gslb.domain.name=GSLB \u30c9\u30e1\u30a4\u30f3\u540d -label.add.gslb=GSLB \u306e\u8ffd\u52a0 -label.gslb.servicetype=\u30b5\u30fc\u30d3\u30b9\u306e\u7a2e\u985e -label.gslb.details=GSLB \u306e\u8a73\u7d30 -label.gslb.delete=GSLB \u306e\u524a\u9664 -label.opendaylight.controller=OpenDaylight \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc -label.opendaylight.controllers=OpenDaylight \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc -label.portable.ip.ranges=\u30dd\u30fc\u30bf\u30d6\u30eb IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2 -label.add.portable.ip.range=\u30dd\u30fc\u30bf\u30d6\u30eb IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u306e\u8ffd\u52a0 -label.delete.portable.ip.range=\u30dd\u30fc\u30bf\u30d6\u30eb IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u306e\u524a\u9664 -label.opendaylight.controllerdetail=OpenDaylight \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u8a73\u7d30 -label.portable.ip.range.details=\u30dd\u30fc\u30bf\u30d6\u30eb IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u306e\u8a73\u7d30 -label.portable.ips=\u30dd\u30fc\u30bf\u30d6\u30eb IP \u30a2\u30c9\u30ec\u30b9 -label.gslb.assigned.lb=\u5272\u308a\u5f53\u3066\u6e08\u307f\u8ca0\u8377\u5206\u6563 -label.gslb.assigned.lb.more=\u8ca0\u8377\u5206\u6563\u306e\u8ffd\u52a0\u5272\u308a\u5f53\u3066 -label.gslb.lb.rule=\u8ca0\u8377\u5206\u6563\u898f\u5247 -label.gslb.lb.details=\u8ca0\u8377\u5206\u6563\u306e\u8a73\u7d30 -label.gslb.lb.remove=\u3053\u306e GSLB \u304b\u3089\u8ca0\u8377\u5206\u6563\u3092\u524a\u9664 -label.enable.autoscale=\u81ea\u52d5\u30b5\u30a4\u30ba\u8a2d\u5b9a\u306e\u6709\u52b9\u5316 -label.disable.autoscale=\u81ea\u52d5\u30b5\u30a4\u30ba\u8a2d\u5b9a\u306e\u7121\u52b9\u5316 -label.min.instances=\u6700\u5c0f\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u6570 -label.max.instances=\u6700\u5927\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u6570 -label.add.OpenDaylight.device=OpenDaylight \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u8ffd\u52a0 -label.show.advanced.settings=\u8a73\u7d30\u8a2d\u5b9a\u306e\u8868\u793a -label.delete.OpenDaylight.device=OpenDaylight \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u306e\u524a\u9664 -label.polling.interval.sec=\u30dd\u30fc\u30ea\u30f3\u30b0\u9593\u9694 (\u79d2) -label.quiet.time.sec=\u5f85\u3061\u6642\u9593 (\u79d2) -label.destroy.vm.graceperiod=VM \u7834\u68c4\u306e\u7336\u4e88\u671f\u9593 -label.SNMP.community=SNMP \u30b3\u30df\u30e5\u30cb\u30c6\u30a3 -label.SNMP.port=SNMP \u30dd\u30fc\u30c8 -label.add.ucs.manager=UCS Manager \u306e\u8ffd\u52a0 -label.ovm.traffic.label=OVM \u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb -label.lxc.traffic.label=LXC \u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb -label.hyperv.traffic.label=Hyper-V \u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb -label.resource.name=\u30ea\u30bd\u30fc\u30b9\u540d -label.reource.id=\u30ea\u30bd\u30fc\u30b9 ID -label.vnmc.devices=VNMC \u30c7\u30d0\u30a4\u30b9 -label.add.vnmc.provider=VNMC \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u306e\u8ffd\u52a0 -label.enable.vnmc.provider=VNMC \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u306e\u6709\u52b9\u5316 -label.add.vnmc.device=VNMC \u30c7\u30d0\u30a4\u30b9\u306e\u8ffd\u52a0 -label.ciscovnmc.resource.details=Cisco VNMC \u30ea\u30bd\u30fc\u30b9\u306e\u8a73\u7d30 -label.delete.ciscovnmc.resource=Cisco VNMC \u30ea\u30bd\u30fc\u30b9\u306e\u524a\u9664 -label.enable.vnmc.device=VNMC \u30c7\u30d0\u30a4\u30b9\u306e\u6709\u52b9\u5316 -label.disbale.vnmc.device=VNMC \u30c7\u30d0\u30a4\u30b9\u306e\u7121\u52b9\u5316 -label.disable.vnmc.provider=VNMC \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u306e\u7121\u52b9\u5316 -label.services=\u30b5\u30fc\u30d3\u30b9 -label.secondary.staging.store=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2 -label.release.account=\u30a2\u30ab\u30a6\u30f3\u30c8\u304b\u3089\u89e3\u653e -label.release.account.lowercase=\u30a2\u30ab\u30a6\u30f3\u30c8\u304b\u3089\u89e3\u653e -label.vlan.vni.ranges=VLAN/VNI \u306e\u7bc4\u56f2 -label.dedicated.vlan.vni.ranges=\u5c02\u7528 VLAN/VNI \u306e\u7bc4\u56f2 -label.dedicate.vlan.vni.range=VLAN/VNI \u306e\u7bc4\u56f2\u3092\u5c02\u7528\u306b\u8a2d\u5b9a -label.vlan.vni.range=VLAN/VNI \u306e\u7bc4\u56f2 -label.vlan.range.details=VLAN \u306e\u7bc4\u56f2\u306e\u8a73\u7d30 -label.release.dedicated.vlan.range=\u5c02\u7528 VLAN \u306e\u7bc4\u56f2\u306e\u89e3\u653e -label.broadcat.uri=\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8 URI -label.ipv4.cidr=IPv4 CIDR -label.guest.network.details=\u30b2\u30b9\u30c8 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8a73\u7d30 -label.ipv4.gateway=IPv4 \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4 -label.release.dedicated.vlan.range=\u5c02\u7528 VLAN \u306e\u7bc4\u56f2\u3092\u89e3\u653e -label.vlan.ranges=VLAN \u306e\u7bc4\u56f2 -label.virtual.appliance.details=\u4eee\u60f3\u30a2\u30d7\u30e9\u30a4\u30a2\u30f3\u30b9\u306e\u8a73\u7d30 -label.start.lb.vm=LB VM \u306e\u8d77\u52d5 -label.stop.lb.vm=LB VM \u306e\u505c\u6b62 -label.migrate.lb.vm=LB VM \u306e\u79fb\u884c -label.vpc.virtual.router=VPC \u4eee\u60f3\u30eb\u30fc\u30bf\u30fc -label.ovs=OVS -label.gslb.service=GSLB \u30b5\u30fc\u30d3\u30b9 -label.gslb.service.public.ip=GSLB \u30b5\u30fc\u30d3\u30b9\u306e\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9 -label.gslb.service.private.ip=GSLB \u30b5\u30fc\u30d3\u30b9\u306e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8 IP \u30a2\u30c9\u30ec\u30b9 -label.baremetal.dhcp.provider=\u30d9\u30a2\u30e1\u30bf\u30eb DHCP \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc -label.add.baremetal.dhcp.device=\u30d9\u30a2\u30e1\u30bf\u30eb DHCP \u30c7\u30d0\u30a4\u30b9\u306e\u8ffd\u52a0 -label.baremetal.pxe.provider=\u30d9\u30a2\u30e1\u30bf\u30eb PXE \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc -label.baremetal.pxe.device=\u30d9\u30a2\u30e1\u30bf\u30eb PXE \u30c7\u30d0\u30a4\u30b9\u306e\u8ffd\u52a0 -label.tftp.root.directory=TFTP \u30eb\u30fc\u30c8 \u30c7\u30a3\u30ec\u30af\u30c8\u30ea -label.add.vmware.datacenter=VMware \u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u306e\u8ffd\u52a0 -label.remove.vmware.datacenter=VMware \u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u306e\u524a\u9664 -label.dc.name=DC \u540d -label.vcenter=vCenter -label.dedicate.zone=\u30be\u30fc\u30f3\u3092\u5c02\u7528\u306b\u8a2d\u5b9a -label.zone.dedicated=\u5c02\u7528\u30be\u30fc\u30f3 -label.release.dedicated.zone=\u5c02\u7528\u30be\u30fc\u30f3\u306e\u89e3\u653e -label.ipv6.dns1=IPv6 DNS 1 -label.ipv6.dns2=IPv6 DNS 2 -label.vmware.datacenter.name=VMware \u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u540d -label.vmware.datacenter.vcenter=VMware \u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u306e vCenter -label.vmware.datacenter.id=VMware \u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc ID -label.system.vm.details=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u8a73\u7d30 -label.system.vm.scaled.up=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u30b5\u30a4\u30ba\u304c\u62e1\u5927\u3055\u308c\u307e\u3057\u305f -label.console.proxy.vm=\u30b3\u30f3\u30bd\u30fc\u30eb \u30d7\u30ed\u30ad\u30b7 VM -label.settings=\u8a2d\u5b9a -label.requires.upgrade=\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u304c\u5fc5\u8981 -label.upgrade.router.newer.template=\u30eb\u30fc\u30bf\u30fc\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3066\u65b0\u3057\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u7528\u3059\u308b -label.router.vm.scaled.up=\u30eb\u30fc\u30bf\u30fc VM \u306e\u30b5\u30a4\u30ba\u304c\u62e1\u5927\u3055\u308c\u307e\u3057\u305f -label.total.virtual.routers=\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc\u5408\u8a08 -label.upgrade.required=\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u304c\u5fc5\u8981\u3067\u3059 -label.virtual.routers.group.zone=\u30be\u30fc\u30f3\u5225\u306e\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc \u30b0\u30eb\u30fc\u30d7 -label.total.virtual.routers.upgrade=\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u304c\u5fc5\u8981\u306a\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc\u5408\u8a08 -label.virtual.routers.group.pod=\u30dd\u30c3\u30c9\u5225\u306e\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc \u30b0\u30eb\u30fc\u30d7 -label.virtual.routers.group.cluster=\u30af\u30e9\u30b9\u30bf\u30fc\u5225\u306e\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc \u30b0\u30eb\u30fc\u30d7 -label.zone.lower=\u30be\u30fc\u30f3 -label.virtual.routers.group.account=\u30a2\u30ab\u30a6\u30f3\u30c8\u5225\u306e\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc \u30b0\u30eb\u30fc\u30d7 -label.netscaler.details=NetScaler \u306e\u8a73\u7d30 -label.baremetal.dhcp.devices=\u30d9\u30a2\u30e1\u30bf\u30eb DHCP \u30c7\u30d0\u30a4\u30b9 -label.baremetal.pxe.devices=\u30d9\u30a2\u30e1\u30bf\u30eb PXE \u30c7\u30d0\u30a4\u30b9 -label.addes.new.f5=\u65b0\u3057\u3044 F5 \u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f -label.f5.details=F5 \u306e\u8a73\u7d30 -label.srx.details=SRX \u306e\u8a73\u7d30 -label.palo.alto.details=Palo Alto \u306e\u8a73\u7d30 -label.added.nicira.nvp.controller=\u65b0\u3057\u3044 Nicira NVP Controller \u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\ -label.nicira.nvp.details=Nicira NVP \u306e\u8a73\u7d30 -label.added.new.bigswitch.vns.controller=\u65b0\u3057\u3044 Big Switch VNS \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u30fc\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f -label.bigswitch.vns.details=Big Switch VNS \u306e\u8a73\u7d30 -label.dedicate=\u5c02\u7528\u306b\u8a2d\u5b9a -label.dedicate.pod=\u30dd\u30c3\u30c9\u3092\u5c02\u7528\u306b\u8a2d\u5b9a -label.pod.dedicated=\u30dd\u30c3\u30c9\u3092\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u305f -label.release.dedicated.pod=\u5c02\u7528\u30dd\u30c3\u30c9\u306e\u89e3\u653e -label.override.public.traffic=\u30d1\u30d6\u30ea\u30c3\u30af \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b -label.public.traffic.vswitch.type=\u30d1\u30d6\u30ea\u30c3\u30af \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e vSwitch \u306e\u7a2e\u985e -label.public.traffic.vswitch.name=\u30d1\u30d6\u30ea\u30c3\u30af \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e vSwitch \u540d -label.override.guest.traffic=\u30b2\u30b9\u30c8 \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9\u3059\u308b -label.guest.traffic.vswitch.type=\u30b2\u30b9\u30c8 \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e vSwitch \u306e\u7a2e\u985e -label.guest.traffic.vswitch.name=\u30b2\u30b9\u30c8 \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e vSwitch \u540d -label.cisco.nexus1000v.ip.address=Nexus 1000V \u306e IP \u30a2\u30c9\u30ec\u30b9 -label.cisco.nexus1000v.username=Nexus 1000V \u306e\u30e6\u30fc\u30b6\u30fc\u540d -label.cisco.nexus1000v.password=Nexus 1000V \u306e\u30d1\u30b9\u30ef\u30fc\u30c9 -label.dedicate.cluster=\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u5c02\u7528\u306b\u8a2d\u5b9a -label.release.dedicated.cluster=\u5c02\u7528\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u89e3\u653e -label.dedicate.host=\u30db\u30b9\u30c8\u3092\u5c02\u7528\u306b\u8a2d\u5b9a -label.release.dedicated.host=\u5c02\u7528\u30db\u30b9\u30c8\u306e\u89e3\u653e -label.number.of.cpu.sockets=CPU \u30bd\u30b1\u30c3\u30c8\u6570 -label.delete.ucs.manager=UCS Manager \u306e\u524a\u9664 -label.blades=\u30d6\u30ec\u30fc\u30c9 -label.chassis=\u30b7\u30e3\u30fc\u30b7 -label.blade.id=\u30d6\u30ec\u30fc\u30c9 ID -label.associated.profile=\u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb -label.refresh.blades=\u30d6\u30ec\u30fc\u30c9\u306e\u66f4\u65b0 -label.instanciate.template.associate.profile.blade=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u4f5c\u6210\u304a\u3088\u3073\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3068\u30d6\u30ec\u30fc\u30c9\u306e\u95a2\u9023\u4ed8\u3051 -label.select.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u9078\u629e -label.profile=\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb -label.delete.profile=\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u306e\u524a\u9664 -label.disassociate.profile.blade=\u30d7\u30ed\u30d5\u30a1\u30a4\u30eb\u3068\u30d6\u30ec\u30fc\u30c9\u306e\u95a2\u9023\u4ed8\u3051\u306e\u89e3\u9664 -label.secondary.storage.details=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u306e\u8a73\u7d30 -label.secondary.staging.store.details=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2\u306e\u8a73\u7d30 -label.add.nfs.secondary.staging.store=NFS \u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2\u306e\u8ffd\u52a0 -label.delete.secondary.staging.store=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2\u306e\u524a\u9664 -label.ipv4.start.ip=IPv4 \u958b\u59cb IP \u30a2\u30c9\u30ec\u30b9 -label.ipv4.end.ip=IPv4 \u7d42\u4e86 IP \u30a2\u30c9\u30ec\u30b9 -label.ipv6.start.ip=IPv6 \u958b\u59cb IP \u30a2\u30c9\u30ec\u30b9 -label.ipv6.end.ip=IPv6 \u7d42\u4e86 IP \u30a2\u30c9\u30ec\u30b9 -label.vm.password=VM \u306e\u30d1\u30b9\u30ef\u30fc\u30c9: -label.group.by.zone=\u30be\u30fc\u30f3\u5225\u30b0\u30eb\u30fc\u30d7 -label.group.by.pod=\u30dd\u30c3\u30c9\u5225\u30b0\u30eb\u30fc\u30d7 -label.group.by.cluster=\u30af\u30e9\u30b9\u30bf\u30fc\u5225\u30b0\u30eb\u30fc\u30d7 -label.group.by.account=\u30a2\u30ab\u30a6\u30f3\u30c8\u5225\u30b0\u30eb\u30fc\u30d7 -label.no.grouping=(\u30b0\u30eb\u30fc\u30d7\u306a\u3057) -label.create.nfs.secondary.staging.storage=NFS \u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2\u3092\u4f5c\u6210\u3059\u308b -label.username.lower=\u30e6\u30fc\u30b6\u30fc\u540d -label.password.lower=\u30d1\u30b9\u30ef\u30fc\u30c9 -label.email.lower=\u96fb\u5b50\u30e1\u30fc\u30eb -label.firstname.lower=\u540d -label.lastname.lower=\u59d3 -label.domain.lower=\u30c9\u30e1\u30a4\u30f3 -label.account.lower=\u30a2\u30ab\u30a6\u30f3\u30c8 -label.type.lower=\u7a2e\u985e -label.rule.number=\u898f\u5247\u756a\u53f7 -label.action=\u64cd\u4f5c -label.name.lower=\u540d\u524d -label.ucs=UCS -label.change.affinity=\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3\u306e\u5909\u66f4 -label.persistent=\u6c38\u7d9a -label.broadcasturi=\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8 URI -label.network.cidr=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af CIDR -label.reserved.ip.range=\u4e88\u7d04\u6e08\u307f IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2 -label.autoscale=\u81ea\u52d5\u30b5\u30a4\u30ba\u8a2d\u5b9a -label.health.check=\u30d8\u30eb\u30b9 \u30c1\u30a7\u30c3\u30af -label.public.load.balancer.provider=\u30d1\u30d6\u30ea\u30c3\u30af\u8ca0\u8377\u5206\u6563\u88c5\u7f6e\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc -label.add.isolated.network=\u5206\u96e2\u3055\u308c\u305f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8ffd\u52a0 -label.vlan=VLAN -label.secondary.isolated.vlan.id=\u5206\u96e2\u3055\u308c\u305f\u30bb\u30ab\u30f3\u30c0\u30ea VLAN ID -label.ipv4.netmask=IPv4 \u30cd\u30c3\u30c8\u30de\u30b9\u30af -label.custom=\u30ab\u30b9\u30bf\u30e0 -label.disable.network.offering=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u7121\u52b9\u5316 -label.enable.network.offering=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u6709\u52b9\u5316 -label.remove.network.offering=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u524a\u9664 -label.system.offering.for.router=\u30eb\u30fc\u30bf\u30fc\u7528\u30b7\u30b9\u30c6\u30e0 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0 -label.mode=\u30e2\u30fc\u30c9 -label.associate.public.ip=\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9\u306e\u95a2\u9023\u4ed8\u3051 -label.acl=ACL -label.user.data=\u30e6\u30fc\u30b6\u30fc \u30c7\u30fc\u30bf -label.virtual.networking=\u4eee\u60f3\u30cd\u30c3\u30c8\u30ef\u30fc\u30af -label.allow=\u8a31\u53ef -label.deny=\u62d2\u5426 -label.default.egress.policy=\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u9001\u4fe1\u30dd\u30ea\u30b7\u30fc -label.xenserver.tools.version.61.plus=XenServer Tools Version 6.1 \u4ee5\u964d managed.state=\u7ba1\u7406\u5bfe\u8c61\u72b6\u614b -message.acquire.new.ip.vpc=\u3053\u306e VPC \u306e\u65b0\u3057\u3044 IP \u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.acquire.ip.nic=\u3053\u306e NIC \u306e\u305f\u3081\u306b\u65b0\u3057\u3044\u30bb\u30ab\u30f3\u30c0\u30ea IP \u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b?
\u6ce8\: \u65b0\u3057\u304f\u53d6\u5f97\u3057\u305f\u30bb\u30ab\u30f3\u30c0\u30ea IP \u30a2\u30c9\u30ec\u30b9\u306f\u4eee\u60f3\u30de\u30b7\u30f3\u5185\u3067\u624b\u52d5\u3067\u69cb\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 message.acquire.new.ip=\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u65b0\u3057\u3044 IP \u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.acquire.new.ip.vpc=\u3053\u306e VPC \u306e\u65b0\u3057\u3044 IP \u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.acquire.public.ip=\u65b0\u3057\u3044 IP \u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\u3059\u308b\u30be\u30fc\u30f3\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.action.cancel.maintenance.mode=\u3053\u306e\u4fdd\u5b88\u3092\u30ad\u30e3\u30f3\u30bb\u30eb\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.cancel.maintenance=\u30db\u30b9\u30c8\u306e\u4fdd\u5b88\u306f\u6b63\u5e38\u306b\u30ad\u30e3\u30f3\u30bb\u30eb\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u306e\u51e6\u7406\u306b\u306f\u6570\u5206\u304b\u304b\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 @@ -1498,6 +1512,7 @@ message.action.delete.ISO.for.all.zones=\u305d\u306e ISO \u306f\u3059\u3079\u306 message.action.delete.ISO=\u3053\u306e ISO \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.delete.network=\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.delete.nexusVswitch=\u3053\u306e Nexus 1000V \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.action.delete.nic=\u3053\u306e NIC \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? \u95a2\u9023\u4ed8\u3051\u3089\u308c\u305f\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3082 VM \u304b\u3089\u524a\u9664\u3055\u308c\u307e\u3059\u3002 message.action.delete.physical.network=\u3053\u306e\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.delete.pod=\u3053\u306e\u30dd\u30c3\u30c9\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.delete.primary.storage=\u3053\u306e\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? @@ -1518,6 +1533,7 @@ message.action.disable.physical.network=\u3053\u306e\u7269\u7406\u30cd\u30c3\u30 message.action.disable.pod=\u3053\u306e\u30dd\u30c3\u30c9\u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.disable.static.NAT=\u9759\u7684 NAT \u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.disable.zone=\u3053\u306e\u30be\u30fc\u30f3\u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.action.downloading.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3044\u307e\u3059\u3002 message.action.download.iso=\u3053\u306e ISO \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.download.template=\u3053\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.enable.cluster=\u3053\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u6709\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? @@ -1540,6 +1556,7 @@ message.action.remove.host=\u3053\u306e\u30db\u30b9\u30c8\u3092\u524a\u9664\u305 message.action.reset.password.off=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306f\u73fe\u5728\u3053\u306e\u6a5f\u80fd\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u307e\u305b\u3093\u3002 message.action.reset.password.warning=\u73fe\u5728\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5909\u66f4\u3059\u308b\u524d\u306b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u505c\u6b62\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 message.action.restore.instance=\u3053\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u5fa9\u5143\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.action.revert.snapshot=\u6240\u6709\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u3053\u306e\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306b\u623b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.start.instance=\u3053\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8d77\u52d5\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.start.router=\u3053\u306e\u30eb\u30fc\u30bf\u30fc\u3092\u8d77\u52d5\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.start.systemvm=\u3053\u306e\u30b7\u30b9\u30c6\u30e0 VM \u3092\u8d77\u52d5\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? @@ -1547,40 +1564,40 @@ message.action.stop.instance=\u3053\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3 message.action.stop.router=\u3053\u306e\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc\u3067\u63d0\u4f9b\u3059\u308b\u3059\u3079\u3066\u306e\u30b5\u30fc\u30d3\u30b9\u304c\u4e2d\u65ad\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u30eb\u30fc\u30bf\u30fc\u3092\u505c\u6b62\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.stop.systemvm=\u3053\u306e\u30b7\u30b9\u30c6\u30e0 VM \u3092\u505c\u6b62\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.take.snapshot=\u3053\u306e\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.action.revert.snapshot=\u6240\u6709\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u3053\u306e\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306b\u623b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.unmanage.cluster=\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u975e\u7ba1\u7406\u5bfe\u8c61\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.vmsnapshot.delete=\u3053\u306e VM \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.action.vmsnapshot.revert=VM \u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u3092\u5143\u306b\u623b\u3059 message.activate.project=\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30a2\u30af\u30c6\u30a3\u30d6\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.add.cluster.zone=\u30be\u30fc\u30f3 \u306b\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc\u3067\u7ba1\u7406\u3055\u308c\u308b\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u8ffd\u52a0\u3057\u307e\u3059 message.add.cluster=\u30be\u30fc\u30f3 \u306e\u30dd\u30c3\u30c9 \u306b\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc\u3067\u7ba1\u7406\u3055\u308c\u308b\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u8ffd\u52a0\u3057\u307e\u3059 +message.add.cluster.zone=\u30be\u30fc\u30f3 \u306b\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc\u3067\u7ba1\u7406\u3055\u308c\u308b\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u8ffd\u52a0\u3057\u307e\u3059 message.add.disk.offering=\u65b0\u3057\u3044\u30c7\u30a3\u30b9\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u3001\u6b21\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.add.domain=\u3053\u306e\u30c9\u30e1\u30a4\u30f3\u306b\u4f5c\u6210\u3059\u308b\u30b5\u30d6\u30c9\u30e1\u30a4\u30f3\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.add.firewall=\u30be\u30fc\u30f3\u306b\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u3092\u8ffd\u52a0\u3057\u307e\u3059 message.add.guest.network=\u30b2\u30b9\u30c8 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u8ffd\u52a0\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.add.host=\u65b0\u3057\u3044\u30db\u30b9\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u3001\u6b21\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.adding.host=\u30db\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 +message.adding.Netscaler.device=Netscaler \u30c7\u30d0\u30a4\u30b9\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 +message.adding.Netscaler.provider=Netscaler \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 message.add.ip.range.direct.network=\u30be\u30fc\u30f3 \u306e\u76f4\u63a5\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u306b IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u3092\u8ffd\u52a0\u3057\u307e\u3059 message.add.ip.range.to.pod=

\u30dd\u30c3\u30c9 \u306b IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u3092\u8ffd\u52a0\u3057\u307e\u3059

message.add.ip.range=\u30be\u30fc\u30f3\u306e\u30d1\u30d6\u30ea\u30c3\u30af \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u3092\u8ffd\u52a0\u3057\u307e\u3059 -message.add.load.balancer.under.ip=\u8ca0\u8377\u5206\u6563\u898f\u5247\u304c\u6b21\u306e IP \u30a2\u30c9\u30ec\u30b9\u306b\u5bfe\u3057\u3066\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\: +message.additional.networks.desc=\u4eee\u60f3\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u63a5\u7d9a\u3059\u308b\u8ffd\u52a0\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.add.load.balancer=\u30be\u30fc\u30f3\u306b\u8ca0\u8377\u5206\u6563\u88c5\u7f6e\u3092\u8ffd\u52a0\u3057\u307e\u3059 +message.add.load.balancer.under.ip=\u8ca0\u8377\u5206\u6563\u898f\u5247\u304c\u6b21\u306e IP \u30a2\u30c9\u30ec\u30b9\u306b\u5bfe\u3057\u3066\u8ffd\u52a0\u3055\u308c\u307e\u3057\u305f\: message.add.network=\u30be\u30fc\u30f3 \u306b\u65b0\u3057\u3044\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u8ffd\u52a0\u3057\u307e\u3059 message.add.new.gateway.to.vpc=\u3053\u306e VPC \u306b\u65b0\u3057\u3044\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306e\u60c5\u5831\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.add.pod.during.zone.creation=\u5404\u30be\u30fc\u30f3\u306b\u306f 1 \u3064\u4ee5\u4e0a\u306e\u30dd\u30c3\u30c9\u304c\u5fc5\u8981\u3067\u3059\u3002\u4eca\u3053\u3053\u3067\u6700\u521d\u306e\u30dd\u30c3\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u30dd\u30c3\u30c9\u306f\u30db\u30b9\u30c8\u3068\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8 \u30b5\u30fc\u30d0\u30fc\u304b\u3089\u69cb\u6210\u3055\u308c\u307e\u3059\u304c\u3001\u3053\u308c\u3089\u306f\u5f8c\u306e\u624b\u9806\u3067\u8ffd\u52a0\u3057\u307e\u3059\u3002\u6700\u521d\u306b\u3001CloudStack \u306e\u5185\u90e8\u7ba1\u7406\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u305f\u3081\u306b IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u3092\u4e88\u7d04\u3057\u307e\u3059\u3002IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u306f\u3001\u30af\u30e9\u30a6\u30c9\u5185\u306e\u5404\u30be\u30fc\u30f3\u3067\u91cd\u8907\u3057\u306a\u3044\u3088\u3046\u306b\u4e88\u7d04\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 message.add.pod=\u30be\u30fc\u30f3 \u306b\u65b0\u3057\u3044\u30dd\u30c3\u30c9\u3092\u8ffd\u52a0\u3057\u307e\u3059 message.add.primary.storage=\u30be\u30fc\u30f3 \u306e\u30dd\u30c3\u30c9 \u306b\u65b0\u3057\u3044\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u8ffd\u52a0\u3057\u307e\u3059 message.add.primary=\u65b0\u3057\u3044\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u3001\u6b21\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.add.region=\u65b0\u3057\u3044\u9818\u57df\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u60c5\u5831\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.add.region=\u65b0\u3057\u3044\u30ea\u30fc\u30b8\u30e7\u30f3\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u5fc5\u8981\u306a\u60c5\u5831\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.add.secondary.storage=\u30be\u30fc\u30f3 \u306b\u65b0\u3057\u3044\u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u8ffd\u52a0\u3057\u307e\u3059 message.add.service.offering=\u65b0\u3057\u3044\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u3001\u6b21\u306e\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.add.system.service.offering=\u65b0\u3057\u3044\u30b7\u30b9\u30c6\u30e0 \u30b5\u30fc\u30d3\u30b9 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u3001\u6b21\u306e\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.add.template=\u65b0\u3057\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u6210\u3059\u308b\u305f\u3081\u306b\u3001\u6b21\u306e\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.add.volume=\u65b0\u3057\u3044\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u3001\u6b21\u306e\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.add.VPN.gateway=VPN \u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3092\u8ffd\u52a0\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.adding.host=\u30db\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 -message.adding.Netscaler.device=Netscaler \u30c7\u30d0\u30a4\u30b9\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 -message.adding.Netscaler.provider=Netscaler \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u8ffd\u52a0\u3057\u3066\u3044\u307e\u3059 -message.additional.networks.desc=\u4eee\u60f3\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u63a5\u7d9a\u3059\u308b\u8ffd\u52a0\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.admin.guide.read=VMware \u30d9\u30fc\u30b9\u306e VM \u306b\u3064\u3044\u3066\u306f\u3001\u30b5\u30a4\u30ba\u5909\u66f4\u306e\u524d\u306b\u7ba1\u7406\u8005\u30ac\u30a4\u30c9\u306e\u52d5\u7684\u306a\u30b5\u30a4\u30ba\u5909\u66f4\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u304a\u8aad\u307f\u304f\u3060\u3055\u3044\u3002\u7d9a\u884c\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b?\\, message.advanced.mode.desc=VLAN \u30b5\u30dd\u30fc\u30c8\u3092\u6709\u52b9\u306b\u3059\u308b\u5834\u5408\u306f\u3001\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30e2\u30c7\u30eb\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u30e2\u30c7\u30eb\u3067\u306f\u6700\u3082\u67d4\u8edf\u306b\u30ab\u30b9\u30bf\u30e0 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u63d0\u4f9b\u3067\u304d\u3001\u30d5\u30a1\u30a4\u30a2\u30a6\u30a9\u30fc\u30eb\u3001VPN\u3001\u8ca0\u8377\u5206\u6563\u88c5\u7f6e\u306e\u30b5\u30dd\u30fc\u30c8\u306e\u307b\u304b\u306b\u3001\u76f4\u63a5\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3068\u4eee\u60f3\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3082\u6709\u52b9\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 message.advanced.security.group=\u30b2\u30b9\u30c8 VM \u3092\u5206\u96e2\u3059\u308b\u305f\u3081\u306b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.advanced.virtual=\u30b2\u30b9\u30c8 VM \u3092\u5206\u96e2\u3059\u308b\u305f\u3081\u306b\u30be\u30fc\u30f3\u5168\u4f53\u306e VLAN \u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306f\u3001\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 @@ -1594,36 +1611,74 @@ message.attach.volume=\u65b0\u3057\u3044\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u30 message.basic.mode.desc=VLAN \u30b5\u30dd\u30fc\u30c8\u304c\u4e0d\u8981\u3067\u3042\u308b\u5834\u5408\u306f\u3001\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30e2\u30c7\u30eb\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30e2\u30c7\u30eb\u3067\u4f5c\u6210\u3055\u308c\u308b\u3059\u3079\u3066\u306e\u4eee\u60f3\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u304b\u3089\u76f4\u63a5 IP \u30a2\u30c9\u30ec\u30b9\u304c\u5272\u308a\u5f53\u3066\u3089\u308c\u3001\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u3092\u4f7f\u7528\u3057\u3066\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3\u3068\u5206\u96e2\u304c\u63d0\u4f9b\u3055\u308c\u307e\u3059\u3002 message.change.offering.confirm=\u3053\u306e\u4eee\u60f3\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30b5\u30fc\u30d3\u30b9 \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u5909\u66f4\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.change.password=\u30d1\u30b9\u30ef\u30fc\u30c9\u3092\u5909\u66f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.cluster.dedicated=\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u305f +message.cluster.dedication.released=\u5c02\u7528\u30af\u30e9\u30b9\u30bf\u30fc\u304c\u89e3\u653e\u3055\u308c\u307e\u3057\u305f message.configure.all.traffic.types=\u8907\u6570\u306e\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u304c\u3042\u308a\u307e\u3059\u3002[\u7de8\u96c6] \u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u7a2e\u985e\u3054\u3068\u306b\u30e9\u30d9\u30eb\u3092\u69cb\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.configure.ldap=LDAP \u3092\u69cb\u6210\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.configuring.guest.traffic=\u30b2\u30b9\u30c8 \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u69cb\u6210\u3057\u3066\u3044\u307e\u3059 message.configuring.physical.networks=\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u69cb\u6210\u3057\u3066\u3044\u307e\u3059 message.configuring.public.traffic=\u30d1\u30d6\u30ea\u30c3\u30af \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u69cb\u6210\u3057\u3066\u3044\u307e\u3059 message.configuring.storage.traffic=\u30b9\u30c8\u30ec\u30fc\u30b8 \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u69cb\u6210\u3057\u3066\u3044\u307e\u3059 message.confirm.action.force.reconnect=\u3053\u306e\u30db\u30b9\u30c8\u3092\u5f37\u5236\u518d\u63a5\u7d9a\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.add.vnmc.provider=VNMC \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u8ffd\u52a0\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.dedicate.cluster.domain.account=\u3053\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u30c9\u30e1\u30a4\u30f3/\u30a2\u30ab\u30a6\u30f3\u30c8\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.dedicate.host.domain.account=\u3053\u306e\u30db\u30b9\u30c8\u3092\u30c9\u30e1\u30a4\u30f3/\u30a2\u30ab\u30a6\u30f3\u30c8\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.dedicate.pod.domain.account=\u3053\u306e\u30dd\u30c3\u30c9\u3092\u30c9\u30e1\u30a4\u30f3/\u30a2\u30ab\u30a6\u30f3\u30c8\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.dedicate.zone=\u3053\u306e\u30be\u30fc\u30f3\u3092\u30c9\u30e1\u30a4\u30f3/\u30a2\u30ab\u30a6\u30f3\u30c8\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.delete.ciscovnmc.resource=Cisco VNMC \u30ea\u30bd\u30fc\u30b9\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.confirm.delete.F5=F5 \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.confirm.delete.NetScaler=NetScaler \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.delete.SRX=SRX \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.confirm.delete.PA=Palo Alto \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.delete.secondary.staging.store=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.delete.SRX=SRX \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.delete.ucs.manager=UCS Manager \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.confirm.destroy.router=\u3053\u306e\u30eb\u30fc\u30bf\u30fc\u3092\u7834\u68c4\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.disable.network.offering=\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.confirm.disable.provider=\u3053\u306e\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.disable.vnmc.provider=VNMC \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.disable.vpc.offering=\u3053\u306e VPC \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u7121\u52b9\u5316\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.enable.network.offering=\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u6709\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.confirm.enable.provider=\u3053\u306e\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u6709\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.enable.vnmc.provider=VNMC \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u6709\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.enable.vpc.offering=\u3053\u306e VPC \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u6709\u52b9\u5316\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.confirm.join.project=\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u53c2\u52a0\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.refresh.blades=\u30d6\u30ec\u30fc\u30c9\u3092\u66f4\u65b0\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.release.dedicated.cluster=\u3053\u306e\u5c02\u7528\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u89e3\u653e\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.release.dedicated.host=\u3053\u306e\u5c02\u7528\u30db\u30b9\u30c8\u3092\u89e3\u653e\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.release.dedicated.pod=\u3053\u306e\u5c02\u7528\u30dd\u30c3\u30c9\u3092\u89e3\u653e\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.release.dedicated.zone=\u3053\u306e\u5c02\u7528\u30be\u30fc\u30f3\u3092\u89e3\u653e\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.release.dedicate.vlan.range=\u5c02\u7528 VLAN \u306e\u7bc4\u56f2\u3092\u89e3\u653e\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.confirm.remove.IP.range=\u3053\u306e IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.remove.network.offering=\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.remove.vmware.datacenter=VMware \u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.remove.vpc.offering=\u3053\u306e VPC \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.scale.up.router.vm=\u30eb\u30fc\u30bf\u30fc VM \u306e\u30b5\u30a4\u30ba\u3092\u62e1\u5927\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.scale.up.system.vm=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u30b5\u30a4\u30ba\u3092\u62e1\u5927\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.confirm.shutdown.provider=\u3053\u306e\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u30b7\u30e3\u30c3\u30c8\u30c0\u30a6\u30f3\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.start.lb.vm=LB VM \u3092\u8d77\u52d5\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.stop.lb.vm=LB VM \u3092\u505c\u6b62\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.upgrade.router.newer.template=\u30eb\u30fc\u30bf\u30fc\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3066\u65b0\u3057\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.upgrade.routers.account.newtemplate=\u3053\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u3059\u3079\u3066\u306e\u30eb\u30fc\u30bf\u30fc\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3066\u65b0\u3057\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.upgrade.routers.cluster.newtemplate=\u3053\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u3059\u3079\u3066\u306e\u30eb\u30fc\u30bf\u30fc\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3066\u65b0\u3057\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.upgrade.routers.newtemplate=\u3053\u306e\u30be\u30fc\u30f3\u306e\u3059\u3079\u3066\u306e\u30eb\u30fc\u30bf\u30fc\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3066\u65b0\u3057\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.confirm.upgrade.routers.pod.newtemplate=\u3053\u306e\u30dd\u30c3\u30c9\u306e\u3059\u3079\u3066\u306e\u30eb\u30fc\u30bf\u30fc\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3066\u65b0\u3057\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.copy.iso.confirm=ISO \u3092\u6b21\u306e\u5834\u6240\u306b\u30b3\u30d4\u30fc\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.copy.template.confirm=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30b3\u30d4\u30fc\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.copy.template=\u30be\u30fc\u30f3 \u304b\u3089\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 XXX \u3092\u6b21\u306e\u5834\u6240\u306b\u30b3\u30d4\u30fc\u3057\u307e\u3059\: +message.create.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.create.template.vm=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 \u304b\u3089 VM \u3092\u4f5c\u6210\u3057\u307e\u3059 message.create.template.volume=\u30c7\u30a3\u30b9\u30af \u30dc\u30ea\u30e5\u30fc\u30e0 \u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u6210\u3059\u308b\u524d\u306b\u3001\u6b21\u306e\u60c5\u5831\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u30dc\u30ea\u30e5\u30fc\u30e0 \u30b5\u30a4\u30ba\u306b\u3088\u3063\u3066\u306f\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u4f5c\u6210\u306b\u306f\u6570\u5206\u4ee5\u4e0a\u304b\u304b\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 -message.create.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.creating.cluster=\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059 message.creating.guest.network=\u30b2\u30b9\u30c8 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059 message.creating.physical.networks=\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059 message.creating.pod=\u30dd\u30c3\u30c9\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059 message.creating.primary.storage=\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059 message.creating.secondary.storage=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059 +message.creating.systemVM=\u30b7\u30b9\u30c6\u30e0 VM \u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059 (\u3057\u3070\u3089\u304f\u304a\u5f85\u3061\u304f\u3060\u3055\u3044) message.creating.zone=\u30be\u30fc\u30f3\u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059 message.decline.invitation=\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3078\u306e\u62db\u5f85\u3092\u8f9e\u9000\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.dedicate.zone=\u30be\u30fc\u30f3\u3092\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059 +message.dedicated.zone.released=\u5c02\u7528\u30be\u30fc\u30f3\u304c\u89e3\u653e\u3055\u308c\u307e\u3057\u305f +message.dedicate.zone=\u30be\u30fc\u30f3\u3092\u5c02\u7528\u5316\u3057\u3066\u3044\u307e\u3059 message.delete.account=\u3053\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.delete.affinity.group=\u3053\u306e\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.delete.gateway=\u3053\u306e\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? @@ -1646,6 +1701,9 @@ message.disable.snapshot.policy=\u73fe\u5728\u306e\u30b9\u30ca\u30c3\u30d7\u30b7 message.disable.user=\u3053\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.disable.vpn.access=VPN \u30a2\u30af\u30bb\u30b9\u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.disable.vpn=VPN \u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.disabling.network.offering=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u7121\u52b9\u306b\u3057\u3066\u3044\u307e\u3059 +message.disabling.vpc.offering=VPC \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u7121\u52b9\u5316 +message.disallowed.characters=\u8a31\u53ef\u3055\u308c\u306a\u3044\u6587\u5b57\: \\<\\,\\> message.download.ISO=ISO \u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u306b\u306f 00000 \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059 message.download.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3059\u308b\u306b\u306f 00000 \u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059 message.download.volume.confirm=\u3053\u306e\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? @@ -1655,17 +1713,25 @@ message.edit.confirm=[\u4fdd\u5b58] \u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u message.edit.limits=\u6b21\u306e\u30ea\u30bd\u30fc\u30b9\u306b\u5236\u9650\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u300c-1\u300d\u306f\u3001\u30ea\u30bd\u30fc\u30b9\u4f5c\u6210\u306b\u5236\u9650\u304c\u306a\u3044\u3053\u3068\u3092\u793a\u3057\u307e\u3059\u3002 message.edit.traffic.type=\u3053\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u7a2e\u985e\u306b\u95a2\u9023\u4ed8\u3051\u308b\u30c8\u30e9\u30d5\u30a3\u30c3\u30af \u30e9\u30d9\u30eb\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.enable.account=\u3053\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u6709\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.enabled.vpn.ip.sec=IPSec \u4e8b\u524d\u5171\u6709\u30ad\u30fc\: +message.enabled.vpn=\u73fe\u5728\u3001VPN \u30a2\u30af\u30bb\u30b9\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u6b21\u306e IP \u30a2\u30c9\u30ec\u30b9\u7d4c\u7531\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002 message.enable.user=\u3053\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u6709\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.enable.vpn.access=\u73fe\u5728\u3053\u306e IP \u30a2\u30c9\u30ec\u30b9\u306b\u5bfe\u3059\u308b VPN \u306f\u7121\u52b9\u3067\u3059\u3002VPN \u30a2\u30af\u30bb\u30b9\u3092\u6709\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.enable.vpn=\u3053\u306e IP \u30a2\u30c9\u30ec\u30b9\u306b\u5bfe\u3059\u308b VPN \u30a2\u30af\u30bb\u30b9\u3092\u6709\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.enabled.vpn.ip.sec=IPSec \u4e8b\u524d\u5171\u6709\u30ad\u30fc: -message.enabled.vpn=\u73fe\u5728\u3001VPN \u30a2\u30af\u30bb\u30b9\u304c\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u6b21\u306e IP \u30a2\u30c9\u30ec\u30b9\u7d4c\u7531\u3067\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002 +message.enabling.network.offering=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u307e\u3059 message.enabling.security.group.provider=\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7 \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u307e\u3059 +message.enabling.vpc.offering=VPC \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u306e\u6709\u52b9\u5316 +message.enabling.zone.dots=\u30be\u30fc\u30f3\u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u307e\u3059... message.enabling.zone=\u30be\u30fc\u30f3\u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u307e\u3059 +message.enter.seperated.list.multiple.cidrs=CIDR \u304c\u8907\u6570\u3042\u308b\u5834\u5408\u306f\u3001\u30b3\u30f3\u30de\u533a\u5207\u308a\u306e\u4e00\u89a7\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044 message.enter.token=\u96fb\u5b50\u30e1\u30fc\u30eb\u306e\u62db\u5f85\u72b6\u306b\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u30c8\u30fc\u30af\u30f3\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.generate.keys=\u3053\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u65b0\u3057\u3044\u30ad\u30fc\u3092\u751f\u6210\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.gslb.delete.confirm=\u3053\u306e GSLB \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.gslb.lb.remove.confirm=GSLB \u304b\u3089\u8ca0\u8377\u5206\u6563\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.guest.traffic.in.advanced.zone=\u30b2\u30b9\u30c8 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306f\u3001\u30a8\u30f3\u30c9 \u30e6\u30fc\u30b6\u30fc\u306e\u4eee\u60f3\u30de\u30b7\u30f3\u9593\u306e\u901a\u4fe1\u3067\u3059\u3002\u5404\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u30b2\u30b9\u30c8 \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u901a\u4fe1\u3059\u308b\u305f\u3081\u306e VLAN ID \u306e\u7bc4\u56f2\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.guest.traffic.in.basic.zone=\u30b2\u30b9\u30c8 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306f\u3001\u30a8\u30f3\u30c9 \u30e6\u30fc\u30b6\u30fc\u306e\u4eee\u60f3\u30de\u30b7\u30f3\u9593\u306e\u901a\u4fe1\u3067\u3059\u3002CloudStack \u3067\u30b2\u30b9\u30c8 VM \u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u308b IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u7bc4\u56f2\u304c\u4e88\u7d04\u6e08\u307f\u306e\u30b7\u30b9\u30c6\u30e0 IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u3068\u91cd\u8907\u3057\u306a\u3044\u3088\u3046\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.host.dedicated=\u30db\u30b9\u30c8\u3092\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u305f +message.host.dedication.released=\u5c02\u7528\u30db\u30b9\u30c8\u304c\u89e3\u653e\u3055\u308c\u307e\u3057\u305f message.installWizard.click.retry=\u8d77\u52d5\u3092\u518d\u8a66\u884c\u3059\u308b\u306b\u306f\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.installWizard.copy.whatIsACluster=\u30af\u30e9\u30b9\u30bf\u30fc\u306f\u30db\u30b9\u30c8\u3092\u30b0\u30eb\u30fc\u30d7\u5316\u3059\u308b\u65b9\u6cd5\u3067\u3059\u30021 \u3064\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u5185\u306e\u30db\u30b9\u30c8\u306f\u3059\u3079\u3066\u540c\u4e00\u306e\u30cf\u30fc\u30c9\u30a6\u30a7\u30a2\u304b\u3089\u69cb\u6210\u3055\u308c\u3001\u540c\u3058\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc\u3092\u5b9f\u884c\u3057\u3001\u540c\u3058\u30b5\u30d6\u30cd\u30c3\u30c8\u4e0a\u306b\u3042\u308a\u3001\u540c\u3058\u5171\u6709\u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002\u540c\u3058\u30af\u30e9\u30b9\u30bf\u30fc\u5185\u306e\u30db\u30b9\u30c8\u9593\u3067\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u3078\u306e\u30b5\u30fc\u30d3\u30b9\u3092\u4e2d\u65ad\u305b\u305a\u306b\u3001\u4eee\u60f3\u30de\u30b7\u30f3 \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u30e9\u30a4\u30d6 \u30de\u30a4\u30b0\u30ec\u30fc\u30b7\u30e7\u30f3\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30af\u30e9\u30b9\u30bf\u30fc\u306f CloudStack&\#8482; \u74b0\u5883\u5185\u306e 3 \u756a\u76ee\u306b\u5927\u304d\u306a\u7d44\u7e54\u5358\u4f4d\u3067\u3059\u3002\u30af\u30e9\u30b9\u30bf\u30fc\u306f\u30dd\u30c3\u30c9\u306b\u542b\u307e\u308c\u3001\u30dd\u30c3\u30c9\u306f\u30be\u30fc\u30f3\u306b\u542b\u307e\u308c\u307e\u3059\u3002

CloudStack&\#8482; \u3067\u306f 1 \u3064\u306e\u30af\u30e9\u30a6\u30c9\u74b0\u5883\u306b\u8907\u6570\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u304c\u3001\u57fa\u672c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u306f\u30af\u30e9\u30b9\u30bf\u30fc\u306f 1 \u3064\u3067\u3059\u3002 message.installWizard.copy.whatIsAHost=\u30db\u30b9\u30c8\u306f\u5358\u4e00\u306e\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u30fc\u3067\u3001\u30b2\u30b9\u30c8\u4eee\u60f3\u30de\u30b7\u30f3\u3092\u5b9f\u884c\u3059\u308b\u30b3\u30f3\u30d4\u30e5\u30fc\u30c6\u30a3\u30f3\u30b0 \u30ea\u30bd\u30fc\u30b9\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\u30d9\u30a2 \u30e1\u30bf\u30eb \u30db\u30b9\u30c8\u3092\u9664\u3044\u3066\u3001\u5404\u30db\u30b9\u30c8\u306b\u306f\u30b2\u30b9\u30c8\u4eee\u60f3\u30de\u30b7\u30f3\u3092\u7ba1\u7406\u3059\u308b\u305f\u3081\u306e\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc \u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002\u30d9\u30a2 \u30e1\u30bf\u30eb \u30db\u30b9\u30c8\u306b\u3064\u3044\u3066\u306f\u3001\u300e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30ac\u30a4\u30c9\u4e0a\u7d1a\u7de8\u300f\u3067\u7279\u6b8a\u4f8b\u3068\u3057\u3066\u8aac\u660e\u3057\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001KVM \u304c\u6709\u52b9\u306a Linux \u30b5\u30fc\u30d0\u30fc\u3001Citrix XenServer \u304c\u52d5\u4f5c\u3059\u308b\u30b5\u30fc\u30d0\u30fc\u3001\u304a\u3088\u3073 ESXi \u30b5\u30fc\u30d0\u30fc\u304c\u30db\u30b9\u30c8\u3067\u3059\u3002\u57fa\u672c\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u306f\u3001XenServer \u307e\u305f\u306f KVM \u3092\u5b9f\u884c\u3059\u308b\u5358\u4e00\u306e\u30db\u30b9\u30c8\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002

\u30db\u30b9\u30c8\u306f CloudStack&\#8482; \u74b0\u5883\u5185\u306e\u6700\u5c0f\u306e\u7d44\u7e54\u5358\u4f4d\u3067\u3059\u3002\u30db\u30b9\u30c8\u306f\u30af\u30e9\u30b9\u30bf\u30fc\u306b\u542b\u307e\u308c\u3001\u30af\u30e9\u30b9\u30bf\u30fc\u306f\u30dd\u30c3\u30c9\u306b\u542b\u307e\u308c\u3001\u30dd\u30c3\u30c9\u306f\u30be\u30fc\u30f3\u306b\u542b\u307e\u308c\u307e\u3059\u3002 @@ -1700,12 +1766,14 @@ message.installWizard.tooltip.configureGuestTraffic.guestGateway=\u30b2\u30b9\u3 message.installWizard.tooltip.configureGuestTraffic.guestNetmask=\u30b2\u30b9\u30c8\u306e\u4f7f\u7528\u3059\u308b\u30b5\u30d6\u30cd\u30c3\u30c8\u4e0a\u3067\u4f7f\u7528\u3055\u308c\u308b\u30cd\u30c3\u30c8\u30de\u30b9\u30af\u3067\u3059\u3002 message.installWizard.tooltip.configureGuestTraffic.guestStartIp=\u3053\u306e\u30be\u30fc\u30f3\u306e\u30b2\u30b9\u30c8\u306b\u5272\u308a\u5f53\u3066\u308b\u3053\u3068\u304c\u3067\u304d\u308b IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u3067\u3059\u3002\u4f7f\u7528\u3059\u308b NIC \u304c 1 \u3064\u306e\u5834\u5408\u306f\u3001\u3053\u308c\u3089\u306e IP \u30a2\u30c9\u30ec\u30b9\u306f\u30dd\u30c3\u30c9\u306e CIDR \u3068\u540c\u3058 CIDR \u306b\u542b\u307e\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 message.installWizard.tooltip.configureGuestTraffic.name=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u540d\u524d\u3067\u3059\u3002 +message.instance.scaled.up.confirm=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30b5\u30a4\u30ba\u3092\u62e1\u5927\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.instanceWizard.noTemplates=\u4f7f\u7528\u53ef\u80fd\u306a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u4e92\u63db\u6027\u306e\u3042\u308b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u3066\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9 \u30a6\u30a3\u30b6\u30fc\u30c9\u3092\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.ip.address.changed=\u304a\u4f7f\u3044\u306e IP \u30a2\u30c9\u30ec\u30b9\u304c\u5909\u66f4\u3055\u308c\u3066\u3044\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u4e00\u89a7\u3092\u66f4\u65b0\u3057\u307e\u3059\u304b? \u305d\u306e\u5834\u5408\u306f\u3001\u8a73\u7d30\u30da\u30a4\u30f3\u304c\u9589\u3058\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.iso.desc=\u30c7\u30fc\u30bf\u307e\u305f\u306f OS \u8d77\u52d5\u53ef\u80fd\u30e1\u30c7\u30a3\u30a2\u3092\u542b\u3080\u30c7\u30a3\u30b9\u30af \u30a4\u30e1\u30fc\u30b8 message.join.project=\u3053\u308c\u3067\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u53c2\u52a0\u3057\u307e\u3057\u305f\u3002\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u53c2\u7167\u3059\u308b\u306b\u306f\u30d7\u30ed\u30b8\u30a7\u30af\u30c8 \u30d3\u30e5\u30fc\u306b\u5207\u308a\u66ff\u3048\u3066\u304f\u3060\u3055\u3044\u3002 message.launch.vm.on.private.network=\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8\u306a\u5c02\u7528\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3067\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u8d77\u52d5\u3057\u307e\u3059\u304b? message.launch.zone=\u30be\u30fc\u30f3\u3092\u8d77\u52d5\u3059\u308b\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\u3002\u6b21\u306e\u624b\u9806\u306b\u9032\u3093\u3067\u304f\u3060\u3055\u3044\u3002 +message.listView.subselect.multi=(Ctrl/Cmd-click) message.lock.account=\u3053\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u30ed\u30c3\u30af\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? \u3053\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u3059\u3079\u3066\u306e\u30e6\u30fc\u30b6\u30fc\u304c\u30af\u30e9\u30a6\u30c9 \u30ea\u30bd\u30fc\u30b9\u3092\u7ba1\u7406\u3067\u304d\u306a\u304f\u306a\u308a\u307e\u3059\u3002\u305d\u306e\u5f8c\u3082\u65e2\u5b58\u306e\u30ea\u30bd\u30fc\u30b9\u306b\u306f\u30a2\u30af\u30bb\u30b9\u3067\u304d\u307e\u3059\u3002 message.migrate.instance.confirm=\u4eee\u60f3\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u79fb\u884c\u5148\u306f\u6b21\u306e\u30db\u30b9\u30c8\u3067\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.migrate.instance.to.host=\u5225\u306e\u30db\u30b9\u30c8\u306b\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u79fb\u884c\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? @@ -1713,7 +1781,11 @@ message.migrate.instance.to.ps=\u5225\u306e\u30d7\u30e9\u30a4\u30de\u30ea \u30b9 message.migrate.router.confirm=\u30eb\u30fc\u30bf\u30fc\u306e\u79fb\u884c\u5148\u306f\u6b21\u306e\u30db\u30b9\u30c8\u3067\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.migrate.systemvm.confirm=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u79fb\u884c\u5148\u306f\u6b21\u306e\u30db\u30b9\u30c8\u3067\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.migrate.volume=\u5225\u306e\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u306b\u30dc\u30ea\u30e5\u30fc\u30e0\u3092\u79fb\u884c\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.network.addVM.desc=\u3053\u306e VM \u3092\u8ffd\u52a0\u3059\u308b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u305f\u3081\u306e\u65b0\u3057\u3044 NIC \u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002 +message.network.addVMNIC=\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u65b0\u3057\u3044 VM NIC \u3092\u8ffd\u52a0\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.new.user=\u30a2\u30ab\u30a6\u30f3\u30c8\u306b\u65b0\u3057\u3044\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u3001\u6b21\u306e\u60c5\u5831\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.no.affinity.groups=\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u6b21\u306e\u624b\u9806\u306b\u9032\u3093\u3067\u304f\u3060\u3055\u3044\u3002 +message.no.host.available=\u79fb\u884c\u306b\u4f7f\u7528\u3067\u304d\u308b\u30db\u30b9\u30c8\u306f\u3042\u308a\u307e\u305b\u3093 message.no.network.support.configuration.not.true=\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u304c\u6709\u52b9\u306a\u30be\u30fc\u30f3\u304c\u7121\u3044\u305f\u3081\u3001\u8ffd\u52a0\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u6a5f\u80fd\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u624b\u9806 5. \u306b\u9032\u3093\u3067\u304f\u3060\u3055\u3044\u3002 message.no.network.support=\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc\u3068\u3057\u3066 vSphere \u3092\u9078\u629e\u3057\u307e\u3057\u305f\u304c\u3001\u3053\u306e\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc\u306b\u8ffd\u52a0\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u6a5f\u80fd\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u624b\u9806 5. \u306b\u9032\u3093\u3067\u304f\u3060\u3055\u3044\u3002 message.no.projects.adminOnly=\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u304c\u3042\u308a\u307e\u305b\u3093\u3002
\u7ba1\u7406\u8005\u306b\u65b0\u3057\u3044\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210\u3092\u4f9d\u983c\u3057\u3066\u304f\u3060\u3055\u3044\u3002 @@ -1731,11 +1803,17 @@ message.please.select.a.configuration.for.your.zone=\u30be\u30fc\u30f3\u306e\u69 message.please.select.a.different.public.and.management.network.before.removing=\u524a\u9664\u306e\u524d\u306b\u7570\u306a\u308b\u30d1\u30d6\u30ea\u30c3\u30af\u304a\u3088\u3073\u7ba1\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.please.select.networks=\u4eee\u60f3\u30de\u30b7\u30f3\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.please.wait.while.zone.is.being.created=\u30be\u30fc\u30f3\u304c\u4f5c\u6210\u3055\u308c\u308b\u307e\u3067\u3057\u3070\u3089\u304f\u304a\u5f85\u3061\u304f\u3060\u3055\u3044... +message.pod.dedication.released=\u5c02\u7528\u30dd\u30c3\u30c9\u304c\u89e3\u653e\u3055\u308c\u307e\u3057\u305f +message.portable.ip.delete.confirm=\u3053\u306e\u30dd\u30fc\u30bf\u30d6\u30eb IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.project.invite.sent=\u30e6\u30fc\u30b6\u30fc\u306b\u62db\u5f85\u72b6\u304c\u9001\u4fe1\u3055\u308c\u307e\u3057\u305f\u3002\u30e6\u30fc\u30b6\u30fc\u304c\u62db\u5f85\u3092\u627f\u8afe\u3059\u308b\u3068\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002 message.public.traffic.in.advanced.zone=\u30af\u30e9\u30a6\u30c9\u5185\u306e VM \u304c\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u30d1\u30d6\u30ea\u30c3\u30af \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u305f\u3081\u306b\u3001\u4e00\u822c\u306b\u30a2\u30af\u30bb\u30b9\u53ef\u80fd\u306a IP \u30a2\u30c9\u30ec\u30b9\u3092\u5272\u308a\u5f53\u3066\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30a8\u30f3\u30c9 \u30e6\u30fc\u30b6\u30fc\u306f CloudStack \u306e\u30e6\u30fc\u30b6\u30fc \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u4f7f\u7528\u3057\u3066\u3053\u308c\u3089\u306e IP \u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\u3057\u3001\u30b2\u30b9\u30c8 \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3068\u30d1\u30d6\u30ea\u30c3\u30af \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u9593\u306b NAT \u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002

\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8 \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u305f\u3081\u306b\u3001\u5c11\u306a\u304f\u3068\u3082 1 \u3064 IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.public.traffic.in.basic.zone=\u30af\u30e9\u30a6\u30c9\u5185\u306e VM \u304c\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u304b\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u7d4c\u7531\u3067\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u30b5\u30fc\u30d3\u30b9\u3092\u63d0\u4f9b\u3059\u308b\u3068\u3001\u30d1\u30d6\u30ea\u30c3\u30af \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u305f\u3081\u306b\u3001\u4e00\u822c\u306b\u30a2\u30af\u30bb\u30b9\u53ef\u80fd\u306a IP \u30a2\u30c9\u30ec\u30b9\u3092\u5272\u308a\u5f53\u3066\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3068\u3001\u30b2\u30b9\u30c8 IP \u30a2\u30c9\u30ec\u30b9\u306e\u307b\u304b\u306b\u3053\u306e\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u304b\u3089\u30a2\u30c9\u30ec\u30b9\u304c 1 \u3064\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u307e\u3059\u3002\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9\u3068\u30b2\u30b9\u30c8 IP \u30a2\u30c9\u30ec\u30b9\u306e\u9593\u306b\u3001\u9759\u7684\u306a 1 \u5bfe 1 \u306e NAT \u304c\u81ea\u52d5\u7684\u306b\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3055\u308c\u307e\u3059\u3002\u30a8\u30f3\u30c9 \u30e6\u30fc\u30b6\u30fc\u306f CloudStack \u306e\u30e6\u30fc\u30b6\u30fc \u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u4f7f\u7528\u3057\u3066\u8ffd\u52a0\u306e IP \u30a2\u30c9\u30ec\u30b9\u3092\u53d6\u5f97\u3057\u3001\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3068\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9\u306e\u9593\u306b\u9759\u7684 NAT \u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002 -message.redirecting.region=\u9818\u57df\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3057\u3066\u3044\u307e\u3059... -message.remove.region=\u3053\u306e\u7ba1\u7406\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u3053\u306e\u9818\u57df\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.read.admin.guide.scaling.up=\u30b5\u30a4\u30ba\u3092\u62e1\u5927\u3059\u308b\u524d\u306b\u7ba1\u7406\u8005\u30ac\u30a4\u30c9\u306e\u52d5\u7684\u306a\u30b5\u30a4\u30ba\u5909\u66f4\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u304a\u8aad\u307f\u304f\u3060\u3055\u3044\u3002 +message.recover.vm=\u3053\u306e VM \u3092\u5fa9\u65e7\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.redirecting.region=\u30ea\u30fc\u30b8\u30e7\u30f3\u306b\u30ea\u30c0\u30a4\u30ec\u30af\u30c8\u3057\u3066\u3044\u307e\u3059... +message.reinstall.vm=\u6ce8\: \u6ce8\u610f\u3057\u3066\u7d9a\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u51e6\u7406\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304b\u3089 VM \u304c\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u307e\u3059\u3002\u30eb\u30fc\u30c8\u30c7\u30a3\u30b9\u30af\u4e0a\u306e\u30c7\u30fc\u30bf\u306f\u5931\u308f\u308c\u3001\u8ffd\u52a0\u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u30c7\u30fc\u30bf\u306f\u4f55\u3082\u51e6\u7406\u3055\u308c\u307e\u305b\u3093\u3002 +message.remove.ldap=LDAP \u69cb\u6210\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.remove.region=\u7ba1\u7406\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u3053\u306e\u30ea\u30fc\u30b8\u30e7\u30f3\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.remove.vpc=VPC \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.remove.vpn.access=\u6b21\u306e\u30e6\u30fc\u30b6\u30fc\u304b\u3089 VPN \u30a2\u30af\u30bb\u30b9\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.reset.password.warning.notPasswordEnabled=\u3053\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306f\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u7ba1\u7406\u3092\u6709\u52b9\u306b\u305b\u305a\u306b\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002 @@ -1745,17 +1823,23 @@ message.restart.mgmt.server=\u65b0\u3057\u3044\u8a2d\u5b9a\u3092\u6709\u52b9\u30 message.restart.mgmt.usage.server=\u65b0\u3057\u3044\u8a2d\u5b9a\u3092\u6709\u52b9\u306b\u3059\u308b\u305f\u3081\u306b\u3001\u7ba1\u7406\u30b5\u30fc\u30d0\u30fc\u3068\u4f7f\u7528\u72b6\u6cc1\u6e2c\u5b9a\u30b5\u30fc\u30d0\u30fc\u3092\u518d\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.restart.network=\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3067\u63d0\u4f9b\u3059\u308b\u3059\u3079\u3066\u306e\u30b5\u30fc\u30d3\u30b9\u304c\u4e2d\u65ad\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u518d\u8d77\u52d5\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.restart.vpc=VPC \u3092\u518d\u8d77\u52d5\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.restoreVM=VM \u3092\u5fa9\u5143\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.security.group.usage=(\u8a72\u5f53\u3059\u308b\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u3092\u3059\u3079\u3066\u9078\u629e\u3059\u308b\u306b\u306f\u3001Ctrl \u30ad\u30fc\u3092\u62bc\u3057\u306a\u304c\u3089\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044) +message.select.affinity.groups=\u3053\u306e VM \u3092\u8ffd\u52a0\u3059\u308b\u30a2\u30d5\u30a3\u30cb\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.select.a.zone=\u30be\u30fc\u30f3\u306f\u901a\u5e38\u3001\u5358\u4e00\u306e\u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u306b\u76f8\u5f53\u3057\u307e\u3059\u3002\u8907\u6570\u306e\u30be\u30fc\u30f3\u3092\u8a2d\u5b9a\u3057\u3001\u7269\u7406\u7684\u306b\u5206\u96e2\u3057\u3066\u5197\u9577\u6027\u3092\u6301\u305f\u305b\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u30af\u30e9\u30a6\u30c9\u306e\u4fe1\u983c\u6027\u3092\u9ad8\u3081\u307e\u3059\u3002 message.select.instance=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.select.iso=\u65b0\u3057\u3044\u4eee\u60f3\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e ISO \u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.select.item=\u9805\u76ee\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.select.security.groups=\u65b0\u3057\u3044\u4eee\u60f3\u30de\u30b7\u30f3\u306e\u30bb\u30ad\u30e5\u30ea\u30c6\u30a3 \u30b0\u30eb\u30fc\u30d7\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.select.template=\u65b0\u3057\u3044\u4eee\u60f3\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.select.tier=\u968e\u5c64\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.set.default.NIC.manual=\u4eca\u3059\u3050\u306b\u3053\u306e VM \u306e\u30c7\u30d5\u30a9\u30eb\u30c8 NIC \u3092\u624b\u52d5\u3067\u66f4\u65b0\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.set.default.NIC=\u3053\u306e NIC \u3092\u3053\u306e VM \u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306b\u8a2d\u5b9a\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.setup.physical.network.during.zone.creation.basic=\u57fa\u672c\u30be\u30fc\u30f3\u3092\u8ffd\u52a0\u3059\u308b\u3068\u304d\u306f\u3001\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc\u4e0a\u306e NIC \u306b\u5bfe\u5fdc\u3059\u308b 1 \u3064\u306e\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3067\u304d\u307e\u3059\u3002\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306f\u3044\u304f\u3064\u304b\u306e\u7a2e\u985e\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u4f1d\u9001\u3057\u307e\u3059\u3002

\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u307b\u304b\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u7a2e\u985e\u3092\u30c9\u30e9\u30c3\u30b0 \u30a2\u30f3\u30c9 \u30c9\u30ed\u30c3\u30d7\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002 message.setup.physical.network.during.zone.creation=\u62e1\u5f35\u30be\u30fc\u30f3\u3092\u8ffd\u52a0\u3059\u308b\u3068\u304d\u306f\u30011 \u3064\u4ee5\u4e0a\u306e\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u5404\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306f\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u30fc\u4e0a\u306e 1 \u3064\u306e NIC \u306b\u5bfe\u5fdc\u3057\u307e\u3059\u3002\u5404\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3067\u306f\u3001\u7d44\u307f\u5408\u308f\u305b\u306b\u5236\u9650\u304c\u3042\u308a\u307e\u3059\u304c\u30011 \u3064\u4ee5\u4e0a\u306e\u7a2e\u985e\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u901a\u4fe1\u3067\u304d\u307e\u3059\u3002

\u5404\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306b\u5bfe\u3057\u3066\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u306e\u7a2e\u985e\u3092\u30c9\u30e9\u30c3\u30b0 \u30a2\u30f3\u30c9 \u30c9\u30ed\u30c3\u30d7\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.setup.successful=\u30af\u30e9\u30a6\u30c9\u304c\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3055\u308c\u307e\u3057\u305f\u3002 message.snapshot.schedule=\u6b21\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304b\u3089\u9078\u629e\u3057\u3066\u30dd\u30ea\u30b7\u30fc\u306e\u57fa\u672c\u8a2d\u5b9a\u3092\u9069\u7528\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u5b9a\u671f\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u306e\u30b9\u30b1\u30b8\u30e5\u30fc\u30eb\u3092\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u3067\u304d\u307e\u3059\u3002 +message.specifiy.tag.key.value=\u30bf\u30b0 \u30ad\u30fc\u304a\u3088\u3073\u5024\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044 message.specify.url=URL \u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044 message.step.1.continue=\u7d9a\u884c\u3059\u308b\u306b\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u307e\u305f\u306f ISO \u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044 message.step.1.desc=\u65b0\u3057\u3044\u4eee\u60f3\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u7528\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002ISO \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u304d\u308b\u7a7a\u767d\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u9078\u629e\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002 @@ -1767,7 +1851,10 @@ message.step.4.continue=\u7d9a\u884c\u3059\u308b\u306b\u306f\u30cd\u30c3\u30c8\u message.step.4.desc=\u4eee\u60f3\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u304c\u63a5\u7d9a\u3059\u308b\u30d7\u30e9\u30a4\u30de\u30ea \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.storage.traffic=\u30db\u30b9\u30c8\u3084 CloudStack \u30b7\u30b9\u30c6\u30e0 VM \u306a\u3069\u3001\u7ba1\u7406\u30b5\u30fc\u30d0\u30fc\u3068\u901a\u4fe1\u3059\u308b CloudStack \u306e\u5185\u90e8\u30ea\u30bd\u30fc\u30b9\u9593\u306e\u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3067\u3059\u3002\u3053\u3053\u3067\u30b9\u30c8\u30ec\u30fc\u30b8 \u30c8\u30e9\u30d5\u30a3\u30c3\u30af\u3092\u69cb\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.suspend.project=\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4e00\u6642\u505c\u6b62\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.systems.vms.ready=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\u3002 +message.template.copying=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30b3\u30d4\u30fc\u3057\u3066\u3044\u307e\u3059\u3002 message.template.desc=VM \u306e\u8d77\u52d5\u306b\u4f7f\u7528\u3067\u304d\u308b OS \u30a4\u30e1\u30fc\u30b8 +message.tier.required=\u968e\u5c64\u306f\u5fc5\u9808\u3067\u3059 message.tooltip.dns.1=\u30be\u30fc\u30f3\u5185\u306e VM \u3067\u4f7f\u7528\u3059\u308b DNS \u30b5\u30fc\u30d0\u30fc\u306e\u540d\u524d\u3067\u3059\u3002\u30be\u30fc\u30f3\u306e\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9\u304b\u3089\u3001\u3053\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u901a\u4fe1\u3067\u304d\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 message.tooltip.dns.2=\u30be\u30fc\u30f3\u5185\u306e VM \u3067\u4f7f\u7528\u3059\u308b 2 \u756a\u76ee\u306e DNS \u30b5\u30fc\u30d0\u30fc\u306e\u540d\u524d\u3067\u3059\u3002\u30be\u30fc\u30f3\u306e\u30d1\u30d6\u30ea\u30c3\u30af IP \u30a2\u30c9\u30ec\u30b9\u304b\u3089\u3001\u3053\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u901a\u4fe1\u3067\u304d\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 message.tooltip.internal.dns.1=\u30be\u30fc\u30f3\u5185\u306e CloudStack \u5185\u90e8\u30b7\u30b9\u30c6\u30e0 VM \u3067\u4f7f\u7528\u3059\u308b DNS \u30b5\u30fc\u30d0\u30fc\u306e\u540d\u524d\u3067\u3059\u3002\u30dd\u30c3\u30c9\u306e\u30d7\u30e9\u30a4\u30d9\u30fc\u30c8 IP \u30a2\u30c9\u30ec\u30b9\u304b\u3089\u3001\u3053\u306e\u30b5\u30fc\u30d0\u30fc\u306b\u901a\u4fe1\u3067\u304d\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 @@ -1780,103 +1867,42 @@ message.tooltip.zone.name=\u30be\u30fc\u30f3\u306e\u540d\u524d\u3067\u3059\u3002 message.update.os.preference=\u3053\u306e\u30db\u30b9\u30c8\u306e OS \u57fa\u672c\u8a2d\u5b9a\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u540c\u69d8\u306e\u57fa\u672c\u8a2d\u5b9a\u3092\u6301\u3064\u3059\u3079\u3066\u306e\u4eee\u60f3\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306f\u3001\u5225\u306e\u30db\u30b9\u30c8\u3092\u9078\u629e\u3059\u308b\u524d\u306b\u307e\u305a\u3053\u306e\u30db\u30b9\u30c8\u306b\u5272\u308a\u5f53\u3066\u3089\u308c\u307e\u3059\u3002 message.update.resource.count=\u3053\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30ea\u30bd\u30fc\u30b9\u6570\u3092\u66f4\u65b0\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.update.ssl=\u5404\u30b3\u30f3\u30bd\u30fc\u30eb \u30d7\u30ed\u30ad\u30b7\u306e\u4eee\u60f3\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u66f4\u65b0\u3059\u308b\u3001X.509 \u6e96\u62e0\u306e\u65b0\u3057\u3044 SSL \u8a3c\u660e\u66f8\u3092\u9001\u4fe1\u3057\u3066\u304f\u3060\u3055\u3044\: +message.validate.accept=\u6709\u52b9\u306a\u62e1\u5f35\u5b50\u3092\u6301\u3064\u5024\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.validate.creditcard=\u30af\u30ec\u30b8\u30c3\u30c8 \u30ab\u30fc\u30c9\u756a\u53f7\u3092\u6b63\u3057\u304f\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.validate.date.ISO=\u65e5\u4ed8\u3092\u6b63\u3057\u304f\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044 (ISO)\u3002 +message.validate.date=\u65e5\u4ed8\u3092\u6b63\u3057\u304f\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.validate.digits=\u6570\u5b57\u306e\u307f\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.validate.email.address=\u30e1\u30fc\u30eb \u30a2\u30c9\u30ec\u30b9\u3092\u6b63\u3057\u304f\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.validate.equalto=\u540c\u3058\u5024\u3092\u518d\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.validate.fieldrequired=\u3053\u308c\u306f\u5fc5\u9808\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3067\u3059\u3002 +message.validate.fixfield=\u3053\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u4fee\u6b63\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.validate.instance.name=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u540d\u306f 63 \u6587\u5b57\u4ee5\u5185\u3067\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002ASCII \u6587\u5b57\u306e a\uff5ez\u3001A\uff5eZ\u3001\u6570\u5b57\u306e 0\uff5e9\u3001\u304a\u3088\u3073\u30cf\u30a4\u30d5\u30f3\u306e\u307f\u3092\u4f7f\u7528\u3067\u304d\u307e\u3059\u3002\u6587\u5b57\u3067\u59cb\u307e\u308a\u3001\u6587\u5b57\u307e\u305f\u306f\u6570\u5b57\u3067\u7d42\u308f\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 +message.validate.invalid.characters=\u7121\u52b9\u306a\u6587\u5b57\u304c\u898b\u3064\u304b\u308a\u307e\u3057\u305f\u3002\u4fee\u6574\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.validate.max={0} \u4ee5\u4e0b\u306e\u5024\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.validate.maxlength={0} \u6587\u5b57\u4ee5\u4e0b\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.validate.minlength={0} \u6587\u5b57\u4ee5\u4e0a\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.validate.number=\u6570\u5024\u3092\u6b63\u3057\u304f\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.validate.range={0} \uff5e {1} \u306e\u5024\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.validate.range.length={0} \uff5e {1} \u6587\u5b57\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.validate.URL=URL \u3092\u6b63\u3057\u304f\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.virtual.network.desc=\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u5c02\u7528\u4eee\u60f3\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3067\u3059\u3002\u30d6\u30ed\u30fc\u30c9\u30ad\u30e3\u30b9\u30c8 \u30c9\u30e1\u30a4\u30f3\u306f VLAN \u5185\u306b\u914d\u7f6e\u3055\u308c\u3001\u30d1\u30d6\u30ea\u30c3\u30af \u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306f\u3059\u3079\u3066\u4eee\u60f3\u30eb\u30fc\u30bf\u30fc\u306b\u3088\u3063\u3066\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3055\u308c\u307e\u3059\u3002 message.vm.create.template.confirm=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3068 VM \u304c\u81ea\u52d5\u7684\u306b\u518d\u8d77\u52d5\u3055\u308c\u307e\u3059\u3002 message.vm.review.launch=\u6b21\u306e\u60c5\u5831\u3092\u53c2\u7167\u3057\u3066\u3001\u4eee\u60f3\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u6b63\u3057\u304f\u8a2d\u5b9a\u3057\u305f\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304b\u3089\u8d77\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.vnmc.available.list=\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u4e00\u89a7\u3067 VNMC \u3092\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002 +message.vnmc.not.available.list=\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u4e00\u89a7\u3067 VNMC \u3092\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002 message.volume.create.template.confirm=\u3053\u306e\u30c7\u30a3\u30b9\u30af \u30dc\u30ea\u30e5\u30fc\u30e0\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? \u30dc\u30ea\u30e5\u30fc\u30e0 \u30b5\u30a4\u30ba\u306b\u3088\u3063\u3066\u306f\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u4f5c\u6210\u306b\u306f\u6570\u5206\u4ee5\u4e0a\u304b\u304b\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 +message.waiting.for.builtin.templates.to.load=\u7d44\u307f\u8fbc\u307f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30ed\u30fc\u30c9\u3092\u5f85\u6a5f\u3057\u3066\u3044\u307e\u3059... +message.XSTools61plus.update.failed=XenServer Tools Version 6.1 \u4ee5\u964d\u3078\u306e\u66f4\u65b0\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u30a8\u30e9\u30fc\: message.you.must.have.at.least.one.physical.network=\u5c11\u306a\u304f\u3068\u3082 1 \u3064\u7269\u7406\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u304c\u5fc5\u8981\u3067\u3059 -message.zone.creation.complete.would.you.like.to.enable.this.zone=\u30be\u30fc\u30f3\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u306e\u30be\u30fc\u30f3\u3092\u6709\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? +message.your.cloudstack.is.ready=CloudStack \u306e\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\! message.Zone.creation.complete=\u30be\u30fc\u30f3\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f +message.zone.creation.complete.would.you.like.to.enable.this.zone=\u30be\u30fc\u30f3\u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f\u3002\u3053\u306e\u30be\u30fc\u30f3\u3092\u6709\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? message.zone.no.network.selection=\u9078\u629e\u3057\u305f\u30be\u30fc\u30f3\u3067\u306f\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u9078\u629e\u3067\u304d\u307e\u305b\u3093\u3002 message.zone.step.1.desc=\u30be\u30fc\u30f3\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30e2\u30c7\u30eb\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.zone.step.2.desc=\u65b0\u3057\u3044\u30be\u30fc\u30f3\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u3001\u6b21\u306e\u60c5\u5831\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 message.zone.step.3.desc=\u65b0\u3057\u3044\u30dd\u30c3\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u3001\u6b21\u306e\u60c5\u5831\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.zoneWizard.enable.local.storage=\u8b66\u544a\: \u3053\u306e\u30be\u30fc\u30f3\u306e\u30ed\u30fc\u30ab\u30eb \u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u6709\u52b9\u306b\u3059\u308b\u5834\u5408\u306f\u3001\u30b7\u30b9\u30c6\u30e0 VM \u306e\u8d77\u52d5\u5834\u6240\u306b\u5fdc\u3058\u3066\u6b21\u306e\u64cd\u4f5c\u304c\u5fc5\u8981\u3067\u3059\u3002

1. \u30b7\u30b9\u30c6\u30e0 VM \u3092\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u3067\u8d77\u52d5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u30d7\u30e9\u30a4\u30de\u30ea \u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u305f\u5f8c\u3067\u30be\u30fc\u30f3\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u30be\u30fc\u30f3\u3092\u7121\u52b9\u72b6\u614b\u304b\u3089\u958b\u59cb\u3059\u308b\u5fc5\u8981\u3082\u3042\u308a\u307e\u3059\u3002

2. \u30b7\u30b9\u30c6\u30e0 VM \u3092\u30ed\u30fc\u30ab\u30eb \u30b9\u30c8\u30ec\u30fc\u30b8\u3067\u8d77\u52d5\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306f\u3001\u30be\u30fc\u30f3\u3092\u6709\u52b9\u306b\u3059\u308b\u524d\u306b system.vm.use.local.storage \u3092 true \u306b\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002


\u7d9a\u884c\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.validate.fieldrequired=\u3053\u308c\u306f\u5fc5\u9808\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3067\u3059\u3002 -message.validate.fixfield=\u3053\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u4fee\u6b63\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.validate.email.address=\u30e1\u30fc\u30eb \u30a2\u30c9\u30ec\u30b9\u3092\u6b63\u3057\u304f\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.validate.URL=URL \u3092\u6b63\u3057\u304f\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.validate.date=\u65e5\u4ed8\u3092\u6b63\u3057\u304f\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.validate.date.ISO=\u65e5\u4ed8\u3092\u6b63\u3057\u304f\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044 (ISO)\u3002 -message.validate.number=\u6570\u5024\u3092\u6b63\u3057\u304f\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.validate.digits=\u6570\u5b57\u306e\u307f\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.validate.creditcard=\u30af\u30ec\u30b8\u30c3\u30c8 \u30ab\u30fc\u30c9\u756a\u53f7\u3092\u6b63\u3057\u304f\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.validate.equalto=\u540c\u3058\u5024\u3092\u518d\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.validate.accept=\u6709\u52b9\u306a\u62e1\u5f35\u5b50\u3092\u6301\u3064\u5024\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.validate.maxlength={0} \u6587\u5b57\u4ee5\u4e0b\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.validate.minlength={0} \u6587\u5b57\u4ee5\u4e0a\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.validate.range.length={0} \uff5e {1} \u6587\u5b57\u3067\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.validate.range={0} \uff5e {1} \u306e\u5024\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.validate.max={0} \u4ee5\u4e0b\u306e\u5024\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +message.zoneWizard.enable.local.storage=\u8b66\u544a\: \u3053\u306e\u30be\u30fc\u30f3\u3067\u30ed\u30fc\u30ab\u30eb\u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u6709\u52b9\u5316\u3059\u308b\u3068\u3069\u3053\u306b\u30b7\u30b9\u30c6\u30e0 VM \u3092\u8d77\u52d5\u3059\u308b\u304b\u306b\u3088\u3063\u3066\u4ee5\u4e0b\u3092\u5b9f\u65bd\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\:

1. \u5171\u6709\u30d7\u30e9\u30a4\u30de\u30ea\u30b9\u30c8\u30ec\u30fc\u30b8\u3067\u30b7\u30b9\u30c6\u30e0 VM \u3092\u8d77\u52d5\u3055\u305b\u308b\u5834\u5408\u3001\u5171\u6709\u30d7\u30e9\u30a4\u30de\u30ea\u30b9\u30c8\u30ec\u30fc\u30b8\u3092\u4f5c\u6210\u3057\u305f\u5f8c\u30be\u30fc\u30f3\u306b\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u305f\u3001\u7121\u52b9\u72b6\u614b\u306e\u30be\u30fc\u30f3\u3092\u8d77\u52d5\u3055\u305b\u306a\u3051\u308c\u3070\u306a\u308a\u307e\u305b\u3093\u3002

2. \u30ed\u30fc\u30ab\u30eb\u30d7\u30e9\u30a4\u30de\u30ea\u30b9\u30c8\u30ec\u30fc\u30b8\u3067\u30b7\u30b9\u30c6\u30e0 VM \u3092\u8d77\u52d5\u3055\u305b\u308b\u5834\u5408\u3001\u30be\u30fc\u30f3\u3092\u6709\u52b9\u5316\u3055\u305b\u308b\u524d\u306b system.vm.use.local.storage \u3092 true \u306b\u8a2d\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002


\u3053\u306e\u307e\u307e\u7d9a\u3051\u307e\u3059\u304b? messgae.validate.min={0} \u4ee5\u4e0a\u306e\u5024\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.creating.systemVM=\u30b7\u30b9\u30c6\u30e0 VM \u3092\u4f5c\u6210\u3057\u3066\u3044\u307e\u3059 (\u3057\u3070\u3089\u304f\u304a\u5f85\u3061\u304f\u3060\u3055\u3044) -message.enabling.zone.dots=\u30be\u30fc\u30f3\u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u307e\u3059... -message.restoreVM=VM \u3092\u5fa9\u5143\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.no.host.available=\u79fb\u884c\u306b\u4f7f\u7528\u3067\u304d\u308b\u30db\u30b9\u30c8\u306f\u3042\u308a\u307e\u305b\u3093 -message.network.addVM.desc=\u3053\u306e VM \u3092\u8ffd\u52a0\u3059\u308b\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u305f\u3081\u306e\u65b0\u3057\u3044 NIC \u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002 -message.network.addVMNIC=\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u65b0\u3057\u3044 VM NIC \u3092\u8ffd\u52a0\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.set.default.NIC=\u3053\u306e NIC \u3092\u3053\u306e VM \u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u306b\u8a2d\u5b9a\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.set.default.NIC.manual=\u4eca\u3059\u3050\u306b\u3053\u306e VM \u306e\u30c7\u30d5\u30a9\u30eb\u30c8 NIC \u3092\u624b\u52d5\u3067\u66f4\u65b0\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.instance.scaled.up.confirm=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u30b5\u30a4\u30ba\u3092\u62e1\u5927\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.copy.template.confirm=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30b3\u30d4\u30fc\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.template.copying=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30b3\u30d4\u30fc\u3057\u3066\u3044\u307e\u3059\u3002 -message.XSTools61plus.update.failed=XenServer Tools Version 6.1 \u4ee5\u964d\u3078\u306e\u66f4\u65b0\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\u30a8\u30e9\u30fc\: -message.gslb.delete.confirm=\u3053\u306e GSLB \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.portable.ip.delete.confirm=\u3053\u306e\u30dd\u30fc\u30bf\u30d6\u30eb IP \u30a2\u30c9\u30ec\u30b9\u306e\u7bc4\u56f2\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.gslb.lb.remove.confirm=GSLB \u304b\u3089\u8ca0\u8377\u5206\u6563\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.admin.guide.read=VMware \u30d9\u30fc\u30b9\u306e VM \u306b\u3064\u3044\u3066\u306f\u3001\u30b5\u30a4\u30ba\u5909\u66f4\u306e\u524d\u306b\u7ba1\u7406\u8005\u30ac\u30a4\u30c9\u306e\u52d5\u7684\u306a\u30b5\u30a4\u30ba\u5909\u66f4\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u304a\u8aad\u307f\u304f\u3060\u3055\u3044\u3002\u7d9a\u884c\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b?\, -message.tier.required=\u968e\u5c64\u306f\u5fc5\u9808\u3067\u3059 -message.remove.ldap=LDAP \u69cb\u6210\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.action.downloading.template=\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u3044\u307e\u3059\u3002 -message.configure.ldap=LDAP \u3092\u69cb\u6210\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.delete.ciscovnmc.resource=Cisco VNMC \u30ea\u30bd\u30fc\u30b9\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.add.vnmc.provider=VNMC \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u8ffd\u52a0\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.enable.vnmc.provider=VNMC \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u6709\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.disable.vnmc.provider=VNMC \u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.vnmc.available.list=\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u4e00\u89a7\u3067 VNMC \u3092\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002 -message.vnmc.not.available.list=\u30d7\u30ed\u30d0\u30a4\u30c0\u30fc\u4e00\u89a7\u3067 VNMC \u3092\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002 -message.confirm.release.dedicate.vlan.range=\u5c02\u7528 VLAN \u306e\u7bc4\u56f2\u3092\u89e3\u653e\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.start.lb.vm=LB VM \u3092\u8d77\u52d5\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.stop.lb.vm=LB VM \u3092\u505c\u6b62\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.remove.vmware.datacenter=VMware \u30c7\u30fc\u30bf\u30bb\u30f3\u30bf\u30fc\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.dedicate.zone=\u3053\u306e\u30be\u30fc\u30f3\u3092\u30c9\u30e1\u30a4\u30f3/\u30a2\u30ab\u30a6\u30f3\u30c8\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.release.dedicated.zone=\u3053\u306e\u5c02\u7528\u30be\u30fc\u30f3\u3092\u89e3\u653e\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.dedicated.zone.released=\u5c02\u7528\u30be\u30fc\u30f3\u304c\u89e3\u653e\u3055\u308c\u307e\u3057\u305f -message.read.admin.guide.scaling.up=\u30b5\u30a4\u30ba\u3092\u62e1\u5927\u3059\u308b\u524d\u306b\u7ba1\u7406\u8005\u30ac\u30a4\u30c9\u306e\u52d5\u7684\u306a\u30b5\u30a4\u30ba\u5909\u66f4\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u3092\u304a\u8aad\u307f\u304f\u3060\u3055\u3044\u3002 -message.confirm.scale.up.system.vm=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u30b5\u30a4\u30ba\u3092\u62e1\u5927\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.upgrade.router.newer.template=\u30eb\u30fc\u30bf\u30fc\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3066\u65b0\u3057\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.scale.up.router.vm=\u30eb\u30fc\u30bf\u30fc VM \u306e\u30b5\u30a4\u30ba\u3092\u62e1\u5927\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.upgrade.routers.newtemplate=\u3053\u306e\u30be\u30fc\u30f3\u306e\u3059\u3079\u3066\u306e\u30eb\u30fc\u30bf\u30fc\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3066\u65b0\u3057\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.upgrade.routers.pod.newtemplate=\u3053\u306e\u30dd\u30c3\u30c9\u306e\u3059\u3079\u3066\u306e\u30eb\u30fc\u30bf\u30fc\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3066\u65b0\u3057\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.upgrade.routers.cluster.newtemplate=\u3053\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u306e\u3059\u3079\u3066\u306e\u30eb\u30fc\u30bf\u30fc\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3066\u65b0\u3057\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.upgrade.routers.account.newtemplate=\u3053\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u3059\u3079\u3066\u306e\u30eb\u30fc\u30bf\u30fc\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3066\u65b0\u3057\u3044\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.dedicate.pod.domain.account=\u3053\u306e\u30dd\u30c3\u30c9\u3092\u30c9\u30e1\u30a4\u30f3/\u30a2\u30ab\u30a6\u30f3\u30c8\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.release.dedicated.pod=\u3053\u306e\u5c02\u7528\u30dd\u30c3\u30c9\u3092\u89e3\u653e\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.pod.dedication.released=\u5c02\u7528\u30dd\u30c3\u30c9\u304c\u89e3\u653e\u3055\u308c\u307e\u3057\u305f -message.confirm.dedicate.cluster.domain.account=\u3053\u306e\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u30c9\u30e1\u30a4\u30f3/\u30a2\u30ab\u30a6\u30f3\u30c8\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.cluster.dedicated=\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u305f -message.confirm.release.dedicated.cluster=\u3053\u306e\u5c02\u7528\u30af\u30e9\u30b9\u30bf\u30fc\u3092\u89e3\u653e\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.cluster.dedication.released=\u5c02\u7528\u30af\u30e9\u30b9\u30bf\u30fc\u304c\u89e3\u653e\u3055\u308c\u307e\u3057\u305f -message.confirm.dedicate.host.domain.account=\u3053\u306e\u30db\u30b9\u30c8\u3092\u30c9\u30e1\u30a4\u30f3/\u30a2\u30ab\u30a6\u30f3\u30c8\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.host.dedicated=\u30db\u30b9\u30c8\u3092\u5c02\u7528\u306b\u8a2d\u5b9a\u3057\u307e\u3057\u305f -message.confirm.release.dedicated.host=\u3053\u306e\u5c02\u7528\u30db\u30b9\u30c8\u3092\u89e3\u653e\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.host.dedication.released=\u5c02\u7528\u30db\u30b9\u30c8\u304c\u89e3\u653e\u3055\u308c\u307e\u3057\u305f -message.confirm.delete.ucs.manager=UCS Manager \u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.refresh.blades=\u30d6\u30ec\u30fc\u30c9\u3092\u66f4\u65b0\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.delete.secondary.staging.store=\u30bb\u30ab\u30f3\u30c0\u30ea \u30b9\u30c6\u30fc\u30b8\u30f3\u30b0 \u30b9\u30c8\u30a2\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.select.tier=\u968e\u5c64\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -message.disallowed.characters=\u8a31\u53ef\u3055\u308c\u306a\u3044\u6587\u5b57: \<\,\> -message.waiting.for.builtin.templates.to.load=\u7d44\u307f\u8fbc\u307f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30ed\u30fc\u30c9\u3092\u5f85\u6a5f\u3057\u3066\u3044\u307e\u3059... -message.systems.vms.ready=\u30b7\u30b9\u30c6\u30e0 VM \u306e\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\u3002 -message.your.cloudstack.is.ready=CloudStack \u306e\u6e96\u5099\u304c\u3067\u304d\u307e\u3057\u305f\! -message.specifiy.tag.key.value=\u30bf\u30b0 \u30ad\u30fc\u304a\u3088\u3073\u5024\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044 -message.enter.seperated.list.multiple.cidrs=CIDR \u304c\u8907\u6570\u3042\u308b\u5834\u5408\u306f\u3001\u30b3\u30f3\u30de\u533a\u5207\u308a\u306e\u4e00\u89a7\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044 -message.disabling.network.offering=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u7121\u52b9\u306b\u3057\u3066\u3044\u307e\u3059 -message.confirm.enable.network.offering=\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u6709\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.enabling.network.offering=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u6709\u52b9\u306b\u3057\u3066\u3044\u307e\u3059 -message.confirm.remove.network.offering=\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u524a\u9664\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? -message.confirm.disable.network.offering=\u3053\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af \u30aa\u30d5\u30a1\u30ea\u30f3\u30b0\u3092\u7121\u52b9\u306b\u3057\u3066\u3082\u3088\u308d\u3057\u3044\u3067\u3059\u304b? mode=\u30e2\u30fc\u30c9 network.rate=\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u901f\u5ea6 notification.reboot.instance=\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u518d\u8d77\u52d5 @@ -1894,14 +1920,14 @@ state.Creating=\u4f5c\u6210\u4e2d state.Declined=\u8f9e\u9000 state.Destroyed=\u7834\u68c4\u6e08\u307f state.Disabled=\u7121\u52b9 -state.Enabled=\u6709\u52b9 state.enabled=\u6709\u52b9 +state.Enabled=\u6709\u52b9 state.Error=\u30a8\u30e9\u30fc state.Expunging=\u62b9\u6d88\u4e2d state.Migrating=\u79fb\u884c\u4e2d state.Pending=\u4fdd\u7559 -state.Ready=\u6e96\u5099\u5b8c\u4e86 state.ready=\u6e96\u5099\u5b8c\u4e86 +state.Ready=\u6e96\u5099\u5b8c\u4e86 state.Running=\u5b9f\u884c\u4e2d state.Starting=\u958b\u59cb\u4e2d state.Stopped=\u505c\u6b62\u6e08\u307f diff --git a/client/WEB-INF/classes/resources/messages_ko_KR.properties b/client/WEB-INF/classes/resources/messages_ko_KR.properties index b755072d61..ce79d2e5b2 100644 --- a/client/WEB-INF/classes/resources/messages_ko_KR.properties +++ b/client/WEB-INF/classes/resources/messages_ko_KR.properties @@ -16,6 +16,7 @@ # under the License. changed.item.properties=\ud56d\ubaa9 \uc18d\uc131 \ubcc0\uacbd +confirm.enable.s3=S3 \uae30\ubc18 2\ucc28 \uc800\uc7a5\uc18c \uc9c0\uc6d0\uc744 \ud558\ub824\uba74 \uc544\ub798 \uc815\ubcf4\ub97c \uc785\ub825\ud574 \uc8fc\uc2ed\uc2dc\uc624. confirm.enable.swift=Swift \uae30\uc220 \uc9c0\uc6d0\ub97c \uc0ac\uc6a9 \ud558\ub824\uba74 \ub2e4\uc74c \uc815\ubcf4\ub97c \uc785\ub825\ud574 \uc8fc\uc2ed\uc2dc\uc624. error.could.not.enable.zone=Zone\uc744 \uc0ac\uc6a9 \ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. error.installWizard.message=\ubb38\uc81c\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4. \ub2e4\uc2dc \uc624\ub958\ub97c \uc218\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. @@ -28,6 +29,7 @@ error.please.specify.physical.network.tags=\ud604\uc7ac \ubb3c\ub9ac \ub124\ud2b error.session.expired=\uc138\uc158 \uc720\ud6a8\uae30\uac04\uc774 \ub04a\uc5b4\uc84c\uc2b5\ub2c8\ub2e4. error.something.went.wrong.please.correct.the.following=\ubb38\uc81c\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4. \ub2e4\uc74c \ub0b4\uc6a9\uc744 \uc218\uc815\ud574 \uc8fc\uc2ed\uc2dc\uc624 error.unable.to.reach.management.server=\uad00\ub9ac \uc11c\ubc84\uc640 \ud1b5\uc2e0\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. +error.unresolved.internet.name=\uc778\ud130\ub137 \uc8fc\uc18c\ub97c \uc54c\uc218 \uc5c6\uc2b5\ub2c8\ub2e4. extractable=\ucd94\ucd9c \uac00\ub2a5 force.delete.domain.warning=\uacbd\uace0\:\uc774 \uc635\uc158\uc744 \uc120\ud0dd\ud558\uba74, \ubaa8\ub4e0 \ub0b4\ubd80 \ub3c4\uba54\uc778 \ubc0f \uad00\ub828\ud558\ub294 \ubaa8\ub4e0 \uacc4\uc815 \uc815\ubcf4\uc640 \uadf8 \uc790\uc6d0\uc774 \uc0ad\uc81c\ub429\ub2c8\ub2e4. force.delete=\uac15\uc81c \uc0ad\uc81c @@ -40,6 +42,8 @@ ICMP.type=ICMP \uc885\ub958 image.directory=\uc774\ubbf8\uc9c0 \ub514\ub809\ud1a0\ub9ac inline=\uc9c1\ub82c instances.actions.reboot.label=\uc778\uc2a4\ud134\uc2a4 \uc7ac\uc2dc\uc791 +label.about.app=CloudStack \uc18c\uac1c +label.about=\uc18c\uac1c label.accept.project.invitation=\ud504\ub85c\uc81d\ud2b8 \ucd08\ub300 \uc2b9\uc778 label.account.and.security.group=\uacc4\uc815 \uc815\ubcf4, \ubcf4\uc548 \uadf8\ub8f9 label.account.id=\uacc4\uc815 \uc815\ubcf4 ID @@ -227,6 +231,9 @@ label.action.update.OS.preference=OS \uae30\ubcf8 \uc124\uc815 \uc5c5\ub370\uc77 label.action.update.OS.preference.processing=OS \uae30\ubcf8 \uc124\uc815\uc744 \uc5c5\ub370\uc774\ud2b8\ud558\ub294 \uc911... label.action.update.resource.count.processing=\uc790\uc6d0 \uc218\ub97c \uc5c5\ub370\uc774\ud2b8\ud558\ub294 \uc911... label.action.update.resource.count=\uc790\uc6d0 \uc218 \uc5c5\ub370\uc774\ud2b8 +label.action.vmsnapshot.create=VM \uc2a4 +label.action.vmsnapshot.delete=VM +label.action.vmsnapshot.revert=VM \uc2a4\ub0c5\uc0f7 label.activate.project=\ud504\ub85c\uc81d\ud2b8 \ud65c\uc131\ud654 label.active.sessions=\ud65c\uc131 \uc138\uc158 label.add.accounts.to=\uacc4\uc815 \uc815\ubcf4 \ucd94\uac00\: @@ -234,6 +241,7 @@ label.add.accounts=\uacc4\uc815 \uc815\ubcf4 \ucd94\uac00 label.add.account.to.project=\uacc4\uc815 \uc815\ubcf4 \ud504\ub85c\uc81d\ud2b8\uc5d0 \ucd94\uac00 label.add.account=\uacc4\uc815 \uc815\ubcf4 \ucd94\uac00 label.add.ACL=\uad8c\ud55c \uad00\ub9ac(ACL) \ucd94\uac00 +label.add.BigSwitchVns.device=BigSwitch Vns \ucf58\ud2b8\ub864\ub7ec label.add.by.cidr=CIDR \ub85c \ucd94\uac00 label.add.by.group=\uadf8\ub8f9\uc5d0\uc11c \ucd94\uac00 label.add.by=\ucd94\uac00 \ub2e8\uc704 @@ -270,10 +278,12 @@ label.add.new.gateway=\uc0c8 \uac8c\uc774\ud2b8\uc6e8\uc774 \ucd94\uac00\ud558\u label.add.new.NetScaler=\uc0c8\ub85c\uc6b4 NetScaler \ucd94\uac00 label.add.new.SRX=\uc0c8\ub85c\uc6b4 SRX \ucd94\uac00 label.add.new.tier=\uc0c8 \uacc4\uce35 \ucd94\uac00 +label.add.NiciraNvp.device=Nvp \ucf58\ud2b8\ub864\ub7ec label.add.physical.network=\ubb3c\ub9ac \ub124\ud2b8\uc6cc\ud06c \ucd94\uac00 label.add.pod=Pod \ucd94\uac00 label.add.port.forwarding.rule=\ud3ec\ud1a0 \uc804\uc1a1 \uaddc\uce59\uc758 \ucd94\uac00 label.add.primary.storage=\uae30\ubcf8 \uc2a4\ud1a0\ub9ac\uc9c0 \ucd94\uac00 +label.add.region=\uc9c0\uc5ed label.add.resources=\uc790\uc6d0 \ucd94\uac00 label.add.route=\ub77c\uc6b0\ud2b8 \ucd94\uac00 label.add.rule=\uaddc\uce59 \ucd94\uac00 @@ -289,7 +299,6 @@ label.add.to.group=\uadf8\ub8f9\uc5d0 \ucd94\uac00 label.add=\ucd94\uac00 label.add.user=\uc0ac\uc6a9\uc790 \ucd94\uac00 label.add.vlan=VLAN \ucd94\uac00 -label.add.vxlan=VXLAN \ucd94\uac00 label.add.vms.to.lb=\ub124\ud2b8\uc6cc\ud06c \ub85c\ub4dc \uacf5\uc720 \uaddc\uce59\uc5d0 VM \ucd94\uac00 label.add.vms=VM \ucd94\uac00 label.add.VM.to.tier=\uacc4\uce35\uc5d0 VM \ucd94\uac00 @@ -299,6 +308,7 @@ label.add.vpc=VPC \ucd94\uac00 label.add.vpn.customer.gateway=VPN \uace0\uac1d \uac8c\uc774\ud2b8\uc6e8\uc774 \ucd94\uac00 label.add.VPN.gateway=VPN \uac8c\uc774\ud2b8\uc6e8\uc774 \ucd94\uac00 label.add.vpn.user=VPN \uc0ac\uc6a9\uc790 \ucd94\uac00 +label.add.vxlan=VXLAN \ucd94\uac00 label.add.zone=Zone \ucd94\uac00 label.admin.accounts=\uad00\ub9ac\uc790 \uacc4\uc815 \uc815\ubcf4 label.admin=\uad00\ub9ac\uc790 @@ -314,11 +324,15 @@ label.allocated=\ud560\ub2f9 \uc644\ub8cc \uc0c1\ud0dc label.allocation.state=\ud560\ub2f9 \uc0c1\ud0dc label.api.key=API \ud0a4 label.apply=\uc801\uc6a9 +label.app.name=CloudStack +label.archive.alerts=\uc54c\ub9bc +label.archive.events=\uc774\ubca4\ud2b8 label.assign.to.load.balancer=\ub124\ud2b8\uc6cc\ud06c \ub85c\ub4dc \uacf5\uc720 \uc7a5\uce58\uc5d0 \uc778\uc2a4\ud134\uc2a4\ub97c \ud560\ub2f9 label.assign=\ud560\ub2f9 label.associated.network.id=\uad00\ub828 \ub124\ud2b8\uc6cc\ud06c ID label.associated.network=\uad00\ub828 \ub124\ud2b8\uc6cc\ud06c label.attached.iso=\uc5f0\uacb0 ISO +label.author.email=\uc81c\uc791\uc790 label.availability=\uac00\uc6a9\uc131 label.availability.zone=\uc774\uc6a9 \uac00\ub2a5 Zone label.available.public.ips=\uc0ac\uc6a9 \uac00\ub2a5 \uacf5\uac1c IP \uc8fc\uc18c @@ -331,9 +345,13 @@ label.bootable=\ubd80\ud305 \uac00\ub2a5 label.broadcast.domain.range=\ube0c\ub85c\ub4dc\uce90\uc2a4\ud2b8 \ub3c4\uba54\uc778 \ubc94\uc704 label.broadcast.domain.type=\ube0c\ub85c\ub4dc\uce90\uc2a4\ud2b8 \ub3c4\uba54\uc778 \uc885\ub958 label.by.account=\uacc4\uc815 \uc815\ubcf4 +label.by.alert.type=\uc54c\ub9bc label.by.availability=\uac00\uc6a9\uc131 +label.by.date.end=\ub0a0\uc9dc(\uc885\ub8cc\uc77c) +label.by.date.start=\ub0a0\uc9dc(\uc2dc\uc791\uc77c) label.by.domain=\ub3c4\uba54\uc778 label.by.end.date=\uc885\ub8cc\uc77c +label.by.event.type=\uc774\ubca4\ud2b8 label.by.level=\ub808\ubca8 label.by.pod=Pod label.by.role=\uc5ed\ud560 @@ -408,6 +426,8 @@ label.dedicated=\uc804\uc6a9 label.default=\uae30\ubcf8 label.default.use=\uae30\ubcf8 \uc0ac\uc6a9 label.default.view=\uae30\ubcf8 \ubcf4\uae30 +label.delete.alerts=\uc54c\ub9bc +label.delete.events=\uc774\ubca4\ud2b8 label.delete.F5=F5 \uc0ad\uc81c label.delete.gateway=\uac8c\uc774\ud2b8\uc6e8\uc774 \uc0ad\uc81c label.delete.NetScaler=NetScaler \uc0ad\uc81c @@ -465,6 +485,7 @@ label.edit.tags=\ud0dc\uadf8 \ud3b8\uc9d1 label.edit.traffic.type=\ud2b8\ub798\ud53d \uc885\ub958 \ud3b8\uc9d1 label.edit=\ud3b8\uc9d1 label.edit.vpc=VPC \ud3b8\uc9d1 +label.egress.default.policy=Egress \uae30\ubcf8 label.egress.rule=\uc804\uc1a1 \uaddc\uce59 label.elastic.IP=\ud0c4\ub825\uc801 IP \uc8fc\uc18c label.elastic.LB=\ud0c4\ub825\uc801 \ub124\ud2b8\uc6cc\ud06c \ub85c\ub4dc \uacf5\uc720 @@ -504,6 +525,7 @@ label.full=\uc804\uccb4 label.gateway=\uac8c\uc774\ud2b8\uc6e8\uc774 label.general.alerts=\uc77c\ubc18 \uc54c\ub9bc \uccb4\uc81c label.generating.url=URL\ub97c \uc0dd\uc131\ud558\uace0 \uc788\uc74c +label.gluster.volume=\ubcfc\ub968 label.go.step.2=\ub2e8\uacc4 2\uc73c\ub85c label.go.step.3=\ub2e8\uacc4 3\uc73c\ub85c label.go.step.4=\ub2e8\uacc4 4\uc73c\ub85c @@ -533,6 +555,7 @@ label.host.tags=\ud638\uc2a4\ud2b8 \ud0dc\uadf8 label.host=\ud638\uc2a4\ud2b8 label.hourly=\ub9e4\uc2dc\uac04 label.hypervisor.capabilities=\ud558\uc774\ud37c \ubc14\uc774\uc800 \uae30\ub2a5 +label.hypervisors=\ud558\uc774\ud37c\ubc14\uc774\uc800 label.hypervisor.type=\ud558\uc774\ud37c \ubc14\uc774\uc800 \uc885\ub958 label.hypervisor=\ud558\uc774\ud37c \ubc14\uc774\uc800 label.hypervisor.version=\ud558\uc774\ud37c \ubc14\uc774\uc800 \ubc84\uc804 @@ -693,6 +716,7 @@ label.migrate.systemvm.to=\uc2dc\uc2a4\ud15c VM \uc774\uc804 \uc704\uce58\: label.migrate.volume=\ub2e4\ub978 \uae30\ubcf8 \uc2a4\ud1a0\ub9ac\uc9c0\uc5d0 \ubcfc\ub968 \uc774\uc804 label.minimum=\ucd5c\uc18c label.minute.past.hour=\ubd84(\ub9e4\uc2dc) +label.mode=\ubaa8\ub4dc label.monday=\uc6d4\uc694\uc77c label.monthly=\ub9e4\uc6d4 label.more.templates=\ub2e4\ub978 \ud15c\ud50c\ub9bf @@ -834,6 +858,7 @@ label.redundant.router.capability=\uc911\ubcf5 \ub77c\uc6b0\ud130 \uae30\ub2a5 label.redundant.router=\uc911\ubcf5 \ub77c\uc6b0\ud130 label.redundant.state=\uc911\ubcf5 \uc0c1\ud0dc label.refresh=\uc5c5\ub370\uc774\ud2b8 +label.reinstall.vm=VM \uc7ac\uc124\uce58 label.related=\uad00\ub828 label.remind.later=\uc54c\ub9bc \ud45c\uc2dc label.remove.ACL=\uad8c\ud55c \uad00\ub9ac(ACL) \uc0ad\uc81c @@ -871,9 +896,13 @@ label.revoke.project.invite=\ucd08\ub300 \ucde8\uc18c label.role=\uc5ed\ud560 label.root.disk.controller=\ub8e8\ud2b8 \ub514\uc2a4\ud06c \ucf58\ud2b8\ub864\ub7ec label.root.disk.offering=\ub8e8\ud2b8 \ub514\uc2a4\ud06c\uc81c\uacf5 +label.root.disk.size=\ub8e8\ud2b8 \ub514\uc2a4\ud06c label.round.robin=\ub77c\uc6b4\ub4dc \ub85c\ube48 +label.routing=\ub77c\uc6b0\ud305 label.rules=\uaddc\uce59 label.running.vms=\uc2e4\ud589\uc911 VM +label.s3.nfs.path=S3 NFS +label.s3.nfs.server=S3 NFS label.s3.secret_key=\ube44\ubc00 \ud0a4 label.saturday=\ud1a0\uc694\uc77c label.save.and.continue=\uc800\uc7a5\ud558\uae30 @@ -905,6 +934,7 @@ label.sent=\uc804\uc1a1\ub41c \uc0c1\ud0dc label.server=\uc11c\ubc84 label.service.capabilities=\uc11c\ube44\uc2a4 \uae30\ub2a5 label.service.offering=\uc11c\ube44\uc2a4\uc81c\uacf5 +label.service.state=\uc11c\ube44\uc2a4 label.session.expired=\uc138\uc158 \uc720\ud6a8\uae30\uac04\uc774 \ub04a\uc5b4\uc9d0 label.setup.network=\ub124\ud2b8\uc6cc\ud06c \uc124\uc815 label.setup=\uc124\uc815 @@ -980,6 +1010,7 @@ label.super.cidr.for.guest.networks=\uc190\ub2d8 \ub124\ud2b8\uc6cc\ud06c \uc288 label.supported.services=\uae30\uc220 \uc9c0\uc6d0\ub418\ub294 \uc11c\ube44\uc2a4 label.supported.source.NAT.type=\uae30\uc220 \uc9c0\uc6d0\ub418\ub294 \uc804\uc1a1 NAT \uc885\ub958 label.suspend.project=\ud504\ub85c\uc81d\ud2b8 \uc77c\uc2dc\uc815\uc9c0 +label.switch.type=\ud615\uc2dd label.system.capacity=\uc2dc\uc2a4\ud15c \ucc98\ub9ac \ub2a5\ub825 label.system.offering=\uc2dc\uc2a4\ud15c \uc81c\uacf5 label.system.service.offering=\uc2dc\uc2a4\ud15c \uc11c\ube44\uc2a4 \uc81c\uacf5 @@ -1059,9 +1090,7 @@ label.virtual.router=\uac00\uc0c1 \ub77c\uc6b0\ud130 label.vlan.id=VLAN ID label.vlan.range=VLAN \ubc94\uc704 label.vlan=\uac00\uc0c1 \ub124\ud2b8\uc6cc\ud06c(VLAN) -label.vxlan.id=VXLAN ID -label.vxlan.range=VXLAN \ubc94\uc704 -label.vxlan=VXLAN +label.vlan.vni.range=VLAN \ubc94\uc704 label.vm.add=\uc778\uc2a4\ud134\uc2a4 \ucd94\uac00 label.vm.destroy=\ud30c\uae30 label.vm.display.name=VM \ud45c\uc2dc\uba85 @@ -1076,6 +1105,8 @@ label.vm.state=VM \uc0c1\ud0dc label.vm.stop=\uc815\uc9c0 label.vms=VM label.vmware.traffic.label=VMware \ud2b8\ub798\ud53d \ub77c\ubca8 +label.vnet.id=VLAN ID +label.vnet=\uac00\uc0c1 \ub124\ud2b8\uc6cc\ud06c(VLAN) label.volgroup=\ubcfc\ub968 \uadf8\ub8f9 label.volume.limits=\ubcfc\ub968 \uc81c\ud55c label.volume.name=\ubcfc\ub968\uba85 @@ -1093,6 +1124,9 @@ label.vsmctrlvlanid=\uc81c\uc5b4 VLAN ID label.vsmpktvlanid=\ud328\ud0b7 VLAN ID label.vsmstoragevlanid=\uc2a4\ud1a0\ub9ac\uc9c0 VLAN ID label.vsphere.managed=vSphere \uad00\ub9ac +label.vxlan.id=VXLAN ID +label.vxlan.range=VXLAN \ubc94\uc704 +label.vxlan=VXLAN label.waiting=\ub300\uae30\ud558\ub294 \uc911 label.warn=\uacbd\uace0 label.wednesday=\uc218\uc694\uc77c @@ -1413,7 +1447,6 @@ message.zone.no.network.selection=\uc120\ud0dd\ud55c Zone\uc5d0\uc11c\ub294 \ub1 message.zone.step.1.desc=Zone \ub124\ud2b8\uc6cc\ud06c \ubaa8\ub378\uc744 \uc120\ud0dd\ud574 \uc8fc\uc2ed\uc2dc\uc624. message.zone.step.2.desc=\uc0c8 Zone\uc744 \ucd94\uac00\ud558\uae30 \uc704\ud574 \uc544\ub798 \uc815\ubcf4\ub97c \uc785\ub825\ud574 \uc8fc\uc2ed\uc2dc\uc624. message.zone.step.3.desc=\uc0c8 Pod\ub97c \ucd94\uac00\ud558\uae30 \uc704\ud574 \uc544\ub798 \uc815\ubcf4\ub97c \uc785\ub825\ud574 \uc8fc\uc2ed\uc2dc\uc624. -message.zoneWizard.enable.local.storage=\uacbd\uace0\:\ud604\uc7ac Zone\uc758 \ub85c\uceec \uc2a4\ud1a0\ub9ac\uc9c0\ub97c \uc0ac\uc6a9 \ud558\ub294 \uacbd\uc6b0\ub294 \uc2dc\uc2a4\ud15c VM\uc758 \uc2dc\uc791 \uc7a5\uc18c\uc5d0 \ub530\ub77c \ub2e4\uc74c \uc791\uc5c5\uc774 \ud544\uc694\ud569\ub2c8\ub2e4.

1. \uc2dc\uc2a4\ud15c VM\uc744 \uae30\ubcf8 \uc2a4\ud1a0\ub9ac\uc9c0\ub85c \uc2dc\uc791\ud574\uc57c \ud558\ub294 \uacbd\uc6b0 \uae30\ubcf8 \uc2a4\ud1a0\ub9ac\uc9c0\ub97c \ub9cc\ub4e4\uae30\ud55c \ub2e4\uc74c\uc5d0 Zone\uc5d0 \ucd94\uac00\ud574\uc57c \ud569\ub2c8\ub2e4. \ub610\ud55c, \uc720\ud6a8\ud558\uc9c0 \uc54a\uc740 \uc0c1\ud0dc\uc758 Zone\uc744 \uc2dc\uc791\ud574\uc57c \ud569\ub2c8\ub2e4.

2. \uc2dc\uc2a4\ud15c VM\ub97c \ub85c\uceec \uc2a4\ud1a0\ub9ac\uc9c0\ub85c \uc2dc\uc791\ud560 \ud544\uc694\uac00 \uc788\ub294 \uacbd\uc6b0 system.vm.use.local.storage\ub97c true \ub85c \uc124\uc815\ud558\uace0 \ub098\uc11c Zone\uc744 \uc0ac\uc6a9\ud574\uc57c \ud569\ub2c8\ub2e4.


\uc9c4\ud589 \ud558\uc2dc\uaca0\uc2b5\ub2c8\uae4c? mode=\ubaa8\ub4dc network.rate=\ub124\ud2b8\uc6cc\ud06c \uc18d\ub3c4 notification.reboot.instance=\uc778\uc2a4\ud134\uc2a4 \uc7ac\uc2dc\uc791 diff --git a/client/WEB-INF/classes/resources/messages_nb_NO.properties b/client/WEB-INF/classes/resources/messages_nb_NO.properties index be41244939..c169112222 100644 --- a/client/WEB-INF/classes/resources/messages_nb_NO.properties +++ b/client/WEB-INF/classes/resources/messages_nb_NO.properties @@ -16,103 +16,466 @@ # under the License. changed.item.properties=Endrede egenskaper +confirm.enable.swift=Vennligst fyll inn f\u00f8lgende informasjon for \u00e5 aktivere st\u00f8tte for Swift +error.could.not.change.your.password.because.ldap.is.enabled=Feil kunne ikke bytte ditt passord fordi LDAP er aktivert. error.could.not.enable.zone=Kunne ikke aktivere sonen error.installWizard.message=Noe gikk galt. G\u00e5 tilbake og korriger feilene. +error.invalid.username.password=Ugyldig brukernavn eller passord +error.mgmt.server.inaccessible=Administrasjonsserver er utilgjengelig. Vennligst pr\u00f8v igjen senere. error.password.not.match=Passordfeltene sammensvarer ikke +error.session.expired=Din sesjon har utl\u00f8pt. error.something.went.wrong.please.correct.the.following=Noe gikk galt. Vennligst korrig\u00e9r f\u00f8lgende +error.unable.to.reach.management.server=Kan ikke oppn\u00e5 kontakt med administrasjonsserveren +extractable=Utpakkbar force.delete=Tving sletting force.remove=Tving fjerning force.stop=Tving stopp +ICMP.code=ICMP-kode +ICMP.type=ICMP-type +image.directory=Bilde-katalog instances.actions.reboot.label=Omstart av instans +label.about.app=Om CloudStack +label.about=Om label.accept.project.invitation=Aksepter prosjektinvitasjon +label.account.and.security.group=Konto, Sikkerhetsgruppe +label.account.id=Konto ID +label.account=Konto +label.account.name=Kontonavn +label.accounts=Kontoer +label.action.attach.disk.processing=Tilknytter Disk.... +label.action.attach.disk=Tilknytt Disk +label.action.attach.iso.processing=Tilknytter ISO.... +label.action.attach.iso=Tilknytt ISO +label.action.change.password=Endre passord +label.action.change.service=Endre Tjeneste +label.action.change.service.processing=Endrer Tjeneste.... +label.action.copy.ISO=Kopier ISO +label.action.copy.ISO.processing=Kopierer ISO.... +label.action.copy.template=Kopier mal +label.action.copy.template.processing=Kopier mal.... +label.action.create.template.from.vm=Lag Mal fra VM +label.action.create.template.from.volume=Lag Mal fra Volum +label.action.create.template=Opprett mal +label.action.create.template.processing=Oppretter mal.... +label.action.create.vm=Opprett VM +label.action.create.vm.processing=Oppretter VM.... +label.action.create.volume=Opprett volum +label.action.create.volume.processing=Oppretter volum.... +label.action.delete.account.processing=Sletter konto.... +label.action.delete.account=Slett konto +label.action.delete.cluster.processing=Sletter klynge.... +label.action.delete.cluster=Slett klynge +label.action.delete.disk.offering.processing=Sletter disktilbud.... +label.action.delete.disk.offering=Slett disktilbud +label.action.delete.domain.processing=Sletter domene.... +label.action.delete.domain=Slett domene +label.action.delete.firewall.processing=Sletter brannmur.... +label.action.delete.firewall=Slett brannmurregel +label.action.delete.ingress.rule.processing=Sletter inng\u00e5ende regel.... +label.action.delete.ingress.rule=Slett inng\u00e5ende regel +label.action.delete.IP.range.processing=Sletter IP-rekke.... +label.action.delete.IP.range=Slett IP-rekke +label.action.delete.ISO.processing=Sletter ISO.... +label.action.delete.ISO=Slett ISO +label.action.delete.load.balancer.processing=Sletter Lastbalanserer +label.action.delete.load.balancer=Slett lastbalanseringsregel +label.action.delete.network.processing=Sletter nettverk.... +label.action.delete.network=Slett nettverk +label.action.delete.nexusVswitch=Slett Nexus 1000v +label.action.delete.nic=Fjern NIC +label.action.delete.physical.network=Slett fysisk nettverk +label.action.delete.pod.processing=Sletter pod.... +label.action.delete.pod=Slett pod +label.action.delete.primary.storage.processing=Sletter prim\u00e6rlagring.... +label.action.delete.primary.storage=Slett prim\u00e6rlagring +label.action.delete.secondary.storage.processing=Sletter sekund\u00e6rlagring.... +label.action.delete.secondary.storage=Slett sekund\u00e6rlagring +label.action.delete.security.group.processing=Slett Sikkerhetsgruppe.... +label.action.delete.security.group=Slett Sikkerhetsgruppe +label.action.delete.service.offering.processing=Sletter tjenestetilbud.... +label.action.delete.service.offering=Slett tjenestetilbud +label.action.delete.system.service.offering=Slett system-tjenestetilbud +label.action.delete.template.processing=Sletter mal.... +label.action.delete.template=Slett mal +label.action.delete.user.processing=Sletter bruker.... +label.action.delete.user=Slett bruker +label.action.delete.volume.processing=Sletter volum.... +label.action.delete.volume=Slett volum +label.action.delete.zone.processing=Sletter sone.... +label.action.delete.zone=Slett sone +label.action.destroy.instance.processing=\u00d8delegge instans.... +label.action.destroy.instance=\u00d8delegg Instans +label.action.destroy.systemvm.processing=Sletter system VM.... +label.action.destroy.systemvm=Slett system VM +label.action.disable.account=Deaktiver konto +label.action.disable.account.processing=Deaktiverer konto.... label.action.disable.cluster=Deaktiver klyngen label.action.disable.cluster.processing=Deaktiverer klyngen... +label.action.disable.nexusVswitch=Deaktiver Nexus 1000v +label.action.disable.physical.network=Deaktiver fysisk nettverk label.action.disable.pod=Deaktiver pod label.action.disable.pod.processing=Deaktiverer pod... +label.action.disable.static.NAT=Deaktiver statisk NAT +label.action.disable.static.NAT.processing=Deaktiverer statisk NAT.... +label.action.disable.user=Deaktivert bruker +label.action.disable.user.processing=Deaktiverer bruker.... label.action.disable.zone=Deaktiver sonen label.action.disable.zone.processing=Deaktiverer sonen... +label.action.download.ISO=Last ned ISO +label.action.download.template=Laster ned mal +label.action.download.volume=Last ned volum +label.action.download.volume.processing=Laster ned volum.... +label.action.edit.account=Rediger konto +label.action.edit.disk.offering=Editer disktilbud +label.action.edit.domain=Editer domene +label.action.edit.global.setting=Editer global innstilling +label.action.edit.host=Editer vert +label.action.edit.instance=Rediger instans +label.action.edit.ISO=Rediger ISO +label.action.edit.network=Editer Nettverk +label.action.edit.network.processing=Editerer Nettverk.... +label.action.edit.pod=Editer Pod +label.action.edit.primary.storage=Editer Prim\u00e6rlagring +label.action.edit.service.offering=Editer tjenestetilbud +label.action.edit.template=Editer mal +label.action.edit.user=Rediger bruker +label.action.edit.zone=Rediger Sone +label.action.enable.account=Aktiver konto +label.action.enable.account.processing=Aktiverer konto.... label.action.enable.cluster=Aktiver klynge label.action.enable.cluster.processing=Aktiverer klyngen... +label.action.enable.nexusVswitch=Aktiver Nexus 1000v +label.action.enable.physical.network=Aktiver fysisk nettverk label.action.enable.pod=Aktiver pod label.action.enable.pod.processing=Aktiverer pod... +label.action.enable.static.NAT=Aktiver statisk NAT +label.action.enable.static.NAT.processing=Aktiverer statisk NAT.... +label.action.enable.user=Aktiver Bruker +label.action.enable.user.processing=Aktiverer Bruker.... label.action.enable.zone=Aktiver sone label.action.enable.zone.processing=Aktiverer sone... +label.action.generate.keys=Generer n\u00f8kler +label.action.generate.keys.processing=Genererer n\u00f8kler.... +label.action.list.nexusVswitch=Liste Nexus 1000v +label.action.lock.account=L\u00e5s konto +label.action.lock.account.processing=L\u00e5ser konto.... +label.action.manage.cluster=Administrer klynge +label.action.manage.cluster.processing=Administrerer klynge.... +label.action.migrate.instance=Migrer Instans +label.action.migrate.instance.processing=Migrerer Instans.... +label.action.migrate.router=Migrer ruter +label.action.migrate.router.processing=Migrerer Ruter.... +label.action.migrate.systemvm=Migrer System VM +label.action.migrate.systemvm.processing=Migrerer System VM.... +label.action.reboot.instance=Omstart Instans +label.action.reboot.instance.processing=Starter om Instans.... +label.action.reboot.router=Omstart Ruter +label.action.reboot.router.processing=Omstaer Instans.... +label.action.reboot.systemvm=Omstart System VM +label.action.reboot.systemvm.processing=Omstarter System VM +label.action.register.iso=Registrer ISO +label.action.register.template=Registrer mal +label.action.remove.host=Fjern Vert +label.action.remove.host.processing=Fjerner Vest.... +label.action.reset.password.processing=Tilbakestiller passord.... +label.action.reset.password=Tilbakestill passord +label.action.resize.volume=Endre st\u00f8rrelse p\u00e5 volum +label.action.resize.volume.processing=Endrer st\u00f8rrelse p\u00e5 volum.... +label.action.resource.limits=Ressursbegrensninger +label.action.restore.instance=Gjenopprett Instans +label.action.restore.instance.processing=Gjenoppretter Instans.... +label.actions=Handlinger +label.action.start.instance.processing=Starter instans.... +label.action.start.instance=Start instans +label.action.start.router.processing=Stopper ruter +label.action.start.router=Start ruter +label.action.start.systemvm.processing=Starter System VM.... +label.action.start.systemvm=Start System VM +label.action.stop.instance.processing=Stopper instans.... +label.action.stop.instance=Stopp instans +label.action.stop.router.processing=Stopper ruter.... +label.action.stop.router=Stopp ruter +label.action.stop.systemvm.processing=Stopper System VM.... +label.action.stop.systemvm=Stopp System VM label.action.unmanage.cluster.processing=Fjerner administrasjon av klynge... label.activate.project=Aktiver prosjekt +label.active.sessions=Aktive sesjoner +label.add.account=Legg til konto label.add.accounts=Legg til kontoer label.add.accounts.to=Legg kontoer til label.add.account.to.project=Legg kontoen til prosjektet +label.add.ACL=Legg til ACL label.add.by=Legg til ved +label.add.cluster=Legg til klynge +label.add.compute.offering=Legg til systemtilbud +label.add.domain=Legg til domene +label.add.F5.device=Legg til F5 enhet +label.add.firewall=Legg til brannmurregel label.add.guest.network=Legg til gjestenettverk +label.add.host=Legg til vert +label.adding.cluster=Legger til klynge +label.adding.failed=Tillegging feilet +label.adding.pod=Legger til pod +label.adding.processing=Legger til +label.adding.succeeded=Tillegging vellykket +label.adding=Tillegger +label.adding.user=Legger til bruker +label.adding.zone=Legger til sone +label.add.ip.range=Legg til IP-rekke +label.add=Legg til +label.add.load.balancer=Legg til lastbalanserer +label.add.more=Legg til mer +label.add.netScaler.device=Legg til Netscaler enhet +label.add.network.ACL=Legg til nettverk ACL label.add.network.device=Legg til nettverksenhet +label.add.network=Legg til nettverk +label.add.network.offering=Legg til nettverkstilbud label.add.new.F5=Legg til ny F5 +label.add.new.gateway=Legg til ny gateway label.add.new.NetScaler=Legg til ny NetScaler +label.add.new.PA=Legg til ny Palo Alto label.add.new.SRX=Legg til ny SRX +label.add.PA.device=Legg til Palo Alto enhet label.add.physical.network=Legg til fysisk nettverk +label.add.pod=Legg til pod +label.add.port.forwarding.rule=Legg til portvideresendingsregel +label.add.primary.storage=Legg til prim\u00e6rlagring +label.add.region=Legg til region label.add.resources=Legg til ressurser +label.add.route=Legg til rute +label.add.rule=Legg til regel +label.add.secondary.storage=Legg til sekund\u00e6rlagring +label.add.security.group=Legg til sikkerhetsgruppe +label.add.service.offering=Legg til tjenestetilbud +label.add.SRX.device=Legg til SRX enhet +label.add.static.nat.rule=Legg til statisk NAT-regel +label.add.static.route=Legg til statisk rute label.add.system.service.offering=Legg til et systemtilbud +label.add.template=Legg til mal label.add.to.group=Legg til gruppe +label.add.user=Legg til bruker +label.add.vlan=Legg til VLAN +label.add.vm=Legg til VM label.add.vms=Legg til VMer +label.add.vms.to.lb=Legg til VM(er) til lastbalanseringsregel +label.add.volume=Legg til volum +label.add.vpc=Legg til VPC +label.add.VPN.gateway=Legg til VPN Gateway +label.add.vpn.user=Legg til VPN-bruker +label.add.vxlan=Legg til VXLAN +label.add.zone=Legg til sone +label.admin.accounts=Adminkontoer +label.admin=Admin label.advanced=Avansert +label.advanced.mode=Avansermodus +label.advanced.search=Avansert s\u00f8k +label.agent.password=Agentpassord label.agree=Godtar +label.alert=Varsel label.allocated=Allokert label.allocation.state=Allokeringsstatus +label.api.key=API-n\u00f8kkel label.apply=Bruk +label.app.name=CloudStack +label.archive.alerts=Arkiver varsler +label.archive.events=Arkiver hendelser +label.assign=Tildel +label.attached.iso=Tilknyttet ISO +label.author.email=Forfatter e-post +label.author.name=Forfatternavn +label.availability=Tilgjengelighet +label.availability.zone=Tilgjengelighetssone +label.available.public.ips=Tilgjengelig offentlige IP-adresser +label.available=Tilgjengelig +label.back=Tilbake label.bandwidth=B\u00e5ndbredde label.basic=Basis +label.basic.mode=Basismodus +label.by.account=Etter Konto +label.by.alert.type=Etter varseltype +label.by.availability=Etter Tilgjengelighet +label.by.date.end=Etter dato (slutt) +label.by.date.start=Etter dato (start) +label.by.domain=Etter Domene +label.by.event.type=Etter hendelsestype +label.by.pod=Etter Pod +label.by.role=Etter Rolle +label.by.start.date=Etter Startdato +label.by.traffic.type=Etter Trafikktype +label.by.type=Etter Type +label.by.type.id=Etter Type ID +label.by.zone=Etter Sone +label.cancel=Avbryt label.capacity=Kapasitet +label.certificate=Sertifikat label.change.service.offering=Endre tjenestetilbud label.change.value=Endre verdi +label.character=Karakter +label.checksum=MD5 sjekksum label.cidr=CIDR +label.CIDR.list=CIDR liste label.cidr.list=Kilde-CIDR label.clean.up=Rydd opp +label.clear.list=T\u00f8m liste +label.close=Lukk +label.cloud.console=Cloud +label.cluster=Klynge +label.cluster.name=Klyngenavn +label.clusters=Klynger +label.cluster.type=Klyngetype label.clvm=CLVM label.compute.and.storage=Regnekraft og lagring label.compute=Beregne +label.compute.offering=Regnekraftstilbud +label.compute.offerings=Regnekraftstilbud +label.configuration=Konfigurering label.configure=Konfigurer +label.configure.vpc=Konfigurer VPC +label.confirmation=Bekreftelse label.confirm.password=Bekreft passord label.congratulations=Gratulerer\! +label.conserve.mode=Konserveringsmodus +label.console.proxy=Konsollproxy label.continue.basic.install=Fortsett med enkelt oppsett label.continue=Fortsett label.corrections.saved=Endringer lagret +label.cpu.allocated=CPU allokert +label.cpu.allocated.for.VMs=CPU Allokert for VMer label.CPU.cap=CPU begrensning +label.cpu=CPU +label.cpu.limits=CPU-begrensninger +label.cpu.mhz=CPU (i MHz) +label.cpu.utilized=CPU-utnyttelse label.created.by.system=Opprettet av systemet +label.created=Opprettet label.create.project=Opprett prosjekt label.create.template=Opprett mal +label.create.VPN.connection=Opprett VPN-tilkobling +label.custom.disk.size=Tilpasset Diskst\u00f8rrelse +label.daily=Daglig +label.data.disk.offering=Datadisktilbud +label.date=Dato label.decline.invitation=Avvis invitasjon label.dedicated=Dedikert label.default=Standardverdi label.default.use=Standard bruk label.default.view=Standardvisning +label.delete.alerts=Slette varsler +label.delete.events=Slett hendelser +label.delete.F5=Slett F5 +label.delete.gateway=slett gateway +label.delete.NetScaler=Slett Netscaler +label.delete.PA=Slett Palo Alto label.delete.project=Slett prosjekt +label.delete=Slett +label.delete.SRX=Slett SRX +label.delete.VPN.connection=Slett VPN-tilkobling +label.delete.VPN.gateway=Slett VPN-gateway +label.delete.vpn.user=Slett VPN-bruker +label.deleting.failed=Sletting feilet +label.deleting.processing=Sletter.... +label.description=Beskrivelse label.destination.physical.network.id=Fysisk nettverksid-destinasjon +label.destination.zone=Destinasjonssone +label.destroy=Destruer label.destroy.router=Slett ruter +label.details=Detaljer +label.device.id=Enhets ID +label.devices=Enheter label.dhcp=DHCP label.DHCP.server.type=DHCP servertype label.disabled=Inaktiv label.disable.provider=Deaktiver tilbyder +label.disable.vpn=Dekativer VPN +label.disabling.vpn.access=Deaktiverer VPN Tilgang +label.disk.allocated=Disk allokert +label.disk.iops.max=Maks IOPS +label.disk.iops.min=Min IOPS +label.disk.iops.total=IOPS Totalt +label.disk.offering=Disktilbud +label.disk.read.bytes=Disk lese (Bytes) +label.disk.read.io=Disk lese (IO) +label.disk.size=Diskst\u00f8rrelse +label.disk.size.gb=Diskst\u00f8rrelse (i GB) +label.disk.total=Disk Totalt +label.disk.volume=Disk Volum +label.disk.write.bytes=Disk skrive (Bytes) +label.disk.write.io=Disk skrive (IO) label.display.name=Visningsnavn +label.display.text=Visningstekst +label.dns.1=DNS 1 +label.dns.2=DNS 2 +label.dns=DNS +label.DNS.domain.for.guest.networks=DNS domene for gjestenettverk +label.domain.admin=Domeneadministrator +label.domain=Domene +label.domain.id=Domene ID +label.domain.name=Domenenavn +label.domain.router=Domeneruter label.done=Utf\u00f8rt label.drag.new.position=Dra til ny posisjon +label.edit=Editer +label.edit.lb.rule=Endre LB-regel label.edit.network.details=Edit\u00e9r nettverksdetaljer label.edit.project.details=Editer prosjektdetaljer +label.edit.traffic.type=Endre trafikktype +label.edit.vpc=Rediger VPC label.elastic=Elastisk label.elastic.IP=Elastisk IP label.elastic.LB=Elastisk LB +label.email=E-post label.enable.provider=Aktiver tilbyder +label.enable.swift=Aktiver Swift label.enable.vpn=Aktiver VPN +label.enabling.vpn.access=Aktiverer VPN-tilgang +label.enabling.vpn=Aktiverer VPN label.end.IP=Slutt-IP +label.end.port=Sluttport label.end.vlan=Slutt-VLAN label.enter.token=Skriv inn koden label.error=Feil +label.esx.host=ESX/ESXi vert +label.example=Eksempel label.f5=F5 +label.failed=Feilet +label.fetch.latest=Hent siste label.filterBy=Filtrer etter +label.firewall=Brannmur +label.first.name=Fornavn +label.format=Format +label.friday=Fredag +label.full=Full +label.full.path=Full sti +label.general.alerts=Generelle varsler +label.gluster.volume=Volum +label.go.step.2=G\u00e5 til steg 2 +label.go.step.3=G\u00e5 til steg 3 +label.go.step.4=G\u00e5 til steg 4 +label.go.step.5=G\u00e5 til steg 5 +label.group=Gruppe +label.group.optional=Gruppe (Valgfritt) +label.guest.cidr=Gjest CIDR label.guest.end.ip=Gjest slutt-IP label.guest=Gjest +label.guest.ip=Gjest IP-adresse +label.guest.ip.range=Gjest IP-rekke +label.guest.netmask=Gjest nettmaske label.guest.networks=Gjestenettverk label.guest.start.ip=Gjest start-IP label.guest.traffic=Gjestetrafikk +label.guest.type=Gjestetype +label.ha.enabled=HA Aktivert +label.help=Hjelp label.hints=Hint +label.home=Hjem +label.host.alerts=Vertsvarsler +label.host.MAC=Verts MAC +label.host.name=Vertsnavn +label.hosts=Verter +label.host=Vert +label.hourly=Hver time +label.id=ID +label.info=Info label.installWizard.addClusterIntro.subtitle=Hva er en klynge? label.installWizard.addClusterIntro.title=La oss legge til en klynge label.installWizard.addHostIntro.subtitle=Hva er en vert? @@ -129,62 +492,206 @@ label.installWizard.addZone.title=Legg til sone label.installWizard.click.launch=Klikk startknappen. label.installWizard.subtitle=Denne veiviseren vil hjelpe deg i din installasjon av CloudStack&\#8482 label.installWizard.title=Hei og velkommen til CloudStack&\#8482 +label.instance=Instans +label.instance.limits=Instans Begrensninger +label.instance.name=Instans Navn +label.instances=Instanser +label.internal.dns.1=Intern DNS 1 +label.internal.dns.2=Intern DNS 2 +label.internal.name=Internt navn label.introduction.to.cloudstack=Introduksjon til CloudStack&\#8482 label.invitations=Invitasjoner label.invited.accounts=Inviterte kontoer label.invite=Inviter label.invite.to=Inviter til -label.ip.ranges=IP-rekke +label.ip.address=IP-adresse +label.ipaddress=IP-adresse +label.ip.allocations=IP Allokeringer +label.ip=IP +label.ip.or.fqdn=IP eller FQDN +label.ip.range=IP-rekke +label.ip.ranges=IP-rekker +label.ips=IPer +label.is.default=Er standard +label.iso=ISO +label.isolated.networks=Isolerte nettverk +label.isolation.method=Isolasjonsmetode +label.isolation.mode=Isolasjonsmetode label.is.redundant.router=Redundant +label.is.shared=Er delt +label.is.system=Er system label.item.listing=Elementlisting +label.keep=Behold +label.key=N\u00f8kkel label.kvm.traffic.label=KVM trafikketikett +label.lang.arabic=Arabisk +label.lang.brportugese=Brasiliansk Portugisisk +label.lang.catalan=Katalansk +label.lang.chinese=Kinesisk (Forenklet) +label.lang.english=Engelsk +label.lang.french=Fransk +label.lang.german=Tysk +label.lang.italian=Italiensk +label.lang.japanese=Japanesisk +label.lang.korean=Koreansk +label.lang.norwegian=Norsk +label.lang.russian=Russisk +label.lang.spanish=Spansk +label.last.name=Etternavn +label.latest.events=Siste hendelser label.launch=Start label.launch.vm=Start VM label.LB.isolation=LB-isolering label.least.connections=F\u00e6rrest tilkoblinger +label.load.balancer=Lastbalanserer label.load.balancing=Lastbalansering label.load.balancing.policies=Regler for lastbalansering +label.loading=Laster +label.local=Lokal label.local.storage=Lokal lagring +label.logout=Logg ut +label.lun=LUN +label.LUN.number=LUN \# label.make.project.owner=Gj\u00f8r konto prosjekteier +label.manage=Administrer label.management=Administrasjon +label.management.ips=Administrasjons IP-adresser label.manage.resources=Behandle ressurser +label.maximum=Maksimum label.max.public.ips=Maks offentlige IPer label.max.snapshots=Maks \u00f8yeblikksbilder label.max.templates=Maks maler label.max.vms=Maks bruker-VMer label.max.volumes=Maks volumer label.may.continue=Du kan n\u00e5 fortsette. +label.memory.allocated=Minne allokert +label.memory.mb=Minne (i MB) +label.memory=Minne +label.memory.total=Minne totalt +label.memory.used=Minne brukt +label.menu.accounts=Kontoer +label.menu.alerts=Varsler +label.menu.all.accounts=Alle kontoer +label.menu.all.instances=Alle instanser +label.menu.configuration=Konfigurering +label.menu.domains=Domener +label.menu.events=Hendelser +label.menu.infrastructure=Infrastruktur +label.menu.instances=Instanser +label.menu.ipaddresses=IP-adresser +label.menu.isos=ISOer +label.menu.my.accounts=Mine kontoer +label.menu.my.instances=Mine instanser +label.menu.my.isos=Mine ISOer +label.menu.my.templates=Mine maler +label.menu.network=Nettverk +label.menu.network.offerings=Nettverkstilbud +label.menu.physical.resources=Fysiske ressurser +label.menu.regions=Regioner +label.menu.running.instances=Kj\u00f8rende instanser +label.menu.security.groups=Sikkerhetsgrupper +label.menu.service.offerings=Tjenestetilbud +label.menu.stopped.instances=Stoppede instanser +label.menu.storage=Lagring label.menu.system.service.offerings=Systemtilbud +label.menu.system=System +label.menu.system.vms=System VMer +label.menu.templates=Maler +label.menu.virtual.resources=Virtuelle ressurser +label.menu.volumes=Volumer label.migrate.instance.to.host=Migrer instansen til en annen vert +label.migrate.instance.to=Migrer instans til label.migrate.instance.to.ps=Migrer instansen til en annen sekund\u00e6r lagring. +label.migrate.router.to=Migrer Ruter til +label.migrate.systemvm.to=Migrer System VM til +label.migrate.to.host=Migrer til vert +label.migrate.to.storage=Migrer til lagring label.migrate.volume=Migrer volumet til en annen prim\u00e6rlagring. +label.minimum=Minimum +label.monday=Mandag +label.monthly=M\u00e5nedlig +label.more.templates=Flere maler label.move.down.row=Flytt \u00e9n rad ned +label.move.to.bottom=Flytt til bunnen label.move.to.top=Flytt til toppen label.move.up.row=Flytt \u00e9n rad opp +label.my.account=Min konto label.my.network=Mitt nettverk label.my.templates=Mine maler +label.name=Navn +label.name.optional=Navn (Valgfritt) +label.nat.port.range=NAT portrekke +label.netmask=Nettmaske label.netScaler=NetScaler +label.network.ACL=Nettverk ACL +label.network.ACLs=Nettverk ACLer +label.network.desc=Nettverksbeskrivelse label.network.device=Nettverksenhet label.network.device.type=Type nettverksenhet +label.network.domain=Nettverksdomene +label.network.domain.text=Nettverksdomene +label.network.id=Nettverks ID label.networking.and.security=Nettverk og sikkerhet label.network.label.display.for.blank.value=Bruk standard gateway +label.network.name=Nettverksdame +label.network=Nettverk +label.network.offering=Nettverkstilbud label.networks=Nettverk label.new=Ny +label.new.password=Nytt passord label.new.project=Nytt prosjekt label.new.vm=Ny VM +label.next=Neste +label.nexusVswitch=Nexus 1000v +label.nfs=NFS +label.nfs.server=NFS Server +label.nfs.storage=NFS Lagring +label.nics=NICer label.no.data=Ingen data \u00e5 vise +label.no=Nei +label.none=Ingen +label.not.found=Ikke funnet label.no.thanks=Nei, takk label.notifications=Notifikasjoner +label.number.of.clusters=Antall klynger +label.number.of.pods=Antall pods +label.number.of.virtual.routers=Antall virtuelle rutere +label.number.of.zones=Antall soner +label.offer.ha=Tilby HA label.ok=OK +label.optional=Valgfritt label.order=Rekkef\u00f8lge +label.os.type=OS-type +label.PA=Palo Alto +label.password=Passord +label.path=Sti +label.physical.network=Fysisk nettverk label.physical.network.ID=Fysisk nettverksid label.PING.CIFS.password=PING CIFS passord label.PING.CIFS.username=PING CIFS brukernavn label.PING.dir=PING-mappe label.PING.storage.IP=PING lagrings-IP label.please.specify.netscaler.info=Vennligst spesifiser NetScaler-info +label.please.wait=Vennligst vent +label.pod.name=Pod navn +label.pod=Pod +label.pods=Pods label.port.forwarding.policies=Regler for portvideresending +label.port.forwarding=Portvideresending +label.port.range=Portrekke +label.prev=Forrige label.previous=Forrige +label.primary.allocated=Prim\u00e6rlagring allokert +label.primary.network=Prim\u00e6rnettverk +label.primary.storage=Prim\u00e6rlagring +label.primary.used=Prim\u00e6rlagring brukt +label.private.Gateway=Privat Gateway +label.private.ip=Privat IP-adresse +label.private.ip.range=Privat IP-rekke +label.private.ips=Private IP-adresser +label.private.network=Privat nettverk +label.private.port=Privat port +label.private.zone=Privat sone label.project.dashboard=Prosjektoversikt label.project.id=Prosjektid label.project.invite=Inviter til prosjekt @@ -192,82 +699,291 @@ label.project.name=Prosjektnavn label.project=Prosjekt label.projects=Prosjekter label.project.view=Prosjektvisning +label.protocol=Protokoll label.providers=Tilbydere +label.public.ip=Offentlig IP-adresse +label.public.ips=Offentlig IP-adresser label.public.network=Offentlig nettverk +label.public=Offentlig +label.public.port=Offentlig port +label.public.traffic=Offentlig trafikk +label.public.zone=Offentlig sone +label.purpose=Form\u00e5l label.Pxe.server.type=PXE Servertype +label.rbd=RBD +label.reboot=Restart label.redundant.router.capability=Redundant ruter label.redundant.router=Redundant ruter label.redundant.state=Redundant tilstand +label.refresh=Oppfrisk +label.region=Region +label.related=Relaterte label.remind.later=P\u00e5minn meg senere +label.remove.ACL=Fjern ACL +label.remove.from.load.balancer=Fjerner instans fra lastbalanserer label.remove.ip.range=Fjern IP-rekke +label.remove.pf=Fjern portvideresendingsregel +label.remove.region=Fjern region +label.remove.rule=Fjern regel +label.remove.static.nat.rule=Fjern statisk NAT-regel +label.remove.static.route=Fjern statisk rute +label.remove.vpc=fjern VPC label.removing=Fjerner +label.removing.user=Fjerner Bruker +label.required=P\u00e5krevd +label.reserved.system.ip=Reservert System IP +label.reset.VPN.connection=Resett VPN-tilkobling +label.resize.new.size=Ny st\u00f8rrelse(GB) +label.resource=Ressurs +label.resources=Ressurser label.restart.network=Nettverksomstart label.restart.required=Omstart p\u00e5krevd +label.restart.vpc=Omstart VPC +label.restore=Gjenopprett label.review=Gjennomg\u00e5 label.revoke.project.invite=Tilbakekall invitasjonen +label.role=Rolle +label.root.disk.size=Rotdiskst\u00f8rrelse label.round.robin=Ringdistribusjon +label.routing=Ruting +label.rules=Regler +label.running.vms=Kj\u00f8rende VMer +label.s3.nfs.path=S3 NFS Sti +label.s3.nfs.server=S3 NFS Server +label.s3.use_https=Bruk HTTPS +label.saturday=L\u00f8rdag label.save.and.continue=Lagre og fortsett +label.save=Lagre +label.saving.processing=Lagrer.... +label.search=S\u00f8k +label.secondary.storage=Sekund\u00e6rlagring +label.secondary.storage.vm=Sekund\u00e6rlagring VM +label.security.group.name=Sikkerhetsgruppenavn +label.security.group=Sikkerhetsgruppe +label.security.groups=Sikkerhetsgrupper label.select.a.template=Velg en mal label.select.a.zone=Velg en sone +label.select.instance.to.attach.volume.to=Velg instans for tildeling av volum +label.select.instance=Velg instans label.select.iso.or.template=Velg ISO eller mal +label.select.offering=Velg tilbud label.select.project=Velg prosjekt +label.select=Velg label.select-view=Velg visning +label.select.vm.for.static.nat=Velg instans for statisk NAT +label.sent=Sendt +label.server=Tjener +label.service.offering=Tjenestetilbud +label.service.state=Tjeneste Status +label.session.expired=Sesjon utl\u00f8pt label.setup.network=Nettverksoppsett label.setup=Oppsett label.setup.zone=Soneoppsett label.set.up.zone.type=Oppsett av sonetype +label.shared=Delt label.shutdown.provider=Steng tilbyder +label.size=St\u00f8rrelse label.skip.guide=Jeg har brukt CloudStack tidligere. Hopp over denne veiviseren label.source=Kilde +label.source.nat=Kilde NAT +label.specify.IP.ranges=Spesifiser IP-rekker +label.specify.vlan=Spesifiser VLAN +label.specify.vxlan=Spesifiser VXLAN label.SR.name = SR navnelapp label.srx=SRX label.start.IP=Start-IP +label.start.port=Start port label.start.vlan=Start-VLAN +label.start.vxlan=Start Vxlan label.static.nat.enabled=Statisk NAT aktivert +label.static.nat=Statistk NAT +label.static.nat.vm.details=Statisk NAT VM Detaljer +label.statistics=Statistikk +label.status=Status +label.step.1=Steg 1 +label.step.1.title=Steg 1\: Velg en mal +label.step.2=Steg 2 +label.step.2.title=Steg 2\: Tjenestetilbud +label.step.3=Steg 3 +label.step.3.title=Steg 3\: Velg et disktilbud +label.step.4=Steg 4 +label.step.4.title=Steg 4\: Nettverk +label.step.5=Steg 5 +label.step.5.title=Steg 5\: Repetere label.stickiness=Klebrighet +label.sticky.domain=Domene +label.sticky.expire=Utl\u00f8per +label.sticky.length=Lengde +label.stopped.vms=Stoppede VMer +label.stop=Stopp +label.storage=Lagring label.storage.tags=Merkelapper for lagring label.storage.traffic=Lagringstrafikk +label.storage.type=Lagringstype label.subdomain.access=Tilgang for underdomene +label.succeeded=Vellykket +label.sunday=S\u00f8ndag +label.supported.services=St\u00f8ttede Tjenester label.supported.source.NAT.type=Supporterte kilde-NAT typer label.suspend.project=Suspender prosjekt +label.switch.type=Svitsjtype +label.system.capacity=Systemkapasistet +label.system.offering=Systemtilbud +label.system.vms=System VMer +label.system.vm=System VM label.task.completed=Oppgave utf\u00f8rt +label.template=Mal label.TFTP.dir=TFTP-mappe +label.thursday=Torsdag label.timeout=Tidsavbrudd +label.time=Tid +label.time.zone=Tidssone +label.timezone=Tidssone label.token=Kode +label.total.cpu=Totalt CPU +label.total.CPU=Totalt CPU +label.total.hosts=Totalt Verter +label.total.memory=Totalt minne +label.total.of.ip=Totalt IP-adresser +label.total.of.vm=Totalt av VM +label.total.storage=Totalt lagring +label.traffic.label=Trafikketikett label.traffic.types=Trafikktyper +label.traffic.type=Trafikktype +label.tuesday=Tirsdag +label.type.id=Type ID +label.type=Type +label.unlimited=Ubegrenset label.update.project.resources=Oppdater prosjektressurser +label.update.ssl.cert= SSL-sertifikat +label.update.ssl= SSL-sertifikat +label.updating=Oppdaterer +label.upload=Last opp +label.upload.volume=Last opp volum +label.url=URL +label.used=Brukt +label.user=Bruker +label.username=Brukernavn +label.users=Brukere +label.use.vm.ip=Bruk VM IP\: +label.value=Verdi +label.vcdcname=vCenter DC navn +label.vcenter.cluster=vCenter Klynge +label.vcenter.host=vCenter Vert +label.vcenter.password=vCenter passord +label.vcenter.username=vCenter brukernavn +label.vcipaddress=vCenter IP-adresse +label.version=Versjon label.view.all=Vis alle label.view.console=Se konsoll label.viewing=Viser +label.view.more=Vis mer +label.view.secondary.ips=Se sekund\u00e6re IPer label.view=Vis label.virtual.machines=Virtuelle maskiner +label.virtual.network=Virtuelt-nettverk +label.virtual.routers=Virtuelle rutere label.virtual.router=Virtuell ruter +label.vlan.id=VLAN/VNI ID +label.vlan=VLAN/VNI +label.vm.add=Legg til Instans +label.vm.destroy=Destruer label.vm.display.name=Visningsnavn for VM label.VMFS.datastore=VMFS lagringsomr\u00e5de +label.vmfs=VMFS label.vm.name=VM-navn +label.vm.reboot=Restart +label.vmsnapshot.type=Type +label.vm.start=Start +label.vm.stop=Stopp +label.vms=VMer label.vmware.traffic.label=VMware trafikketikett +label.vnet.id=VLAN/VNI ID +label.vnet=VLAN/VNI label.volgroup=Volumgruppe +label.volume.limits=Volumbegrensninger +label.volume.name=Volumnavn +label.volumes=Volumer +label.volume=Volum +label.vpc.id=VPC ID +label.VPC.router.details=VPC ruterdetaljer +label.vpc=VPC +label.VPN.connection=VPN-tilkobling +label.VPN.gateway=VPN Gateway +label.vpn=VPN +label.vxlan.id=VXLAN ID +label.vxlan.range=VXLAN-rekke +label.vxlan=VXLAN +label.waiting=Venter +label.warn=Varsle +label.wednesday=Onsdag +label.weekly=Ukentlig +label.welcome.cloud.console=Velkommen til administrasjonskonsollet +label.welcome=Velkommen label.what.is.cloudstack=Hva er CloudStack&\#8482? label.xen.traffic.label=XenServer trafikketikett +label.yes=Ja label.zone.details=Sonedetaljer +label.zone.id=Sone ID label.zone.name=Sonenavn +label.zone=Sone +label.zones=Soner +label.zone.step.1.title=Steg 1\: Velg et nettverk +label.zone.step.2.title=Steg 2\: Legg til en sone +label.zone.step.3.title=Steg 3\: Legg til en pod +label.zone.step.4.title=Steg 4\: Legg til en IP-rekke label.zone.type=Sonetype +message.acquire.ip.nic=Vennligst bekreft at du vil allokere en ny sekund\u00e6r IP for dette nettverkskortet.
NB\: Du m\u00e5 manuelt konfigurere den nye sekund\u00e6r-IPen i den virtuelle maskinen. message.acquire.new.ip=Vennligst bekreft at du \u00f8nsker \u00e5 anskaffe en ny IP for dette nettverket +message.action.change.service.warning.for.router=Din ruter m\u00e5 v\u00e6re stoppet f\u00f8r du kan fors\u00f8ke \u00e5 endre n\u00e5v\u00e6rende servicetilbud. +message.action.delete.cluster=Vennligst bekreft at du vil slette denne klyngen. +message.action.delete.disk.offering=Vennligst bekreft at du \u00f8nsker \u00e5 slette dette disktilbudet. +message.action.delete.domain=Vennligst bekreft at du vil slette dette domenet. +message.action.delete.ingress.rule=Vennligst bekreft at du \u00f8nsker \u00e5 slette denne inng\u00e5ende regel. +message.action.delete.ISO.for.all.zones=Denne ISO er brukt av alle soner. Vennligst bekreft at du \u00f8nsker \u00e5 slette den fra alle soner. +message.action.delete.ISO=Vennligst bekreft at du vil slette denne ISO. +message.action.delete.network=Vennligst bekreft at du vil slette dette nettverket. +message.action.delete.nexusVswitch=Vennligst bekreft at du \u00f8nsker \u00e5 slette denne nexus 1000v +message.action.delete.physical.network=Vennligst bekreft at du \u00f8nsker \u00e5 slette dette fysiske nettverk +message.action.delete.pod=Vennligst bekreft at du vil slette denne pod. +message.action.delete.primary.storage=Vennligst bekreft at du \u00f8nsker \u00e5 slette denne prim\u00e6rlagring. +message.action.delete.secondary.storage=Vennligst bekreft at du \u00f8nsker \u00e5 slette denne sekund\u00e6rlagring. +message.action.delete.security.group=Vennligst bekreft at du \u00f8nsker \u00e5 slette denne sikkerhetsgruppe. +message.action.delete.service.offering=Vennligst bekreft at du \u00f8nsker \u00e5 slette dette servicetilbud. +message.action.delete.system.service.offering=Vennligst bekreft at du \u00f8nsker \u00e5 slette dette system-servicetilbud. +message.action.delete.template.for.all.zones=Denne mal er brukt av alle soner. Vennligst bekreft at du \u00f8nsker \u00e5 slette den fra alle soner. +message.action.delete.template=Vennligst bekreft at du vil slette denne mal. +message.action.delete.volume=Vennligst bekreft at du vil slette dette volumet. +message.action.delete.zone=Vennligst bekreft at du \u00f8nsker \u00e5 slette denne sone. +message.action.destroy.instance=Vennligst bekreft at du \u00f8nsker \u00e5 fjerne denne instansen. +message.action.disable.nexusVswitch=Vennligst bekreft at du \u00f8nsker \u00e5 deaktivere denne nexus 1000v +message.action.disable.physical.network=Vennligst bekreft at du \u00f8nsker \u00e5 deaktivere dette fysiske nettverket. message.action.disable.pod=Vennligst bekreft at du \u00f8nsker \u00e5 aktivere denne poden message.action.disable.zone=Vennligst bekreft at du \u00f8nsker \u00e5 deaktivere denne sonen. +message.action.download.iso=Vennligst bekreft at du \u00f8nsker \u00e5 laste ned denne ISO. +message.action.download.template=Vennligst bekreft at du \u00f8nsker \u00e5 laste ned denne malen. message.action.enable.cluster=Vennligst bekreft at du \u00f8nsker \u00e5 aktivere denne klyngen. +message.action.enable.nexusVswitch=Vennligst bekreft at du \u00f8nsker \u00e5 aktivere denne nexus 1000v +message.action.enable.physical.network=Vennligst bekreft at du \u00f8nsker \u00e5 aktivere dette fysiske nettverket. message.action.enable.pod=Vennligst bekreft at du \u00f8nsker \u00e5 aktivere denne poden. message.action.enable.zone=Vennligst bekreft at du \u00f8nsker \u00e5 aktivere denne sonen. +message.action.start.instance=Vennligst bekreft at du \u00f8nsker \u00e5 starte denne instansen. message.activate.project=Er du sikker p\u00e5 du \u00f8nsker \u00e5 aktivere dette prosjektet? +message.add.domain=Vennligst bekreft underdomenet du \u00f8nsker \u00e5 opprette under dette domenet message.add.guest.network=Vennligst bekreft at du \u00f8nsker \u00e5 legge til gjestenettverk message.adding.host=Legger til vert message.adding.Netscaler.device=Legg til NetScaler-enhet +message.add.load.balancer.under.ip=Lastbalanseringsregelen har blitt lagt til under IP\: +message.add.VPN.gateway=Vennligst bekreft at du \u00f8nsker \u00e5 legge til en VPN Gateway message.alert.state.detected=Alarm oppdaget message.change.password=Vennligst endre ditt passord message.configuring.guest.traffic=Konfigurerer gjestetrafikk message.configuring.physical.networks=Konfigurer fysisk nettverk message.configuring.public.traffic=Konfigurerer offentlig trafikk message.configuring.storage.traffic=Konfigurerer lagringstrafikk +message.confirm.delete.F5=Vennligst bekreft at du \u00f8nsker \u00e5 slette F5 +message.confirm.delete.NetScaler=Vennligst bekreft at du \u00f8nsker \u00e5 slette Netscaler +message.confirm.delete.SRX=Vennligst bekreft at du \u00f8nsker \u00e5 slette SRX message.confirm.destroy.router=Vennligst bekreft at du \u00f8nsker \u00e5 fjerne denne ruteren message.confirm.disable.provider=Vennligst bekreft at du \u00f8nsker \u00e5 deaktivere denne tilbyderen message.confirm.enable.provider=Vennligst bekreft at du \u00f8nsker \u00e5 aktivere denne tilbyderen @@ -275,16 +991,26 @@ message.confirm.join.project=Vennligst bekreft at du \u00f8nsker \u00e5 delta i message.confirm.shutdown.provider=Vennligst bekreft at du \u00f8nsker \u00e5 stenge denne tilbyderen message.create.template=Er du sikker p\u00e5 at du \u00f8nsker \u00e5 lage malen? message.creating.cluster=Oppretter klynge +message.creating.guest.network=Oppretter gjestenettverk +message.creating.physical.networks=Oppretter fysiske nettverk message.creating.pod=Oppretter pod message.creating.primary.storage=Oppretter prim\u00e6rlagring message.creating.secondary.storage=Oppretter sekund\u00e6rlagring +message.creating.zone=Oppretter sone message.decline.invitation=Er du sikker p\u00e5 du \u00f8nsker \u00e5 avvise denne prosjektinvitasjonen? +message.delete.gateway=Vennligst bekreft at du \u00f8nsker \u00e5 slette gateway message.delete.project=Er du sikker p\u00e5 du \u00f8nsker \u00e5 slette dette prosjektet? +message.delete.user=Vennligst bekreft at du \u00f8nsker \u00e5 slette denne bruker. +message.delete.VPN.connection=Vennligst bekreft at du \u00f8nsker \u00e5 slette VPN-tilkobling message.detach.disk=Er du sikker p\u00e5 at du \u00f8nsker \u00e5 frakoble denne disken? +message.disable.user=Vennligst bekreft at du \u00f8nsker \u00e5 deaktivere denne bruker. +message.disable.vpn=Er du sikker p\u00e5 at du vil deaktivere VPN? message.download.volume.confirm=Vennligst bekreft at du \u00f8nsker \u00e5 laste ned dette volumet +message.enable.user=Vennligst bekreft at du \u00f8nsker \u00e5 aktivere denne bruker. message.enable.vpn=Vennligst bekreft at du \u00f8nsker \u00e5 aktivere VPN-tilgang for denne IP-adressen message.enabling.zone=Aktiverer sonen message.enter.token=Vennligst skriv inn koden du fikk i invitasjonsmailen. +message.generate.keys=Vennligst bekreft at du \u00f8nsker \u00e5 generere nye n\u00f8kler for denne bruker. message.installWizard.click.retry=Klikk p\u00e5 knappen for \u00e5 pr\u00f8ve oppstart p\u00e5 nytt. message.installWizard.tooltip.addCluster.name=Klyngenavnet. Dette kan v\u00e6re hva som helst og er ikke benyttet av CloudStack. message.installWizard.tooltip.addHost.hostname=DNS-navnet eller IP-adressen til verten. @@ -311,6 +1037,8 @@ message.iso.desc=Diskimage som inneholder data etter oppstartsbar media for OS message.join.project=Du har n\u00e5 deltatt i et prosjekt. Vennligst bytt til prosjektvisning for \u00e5 se prosjektet. message.migrate.instance.to.host=Vennligst bekreft at du \u00f8nsker \u00e5 migrere instansen til en annen vert. message.migrate.instance.to.ps=Vennligst bekreft at du \u00f8nsker \u00e5 migrere instansen til en annen sekund\u00e6r lagring. +message.migrate.router.confirm=Vennligst bekreft verten du \u00f8nsker \u00e5 migrere ruteren til\: +message.migrate.systemvm.confirm=Vennligst bekreft verten du \u00f8nsker \u00e5 migrere system VM til\: message.migrate.volume=Vennligst bekreft at du \u00f8nsker \u00e5 migrere volumet til en annen prim\u00e6rlagring. message.no.projects.adminOnly=Du har ingen prosjekter.
Vennligst be din administrator om \u00e5 opprette et nytt prosjekt. message.no.projects=Du har ingen prosjekter.
Vennligst opprett et nytt fra prosjektseksjonen. @@ -323,17 +1051,28 @@ message.please.select.a.different.public.and.management.network.before.removing= message.please.select.networks=Vennligst velg nettverk for din VM message.please.wait.while.zone.is.being.created=Vennlist vent mens din sone opprettes. Dette kan ta noe tid... message.project.invite.sent=Invitasjon sendt til bruker. De vil bli lagt til prosjektet s\u00e5 snart de har akseptert invitasjonen +message.remove.region=Er du sikker p\u00e5 at du vil fjerne denne regionen fra denne administrasjonsserveren? +message.remove.vpc=Vennligst bekreft at du \u00f8nsker \u00e5 fjerne VPC message.reset.password.warning.notPasswordEnabled=Denne malen vil bli opprettet uten passord message.reset.password.warning.notStopped=Din instans m\u00e5 stoppes f\u00f8r man fors\u00f8ker \u00e5 bytte n\u00e5v\u00e6rende passord +message.reset.VPN.connection=Vennligst bekreft at du \u00f8nsker \u00e5 resette VPN-tilkobling +message.restart.mgmt.server=Vennlist restart administrajonsserveren(e) din(e) for at de nye innstillingene skal tr\u00e5 i kraft. +message.restart.vpc=Vennligst bekreft at du \u00f8nsker \u00e5 restarte VPC +message.select.instance=Vennligst velg en instans. message.select.iso=Vennligst velg en ISO for din nye virtuelle instans. message.select.item=Vennligst velg et element message.select.security.groups=Vennligst velg sikkerhetsgruppe(r) for din nye VM message.select.template=Vennligst velg en mal for din nye virtuelle instans. message.setup.successful=Oppsettet av nettskyen er vellykket\! +message.specify.url=Vennligst spesifiser URL message.step.2.desc= message.step.3.desc= message.suspend.project=Er du sikker du \u00f8nsker \u00e5 pause dette prosjektet? message.template.desc=OS-image som kan brukes til \u00e5 starte VMer +message.tooltip.pod.name=Et navn for denne pod. +message.tooltip.zone.name=Et navn for denne sonen. +message.validate.invalid.characters=Ugyldige tegn funnet; vennligst korriger. +message.vm.create.template.confirm=Oppretting av Mal vil restarte VM automatisk. message.vm.review.launch=Vennligst vurder f\u00f8lgende informasjon og bekreft at din virtuelle instans er korrekt f\u00f8r kj\u00f8ring message.you.must.have.at.least.one.physical.network=Du trenger minst ett fysisk nettverk message.Zone.creation.complete=Opprettelsen av sonen utf\u00f8rt @@ -345,6 +1084,7 @@ notification.stop.instance=Stopp instans state.Accepted=Akseptert state.Active=Aktiv state.Allocated=Allokert +state.Allocating=Allokerer state.BackedUp=Sikkerhetskopiert state.BackingUp=Sikkerhetskopierer state.Completed=Utf\u00f8rt @@ -352,14 +1092,18 @@ state.Creating=Oppretter state.Declined=Avvist state.Destroyed=Destruert state.Disabled=Inaktiv +state.enabled=Aktivert +state.Enabled=Aktivert state.Error=Feil state.Expunging=Fjerner +state.Migrating=Migrering state.Pending=Venter state.ready=Klar state.Ready=Klar state.Running=Kj\u00f8rer state.Starting=Starter state.Stopped=Stoppet +state.Stopping=Stopper state.Suspended=Pauset ui.listView.filters.all=Alle ui.listView.filters.mine=Mine diff --git a/client/WEB-INF/classes/resources/messages_nl_NL.properties b/client/WEB-INF/classes/resources/messages_nl_NL.properties index 5d666a4fb4..54c78e30e5 100644 --- a/client/WEB-INF/classes/resources/messages_nl_NL.properties +++ b/client/WEB-INF/classes/resources/messages_nl_NL.properties @@ -18,6 +18,7 @@ changed.item.properties=Item eigenschappen gewijzigd confirm.enable.s3=Vul de volgende informatie in om ondersteuning voor S3-aangestuurde Secundaire Opslag te activeren confirm.enable.swift=Vul de volgende informatie in om ondersteuning voor Swift te activeren +error.could.not.change.your.password.because.ldap.is.enabled=Fout. Kan wachtwoord niet wijzigen omdat LDAP is uitgeschakeld. error.could.not.enable.zone=Kon zone niet activeren error.installWizard.message=Er ging iets mis; je kunt teruggaan om de eventuele fouten te herstellen error.invalid.username.password=Ongeldige gebruikersnaam of wachtwoord @@ -42,14 +43,20 @@ ICMP.type=ICMP Type image.directory=Afbeelding Directory inline=Inline instances.actions.reboot.label=Herstart instantie +label.about.app=Over CloudStack +label.about=Over label.accept.project.invitation=Accepteer project uitnodiging label.account=Account label.account.and.security.group=Account, Security group label.account.id=Account ID +label.account.lower=account label.account.name=Account Naam label.accounts=Accounts label.account.specific=Account-specifiek +label.acl=ACL label.acquire.new.ip=Bemachtig nieuw IP +label.acquire.new.secondary.ip=Verkrijg nieuw secundair IP +label.action=Actie label.action.attach.disk.processing=Schijf wordt toegevoegd.... label.action.attach.disk=Schijf toevoegen label.action.attach.iso=ISO toevoegen @@ -92,6 +99,7 @@ label.action.delete.load.balancer=Verwijder load balancer regel label.action.delete.network.processing=Bezig met verwijderen van Netwerk.... label.action.delete.network=Verwijder Netwerk label.action.delete.nexusVswitch=Verwijder Nexus 1000v +label.action.delete.nic=Verwijder netwerkkaart label.action.delete.physical.network=Verwijder fysiek netwerk label.action.delete.pod.processing=Bezig met verwijderen van Pod.... label.action.delete.pod=Verwijder Pod @@ -173,6 +181,8 @@ label.action.enable.user=Activeer Gebruiker label.action.enable.user.processing=Bezig met activeren van Gebruiker.... label.action.enable.zone=Activeer Zone label.action.enable.zone.processing=Bezig met activeren van Zone.... +label.action.expunge.instance.processing=Opruimen Instantie.... +label.action.expunge.instance=Ruim instantie op label.action.force.reconnect=Forceer opnieuw verbinden label.action.force.reconnect.processing=Bezig met opnieuw verbinden.... label.action.generate.keys=Genereer Sleutels @@ -208,6 +218,8 @@ label.action.resize.volume=Wijzig de grootte van het volume label.action.resource.limits=Verbruikslimieten label.action.restore.instance=Herstel Instantie label.action.restore.instance.processing=Bezig met herstellen van Instantie.... +label.action.revert.snapshot=Draai terug naar snapshot +label.action.revert.snapshot.processing=Terugdraaien naar snapshot... label.actions=Acties label.action.start.instance.processing=Bezig met starten van Instantie.... label.action.start.instance=Start Instantie @@ -239,6 +251,8 @@ label.add.accounts=Voeg accounts toe label.add.account.to.project=Voeg account aan project toe label.add.account=Voeg Account toe label.add.ACL=Voeg ACL toe +label.add.affinity.group=Nieuwe affinity groep toevoegen +label.add.baremetal.dhcp.device=Voeg Baremetal DHCP Apparaat toe label.add.BigSwitchVns.device=Voeg BigSwitch Vns Controller toe label.add.by.cidr=Voeg toe door middel van CIDR label.add.by.group=Voeg toe door middel van Groep @@ -248,9 +262,12 @@ label.add.compute.offering=Voeg Compute aanbieding toe label.add.direct.iprange=Voeg Direct IP Range toe label.add.disk.offering=Voeg Schijf Aanbieding toe label.add.domain=Voeg Domein toe +label.added.new.bigswitch.vns.controller=Nieuwe BigSwitch VNS Controller toegevoegd label.add.egress.rule=Voeg uitgaande regel toe +label.addes.new.f5=Nieuwe F5 toegevoegd label.add.F5.device=Voeg F5 apparaat toe label.add.firewall=Voeg firewall regel toe +label.add.gslb=GSLB Toevoegen label.add.guest.network=Gast netwerk toevoegen label.add.host=Host toevoegen label.adding.cluster=Bezig met toevoegen van Cluster @@ -263,6 +280,7 @@ label.adding=Toevoegen label.adding.user=Bezig met toevoegen van Gebruiker label.adding.zone=Bezig met toevoegen van Zone label.add.ip.range=Voeg IP range toe +label.add.isolated.network=Geisoleerd Netwerk Toevoegen label.additional.networks=Additioneele Netwerken label.add.load.balancer=Voeg Load Balancer toe label.add.more=Voeg meer toe @@ -274,11 +292,16 @@ label.add.network=Voeg Netwerk toe label.add.new.F5=Voeg nieuwe F5 toe label.add.new.gateway=Voeg nieuwe gateway toe label.add.new.NetScaler=Voeg nieuwe Netscaler toe +label.add.new.PA=Nieuwe Palo Alto toevoegen label.add.new.SRX=Voeg nieuwe SRX toe label.add.new.tier=Voeg nieuwe Tier toe +label.add.nfs.secondary.staging.store=Secundaire Staging Opslag toevoegen label.add.NiciraNvp.device=Voeg NVP Controller toe +label.add.OpenDaylight.device=OpenDaylight Controller toevoegen +label.add.PA.device=Nieuw Palo Alto apparaat toevoegen label.add.physical.network=Voeg fysiek netwerk toe label.add.pod=Voeg Pod toe +label.add.portable.ip.range=Porteerbare IP Range toevoegen label.add.port.forwarding.rule=Voeg port forwarding regel toe label.add.primary.storage=Voeg Primaire Opslag toe label.add.region=Voeg Regio toe @@ -294,24 +317,33 @@ label.add.static.route=Statische route toevoegen label.add.system.service.offering=Systeem Service Aanbieding toevoegen label.add.template=Template toevoegen label.add.to.group=Toevoegen aan groep +label.add.ucs.manager=UCS Manager toevoegen label.add.user=Gebruiker toevoegen label.add.vlan=VLAN toevoegen label.add.vms.to.lb=Voeg VM(s) toe aan load balancer regel label.add.vms=VMs toevoegen label.add.VM.to.tier=Voeg VM toe aan tier label.add.vm=VM toevoegen +label.add.vmware.datacenter=VMware datacenter toevoegen +label.add.vnmc.device=VNMC apparaat toevoegen +label.add.vnmc.provider=VNMC provider toevoegen label.add=Voeg toe label.add.volume=Volume toevoegen +label.add.vpc.offering=VPC Aanbieding toevoegen label.add.vpc=VPC toevoegen label.add.vpn.customer.gateway=VPN Customer Gateway toevoegen label.add.VPN.gateway=VPN Gateway toevoegen label.add.vpn.user=VPN gebruiker toevoegen +label.add.vxlan=VXLAN toevoegen label.add.zone=Zone toevoegen label.admin.accounts=Beheer Accounts label.admin=Beheerder label.advanced=Geavanceerd label.advanced.mode=Geavanceerde Modus label.advanced.search=Geavanceerd zoeken +label.affinity=Affinity +label.affinity.group=Affinity Groep +label.affinity.groups=Affinity Groepen label.agent.password=Agent wachtwoord label.agent.username=Agent Gebruikersnaam label.agree=Accepteren @@ -319,32 +351,57 @@ label.alert=Alarm label.algorithm=Algoritme label.allocated=Gebruikt label.allocation.state=Verbruik Staat +label.allow=Toestaan +label.anti.affinity=Anti-affinity +label.anti.affinity.group=Anti-affinity Groep +label.anti.affinity.groups=Anti-affinity Groepen label.api.key=API Sleutel label.apply=Uitvoeren +label.app.name=CloudStack +label.archive.alerts=Archiveer waarschuwingen +label.archive.events=Archiveer evenementen +label.assign.instance.another=Wijs instantie toe aan een andere Account label.assign=Toevoegen label.assign.to.load.balancer=Voeg instantie toe aan load balancer label.associated.network=Bijbehorend Netwerk label.associated.network.id=Bijbehorend Netwerk ID +label.associated.profile=Bijbehorend Profiel +label.associate.public.ip=Associeers Publiek IP label.attached.iso=Gekoppelde ISO label.author.email=Auteur e-mail label.author.name=Auteur naam +label.autoscale=Automatisch Schalen label.availability=Beschikbaarheid label.availability.zone=Beschikbaarheids-zone label.available=Beschikbaar label.available.public.ips=Beschikbare Publieke IP adressen label.back=Terug label.bandwidth=Bandbreedte +label.baremetal.dhcp.devices=Baremetal DHCP Apparten +label.baremetal.dhcp.provider=Baremetal DHCP Provider +label.baremetal.pxe.devices=Baremetal DHCP Apparaten +label.baremetal.pxe.device=Voeg Baremetal PXE Apparaat toe +label.baremetal.pxe.provider=Baremetal PXE Provider label.basic=Basis label.basic.mode=Basis Modus label.bigswitch.controller.address=BigSwitch Vns Controller Adres +label.bigswitch.vns.details=BigSwitch VNS details +label.blade.id=Blade ID +label.blades=Blades label.bootable=Bootable label.broadcast.domain.range=Broadcast domain range label.broadcast.domain.type=Broadcast Domain Type label.broadcast.uri=Broadcast URI +label.broadcasturi=broadcasturi +label.broadcat.uri=broadcast URI label.by.account=Op Account +label.by.alert.type=Op alarm type label.by.availability=Op Beschikbaarheid +label.by.date.end=Op datum (eind) +label.by.date.start=Op datum (start) label.by.domain=Op Domein label.by.end.date=Op Eind Datum +label.by.event.type=Op gebeurtenis type label.by.level=Op Level label.by.pod=Op Pod label.by.role=Op Rol @@ -356,18 +413,25 @@ label.by.traffic.type=Op Verkeerstype label.by.type.id=Op Type ID label.by.type=Op Type label.by.zone=Op Zone +label.cache.mode=Schrijf cache Type label.cancel=Annuleer label.capacity=Capaciteit label.certificate=Certificaat +label.change.affinity=Wijzig Affinity label.change.service.offering=Wijzig service aanbieding label.change.value=Wijzig waarde label.character=Karakter +label.chassis=Chassis label.checksum=MD5 checksum label.cidr.account=CIDRN of Account/Security Group label.cidr=CIDR label.cidr.list=Bron CIDR label.CIDR.list=CIDR lijst label.CIDR.of.destination.network=CIDR van bestemmingsnetwerk +label.cisco.nexus1000v.ip.address=Nexus 1000v IP Adres +label.cisco.nexus1000v.password=Nexus 1000v Wachtwoord +label.cisco.nexus1000v.username=Nexus 1000v Gebruikersnaam +label.ciscovnmc.resource.details=CiscoVNMC resource details label.clean.up=Opschonen label.clear.list=Schoon lijst op label.close=Sluiten @@ -383,8 +447,10 @@ label.community=Community label.compute.and.storage=Compute en Opslag label.compute=Compute label.compute.offering=Compute aanbieding +label.compute.offerings=Compute aanbiedingen label.configuration=Configuratie label.configure=Configureer +label.configure.ldap=Configureer LDAP label.configure.network.ACLs=Configureer Netwerk ACLs label.configure.vpc=Configureer VPC label.confirmation=Bevestiging @@ -392,6 +458,7 @@ label.confirm.password=Bevestig wachtwoord label.congratulations=Gefeliciteerd\! label.conserve.mode=Conserveer modus label.console.proxy=Console proxy +label.console.proxy.vm=Console Proxy VM label.continue.basic.install=Ga door met basis installatie label.continue=Ga door label.corrections.saved=Correcties opgeslagen @@ -404,29 +471,52 @@ label.cpu.mhz=CPU (in MHz) label.cpu.utilized=CPU Verbruik label.created=Aangemaakt label.created.by.system=Aangemaakt door systeem +label.create.nfs.secondary.staging.storage=Creeer NFS staging secudaire opslag +label.create.nfs.secondary.staging.store=Creeer NFS staging secudaire opslag label.create.project=Nieuw project label.create.template=Nieuwe template label.create.VPN.connection=Nieuwe VPN connectie label.cross.zones=Over Zones +label.custom=Aangepast +label.custom.disk.iops=Aangepaste IOPS label.custom.disk.size=Vrije schijf grootte label.daily=Dagelijkse label.data.disk.offering=Data Schijf Aanbieding label.date=Datum label.day.of.month=Dag van de Maand label.day.of.week=Dag van de Week +label.dc.name=DC Naam label.dead.peer.detection=Dead Peer detectie label.decline.invitation=Sla uitnodiging af -label.dedicated=Dedicated +label.dedicate.cluster=Cluster toewijden +label.dedicated=Toegewijd +label.dedicated.vlan.vni.ranges=Toegewijde VLAN/VNI Ranges +label.dedicate.host=Host Toewijden +label.dedicate.pod=Pod toewijden +label.dedicate=Toewijden +label.dedicate.vlan.vni.range=Toegewijde VLAN/VNI Range +label.dedicate.zone=Zone toewijden +label.default.egress.policy=Standaard Uitgaande policy label.default=Standaard label.default.use=Standaard Gebruik label.default.view=Standaard Weergave +label.delete.affinity.group=Verwijder Affinity Groep +label.delete.alerts=Verwijder waarschuwingen label.delete.BigSwitchVns=Verwijder BigSwitch Vns Controller +label.delete.ciscovnmc.resource=CiscoVNMC resource verwijderen +label.delete.events=Verwijder gebeurtenissen label.delete.F5=Verwijder F5 label.delete.gateway=Verwijder gateway label.delete.NetScaler=Verwijder NetScaler label.delete.NiciraNvp=Verwijder Nvp Controller +label.delete.OpenDaylight.device=OpenDaylight Controller verwijderen +label.delete.PA=Verwijder Palo Alto +label.delete.portable.ip.range=Porteerbare IP Range verwijderen +label.delete.profile=Profiel Verwijderen label.delete.project=Verwijder project +label.delete.secondary.staging.store=Secundaire Staging Opslag verwijderen label.delete.SRX=Verwijder SRX +label.delete.ucs.manager=Verwijder UCS Manager label.delete=Verwijder label.delete.VPN.connection=Verwijder VPN connectie label.delete.VPN.customer.gateway=Verwijder VPN Customer Gateway @@ -434,11 +524,14 @@ label.delete.VPN.gateway=Verwijder VPN Gateway label.delete.vpn.user=Verwijder VPN gebruiker label.deleting.failed=Verwijderen Mislukt label.deleting.processing=Verwijderen.... +label.deny=Weigeren +label.deployment.planner=Deployment planner label.description=Beschrijving label.destination.physical.network.id=Bestemming fysiek netwerk ID label.destination.zone=Bestemmingszone label.destroy.router=Verwijder router label.destroy=Verwijder +label.destroy.vm.graceperiod=Respijt periode verwijderde VM label.detaching.disk=Ontkoppelen Schijf label.details=Details label.device.id=Apparaat ID @@ -446,18 +539,36 @@ label.devices=Apparaten label.dhcp=DHCP label.DHCP.server.type=DHCP Server Type label.direct.ips=Shared Netwerk IPs +label.disable.autoscale=Autoscale uitschakelen label.disabled=Uitgeschakeld +label.disable.network.offering=Netwerk Aanbieding Uitschakelen label.disable.provider=Provider uitschakelen +label.disable.vnmc.provider=VNMC provider uitschakelen +label.disable.vpc.offering=VPC aanbieding uitschakelen label.disable.vpn=VPN uitschakelen label.disabling.vpn.access=Uitschakelen van VPN Toegang +label.disassociate.profile.blade=Ontkoppel Profiel van Blade +label.disbale.vnmc.device=VNMC apparaat uitschakelen label.disk.allocated=Schijfruimte gealloceerd +label.disk.bytes.read.rate=Lees Snelheid Schijf (BPS) +label.disk.bytes.write.rate=Schrijf Snelheid Schijf (BPS) +label.disk.iops.max=Max IOPS +label.disk.iops.min=Min IOPS +label.disk.iops.read.rate=Lees Snelheid Schijf (IOPS) +label.disk.iops.total=IOPS Totaal +label.disk.iops.write.rate=Schrijf snelheid Schijf (IOPS) label.disk.offering=Schijf Aanbieding +label.disk.read.bytes=Schijf lezen (Bytes) +label.disk.read.io=Schijf Lezen (IO) label.disk.size.gb=Schijf Grootte (in GB) label.disk.size=Schijf Grootte label.disk.total=Schijf Totaal label.disk.volume=Schijf Volume +label.disk.write.bytes=Schijf Schrijven (Bytes) +label.disk.write.io=Schijf Schrijven (IO) label.display.name=Weergavenaam label.display.text=Weergavetekst +label.distributedrouter=Gedistribueerde Router label.dns.1=DNS 1 label.dns.2=DNS 2 label.dns=DNS @@ -465,6 +576,7 @@ label.DNS.domain.for.guest.networks=DNS domein voor Gast Netwerken label.domain.admin=Domein Beheerder label.domain=Domein label.domain.id=Domein ID +label.domain.lower=domein label.domain.name=Domeinnaam label.domain.router=Domein router label.domain.suffix=DNS domein achtervoegsel (v.b., xyz.com) @@ -472,22 +584,32 @@ label.done=Klaar label.double.quotes.are.not.allowed=Aanhalingstekens zijn hier niet toegestaan label.download.progress=Download Voortgang label.drag.new.position=Sleep naar nieuwe positie +label.dynamically.scalable=Dynamisch Schaalbaar +label.edit.affinity.group=Wijzig Affinity Groep label.edit.lb.rule=Wijzig LB regel label.edit.network.details=Wijzig netwerk details label.edit.project.details=Wijzig project details +label.edit.region=Wijzig Regio label.edit.tags=Wijzig tags label.edit.traffic.type=Wijzig traffic type label.edit.vpc=Wijzig VPC label.edit=Wijzig +label.egress.default.policy=Standaard uitgaande policy label.egress.rules=Uitgaande regels label.egress.rule=Uitgaande regel label.elastic=Elastisch label.elastic.IP=Elastisch IP label.elastic.LB=Elastisch LB label.email=Email +label.email.lower=email +label.enable.autoscale=Autoscale inschakelen +label.enable.network.offering=Netwerk Aanbieding Inschakelen label.enable.provider=Provider inschakelen label.enable.s3=S3-gebaseerde Secondary Storage inschakelen label.enable.swift=Swift inschakelen +label.enable.vnmc.device=VNMC appraat inschakelen +label.enable.vnmc.provider=VNMC provider inschakelen +label.enable.vpc.offering=VPC aanbieding inschakelen label.enable.vpn=VPN inschakelen label.enabling.vpn.access=VPN toegang inschakelen label.enabling.vpn=VPN inschakelen @@ -497,6 +619,7 @@ label.endpoint.or.operation=Endpoint or Operation label.end.port=Eind Poort label.end.reserved.system.IP=Einde gereserveerde systeem IP label.end.vlan=Einde Vlan +label.end.vxlan=Eind Vxlan label.enter.token=Voer token in label.error.code=Fout code label.error=Fout @@ -506,13 +629,16 @@ label.ESP.lifetime=ESP Lifetime (secondes) label.ESP.policy=ESP policy label.esx.host=ESX/ESXi Host label.example=Voorbeeld +label.expunge=Ruim op label.external.link=Externe link +label.f5.details=F5 details label.f5=F5 label.failed=Mislukt label.featured=Voorgesteld label.fetch.latest=Haal laatste op label.filterBy=Filter per label.firewall=Firewall +label.firstname.lower=voornaam label.first.name=Voornaam label.format=Formaat label.friday=Vrijdag @@ -521,12 +647,30 @@ label.full=Volledig label.gateway=Gateway label.general.alerts=Algemene Waarschuwingen label.generating.url=Generen van URL +label.gluster.volume=Volume label.go.step.2=Ga naar Stap 2 label.go.step.3=Ga naar Stap 3 label.go.step.4=Ga naar Stap 4 label.go.step.5=Ga naar Stap 5 +label.gpu=CPU +label.group.by.account=groepeer per account +label.group.by.cluster=groepeer per cluster +label.group.by.pod=groepeer per pod +label.group.by.zone=groepeer per zone label.group=Groep label.group.optional=Groep (Optioneel) +label.gslb.assigned.lb.more=Wijs meer load balancing toe +label.gslb.assigned.lb=toegewezen load balancing +label.gslb.delete=GSLB verwijderen +label.gslb.details=GSLB details +label.gslb.domain.name=GSLB Domein Naam +label.gslb.lb.details=load balancing details +label.gslb.lb.remove=verwijder load balancing van deze GSLB +label.gslb.lb.rule=load balancing regel +label.gslb.service=GSLB service +label.gslb.service.private.ip=GSLB service Private IP +label.gslb.service.public.ip=GSLB service Publiek IP +label.gslb.servicetype=Service Type label.guest.cidr=Gast CIDR label.guest.end.ip=Gast eind IP label.guest=Gast @@ -534,14 +678,19 @@ label.guest.gateway=Gast Gateway label.guest.ip=Gast IP Adres label.guest.ip.range=Gast IP range label.guest.netmask=Gast Netmask +label.guest.network.details=Gast netwerk details label.guest.networks=Gast netwerken label.guest.start.ip=Gast start IP label.guest.traffic=Gast verkeer +label.guest.traffic.vswitch.name=vSwitch Gast Verkeer Naam +label.guest.traffic.vswitch.type=vSwitch Gast Verkeer Type label.guest.type=Gast Type label.ha.enabled=HA ingeschakeld +label.health.check=Health Check label.help=Help label.hide.ingress.rule=Verberg Inkomende Regel label.hints=Tips +label.home=Home label.host.alerts=Host Waarschuwingen label.host=Host label.host.MAC=Host MAC @@ -551,8 +700,11 @@ label.host.tags=Host Tags label.hourly=Uurlijks label.hypervisor.capabilities=Hypervisor mogelijkheden label.hypervisor=Hypervisor +label.hypervisors=Hypervisors +label.hypervisor.snapshot.reserve=Hypervisor Snapshot Reserve label.hypervisor.type=Hypervisor Type label.hypervisor.version=Hypervisor versie +label.hyperv.traffic.label=HyperV verkeerslabel label.id=ID label.IKE.DH=IKE DH label.IKE.encryption=IKE Encryptie @@ -581,7 +733,9 @@ label.installWizard.title=Hallo en welkom bij CloudStack&\#8482 label.instance=Instantie label.instance.limits=Instantie Limieten label.instance.name=Instantie Naam +label.instance.scaled.up=Instantie Omhoog Geschaald label.instances=Instanties +label.instanciate.template.associate.profile.blade=Initieer Template en verbind Profiel met Blade label.internal.dns.1=Interne DNS 1 label.internal.dns.2=Interne DNS 2 label.internal.name=Interne naam @@ -603,6 +757,18 @@ label.ip.range=IP Range label.ip.ranges=IP Ranges label.IPsec.preshared.key=IPsec Preshared-Key label.ips=IPs +label.ipv4.cidr=IPv4 CIDR +label.ipv4.end.ip=IPv4 Eind IP +label.ipv4.gateway=IPv4 Gateway +label.ipv4.netmask=IPv4 Netmask +label.ipv4.start.ip=IPv4 Begin IP +label.ipv6.address=IPv6 IP Address +label.ipv6.CIDR=IPv6 CIDR +label.ipv6.dns1=IPv6 DNS1 +label.ipv6.dns2=IPv6 DNS2 +label.ipv6.end.ip=IPv6 Eind IP +label.ipv6.gateway=IPv6 Gateway +label.ipv6.start.ip=IPv6 Begin IP label.iscsi=iSCSI label.is.default=Is Standaard label.iso.boot=ISO Boot @@ -620,23 +786,35 @@ label.keyboard.type=Toetsenbord type label.key=Sleutel label.kvm.traffic.label=KVM verkeer label label.label=Label +label.lang.arabic=Arabisch label.lang.brportugese=Braziliaans Portgees +label.lang.catalan=Catalaans label.lang.chinese=Chinees (Simplified) +label.lang.dutch=Nederlands (Nederlands) label.lang.english=Engels label.lang.french=Frans +label.lang.german=Duits +label.lang.italian=Italiaans label.lang.japanese=Japans label.lang.korean=Koreans +label.lang.norwegian=Noors +label.lang.polish=Pools label.lang.russian=Russisch label.lang.spanish=Spaans label.last.disconnected=Laatse keer niet verbonden label.last.name=Achternaam +label.lastname.lower=achternaam label.latest.events=Laatste gebeurtenissen label.launch=Lanceer label.launch.vm=Lanceer VM label.launch.zone=Lanceer zone label.LB.isolation=LB isolatie +label.ldap.configuration=LDAP Configuratie +label.ldap.group.name=LDAP Groep +label.ldap.port=LDAP poort label.least.connections=Minste connecties label.level=Level +label.linklocal.ip=Link Local IP Adres label.load.balancer=Load Balancer label.load.balancing=Load Balancing label.load.balancing.policies=Load balancing policies @@ -648,6 +826,7 @@ label.login=Login label.logout=Log uit label.lun=LUN label.LUN.number=LUN \# +label.lxc.traffic.label=LXC verkeerslabel label.make.project.owner=Maak account project eigenaar label.manage=Beheer label.management=Beheer @@ -656,6 +835,7 @@ label.manage.resources=Beheer Resources label.max.cpus=Max. CPU cores label.max.guest.limit=Max. Instanties label.maximum=Maximaal +label.max.instances=Max Instances label.max.memory=Max. geheugen (MiB) label.max.networks=Max. netwerken label.max.primary.storage=Max. primare opslag (GiB) @@ -713,16 +893,20 @@ label.menu.templates=Templates label.menu.virtual.appliances=Virtueele Appliances label.menu.virtual.resources=Virtuele Resources label.menu.volumes=Volumes +label.menu.vpc.offerings=VPC Aanbiedingen label.migrate.instance.to.host=Migreer instantie naar andere host label.migrate.instance.to=Migreer instantie naar label.migrate.instance.to.ps=Migreer instantie naar andere primaire opslag +label.migrate.lb.vm=Migreer LB VM label.migrate.router.to=Migreer Router naar label.migrate.systemvm.to=Migreer Systeem VM naar label.migrate.to.host=Migreer naar host label.migrate.to.storage=Migreer naar opslag label.migrate.volume=Migreer volume naar andere primaire opslag label.minimum=Minimum +label.min.instances=Min Instances label.minute.past.hour=Minuten na het uur +label.mode=Modus label.monday=Maandag label.monthly=Maandelijks label.more.templates=Meer Templates @@ -733,14 +917,18 @@ label.move.up.row=Verplaats \u00e9\u00e9n regel naar boven label.my.account=Mijn Account label.my.network=Mijn netwerk label.my.templates=Mijn templates +label.name.lower=naam label.name=Naam label.name.optional=Naam (Optioneel) label.nat.port.range=NAT Poort Range label.netmask=Netmask +label.netscaler.details=NetScaler details label.netScaler=NetScaler label.network.ACL=Netwerk ACL label.network.ACLs=Netwerk ACLs label.network.ACL.total=Netwerk ACL Totaal +label.network.addVM=Voeg netwerk toe aan VM +label.network.cidr=Network CIDR label.network.desc=Netwerk Beschr. label.network.device=Netwerk Apparaat label.network.device.type=Netwerk Apparaat Type @@ -749,12 +937,15 @@ label.network.domain.text=Netwerk Domein label.network.id=Netwerk ID label.networking.and.security=Netwerken en beveiliging label.network.label.display.for.blank.value=Gebruik standaard gateway +label.network.limits=Netwerk limieten label.network.name=Netwerk Naam label.network=Netwerk label.network.offering.display.text=Netwerk Aanbieding Weergave Tekst label.network.offering.id=Netwerk Aanbieding ID label.network.offering.name=Netwerk Aanbieding Naam label.network.offering=Netwerk Aanbieding +label.network.rate.megabytes=Netwerk Snelheid (MB/s) +label.network.rate=Netwerk Snelheid (Mb/s) label.network.read=Netwerk gelezen label.network.service.providers=Netwerk Service Aanbieders label.networks=Netwerken @@ -778,6 +969,7 @@ label.no.actions=Geen Beschikbare Acties label.no.alerts=Geen Recente Waarschuwingen label.no.data=Geen data om weer te geven label.no.errors=Geen Recente Fouten +label.no.grouping=(Geen groepering) label.no.isos=Geen beschikbare ISOs label.no.items=Geen Beschikbare Items label.no=Nee @@ -787,6 +979,7 @@ label.not.found=Niet gevonden label.no.thanks=Nee bedankt label.notifications=Notificaties label.number.of.clusters=Aantal Clusters +label.number.of.cpu.sockets=Het aantal CPU sockets label.number.of.hosts=Aantal Hosts label.number.of.pods=Aantal Pods label.number.of.system.vms=Aantal Systeem VMs @@ -797,33 +990,55 @@ label.numretries=Keren opnieuw geprorbeerd label.ocfs2=OCFS2 label.offer.ha=HA aanbieden label.ok=OK +label.opendaylight.controllerdetail=OpenDaylight Controller Details +label.opendaylight.controller=OpenDaylight Controller +label.opendaylight.controllers=OpenDaylight Controllers +label.openDaylight=OpenDaylight label.optional=Optioneel label.order=Volgorde label.os.preference=OS Voorkeur label.os.type=OS Type +label.override.guest.traffic=Overschrijf Gast Verkeer +label.override.public.traffic=Overschrijf Publiek Verkeer +label.ovm.traffic.label=OVM verkeerslabel +label.ovs=OVS label.owned.public.ips=Publieke IP Adressen in beheer label.owner.account=Account Eigenaar label.owner.domain=Domein Eigenaar +label.palo.alto.details=Palo Alto details +label.PA.log.profile=Palo Alto Log Profiel +label.PA=Palo Alto label.parent.domain=Bovenliggend Domein label.password.enabled=Wachtwoord Ingeschakeld +label.password.lower=wachtwoord +label.password.reset.confirm=Het wachtwoord is gereset naar label.password=Wachtwoord label.path=Pad +label.PA.threat.profile=Palo Alto Threat Profiel label.perfect.forward.secrecy=Perfect Forward Secrecy +label.persistent=Persistent label.physical.network=Fysiek Netwerk label.physical.network.ID=Fysiek netwerk ID label.PING.CIFS.password=PING CIFS wachtwoord label.PING.CIFS.username=PING CIFS gebruikersnaam label.PING.dir=PING Directory label.PING.storage.IP=PING opslag IP +label.planner.mode=Planner modus label.please.specify.netscaler.info=Geef hier informatie van de Netscaler op label.please.wait=Een ogenblik geduld a.u.b. label.plugin.details=Plugin details label.plugins=Plugins +label.pod.dedicated=Pod toegewijd label.pod.name=Pod Naam label.pod=Pod label.pods=Pods +label.polling.interval.sec=Polling Interval (in sec) +label.portable.ip.range.details=Porteerbare IP Range details +label.portable.ip.ranges=Porteerbare IP Ranges +label.portable.ips=Porteerbare IPs label.port.forwarding.policies=Port forwarding policies label.port.forwarding=Port Forwarding +label.port=Poort label.port.range=Port Range label.PreSetup=PreSetup label.previous=Vorige @@ -843,6 +1058,7 @@ label.privatekey=PKCS\#8 Private Key label.private.network=Priv\u00e9 Netwerk label.private.port=Priv\u00e9 Port label.private.zone=Priv\u00e9 Zone +label.profile=Profiel label.project.dashboard=Project Dashboard label.project.id=Project ID label.project.invite=Nodig uit voor project @@ -851,32 +1067,57 @@ label.project=Project label.projects=Projecten label.project.view=Project Weergave label.protocol=Protocol +label.provider=Provider label.providers=Providers label.public.interface=Publieke Interface label.public.ip=Publiek IP Adres label.public.ips=Publieke IP Adressen +label.public.load.balancer.provider=Publieke Load Balancer Provider label.public.network=Publiek netwerk label.public.port=Publieke Poort label.public=Publiek label.public.traffic=Publiek verkeer +label.public.traffic.vswitch.name=vSwitch Publiek Verkeer Naam +label.public.traffic.vswitch.type=vSwitch Publiek Verkeer Type label.public.zone=Publieke Zone label.purpose=Doel label.Pxe.server.type=PXE Server Type +label.qos.type=QoS Type label.quickview=Sneloverzicht +label.quiesce.vm=Quiesce VM +label.quiet.time.sec=Quiet Time (in sec) +label.rbd.id=Cephx gebruiker +label.rbd.monitor=Ceph monitor +label.rbd.pool=Ceph pool +label.rbd=RBD +label.rbd.secret=Cephx secret label.reboot=Reboot label.recent.errors=Recente Fouten +label.recover.vm=Herstel VM label.redundant.router.capability=Redundante router mogelijkheden label.redundant.router=Redundante Router label.redundant.state=Redundante staat +label.refresh.blades=Ververs Blades label.refresh=Ververs +label.regionlevelvpc=Region Level VPC label.region=Regio +label.reinstall.vm=Herinstalleer VM label.related=Samenhangend +label.release.account.lowercase=ontkoppel van account +label.release.account=Ontkoppel van Account +label.release.dedicated.cluster=Toegewijd Cluster loskoppelen +label.release.dedicated.host=Toegewijde Host ontkoppelen +label.release.dedicated.pod=Toegewijde Pod loskoppelen +label.release.dedicated.vlan.range=Toegewijde VLAN range ontkoppelen +label.release.dedicated.zone=Toegewijde zone ontkoppelen label.remind.later=Herinner me later label.remove.ACL=Verwijder ACL label.remove.egress.rule=Verwijder uitgaande regel label.remove.from.load.balancer=Verwijder Instantie van load balancer label.remove.ingress.rule=Verwijder inkomende regel label.remove.ip.range=Verwijder IP range +label.remove.ldap=Verwijder LDAP +label.remove.network.offering=Netwerk Aanbieding Verwijderen label.remove.pf=Verwijder port forwarding regel label.remove.project.account=Verwijder account van project label.remove.region=Verwijder Regio @@ -885,18 +1126,25 @@ label.remove.static.nat.rule=Verwijder static NAT regel label.remove.static.route=Verwijder statische route label.remove.tier=Verwijder tier label.remove.vm.from.lb=Verwijder VM van load balancer regel +label.remove.vmware.datacenter=VMware datacenter verwijderen +label.remove.vpc.offering=VPC aanbieding verwijderen label.remove.vpc=verwijder VPC label.removing.user=Verwijderen Gebruiker label.removing=Verwijderen +label.reource.id=Verbruik ID label.required=Vereist +label.requires.upgrade=Upgrade Benodigd +label.reserved.ip.range=Gereserveerde IP Range label.reserved.system.gateway=Gereseveerde systeem gateway label.reserved.system.ip=Gereserveerd Systeem IP label.reserved.system.netmask=Gereserveerd systeem netmask +label.resetVM=Reset VM label.reset.VPN.connection=Reset VPN verbinding label.resize.new.offering.id=Nieuwe Aanbieding label.resize.new.size=Nieuwe Grootte(GB) label.resize.shrink.ok=Verklein OK label.resource.limits=Verbruikslimieten +label.resource.name=Verbruik Naam label.resource.state=Verbruik staat label.resources=Verbruiken label.resource=Verbruik @@ -909,7 +1157,11 @@ label.revoke.project.invite=Trek uitnodiging in label.role=Rol label.root.disk.controller=Root schijf controller label.root.disk.offering=Root Schijf Aanbieding +label.root.disk.size=Grootte root volume label.round.robin=Round-robin +label.router.vm.scaled.up=Router VM Omhoog Geschaald +label.routing=Routing +label.rule.number=Regel Nummer label.rules=Regels label.running.vms=Draaiende VMs label.s3.access_key=Toegangssleutel @@ -917,6 +1169,8 @@ label.s3.bucket=Bucket label.s3.connection_timeout=Connectie Timeout label.s3.endpoint=Endpoint label.s3.max_error_retry=Max. opnieuw proberen na Fout +label.s3.nfs.path=S3 NFS Pad +label.s3.nfs.server=S3 NFS Server label.s3.secret_key=Geheime sleutel label.s3.socket_timeout=Socket Timeout label.s3.use_https=Gebruik HTTPS @@ -926,7 +1180,11 @@ label.save=Opslaan label.saving.processing=Opslaan.... label.scope=Scope label.search=Zoeken +label.secondary.isolated.vlan.id=Secundair Geisoleerd VLAN ID +label.secondary.staging.store.details=Secundaire Staging Opslag details +label.secondary.staging.store=Secundaire Staging Opslag label.secondary.storage.count=Secundaire Opslag Pools +label.secondary.storage.details=Secundaire Opslag details label.secondary.storage.limits=Secundaire Opslag limieten (GiB) label.secondary.storage=Secundaire Opslag label.secondary.storage.vm=Secundaire Opslag VM @@ -944,6 +1202,7 @@ label.select.iso.or.template=Selecteer een ISO of template label.select.offering=Selecteer Aanbieding label.select.project=Selecteer Project label.select=Selecteer +label.select.template=Selecteer Template label.select.tier=Selecteer Tier label.select-view=Selecteer Weergave label.select.vm.for.static.nat=Selecteer VM voor static NAT @@ -951,34 +1210,49 @@ label.sent=Verstuurd label.server=Server label.service.capabilities=Service Mogelijkheden label.service.offering=Service Aanbieding +label.services=Diensten +label.service.state=Service Status label.session.expired=Sessie Verlopen +label.set.default.NIC=Stel standaard NIC in +label.settings=Instellingen label.setup=Instellen label.setup.network=Stel Netwerk in label.setup.zone=Stel Zone in label.set.up.zone.type=Stel zone type in label.shared=Gedeeld label.SharedMountPoint=SharedMountPoint +label.show.advanced.settings=Geavaceerde instellingen weergeven label.show.ingress.rule=Toon Inkomende Regel label.shutdown.provider=Schakel provider uit label.site.to.site.VPN=Site-to-site VPN label.size=Grootte label.skip.guide=Ik heb CloudStack al eerder gebruikt, sla deze stap over +label.smb.domain=SMB Domein +label.smb.password=SMB Wachtwoord +label.smb.username=SMB Gebruikersnaam label.snapshot.limits=Snapshot Limieten label.snapshot.name=Snapshot Naam label.snapshot.schedule=Stel herhalende Snapshot in label.snapshot=Snapshot label.snapshot.s=Snapshot (s) label.snapshots=Snapshots +label.SNMP.community=SNMP Community +label.SNMP.port=SNMP Poort +label.sockets=CPU Sockets label.source=Bron label.source.nat=Source NAT label.specify.IP.ranges=Specificeer IP ranges label.specify.vlan=Specificeer VLAN +label.specify.vxlan=Specificeer VXLAN label.SR.name = SR Name-Label +label.srx.details=SRX details label.srx=SRX label.start.IP=Start IP +label.start.lb.vm=Start LB VM label.start.port=Start Poort label.start.reserved.system.IP=Start gereseveerd systeem IP label.start.vlan=Start VLAN +label.start.vxlan=Start Vxlan label.state=Staat label.static.nat.enabled=Static NAT Ingeschakeld label.static.nat=Static NAT @@ -1009,6 +1283,7 @@ label.sticky.postonly=Alleen Post label.sticky.prefix=Prefix label.sticky.request-learn=Request learn label.sticky.tablesize=Tabel grootte +label.stop.lb.vm=Stop LB VM label.stopped.vms=Uitgeschakelde VMs label.stop=Stop label.storage=Opslag @@ -1023,21 +1298,29 @@ label.sunday=Zondag label.super.cidr.for.guest.networks=Super CIDR voor Gast Netwerken label.supported.services=Geondersteunde Diensten label.supported.source.NAT.type=Ondersteunde Source NAT type +label.supportsstrechedl2subnet=Ondersteund Streched L2 Subnet label.suspend.project=Pauzeer Project +label.switch.type=Switch Type label.system.capacity=Systeem Capaciteit +label.system.offering.for.router=Systeem Aanbieding voor Router label.system.offering=Systeem Aanbieding label.system.service.offering=Systeem Service Aanbieding +label.system.vm.details=Systeem VM details +label.system.vm.scaled.up=Systeem VM omhoog geschaald label.system.vms=Systeem VMs label.system.vm=Systeem VM label.system.vm.type=Systeem VM type label.system.wide.capacity=Systeembreede capaciteit label.tagged=Tagged +label.tag.key=Tag Sleutel label.tags=Tags +label.tag.value=Tag Waarde label.target.iqn=Doel IQN label.task.completed=Taak uitgevoerd label.template.limits=Template Limieten label.template=Template label.TFTP.dir=TFTP Directory +label.tftp.root.directory=TFTP root directory label.theme.default=Standaard Thema label.theme.grey=Aangepast - Grijs label.theme.lightblue=Aangepast - Licht Blauw @@ -1057,13 +1340,17 @@ label.total.memory=Totaal Geheugen label.total.of.ip=Totaal aantal IP Adressen label.total.of.vm=Totaal aantal VM label.total.storage=Totaal Opslag +label.total.virtual.routers=Totaal Virtual Routers +label.total.virtual.routers.upgrade=Totaal Virtueele Routers die een ugrade nodig hebben label.total.vms=Totaal VMs label.traffic.label=Verkeerslabel label.traffic.types=Verkeer Types label.traffic.type=Verkeer Type label.tuesday=Dinsdag label.type.id=Type ID +label.type.lower=type label.type=Type +label.ucs=UCS label.unavailable=Niet beschikbaar label.unlimited=Ongelimiteerd label.untagged=Untagged @@ -1071,15 +1358,20 @@ label.update.project.resources=Update project verbruik label.update.ssl.cert= SSL Certificaat label.update.ssl= SSL Certificaat label.updating=Bezig met updaten +label.upgrade.required=Upgrade is benodigd +label.upgrade.router.newer.template=Upgrade Router om nieuwe Template te gebruiken label.upload=Upload label.upload.volume=Upload Volume label.url=URL label.usage.interface=Verbruik Interface label.used=Gebruikt +label.user.data=Gebruiker Data label.user=Gebruiker label.username=Gebruikersnaam +label.username.lower=gebruikersnaam label.users=Gebruikers label.use.vm.ip=Gebruik VM IP\: +label.use.vm.ips=Gebruik VM IPs label.value=Waarde label.vcdcname=vCenter DC naam label.vcenter.cluster=vCenter Cluster @@ -1088,25 +1380,46 @@ label.vcenter.datastore=VCenter Datastore label.vcenter.host=vCenter Host label.vcenter.password=vCenter Wachtwoord label.vcenter.username=vCenter Gebruikersnaam +label.vcenter=vcenter label.vcipaddress=vCenter IP Adres label.version=Versie +label.vgpu.max.resolution=Maximale resolutie +label.vgpu.max.vgpu.per.gpu=vGPUs per GPU +label.vgpu.remaining.capacity=Overgebleven capaciteit +label.vgpu.type=vCPU type +label.vgpu.video.ram=Video RAM label.view.all=Toon alle label.view.console=Toon console label.viewing=Weergeven label.view.more=Toon meer +label.view.secondary.ips=Toon secundaire IPs label.view=Toon +label.virtual.appliance.details=Virtual applicance details label.virtual.appliances=Virtueele Appliances label.virtual.appliance=Virtuele Appliance label.virtual.machines=Virtuele machines +label.virtual.networking=Virtual Networking label.virtual.network=Virtueel Netwerk +label.virtual.routers.group.account=Groepeer Virtuele Routers op account +label.virtual.routers.group.cluster=Groepeer Virtuele Routers op cluster +label.virtual.routers.group.pod=Groepeer Virtuele Routers op pod +label.virtual.routers.group.zone=Groepeer Virtuele Routers op zone label.virtual.routers=Virtuele Routers label.virtual.router=Virtuele Router +label.vlan.id=VLAN/VNI ID +label.vlan.range.details=VLAN Range details +label.vlan.ranges=VLAN Range(s) +label.vlan.range=VLAN/VNI Reeks +label.vlan=VLAN/VNI +label.vlan.vni.ranges=VLAN/VNI Range(s) +label.vlan.vni.range=VLAN/VNI Reeks label.vm.add=Instantie Toevoegen label.vm.destroy=Verwijder label.vm.display.name=VM weergave naam label.VMFS.datastore=VMFS datastore label.vmfs=VMFS label.vm.name=VM naam +label.vm.password=Het wachtwoord van de VM is label.vm.reboot=Reboot label.VMs.in.tier=VMs in tier label.vmsnapshot.current=isHuidige @@ -1118,14 +1431,27 @@ label.vm.start=Start label.vm.state=VM staat label.vm.stop=Stop label.vms=VMs +label.vmware.datacenter.id=VMware datacenter ID +label.vmware.datacenter.name=VMware datacenter Naam +label.vmware.datacenter.vcenter=VMware datacenter vcenter label.vmware.traffic.label=VMware verkeerslabel +label.vnet.id=VLAN/VNI ID +label.vnet=VLAN/VNI +label.vnmc.devices=VNMC apparaten +label.volatile=Volatile label.volgroup=Volume Groep label.volume.limits=Volume Limieten label.volume.name=Volume Naam label.volumes=Volumes label.volume=Volume +label.vpc.distributedvpcrouter=Gedistribueerde VPC Router label.vpc.id=VPC ID +label.VPC.limits=VPC limieten +label.vpc.offering.details=VPC Aanbieding details +label.vpc.offering=VPC Aanbieding label.VPC.router.details=VPC router details +label.vpc.supportsregionlevelvpc=Ondersteund Region Level VPC +label.vpc.virtual.router=VPC Virtueele Router label.vpc=VPC label.VPN.connection=VPN Connectie label.vpn.customer.gateway=VPN Customer Gateway @@ -1136,6 +1462,9 @@ label.vsmctrlvlanid=Controle VLAN ID label.vsmpktvlanid=Pakket VLAN ID label.vsmstoragevlanid=Opslag VLAN ID label.vsphere.managed=vSphere beheerd +label.vxlan.id=VXLAN ID +label.vxlan.range=VXLAN Reeks +label.vxlan=VXLAN label.waiting=Wachten label.warn=Waarschuwing label.wednesday=Woensdag @@ -1143,10 +1472,14 @@ label.weekly=Wekelijks label.welcome.cloud.console=Welkom op de Management Console label.welcome=Welkom label.what.is.cloudstack=Wat is CloudStack&\#8482? +label.xenserver.tools.version.61.plus=XenServer Tools Versie 6.1\\+ +label.Xenserver.Tools.Version61plus=XenServer Tools Versie 6.1\\+ label.xen.traffic.label=XenServer verkeerslabel label.yes=Ja +label.zone.dedicated=Zone toegewijd label.zone.details=Zone details label.zone.id=Zone ID +label.zone.lower=zone label.zone.name=Zone naam label.zone.step.1.title=Stap 1\: Selecteer een Netwerk label.zone.step.2.title=Stap 2\: Zone toevoegen @@ -1156,10 +1489,12 @@ label.zones=Zones label.zone.type=Type Zone label.zone.wide=Zone breed label.zoneWizard.trafficType.guest=Gast\: Verkeer tussen virtuele machines van de eindgebruiker +label.zoneWizard.trafficType.management=Management\: Verkeer tussen CloudStack\\\\'s interne resources zoals componenten die communiceren met de Management Server zoals hosts en CloudStack systeem VMs label.zoneWizard.trafficType.public=Publiek\: Verkeer tussen het internet en virtueele machines in de cloud. label.zoneWizard.trafficType.storage=Opslag\: Verkeer tussen de primaire en secundaire opslag servers zoals VM templates en snapshots label.zone=Zone managed.state=Beheersstaat +message.acquire.ip.nic=Bevestig dat u een nieuw secundair IP voor deze netwerkkaart wilt verkrijgen. LET OP\: U dient het secundaire IP adres handmatig te configureren binnen de virtueele machine. message.acquire.new.ip=Bevestigen dat je een nieuw IP voor dit netwerk wilt verkrijgen. message.acquire.new.ip.vpc=Bevestig dat u een nieuw IP wilt verkrijgen voor deze VPC. message.acquire.public.ip=Selecteer de zone waarvan u een nieuw IP wenst te verkrijgen. @@ -1177,6 +1512,7 @@ message.action.delete.ISO=Bevestig dat u deze ISO wilt verwijderen. message.action.delete.ISO.for.all.zones=Deze ISO wordt gebruikt door alle zones. Bevestig dat u deze wilt verwijderen van alle zones. message.action.delete.network=Bevestig dat u dit netwerk wilt verwijderen. message.action.delete.nexusVswitch=Bevestig dat u deze nexus 1000v wilt verwijderen +message.action.delete.nic=Bevestig dat u deze netwerkkaart wilt verwijderen, de VM zal ontkoppeld worden van het netwerk wat aan de netwerkkaart aangesloten zit. message.action.delete.physical.network=Bevestig dat u dit fysieke netwerk wilt verwijderen. message.action.delete.pod=Bevestig dat u deze pod wilt verwijderen. message.action.delete.primary.storage=Bevestig dat u deze primaire opslag wilt verwijderen. @@ -1197,6 +1533,7 @@ message.action.disable.physical.network=Bevestig dat u dit fysieke netwerk wilt message.action.disable.pod=Bevestig dat u deze pod wilt uitschakelen. message.action.disable.static.NAT=Bevestig dat u static NAT wilt uitschakelen. message.action.disable.zone=Bevestig dat u deze zone wilt uitschakelen. +message.action.downloading.template=Downloaden template. message.action.download.iso=Bevestig dat u deze ISO wilt downloaden. message.action.download.template=Bevestig dat u deze template wilt downloaden. message.action.enable.cluster=Bevestig dat u dit cluster wilt inschakelen. @@ -1205,12 +1542,396 @@ message.action.enable.nexusVswitch=Bevestig dat u deze nexus 1000v wilt inschake message.action.enable.physical.network=Bevestig dat u dit fysieke netwerk wilt inschakelen. message.action.enable.pod=Bevestigd dat u deze pod wilt inschakelen. message.action.enable.zone=Bevestig dat u deze zone wilt inschakelen. +message.action.expunge.instance=Bevestig dat u deze instantie wilt opruimen message.action.force.reconnect=De host is succesvol geforceerd om opnieuw te verbinden. Dit proces kan echter enkele minuten duren. message.action.host.enable.maintenance.mode=Het inschakelen van de onderhoudsmodus zorgt ervoor dat alle draaiende instanties worden gemigreerd naar andere beschikbare hosts. +message.action.instance.reset.password=Bevestig dat u het ROOT wachtwoord van deze virtueele machine wilt aanpassen. +message.action.manage.cluster=Bevestig dat u dit cluster wilt beheren. +message.action.primarystorage.enable.maintenance.mode=Waarschuwing\: Wanneer u de primaire opslag in onderhoudsmodus plaatst, worden alle VMs die hier gebruik van maken gestopt. Weet u zeker dat u deze actie wilt uitvoeren? +message.action.reboot.instance=Bevestig dat u deze instantie wilt herstarten. +message.action.reboot.router=Als u deze router herstarten zullen de diensten op de router verstoord worden. Weet u zeker dat u deze actie wil uitvoeren? +message.action.reboot.systemvm=Bevestig dat u deze Systeem VM wilt herstarten. +message.action.release.ip=Bevestigd dat u dit IP adres wilt los koppelen. +message.action.remove.host=Bevestig dat u deze host wilt verwijderen. +message.action.reset.password.off=Uw instantie ondersteunt deze functie momenteel niet. +message.action.reset.password.warning=Uw instantie moet gestopt worden voordat u het wachtwoord kunt wijzigen. +message.action.restore.instance=Bevestig dat u deze instantie wilt herstellen. +message.action.revert.snapshot=Bevestig dat u het volume wilt terugdraaien naar dit snapshot. +message.action.start.instance=Bevestig dat u deze instantie wilt starten. +message.action.start.router=Bevestig dat uw deze router wilt starten. +message.action.start.systemvm=Bevestig dat u deze Systeem VM wilt starten. +message.action.stop.instance=Bevestig dat u deze instantie wilt stoppen. +message.action.stop.router=Als u deze router stopt zullen de diensten die gebruik maken van de router verstoord worden. Weet u zeker dat u deze actie wil uitvoeren? +message.action.stop.systemvm=Bevestig dat u deze systeem VM wilt stoppen. +message.action.take.snapshot=Bevestig dat u een snapshot wilt maken van dit volume. +message.action.unmanage.cluster=Bevestig dat u dit cluster niet langer wilt laten beheren door CloudStack. +message.action.vmsnapshot.delete=Bevestig dat u deze VM snapshot wilt verwijderen. +message.action.vmsnapshot.revert=Draai VM snapshot terug +message.activate.project=Weet u zeker dat u dit project wilt activeren? +message.add.cluster=Voeg een hypervisor beheerd cluster toe voor zone , pod
+message.add.disk.offering=Specificeer de volgende waardes om een nieuwe schijf aanbieding toe te voegen +message.add.domain=Specificeer het subdomein welke u onder dit domein wilt aanmaken +message.add.firewall=Voeg firewall toe aan zone +message.add.guest.network=Bevestig dat u een gast netwerk wilt toevoegen +message.add.host=Specificeer de volgende parameters om een nieuwe host toe te voegen +message.adding.host=Host toevoegen +message.adding.Netscaler.device=Netscaler toevoegen +message.adding.Netscaler.provider=Netscaler provider toevoegen +message.add.ip.range.direct.network=Voeg een IP range toe aan direct gekoppeld netwerk in zone +message.add.ip.range.to.pod=

Voeg een IP range toe aan pod\:

+message.add.ip.range=Voeg een IP range aan het publieke netwerk in de zone toe +message.additional.networks.desc=Selecteer additionele netwerk(en) waar uw virtuele instantie aan gekoppeld moet worden. +message.add.load.balancer.under.ip=De loadbalancer regel is toegeovegd onder IP adres\: +message.add.load.balancer=Voeg load balancer toe aan zone +message.add.network=Voeg nieuw netwerk toe aan zone\: +message.add.new.gateway.to.vpc=Specificeer de volgende informatie om een nieuwe gateway toe te voegen aan deze VPC. +message.add.pod.during.zone.creation=Elke zone moet \u00e9\u00e9n of meerdere pods hebben, de eerste pod gaan we nu toevoegen. Een pod bevat de hosts en primaire opslag servers welke we in een van de volgende stappen toevoegen. Allereerst dient u een reeks gereserveerde IP adressen te defini\u00ebren voor CloudStack&\#39s management verkeer. Deze gereserveerde IP reeks moet uniek zijn voor elke zone in de cloud. +message.add.pod=Voeg een nieuwe pod toe aan zone +message.add.primary=Specificeer de volgende parameters om nieuwe primaire opslag toe te voegen +message.add.primary.storage=Voeg nieuwe primaire opslag toe voor zone , pod +message.add.region=Specificeer de benodigde informatie om een nieuwe regio toe te voegen. +message.add.secondary.storage=Voeg nieuwe opslag toe voor zone +message.add.service.offering=Specificeer de volgende gegevens om een nieuwe service aanbieding aan te maken. +message.add.system.service.offering=Specificeer de volgende gegevens om een nieuwe systeem aanbieding toe te voegen. +message.add.template=Specificeer de volgende gegevens om een nieuwe template aan te maken +message.add.volume=Specificeer de volgende gegevens om een nieuw volume toe te voegen. +message.add.VPN.gateway=Bevestig dat u een VPN Gateway wilt toevoegen +message.admin.guide.read=Voor VMware-gebaseerde VMs, lees eerst de dynamic scaling sectie in de admin guide voordat u gaat schalen. Weet u zeker dat u verder wilt gaan? +message.advanced.mode.desc=Kies dit netwerk model als u VLAN ondersteuning wilt inschakelen. Dit netwerk model geeft u de meeste flexibiliteit en stelt beheerders in staat om aangepaste netwerk aanbiedingen aan te maken met firewall, vpn, of load balancer ondersteuning. Ook kunt u kiezen tussen direct en virtual networking. +message.advanced.security.group=Kies dit netwerk model als u security groups wilt gebruiken om virtueele machines te isoleren. +message.advanced.virtual=Kies deze optie als u zone breede VLANs wilt gebruiken om virtueele machines te isoleren. +message.after.enable.s3=S3-backed Secondary Storage is geconfigureerd. Let op\: Als u deze pagina verlaat zult u niet in staat zijn om S3 te (her)configureren. +message.after.enable.swift=Swift is geconfigureerd. Let op\: Als u deze pagina verlaat zult u niet in staat zijn om Swift te (her)configureren. +message.alert.state.detected=Probleem status gedetecteerd +message.allow.vpn.access=Specificeer een gebruikersnaam en wachtwoord voor de gebruiker die u toegang wilt geven tot de VPN. +message.apply.snapshot.policy=De huidige snapshot policy is succesvol gewijzigd. +message.attach.iso.confirm=Bevestig dat u deze ISO wilt koppelen aan de virtuele machine. +message.attach.volume=Specificeer de volgende gegevens om een nieuw volume te koppelen. Als u een schijf volume wilt toevoegen aan een Windows gebaseerde machine, dan dient u deze te rebooten om de schijf zichtbaar te maken. +message.basic.mode.desc=Kies dit netwerk model als u *geen* VLAN ondersteuning wilt inschakelen. Alle virtuele machines onder dit netwerk model zullen direct een IP gealloceerd krijgen vanuit het netwerk en security groups kunnen gebruikt worden om beveiliging en segmentering te realiseren. +message.change.offering.confirm=Bevestig dat u de service aanbieding van deze virtueele machine wilt wijzigen. +message.change.password=Wijzig a.u.b. uw wachtwoord. +message.cluster.dedicated=Zone toegewijd +message.cluster.dedication.released=Cluster toewijding losgekoppeld +message.configure.all.traffic.types=U heeft meerdere fysieke netwerken; Configureer labels voor elk verkeerstype door op de Wijzig knop te klikken. +message.configure.ldap=Bevestig dat u LDAP wilt configureren. +message.configuring.guest.traffic=Bezig met configureren guest traffic +message.configuring.physical.networks=Bezig met configureren fysieke netwerken +message.configuring.public.traffic=Bezig met configureren publiek verkeer +message.configuring.storage.traffic=Bezig met configureren opslag verkeer +message.confirm.action.force.reconnect=Bevestig dat u deze host geforceerd opnieuw wilt laten verbinden. +message.confirm.add.vnmc.provider=Bevestig dat u de VNMC provider wilt toevoegen. +message.confirm.dedicate.cluster.domain.account=Weet u zeker dat u dit cluster wilt toewijden aan een domein/account? +message.confirm.dedicate.host.domain.account=Weet u zeker dat u deze host wilt toewijden aan een domein/account? +message.confirm.dedicate.pod.domain.account=Weet u zeker dat u deze pod wilt toewijden aan een domein/account? +message.confirm.dedicate.zone=Weet u zeker dat u deze zone wilt toewijden aan een domein/account? +message.confirm.delete.ciscovnmc.resource=Bevestig dat u de CiscoVNMC resource wilt verwijderen. +message.confirm.delete.F5=Bevestig dat u deze F5 wilt verwijderen +message.confirm.delete.NetScaler=Bevestig dat u deze NetScaler wilt verwijderen +message.confirm.delete.PA=Bevestig dat u Palo Alto wilt verwijderen +message.confirm.delete.secondary.staging.store=Bevestig dat u de secudaire staging opslag wilt verwijderen. +message.confirm.delete.SRX=Bevestig dat u deze SRX wilt verwijderen +message.confirm.delete.ucs.manager=Bevestig dat u de UCS Manager wilt verwijderen +message.confirm.destroy.router=Bevestig dat u deze router wilt verwijderen +message.confirm.disable.network.offering=Weet u zeker dat u deze netwerk aanbieding wilt uitschakelen? +message.confirm.disable.provider=Bevestig dat u deze provider wilt uitschakelen +message.confirm.disable.vnmc.provider=Bevestig dat u de VNMC provider wilt uitschakelen. +message.confirm.disable.vpc.offering=Weet u zeker dat u deze VPC aanbieding wilt uitschakelen? +message.confirm.enable.network.offering=Weet u het zeker dat u deze netwerk aanbieding wilt inschakelen? +message.confirm.enable.provider=Bevestig dat u deze provider wilt inschakelen +message.confirm.enable.vnmc.provider=Bevestig dat u de VNMC provider wilt inschakelen. +message.confirm.enable.vpc.offering=Weet u zeker dat u deze VPC aanbieding wilt inschakelen? +message.confirm.join.project=Bevestig dat u aan dit project wilt bijdragen +message.confirm.refresh.blades=Bevestig dat u de blades wilt verversen. +message.confirm.release.dedicated.cluster=Weet u zeker dat u dit toegewijde cluster wilt loskoppelen? +message.confirm.release.dedicated.host=Weet u zeker dat u deze toegewijde host wilt loskoppelen? +message.confirm.release.dedicated.pod=Weet u zeker dat u deze toegewijde pod wilt loskoppelen? +message.confirm.release.dedicated.zone=Weet u zeker dat u deze toegewijde zone wilt loskoppelen? +message.confirm.release.dedicate.vlan.range=Bevestig dat u de toegewijde VLAN range wilt loskoppelen +message.confirm.remove.IP.range=Bevestig dat u deze IP range wilt verwijderen. +message.confirm.remove.network.offering=Weet u zeker dat u deze netwerk aanbieding wilt verwijderen? +message.confirm.remove.vmware.datacenter=Bevestig dat u VM datacenter wilt verwijderen +message.confirm.remove.vpc.offering=Weet u zeker dat u deze VPC aanbieding wilt verwijderen? +message.confirm.scale.up.router.vm=Weet u zeker dat u de Router VM wilt opschalen? +message.confirm.scale.up.system.vm=Weet u zeker dat u de Systeem VM wilt opschalen? +message.confirm.shutdown.provider=Bevestig dat u deze provider wilt afsluiten +message.confirm.start.lb.vm=Bevestig dat u de LB VM wilt starten +message.confirm.stop.lb.vm=Bevestig dat u de LB VM wilt stoppen +message.confirm.upgrade.router.newer.template=Bevestig dat u de router naar een nieuwere template versie wilt upgraden +message.confirm.upgrade.routers.account.newtemplate=Bevestig dat u alle routers onder deze account wilt upgraden naar een nieuwe template +message.confirm.upgrade.routers.cluster.newtemplate=Bevestig dat u alle routers in dit cluster wilt upgraden naar een nieuwe template +message.confirm.upgrade.routers.newtemplate=Bevestig dat u alle routers in deze zone wilt upgraden naar een nieuwe template +message.confirm.upgrade.routers.pod.newtemplate=Bevestig dat u alle routers in deze pod wilt upgraden naar een nieuwe template +message.copy.iso.confirm=Bevestig dat u deze ISO wilt kopieeren naar +message.copy.template.confirm=Weet u zeker dat u de template wilt kopieeren? +message.copy.template=Kopieer template XXX van zone naar +message.create.template.vm=Maak een VM aan vanaf een template +message.create.template.volume=Specificeer a.u.b. de volgende informatie voordat u een template van het schijf volume\: . Het maken van een template kan een paar minuten duren maar ook langer afhankelijk van de grote van het volume. +message.create.template=Weet u het zeker dat u een template wilt aanmaken? +message.creating.cluster=Cluster aanmaken +message.creating.guest.network=Gast netwerk aanmaken +message.creating.physical.networks=Fysieke netwerken aanmaken +message.creating.pod=Pod aanmaken +message.creating.primary.storage=Primaire opslag aanmaken +message.creating.secondary.storage=Secundaire opslag aanmaken +message.creating.systemVM=Bezig met aanmaken van systeem VMs (dit kan enige tijd duren) +message.creating.zone=Zone aanmaken +message.decline.invitation=Weet u zeker dat u deze project uitnodiging wilt afwijzen? +message.dedicated.zone.released=Zone toewijding losgekoppeld +message.dedicate.zone=Dedicating zone +message.delete.account=Bevestig dat u deze account wilt verwijderen. +message.delete.affinity.group=Bevestig dat u deze affinity groep wilt verwijderen +message.delete.gateway=Bevestig dat u deze gateway wilt verwijderen +message.delete.project=Weet u zeker dat u dit project wilt verwijderen? +message.delete.user=Bevestig dat u deze gebruiker wilt verwijderen +message.delete.VPN.connection=Bevestig dat u deze VPN verbinding wilt verwijderen +message.delete.VPN.customer.gateway=Bevestig dat u deze VPN Customer Gateway wilt verwijderen +message.delete.VPN.gateway=Bevestig dat u deze VPN Gateway wilt verwijderen +message.desc.advanced.zone=Voor ingewikkeldere netwerk topologie\u00ebn. Dit netwerk model geeft de meeste flexibiliteit en het definieren van gast netwerken en het aanbieden van speciale diensten zoals firewall, VPN of loadbalancer ondersteuning. +message.desc.basic.zone=Cre\u00ebert een enkel netwerk waar elke VM instantie direct een IP op krijgt. Het isoleren van instanties kunt op layer-3 niveau doen door middel van security groups. +message.desc.cluster=Elke pod moet \u00e9\u00e9n of meerdere cluster bevatten, en we gaan het eerste cluster nu toevoegen. Een cluster is een manier om hosts te groeperen. De hosts in een cluster hebben identieke hardware, gebruiken de zelfde hypervisor, zitten op hetzelfde subnet en kunnen bij dezelfde gedeelde opslag. Elk cluster bestaan uit \u00e9\u00e9n of meerdere hosts en \u00e9\u00e9n of meerdere primaire opslag systemen. +message.desc.host=Elke cluster moet een of meerdere hosts (servers) bevatten om gast VMs op te draaien. We gaan de eerste host nu toevoegen. Om een host met CloudStack te laten werken moet hij voorzien zijn van hypersvisor software, een werkend IP adres en in staat zijn de management server over het netwerk te bereiken.

Specificeer de DNS hostnaam of het IP adres van de host, de gebruikersnaam (meestal root) en het bijbehorende wachtwoord en als laatste eventuele labels om de host te categoriseren. +message.desc.primary.storage=Elk cluster moet over \u00e9\u00e9n of meerdere primaire opslag servers beschikken, de eerste gaan we nu aanmaken. Primaire opslag bevat de volumes van VMs draaiende op de hosts in het cluster. Gebruik een protocol dat is ondersteund door de hypervisor. +message.desc.secondary.storage=Elke zone moet minimaal \u00e9\u00e9n of meerdere secundaire opslag servers hebben, de eerste maken we nu aan. Secundaire opslag wordt gebruikt voor het opslaan van VM templates, ISO bestanden en snapshots. Deze server moet beschikbaar zijn aan alle hosts in de zone.

Specificeer het IP adres en het exporteerde pad. +message.desc.zone=Een zone is de grootste organisatorische unit binnen CloudStack en correspondeert normaliter met enkel datacenter. Zones geven fysieke isolatie en redundantie. Een zone bestaat uit een of meerdere pods (waarvan ieder eigen hosts en primaire opslag servers heeft) en een secundaire opslag server welke gedeeld wordt door alle pods in de zone. +message.detach.disk=Weet u zeker zeker dat u deze schijf wilt ontkoppelen? +message.detach.iso.confirm=Bevestig dat u deze ISO wilt ontkoppelen van de virtueele machine. +message.disable.account=Bevestig dat u deze account wilt uitschakelen. Als u deze account uitschakelt zullen de gebruikers niet langer toegang hebben tot hun cloud resources. Alle draaiende virtueele machines zullen direct afgesloten worden. +message.disable.snapshot.policy=De huidige snapshot policy is uitgeschakeld. +message.disable.user=Bevestig dat u deze gebruiker wilt uitschakelen. +message.disable.vpn.access=Bevestig dat u VPN toegang wilt uitschakelen. +message.disable.vpn=Weet u zeker dat u VPN wilt uitschakelen? +message.disabling.network.offering=Netwerk Aanbieding Uitschakelen +message.disabling.vpc.offering=VPC offering uitschakelen +message.disallowed.characters=Niet toegestane karakters\: \\<\\,\\> +message.download.ISO=Klik op 00000 om de ISO te downloaden +message.download.template=Klik op 00000 om de template te downloaden +message.download.volume.confirm=Bevestig dat u dit volume wilt downloaden +message.download.volume=Klik op 00000 om het volume te downloaden +message.edit.account=Wijzig ("-1" geeft aan dat er geen limiet is ingesteld) +message.edit.confirm=Controleer uw wijzigen voordat u op "Opslaan" klikt. +message.edit.limits=Specificeer de limieten voor de volgende resources. Met "-1" geeft u aan dat er geen limiet geld. +message.edit.traffic.type=Specificeer het verkeerslabel dat u met dit type verkeer wilt associeren. +message.enable.account=Bevestig dat u deze account wilt inschakelen. +message.enabled.vpn.ip.sec=Uw IPSec pre-shared key is +message.enabled.vpn=Uw VPN toegang is ingeschakeld en kan benaderd worden via het IP +message.enable.user=Bevestig dat u deze gebruiker wilt inschakelen. +message.enable.vpn.access=VPN is momenteel uitgeschakeld voor dit IP adres. Wilt u deze inschakelen? +message.enable.vpn=Bevestig dat u VPN toegang voor dit IP adres wilt inschakelen. +message.enabling.network.offering=Netwerk Aanbieding Inschakelen +message.enabling.security.group.provider=Inschakelen Security Group provider +message.enabling.vpc.offering=VPC aanbieding inschakelen +message.enabling.zone.dots=Bezig met activeren van Zone.... +message.enabling.zone=Inschakelen zone +message.enter.seperated.list.multiple.cidrs=Gelieve een met komma\\'s gescheiden lijst van CIDRs invoeren wanneer er meer dan een zijn +message.enter.token=Vul het token in dat vermeld staat in de e-mail uitnodiging. +message.generate.keys=Bevestig dat u nieuwe sleutels wilt genereren voor deze gebruiker. +message.gslb.delete.confirm=Bevestigd dat u deze GSLB wilt verwijderen +message.gslb.lb.remove.confirm=Bevestig dat u loadbalancing van GSLB wilt verwijderen +message.guest.traffic.in.advanced.zone=Gast netwerk verkeer is communicatie tussen virtuele machines van de eindgebruiker. Specificeer een range van VLAN IDs om gast verkeer te transporteren over het fysieke netwerk. +message.guest.traffic.in.basic.zone=Gast netwerk verkeer is communicatie tussen virtuele machines van de eindgebruiker. Specificeer een range van IP adressen welke CloudStack kan uitdelen aan gast VMs. Let erop dat deze range niet overlapt met de gereserveerde systeem IP range. +message.host.dedicated=Host toegewijd +message.host.dedication.released=Toegewijde host losgekoppeld +message.installWizard.click.retry=Druk op de knop om de lancering opnieuw te proberen +message.installWizard.copy.whatIsACluster=Een cluster is een manier om hosts te groeperen. De hosts in een cluster hebben ieder identieke hardware, draaien dezelfde hypervisor, zitten op hetzelfde subnet en kunnen dezelfde gedeelde opslag benaderen. Virtuele machines (VMs) kunnen live gemigreerd worden van tot ene naar de andere host in hetzelfde cluster zonder dat de gebruiker hier iets van merkt. Een cluster is de 3e grootste organisatorische unit binnen Cloudstack&\#8482;. Clusters worden ondergebracht in pods, en pods zijn op hun beurt ondergebracht in zones. CloudStack&\#8482; biedt te mogelijkheid tot meerdere clusters, maar voor een basis installatie hebben we maar \u00e9\u00e9n cluster nodig. +message.installWizard.copy.whatIsAHost=Een host een opzichzelfstaande computer. Hosts verzorgen de resources nodig om de gast virtuele machines te draaien. Elke host heeft eigen hypervisor software geinstalleerd om de virtuele machines erop te beheren (Afgezien van bare metal hosts, hierover is meer te vinden in de geavanceerde installatie handleiding). Om een paar voorbeelden te noemen\: een Linux server met KVM, een server met Citrix XenServer en servers met ESXi geinstalleerd zijn hosts. Bij de basis installatie gebruiken we een opzichzelfstaande host met XenServer of KVM geinstalleerd.

Een host is de kleinste organisatorische unit binnen een CloudStack&\#8482; omgeving. Hosts worden ondergebracht in clusters, cluster zijn ondergebracht in pods en pods zijn ongebracht in zones. +message.installWizard.copy.whatIsAPod=Een pod vertegenwoordigd meestal een rack. Hosts in dezelfde pod hebben hetzelfde subnet.

Een pod is de tweede grootste organisatorische unit binnen een CloudStack&\#8482; omgeving. Pods zijn ondergebracht in zones. Elke zone kan meerdere pods hebben, voor de basis installatie hebben we een enkele pod in de zone. +message.installWizard.copy.whatIsAZone=Een zone is de grootste organisatorische unit binnen een CloudStack&\#8482; omgeving. Een zone staat meestal voor een datacenter, al is het geen probleem om meerdere zones in hetzelfde datacenter te hebben. Het voordeel van infrastructuur onderbrengen in zones is om fysieke isolatie en redundantie te cre\u00ebren. Elke zone kan bijvoorbeeld zijn eigen stroom voorziening en netwerk uplinks hebben en kunnen geografisch verspreid worden (al is dit geen vereiste). +message.installWizard.copy.whatIsCloudStack=CloudStack&\#8482; is een software platform welke computer capaciteit herenigd om public, private en hybrid infrastructure as a Service (IaaS) clouds te bouwen. CloudStack&\#8482; beheert het netwerk, de opslag en de computer nodes welke de cloud infrastructuur vertegenwoordigen. Gebruik CloudStack&\#8482; om cloud computing omgevingen uit te rollen, te beheren en te configureren.

CloudStack&\#8482 gaat veel verder dan het draaien van virtuele machine bestanden op commodity hardware, het is een turnkey oplossing om virtuele datacenters (as a service) te realiseren. Daarbij levert het alle essenti\u00eble componenten om multi-tier en multi-tentant cloud applicaties te bouwen en te beheren. Er is een zowel een open-source als Premium versie beschikbaar, waarbij de open-source versie nagenoeg dezelfde functionaliteit biedt als de Premium versie. +message.installWizard.copy.whatIsPrimaryStorage=Een CloudStack&\#8482; cloud infrastructuur maakt gebruik van 2 type opslag, namelijk primaire en secundaire opslag. Primaire opslag kan iSCSI, NFS of lokale opslag zijn. Secundaire opslag werkt via NFS of een S3-compatible opslag systeem.

Primaire opslag is onderdeel van een cluster, en het bevat de schijf volumes van iedere gast VM in dat cluster. De primaire opslag server wordt meestal dicht bij de hosts geplaatst. +message.installWizard.copy.whatIsSecondaryStorage=Secundaire opslag is onderdeel van een zone, en biedt opslagruimte aan\:
  • Templates - kant-en-klare VMs die gebruikt kunnen worden zonder voorafgaande installatie.
  • ISO bestanden - Installatie mediums voor VMs.
  • Schijf volume snapshots - reservekopie\u00ebn van schijf volumes die later gebruikt kunnen worden tijdens recovery of het maken van nieuwe templates.
+message.installWizard.now.building=Bezig met het bouwen van je cloud... +message.installWizard.tooltip.addCluster.name=Een naam voor het cluster. U kunt deze tekst vrij invullen, en zal verder niet gebruikt worden door CloudStack. +message.installWizard.tooltip.addHost.hostname=De DNS naam of het IP adres van de host. +message.installWizard.tooltip.addHost.password=Dit is het wachtwoord voor de gebruiker die hierboven genoemd wordt (van uw Xenserver instllatie). +message.installWizard.tooltip.addHost.username=Meestal root. +message.installWizard.tooltip.addPod.name=Een naam voor de pod +message.installWizard.tooltip.addPod.reservedSystemEndIp=Dit is de IP range van het private netwerk dat CloudStack gebruikt om met Secundaire Opslag VMs en Console Proxy VMs te communiceren. Deze IP adressen komen uit hetzelfde subnet als de gast VMs. +message.installWizard.tooltip.addPod.reservedSystemGateway=De gateway voor de hosts in die pod. +message.installWizard.tooltip.addPod.reservedSystemNetmask=De netmask die gebruikt wordt op het subnet dat de gast VMs gaan gebruiken. +message.installWizard.tooltip.addPod.reservedSystemStartIp=Dit is de IP range van het private netwerk dat CloudStack gebruikt om met Secundaire Opslag VMs en Console Proxy VMs te communiceren. Deze IP adressen komen uit hetzelfde subnet als de gast VMs. +message.installWizard.tooltip.addPrimaryStorage.name=De naam voor het opslag apparaat. +message.installWizard.tooltip.addPrimaryStorage.path=(Voor NFS) Bij NFS dit is het ge\u00ebxporteerde pad van de server. Pad (Voor SharedMountPoint). Bij KVM is dit het pad waar op elke machine de primaire opslag is gekoppeld. Bijvoorbeeld, "/mnt/primary". +message.installWizard.tooltip.addPrimaryStorage.server=(Voor NFS, iSCSI of PreSetup) Het IP adres of DNS naam van het opslag apparaat. +message.installWizard.tooltip.addSecondaryStorage.nfsServer=Het IP adres van de NFS server welke de secundaire opslag serveert +message.installWizard.tooltip.addSecondaryStorage.path=Het ge\u00ebxporteerde pad, op de server die u hierboven heeft gespecificeerd +message.installWizard.tooltip.addZone.dns1=Deze DNS servers worden gebruik door gast VMs in de Zone. Deze DNS servers moeten toegankelijk zijn op het publieke netwerk wat we later gaan toevoegen. De publieke IP adressen voor de zone moeten een route hebben naar de DNS server hier vermeld. +message.installWizard.tooltip.addZone.dns2=Deze DNS servers worden gebruik door gast VMs in de Zone. Deze DNS servers moeten toegankelijk zijn op het publieke netwerk wat we later gaan toevoegen. De publieke IP adressen voor de zone moeten een route hebben naar de DNS server hier vermeld. +message.installWizard.tooltip.addZone.internaldns1=Deze DNS servers worden gebruik door gast VMs in de Zone. Deze DNS servers moeten toegankelijk zijn op het private netwerk wat we later gaan toevoegen. De private IP adressen voor de zone moeten een route hebben naar de DNS server hier vermeld. +message.installWizard.tooltip.addZone.internaldns2=Deze DNS servers worden gebruik door gast VMs in de Zone. Deze DNS servers moeten toegankelijk zijn op het private netwerk wat we later gaan toevoegen. De private IP adressen voor de zone moeten een route hebben naar de DNS server hier vermeld. +message.installWizard.tooltip.addZone.name=Een naam voor de zone +message.installWizard.tooltip.configureGuestTraffic.description=Een beschrijving voor het netwerk +message.installWizard.tooltip.configureGuestTraffic.guestEndIp=De IP reeks welke beschikbaar zal zijn voor gast VMs in de zone. Als \u00e9\u00e9n NIC gebruikt wordt, zouden deze IP adressen in hetzelfde CIDR moeten vallen als die van de pod. +message.installWizard.tooltip.configureGuestTraffic.guestGateway=De gateway welke gast VMs moeten gebruiken +message.installWizard.tooltip.configureGuestTraffic.guestNetmask=De netmask die gebruikt wordt op het subnet dat door gast VMs gebruikt wordt +message.installWizard.tooltip.configureGuestTraffic.guestStartIp=De IP reeks welke beschikbaar zal zijn voor gast VMs in de zone. Als \u00e9\u00e9n NIC gebruikt wordt, zouden deze IP adressen in hetzelfde CIDR moeten vallen als die van de pod. +message.installWizard.tooltip.configureGuestTraffic.name=Een naam voor het netwerk +message.instance.scaled.up.confirm=Weet u zeker dat u deze VM wilt opschalen? +message.instanceWizard.noTemplates=Er zijn geen templates beschikbaar. Voeg een geschikte template toe, en herstart deze instantie wizard. +message.ip.address.changed=Uw IP adres is mogelijk gewijzigd, wilt u de lijst verversen? Wanneer dit het geval is, zal het detail paneel gesloten worden. +message.iso.desc=Image bestand met data of bootable media voor besturingsysteem +message.join.project=U neemt nu deel aan een project. Klik op het project overzicht om het project te zien. +message.launch.vm.on.private.network=Wilt u de instantie starten op uw eigen private dedicated netwerk? +message.launch.zone=De zone is klaar om geactiveerd te worden, ga door naar de volgende stap. +message.listView.subselect.multi=(Ctrl/Cmd-click) +message.lock.account=Bevestig dat u deze account wilt vergrendelen. Wanneer u de account vergrendeld zullen alle gebruikers van deze account hun cloud resources niet meer kunnen beheren. Toegang tot bestaande producten blijft bestaan. +message.migrate.instance.confirm=Bevestig de host naar waar u de instantie toe wilt migreren. +message.migrate.instance.to.host=Bevestig dat u de instantie naar een andere host toe wilt migreren. +message.migrate.instance.to.ps=Bevestig dat u de instantie naar een andere primaire opslag toe wilt migreren. +message.migrate.router.confirm=Bevestig de host waar u de router naartoe wilt migreren\: +message.migrate.systemvm.confirm=Bevestig de host naar waar u de systeem VM toe wilt migreren\: +message.migrate.volume=Bevestig dat u het volume wilt migreren naar een andere primaire opslag. +message.network.addVM.desc=Specificeer het netwerk dat u aan deze VM wilt toevoegen. Een nieuwe netwerk interface zal worden toegevoegd aan de VM. +message.network.addVMNIC=Bevestig dat u een nieuwe netwerk interface voor dit netwerk wilt verkrijgen. +message.new.user=Sepecificeer de volgende waarden om een nieuwe gebruiker toe te voegen aan de account +message.no.affinity.groups=U heeft geen affinity groepen. Ga door naar de volgende stap. +message.no.host.available=Geen hosts beschikbaar voor Migratie +message.no.network.support.configuration.not.true=Er is geen zone waarin security groups zijn ingeschakeld. Om die reden zijn er geen additionele netwerk diensten beschikbaar. Ga door naar stap 5. +message.no.network.support=De geselecteerde hypervisor, vSphere, beschikt niet over additionele netwerk diensten. Ga door naar stap 5. +message.no.projects.adminOnly=U hebt momenteel geen projecten.
Uw beheerder kan een nieuw project aanmaken. +message.no.projects=U hebt momenteel geen projecten.
U kunt een nieuw project aanmaken vanuit de projecten sectie. +message.number.clusters=

Aantal Clusters

+message.number.hosts=

Aantal Hosts

+message.number.pods=

Aantal Pods

+message.number.storage=

Aantal Primaire Opslag Volumes

+message.number.zones=

Aantal Zones

+message.pending.projects.1=U heeft openstaande project uitnodigigingen\: +message.pending.projects.2=Ga naar de project sectie om deze te zien. Selecteer de uitnodiging vanuit het drop-down menu. +message.please.add.at.lease.one.traffic.range=U dient minimaal \u00e9\u00e9n traffic range toe te voegen. +message.please.proceed=Ga door naar de volgende stap. +message.please.select.a.configuration.for.your.zone=Selecteer een configuratie voor uw zone. +message.please.select.a.different.public.and.management.network.before.removing=Selecteer a.u.b. een ander publiek en beheer netwerk voordat u deze verwijderd +message.please.select.networks=Selecteer netwerken voor uw virtuele machine. +message.please.wait.while.zone.is.being.created=Even geduld, uw zone wordt aangemaakt; Dit kan enige tijd duren... +message.pod.dedication.released=Toegewijde pod losgekoppeld +message.portable.ip.delete.confirm=Bevestig dat u deze porteerbare IP reeks wilt verwijderen +message.project.invite.sent=Uitnodiging is verstuurd aan gebruiker. De gebruiker wordt toegevoegd aan het project wanneer hij de uitnodiging accepteert. +message.public.traffic.in.advanced.zone=Publiek verkeer wordt gegenereerd wanneer VMs in de cloud het internet bezoeken. Publiek toegankelijke IPs moeten om deze reden toegevoegd worden. Eindgebruikers kunnen deze IP adressen via de Cloudstack UI aanvragen om zo verkeer tussen het gast netwerk en publieke netwerk te realiseren.

Geef minimaal \u00e9\u00e9n IP range op voor internet verkeer. +message.public.traffic.in.basic.zone=Publiek verkeer wordt gegenereerd wanneer VMs in de cloud het internet bezoeken of diensten serveren aan het internet. Publiek toegankelijke IPs moeten om deze reden toegevoegd worden. Wanneer een instantie wordt aangemaakt, krijgt deze automatisch een van deze IP adressen toegewezen naast het gast IP adres. Static 1-1 NAT wordt automatisch geconfigureerd tussen het publieke IP en gast IP adres. Eindgebruikers kunnen via de CloudStack UI meerdere IP adressen aanvragen om static NAT tussen hun instanties en het publieke IP te realiseren. +message.read.admin.guide.scaling.up=Gelieve de dynamic scaling sectie te lezen in admin guide voordat u gaat opschalen. +message.recover.vm=Bevestig dat u deze VM wilt herstellen. +message.redirecting.region=U wordt doorverbonden met de regio... +message.reinstall.vm=LET OP\: Als u doorgaat zal de VM opnieuw geinstalleerd worden vanaf de template. Alle data op de root disk zal verwijderd worden. Eventuele data volumes blijven onaangeraakt. +message.remove.ldap=Weet u zeker dat u de LDAP configuratie wilt verwijderen? +message.remove.region=Weet u zeker dat u deze regio wilt verwijderen van deze management server? +message.remove.vpc=Bevestigd dat u de VPC wilt verwijderen +message.remove.vpn.access=Bevestig dat u VPN toegang wilt verwijderen van de volgende gebruiker. +message.reset.password.warning.notPasswordEnabled=De template van deze instantie was aangemaakt zonder wachtwoord functie +message.reset.password.warning.notStopped=Uw instantie moet gestopt worden voordat u het wachtwoord kunt wijzigen. +message.reset.VPN.connection=Bevestig dat u deze VPN verbinding wilt resetten +message.restart.mgmt.server=Gelieve uw management server(s) herstarten om deze wijziging actief te maken. +message.restart.mgmt.usage.server=Gelieve uw management server(s) en gebruik server(s) herstarten om deze wijziging actief te maken. +message.restart.network=Als u dit netwerk herstart zullen de diensten op het netwerk verstoord worden. Weet u zeker dat u deze actie wil uitvoeren? +message.restart.vpc=Bevestig dat u deze VPC wilt herstarten +message.restoreVM=Wilt u de VM herstellen? +message.security.group.usage=(Gebruik Ctrl-klik om meerdere security groups te selecteren) +message.select.affinity.groups=Selecteer welke affinity groepen u wilt gebruiken voor deze VM\: +message.select.a.zone=Een zone correspondeert meestal met een enkel datacenter. Meerdere zones maken de cloud betrouwbaarder door fysiek isolatie en redunatie te verzorgen. +message.select.instance=Selecteer een instantie. +message.select.iso=Gelieve een ISO te selecteren voor uw nieuwe instantie. +message.select.item=Gelieve een item te selecteren. +message.select.security.groups=Gelieve security group(s) te selecteren voor de nieuwe instantie +message.select.template=Gelieve een template te selecteren voor de nieuwe instantie +message.select.tier=Gelieve een tier te selecteren +message.set.default.NIC=Bevestig dat u dit netwerk apparaat standaard wilt maken voor deze VM. +message.set.default.NIC.manual=U dient nu manueel de netwerk interface op de VM updaten. +message.setup.physical.network.during.zone.creation.basic=Wanneer u een basis zone toevoegt bevat deze een fysiek netwerk welke correspondeert met de netwerkkaart op de hypervisor. Op dit netwerk zullen meerdere verkeerstypen gebruikt worden.

U kunt via drag & drop andere verkeerstypen toevoegen aan het fysieke netwerk. +message.setup.physical.network.during.zone.creation=Wanneer u een geavanceerde zone toevoegt, dient u meerdere fysiek netwerken te configureren. Een netwerk correspondeert met een netwerkkaart op de hypervisor. Elk fysiek netwerk kan een of meerdere traffic types bevatten, met bepaald geldende restricties hoe deze gecombineerd mogen worden. Drag & Drop een of meerdere verkeerstypen op het fysieke netwerk. +message.setup.successful=Cloud installatie is succesvol verlopen\! +message.snapshot.schedule=U kunt terugkerende snapshots schema&\#39s aanmaken door een van de beschikbare opties hieronder te selecteren. +message.specifiy.tag.key.value=Gelieve een tag sleutel en waarde te specificeren +message.specify.url=Gelieve een URL te specificeren +message.step.1.continue=Gelieve een template of ISO te selecteren om door te gaan +message.step.1.desc=Selecteer een template voor uw nieuwe instantie. U kunt ook een blanco template selecteren op welke een ISO bestand geinstalleerd kan worden. +message.step.2.continue=Selecteer een service aanbieding om verder te gaan. message.step.2.desc= +message.step.3.continue=Selecteer een schijf aanbieding om verder te gaan message.step.3.desc= +message.step.4.continue=Selecteer minimaal \u00e9\u00e9n netwerk om door te gaan +message.step.4.desc=Selecteer het primaire netwerk aan welke uw instantie verbonden moet worden +message.storage.traffic=Verkeer tussen CloudStack&\#39s interne diensten, inclusief componenten die communiceren met de management server zoals hosts en CloudStack systeem VMs. Configureer opslag verkeer hier. +message.suspend.project=Weet u zeker dat u dit project wilt pauzeren? +message.systems.vms.ready=Systeem VMs klaar. +message.template.copying=De template wordt gekopieerd. +message.template.desc=OS image bestand dat gebruikt kan worden om de VM op te starten +message.tier.required=Tier is benodigd +message.tooltip.dns.1=Naam van de DNS server die gebruikt mag worden door VMs in de zone. De publieke IP adressen in de zone moeten een route hebben naar deze server. +message.tooltip.dns.2=Naam van een secudaire DNS server die gebruikt mag worden door VMs in de zone. De publieke IP adressen in de zone moeten een route hebben naar deze server. +message.tooltip.internal.dns.1=Naam van de DNS server die gebruikt mag worden door interne systeem VMs van CloudStack in de zone. De priv\u00e9 IP adressen in de pod moeten een route hebben naar deze server. +message.tooltip.internal.dns.2=Naam van de DNS server die gebruikt mag worden door interne systeem VMs van CloudStack in de zone. De priv\u00e9 IP adressen in de pod moeten een route hebben naar deze server. +message.tooltip.network.domain=Een DNS toevoeging dat de domeinnaam zal zijn voor het netwerk wat toegangkelijk is voor gast VMs. +message.tooltip.pod.name=Een naam voor deze pod. +message.tooltip.reserved.system.gateway=De gateway voor hosts in deze pod. +message.tooltip.reserved.system.netmask=De netwerk prefix dat het pod subnet definieert. Gebruik de CIDR notatie. +message.tooltip.zone.name=Een naam voor de zone. +message.update.os.preference=Selecteer een OS voorkeur voor deze host. Alle virtueel instanties van gelijke voorkeur zullen eerst op deze machine gealloceerd worden voordat er gekeken wordt naar andere hosts. +message.update.resource.count=Bevestig dat u de verbruiksstatistieken voor deze account wilt bijwerken. +message.update.ssl=Geef een nieuw X.509 compliant SSL certificaat in waarmee elke console proxy en secundaire opslag instantie mee geupdate kunnen worden\: +message.validate.accept=Gelieve een waarde in te geven met een geldidge extensie. +message.validate.creditcard=Gelieve een geldig credit card nummer in te geven. +message.validate.date=Gelieve een geldige datum in te geven. +message.validate.date.ISO=Gelieve een geldige datum (ISO) in te geven. +message.validate.digits=Gelieve alleen cijfers in te geven. +message.validate.email.address=Gelieve een geldig email adres in te geven. +message.validate.equalto=Voer dezelfde waarde nogmaals in. +message.validate.fieldrequired=Dit veld is vereist +message.validate.fixfield=Gelieve dit veld te herstellen. +message.validate.instance.name=Namen van instantie kunnen niet langer zijn dan 63 karakters. Alleen ASCII letters a~z, A~Z, cijfers 0~9 zijn toegestaan. Moet beginnen met een letter en mag eindigen met een letter of cijfer. +message.validate.invalid.characters=Niet toegestane karakters gevonden, corrigeer deze. +message.validate.max=Gelieve een waarde kleiner of gelijk aan {0} in te geven. +message.validate.maxlength=Gelieve niet meer dan {0} karakters in te geven. +message.validate.minlength=Gelieve minimaal {0} karakters in te geven. +message.validate.number=Gelieve een geldig nummer in te geven. +message.validate.range=Gelieve een waarde tussen {0} en {1} in te geven. +message.validate.range.length=Gelieve een waarde tussen de {0} en {1} karakters lang in te geven. +message.validate.URL=Gelieve een geldige URL in te geven. +message.virtual.network.desc=Een dedicated gevirtualiseerd netwerk voor uw account. Het broadcast domein is ingesloten binnen een VLAN en toegang naar het publieke netwerk wordt gerouteerd door een virtueele router. +message.vm.create.template.confirm=Creer een template welke de VM atuomatisch laat opstarten. +message.vm.review.launch=Gelieve de volgende gegevens te verifi\u00ebren te bevestigen zodat uw instantie gestart kan worden. +message.vnmc.available.list=VNMC is niet beschikbaar van de provider lijst. +message.vnmc.not.available.list=VNMC is niet beschikbaar van de provider lijst. +message.volume.create.template.confirm=Bevestig dat u een template wilt maken van dit schijf volume. Het maken van een template kan meerdere minuten duren maar soms ook langer afhankelijk van de grootte van het volume. +message.waiting.for.builtin.templates.to.load=Wachten totdat ingebouwde templates zijn geladen... +message.XSTools61plus.update.failed=Kon XenServer Tools Version 6.1\\+ field niet updaten. Fout\: +message.you.must.have.at.least.one.physical.network=U moet minimaal \u00e9\u00e9n fysiek netwerk hebben +message.your.cloudstack.is.ready=Uw CloudStack is klaar\! +message.Zone.creation.complete=De installatie van de zone is compleet +message.zone.creation.complete.would.you.like.to.enable.this.zone=De installatie van de zone is compleet, wilt u deze zone meteen inschakelen? +message.zone.no.network.selection=De geselecteerde zone heeft geen meerdere netwerk selectie mogelijkheden. +message.zone.step.1.desc=Selecteer een netwerk model voor uw zone. +message.zone.step.2.desc=Specificeer de volgende gegevens om een nieuwe zone toe te voegen +message.zone.step.3.desc=Specificeer de volgende gegevens om een nieuwe pod toe te voegen +message.zoneWizard.enable.local.storage=WAARSCHUWING\: Als u lokale opslag activeert voor deze zone, moet u de volgende stappen ondernemen afhankelijk van het opslagsysteem waar u de systeem VMs vanaf wilt starten\:

1. Wanneer de systeem VMs gestart moeten worden van primaire (gedeelde) opslag moet deze nadat configuratie van de zone klaar is, toegevoegd worden.

2. Wanneer de systeem VMs gestart moeten worden vanaf lokale opslag, dient de parameter system.vm.use.local.storage gezet zijn voordat u de zone activeert.


Weet u zeker dat u verder wilt gaan? +messgae.validate.min=Gelieve een waarde groter of gelijk aan {0} in te geven. mode=Modus +network.rate=Netwerk Snelheid notification.reboot.instance=Herstart instantie +notification.start.instance=Start Instantie +notification.stop.instance=Stop Instantie +side.by.side=Zij aan Zij +state.Accepted=Geaccepteerd +state.Active=Actief state.Allocated=Gebruikt +state.Allocating=Alloceren +state.BackedUp=Geback-upt +state.BackingUp=Back-uppen +state.Completed=Uitgevoerd +state.Creating=Aanmaken +state.Declined=Geweigerd +state.Destroyed=Verwijderd state.Disabled=Uitgeschakeld +state.enabled=Geactiveerd +state.Enabled=Geactiveerd state.Error=Fout +state.Expunging=Opruimen +state.Migrating=MIgreren +state.Pending=In afwachting +state.ready=Klaar +state.Ready=Klaar +state.Running=Draaiend +state.Starting=Starten +state.Stopped=Gestopt +state.Stopping=Stoppen +state.Suspended=Gepauzeerd +ui.listView.filters.all=Alle +ui.listView.filters.mine=Eigen diff --git a/client/WEB-INF/classes/resources/messages_pl.properties b/client/WEB-INF/classes/resources/messages_pl.properties index 84808f818d..06d5ec2dbd 100644 --- a/client/WEB-INF/classes/resources/messages_pl.properties +++ b/client/WEB-INF/classes/resources/messages_pl.properties @@ -245,6 +245,7 @@ label.email=Poczta label.enable.vpn=W\u0142\u0105cz VPN label.error=B\u0142\u0105d label.f5=F5 +label.failed=B\u0142\u0105d label.featured=Polecane label.filterBy=Filtrowanie wg label.firewall=Zapora @@ -270,6 +271,7 @@ label.invited.accounts=Zaproszone konta label.invite.to=Zapro\u015b do label.invite=Zapro\u015b label.ip=IP +label.ips=IP label.iso=ISO label.keep=Zostaw label.key=Klucz @@ -280,6 +282,7 @@ label.lang.korean=Korea\u0144ski label.lang.russian=Rosyjski label.lang.spanish=Hiszpia\u0144ski label.last.name=Nazwisko +label.launch=Rozpocznij label.least.connections=Ostatnie po\u0142\u0105czenie label.level=Poziom label.loading=Wczytywanie @@ -313,6 +316,7 @@ label.menu.network=Sie\u0107 label.menu.regions=Regiony label.menu.system=System label.minimum=Minimum +label.mode=Tryb label.monday=Poniedzia\u0142ek label.monthly=Miesi\u0119cznie label.move.down.row=Jeden rz\u0105d na d\u00f3\u0142 @@ -382,6 +386,7 @@ label.select.project=Wybierz projekt label.select=Wybierz label.sent=Wys\u0142ano label.server=Serwer +label.setup=Konfiguracja label.size=Wielko\u015bc label.specify.IP.ranges=Wyszczeg\u00f3lnij zasi\u0119g adres\u00f3w IP label.srx=SRX diff --git a/client/WEB-INF/classes/resources/messages_pt_BR.properties b/client/WEB-INF/classes/resources/messages_pt_BR.properties index 1bcdc9ce1b..8ee08ba3cb 100644 --- a/client/WEB-INF/classes/resources/messages_pt_BR.properties +++ b/client/WEB-INF/classes/resources/messages_pt_BR.properties @@ -15,21 +15,23 @@ # specific language governing permissions and limitations # under the License. -changed.item.properties=Alteradas propriedades do item -confirm.enable.s3=Por favor preencha as informa\u00e7\u00f5es abaixo para habilitar suporte a storage secund\u00e1ria fornecida por S3 -confirm.enable.swift=Por favor preencha as informa\u00e7\u00f5es abaixo para habilitar suporte ao Swift +changed.item.properties=Propriedades do item alteradas +confirm.enable.s3=Por favor, preencha as informa\u00e7\u00f5es abaixo para habilitar suporte o Storage Secund\u00e1rio fornecido por S3 +confirm.enable.swift=Por favor, preencha as informa\u00e7\u00f5es abaixo para habilitar suporte ao Swift +error.could.not.change.your.password.because.ldap.is.enabled=Erro\: a nuvem n\u00e3o alterou sua senha porque o LDAP est\u00e1 ativo. error.could.not.enable.zone=N\u00e3o foi poss\u00edvel habilitar a zona error.installWizard.message=Alguma coisa est\u00e1 errada; voc\u00ea pode voltar e corrigir quaisquer erros error.invalid.username.password=Usu\u00e1rio ou senha inv\u00e1lidos -error.login=Usu\u00e1rio ou senha inv\u00e1lido. +error.login=O seu usu\u00e1rio/senha n\u00e3o coincidem com nossos registros. error.menu.select=N\u00e3o foi poss\u00edvel realizar a a\u00e7\u00e3o pois nenhum item foi selecionado. -error.mgmt.server.inaccessible=O servidor de gerenciamento est\u00e1 inacess\u00edvel. Tente novamente mais tarde. +error.mgmt.server.inaccessible=O Servidor de Gerenciamento est\u00e1 inacess\u00edvel. Tente novamente mais tarde. error.password.not.match=Os campos de senha n\u00e3o combinam -error.please.specify.physical.network.tags=Ofertas de Rede n\u00e3o estar\u00e3o dispon\u00edveis enquanto voc\u00ea n\u00e3o especificar tags para esta interface f\u00edsica. +error.please.specify.physical.network.tags=As Ofertas de Rede n\u00e3o estar\u00e3o dispon\u00edveis enquanto voc\u00ea n\u00e3o especificar tags para esta interface f\u00edsica. error.session.expired=Sua sess\u00e3o expirou. -error.something.went.wrong.please.correct.the.following=Algo deu errado; por favor corrija abaixo +error.something.went.wrong.please.correct.the.following=Alguma coisa est\u00e1 errada; por favor corrija abaixo error.unable.to.reach.management.server=N\u00e3o foi poss\u00edvel acessar o Servidor de Gerenciamento error.unresolved.internet.name=Imposs\u00edvel resolver DNS +extractable=Extra\u00edvel force.delete.domain.warning=Aten\u00e7\u00e3o\: Esta op\u00e7\u00e3o remover\u00e1 todos os dom\u00ednios, contas e recursos associados. force.delete=For\u00e7ar Exclus\u00e3o force.remove=For\u00e7ar Remo\u00e7\u00e3o @@ -39,7 +41,10 @@ force.stop.instance.warning=Aviso\: For\u00e7ar o desligamento desta inst\u00e2n ICMP.code=C\u00f3digo ICMP ICMP.type=Tipo ICMP image.directory=Diret\u00f3rio da Imagem +inline=Inline instances.actions.reboot.label=Reiniciar inst\u00e2ncia +label.about.app=Sobre o CloudStack +label.about=Sobre label.accept.project.invitation=Aceitar convite de projeto. label.account.and.security.group=Contas, grupos de Seguran\u00e7a label.account=Conta @@ -48,6 +53,7 @@ label.account.name=Nome da Conta label.accounts=Contas label.account.specific=Conta-Specific label.acquire.new.ip=Adquirir novo IP +label.acquire.new.secondary.ip=Adquira um novo IP secund\u00e1rio label.action.attach.disk=Anexar Disco label.action.attach.disk.processing=Anexando Disco.... label.action.attach.iso=Anexar ISO @@ -90,6 +96,7 @@ label.action.delete.load.balancer=Remover regra de balanceador de carga label.action.delete.network.processing=Removendo Rede.... label.action.delete.network=Remover Rede label.action.delete.nexusVswitch=Remover NexusVswitch +label.action.delete.nic=Remover Interface de Rede label.action.delete.physical.network=Deletar rede f\u00edsica label.action.delete.pod.processing=Removendo POD.... label.action.delete.pod=Remover POD @@ -112,8 +119,8 @@ label.action.delete.volume.processing=Removendo Disco.... label.action.delete.volume=Remover Disco label.action.delete.zone.processing=Removendo Zona.... label.action.delete.zone=Remover Zona -label.action.destroy.instance=Apagar Cloud Server -label.action.destroy.instance.processing=Apagando Cloud Server.... +label.action.destroy.instance=Apagar Inst\u00e2ncia +label.action.destroy.instance.processing=Apagando Inst\u00e2ncia.... label.action.destroy.systemvm=Apagar VM de Sistema label.action.destroy.systemvm.processing=Apagando VM de Sistema.... label.action.detach.disk=Desplugar Disco @@ -143,7 +150,7 @@ label.action.edit.disk.offering=Editar Oferta de Disco label.action.edit.domain=Editar Dom\u00ednio label.action.edit.global.setting=Editar Configura\u00e7\u00f5es Globais label.action.edit.host=Editar Host -label.action.edit.instance=Editar Cloud Server +label.action.edit.instance=Editar Inst\u00e2ncia label.action.edit.ISO=Editar ISO label.action.edit.network=Editar Rede label.action.edit.network.offering=Editar Oferta de Rede @@ -171,6 +178,8 @@ label.action.enable.user=Habilitar usu\u00e1rio label.action.enable.user.processing=Habilitando Usu\u00e1rio... label.action.enable.zone=Ativar Zona label.action.enable.zone.processing=Ativando Zona.... +label.action.expunge.instance=Eliminar Inst\u00e2ncia +label.action.expunge.instance.processing=Expurgando Inst\u00e2ncia.... label.action.force.reconnect=Force Reconnect label.action.force.reconnect.processing=Reconectando.... label.action.generate.keys=Gerar Chaves @@ -180,18 +189,19 @@ label.action.lock.account=Bloquear conta label.action.lock.account.processing=Bloqueando conta.... label.action.manage.cluster.processing=Vinculando o Cluster.... label.action.manage.cluster=Vincular Cluster -label.action.migrate.instance=Migrar Cloud Server -label.action.migrate.instance.processing=Migrando Cloud Server... +label.action.migrate.instance=Migrar Inst\u00e2ncia +label.action.migrate.instance.processing=Migrando Inst\u00e2ncia.... label.action.migrate.router=Migrar Roteador label.action.migrate.router.processing=Migrando Roteador... label.action.migrate.systemvm=Migrar VM de Sistema label.action.migrate.systemvm.processing=Migrando VM de Sistema... -label.action.reboot.instance.processing=Reiniciando Cloud Server... -label.action.reboot.instance=Reiniciar Cloud Server +label.action.reboot.instance.processing=Reiniciando Inst\u00e2ncia... +label.action.reboot.instance=Reiniciar Inst\u00e2ncia label.action.reboot.router.processing=Reiniciando Roteador.... label.action.reboot.router=Reiniciar Roteador label.action.reboot.systemvm.processing=Reiniciando VM de Sistema.... label.action.reboot.systemvm=Reiniciar VM de Sistema +label.action.recurring.snapshot=Snapshots recorrentes label.action.register.iso=Registrar ISO label.action.register.template=Registrar template label.action.release.ip=Liberar IP @@ -203,17 +213,19 @@ label.action.reset.password=Recuperar Senha label.action.resize.volume.processing=Resizing Volume.... label.action.resize.volume=Resize Volume label.action.resource.limits=Limite de Recursos -label.action.restore.instance.processing=Restaurando Cloud Server... -label.action.restore.instance=Restaurar Cloud Server -label.actions=A\u00c3\u00a7\u00c3\u00b5es -label.action.start.instance=Iniciar Cloud Server -label.action.start.instance.processing=Iniciando Cloud Server... +label.action.restore.instance.processing=Restaurando Inst\u00e2ncia... +label.action.restore.instance=Restaurar Inst\u00e2ncia +label.action.revert.snapshot.processing=Revertendo para Snapshot... +label.action.revert.snapshot=Reverter para Snapshot +label.actions=A\u00e7\u00f5es +label.action.start.instance=Iniciar Inst\u00e2ncia +label.action.start.instance.processing=Iniciando Inst\u00e2ncia... label.action.start.router=Iniciar Roteador label.action.start.router.processing=Iniciando Roteador.... label.action.start.systemvm=Iniciar VM de Sistema label.action.start.systemvm.processing=Iniciando VM de Sistema.... -label.action.stop.instance=Parar Cloud Server -label.action.stop.instance.processing=Parando Cloud Server... +label.action.stop.instance=Parar Inst\u00e2ncia +label.action.stop.instance.processing=Parando Inst\u00e2ncia... label.action.stop.router=Parar Roteador label.action.stop.router.processing=Parando Roteador.... label.action.stop.systemvm=Parar VM de Sistema @@ -226,6 +238,9 @@ label.action.update.OS.preference=Atualizar Prefer\u00eancia de SO label.action.update.OS.preference.processing=Atualizando Prefer\u00eancia de SO.... label.action.update.resource.count=Atualiza Contador de Recursos label.action.update.resource.count.processing=Atualizando Contador de Recursos.... +label.action.vmsnapshot.create=Fazer Snapshot de VM +label.action.vmsnapshot.delete=Remover snapshot de VM +label.action.vmsnapshot.revert=Reverter snapshot de VM label.activate.project=Ativar Projeto label.active.sessions=Sess\u00f5es Ativas label.add.account=Adicionar Conta @@ -234,6 +249,8 @@ label.add.accounts.to=Adicionar contas para label.add.account.to.project=Adicionar conta ao projeto label.add.ACL=Adicionar ACL label.add=Adicionar +label.add.affinity.group=Adicionar um grupo de afinidade +label.add.BigSwitchVns.device=Adicionar BigSwitch Vns Controller label.add.by=Adicionado por label.add.by.cidr=Adicionar por CIDR label.add.by.group=Adicionar por Grupo @@ -268,12 +285,16 @@ label.add.network.offering=Adicionar oferta de rede label.add.new.F5=Adicionar um novo F5 label.add.new.gateway=Adicionar novo gateway label.add.new.NetScaler=Adicionar um novo NetScaler +label.add.new.PA=Adicionar novo Palo Alto label.add.new.SRX=Adicionar um novo SRX label.add.new.tier=Adicionar nova camada +label.add.NiciraNvp.device=Adicionar Controlador Nvp +label.add.PA.device=Adicionar dispositivo Palo Alto label.add.physical.network=Adicionar rede f\u00edsica label.add.pod=Adicionar POD label.add.port.forwarding.rule=Adicionar regra de encaminhamento de porta label.add.primary.storage=Adicionar Storage Prim\u00e1rio +label.add.region=Adicionar Regi\u00e3o label.add.resources=Adicionar Recursos label.add.route=Adicionar rota label.add.rule=Adicionar regra @@ -288,7 +309,6 @@ label.add.template=Adicionar Template label.add.to.group=Adicionar ao grupo label.add.user=Adicionar Usu\u00e1rio label.add.vlan=Adicionar VLAN -label.add.vxlan=Adicionar VXLAN label.add.vm=Adicionar VM label.add.vms=Adicionar VMs label.add.vms.to.lb=Add VM(s) na regra de balanceamento de carga @@ -298,12 +318,16 @@ label.add.vpc=Adicionar VPC label.add.vpn.customer.gateway=Adicionar Gateway de VPN de usu\u00e1rio label.add.VPN.gateway=Adicionar gateway de VPN label.add.vpn.user=Adicionar usu\u00e1rio VPN +label.add.vxlan=Adicionar VXLAN label.add.zone=Adicionar Zona label.admin.accounts=Contas Administrativas label.admin=Administrador label.advanced=Avan\u00e7ado label.advanced.mode=Modo Avan\u00e7ado label.advanced.search=Busca Avan\u00e7ada +label.affinity=Afinidade +label.affinity.group=Grupo de Afinidade +label.affinity.groups=Grupos de Afinidade label.agent.password=Senha do Agente label.agent.username=Usu\u00e1rio do Agente label.agree=Concordo @@ -311,13 +335,21 @@ label.alert=Alerta label.algorithm=Algoritmo label.allocated=Alocado label.allocation.state=Status da Aloca\u00e7\u00e3o +label.anti.affinity=Anti-afinidade +label.anti.affinity.group=Grupo de Anti-afinidade +label.anti.affinity.groups=Grupos de Anti-afinidade label.api.key=API Key label.apply=Aplicar +label.app.name=CloudStack +label.archive.alerts=Guardar alertas +label.archive.events=Guardar eventos label.assign=Atribuir -label.assign.to.load.balancer=Atribuindo o Cloud Server ao Load Balancer +label.assign.to.load.balancer=Atribuindo Inst\u00e2ncia ao balanceador de carga label.associated.network.id=ID de Rede Associado label.associated.network=Rede associada label.attached.iso=Imagem ISO Plugada +label.author.email=E-mail do autor +label.author.name=Nome do autor label.availability=Availability label.availability.zone=Datacenter label.available=Dispon\u00edvel @@ -326,14 +358,19 @@ label.back=Voltar label.bandwidth=Bandwidth label.basic=B\u00e1sico label.basic.mode=Modo B\u00e1sico +label.bigswitch.controller.address=Endere\u00e7o do Controlador BigSwitch Vns label.bootable=Inicializ\u00e1vel label.broadcast.domain.range=Range do dom\u00ednio de Broadcast label.broadcast.domain.type=Tipo de Dom\u00ednio Broadcast label.broadcast.uri=URI de broadcast label.by.account=por Conta +label.by.alert.type=Por tipo de alerta label.by.availability=By Availability +label.by.date.end=Por data (final) +label.by.date.start=Por data (in\u00edcio) label.by.domain=por Dom\u00ednio label.by.end.date=por Data Final +label.by.event.type=Por tipo de evento label.by.level=por N\u00edvel label.by.pod=por Pod label.by.role=por Fun\u00e7\u00e3o @@ -370,7 +407,9 @@ label.clvm=CLVM label.code=C\u00f3digo label.community=Comunidade label.compute.and.storage=Processamento e Armazenamento +label.compute=Computa\u00e7\u00e3o label.compute.offering=Oferta de Computa\u00e7\u00e3o +label.compute.offerings=Oferta de Computa\u00e7\u00e3o label.configuration=Configura\u00e7\u00e3o label.configure=Configurar label.configure.ldap=Configurar LDAP @@ -379,6 +418,7 @@ label.configure.vpc=Configurar VPC label.confirmation=Confirma\u00e7\u00e3o label.confirm.password=Confirme a senha label.congratulations=Parab\u00e9ns\! +label.conserve.mode=Modo Conservativo label.console.proxy=Console proxy label.continue.basic.install=Continuar com a instala\u00e7\u00e3o b\u00e1sica label.continue=Continuar @@ -387,6 +427,7 @@ label.cpu.allocated=CPU Alocada label.cpu.allocated.for.VMs=CPU Alocada por VMs label.CPU.cap=CPU Cap label.cpu=CPU +label.cpu.limits=Limite de CPU label.cpu.mhz=CPU (em MHz) label.cpu.utilized=CPU Utilizada label.created.by.system=Criado pelo sistema @@ -396,6 +437,7 @@ label.create.project=Criar um projeto label.create.template=Criar template label.create.VPN.connection=Criar uma conex\u00e3o VPN label.cross.zones=Inter Zonas +label.custom.disk.iops=IOPS personalizado label.custom.disk.size=Tamanho Customizado label.daily=Di\u00e1rio label.data.disk.offering=Oferta de Disco Adicional @@ -408,9 +450,15 @@ label.dedicated=Dedicado label.default=Padr\u00e3o label.default.use=Uso padr\u00e3o label.default.view=Vis\u00e3o Padr\u00e3o +label.delete.affinity.group=Deletar Grupo de Afinidade +label.delete.alerts=Remover alertas +label.delete.BigSwitchVns=Remover Controlador BigSwitch Vns +label.delete.events=Remover eventos label.delete.F5=Remover F5 label.delete.gateway=delete gateway label.delete.NetScaler=Remover NetScaler +label.delete.NiciraNvp=Remover Controlador Nvp +label.delete.PA=Remover Palo Alto label.delete.project=Deletar projeto label.delete=Remover label.delete.SRX=Remover SRX @@ -438,11 +486,22 @@ label.disable.provider=Desabilitar Provider label.disable.vpn=Desabilitar VPN label.disabling.vpn.access=Desativando Acesso VPN label.disk.allocated=Disco Alocado +label.disk.bytes.read.rate=Taxa de Leitura do Disco (BPS) +label.disk.bytes.write.rate=Taxa de Escrita no Disco (BPS) +label.disk.iops.max=M\u00e1x IOPS +label.disk.iops.min=M\u00edn IOPS +label.disk.iops.read.rate=Taxa de Leitura do Disco (IOPS) +label.disk.iops.total=IOPS Total +label.disk.iops.write.rate=Taxa de Escrita no Disco (IOPS) label.disk.offering=Oferta de Disco +label.disk.read.bytes=Leitura do Disco (Bytes) +label.disk.read.io=Leitura do Disk (I/O) label.disk.size.gb=Tamanho (em GB) label.disk.size=Tamanho do Disco label.disk.total=Disco Total label.disk.volume=Disco +label.disk.write.bytes=Escrita no Disco (Bytes) +label.disk.write.io=Escrita no Disco (I/O) label.display.name=Nome de exibi\u00e7\u00e3o label.display.text=Descri\u00e7\u00e3o label.dns.1=DNS 1 @@ -459,6 +518,7 @@ label.done=Pronto label.double.quotes.are.not.allowed=Aspas duplas n\u00e3o s\u00e3o permitidas label.download.progress=Status do Download label.drag.new.position=Arrastar para uma nova posi\u00e7\u00e3o +label.edit.affinity.group=Editar Grupo de Afinidade label.edit=Editar label.edit.lb.rule=Editar regra de LB label.edit.network.details=Editar detalhes de rede @@ -466,6 +526,7 @@ label.edit.project.details=Editar detalhes do projeto label.edit.tags=Edite etiquetas label.edit.traffic.type=Editar tipo de tr\u00e1fego label.edit.vpc=Editar VPC +label.egress.default.policy=Pol\u00edtica de Entrada Padr\u00e3o label.egress.rule=Regra Egress label.egress.rules=Regras de sa\u00edda label.elastic=El\u00e1stico @@ -490,9 +551,12 @@ label.error.code=C\u00f3digo de Erro label.error=Erro label.ESP.encryption=Encripta\u00e7\u00e3o ESP label.ESP.hash=Hash ESP +label.ESP.lifetime=Tempo de vida do ESP (segundos) label.ESP.policy=Pol\u00edtica ESP label.esx.host=ESX/ESXi Host label.example=Examplo +label.expunge=Eliminar +label.external.link=Link externo label.f5=F5 label.failed=Falhou label.featured=Featured @@ -507,6 +571,7 @@ label.full.path=Path completo label.gateway=Gateway label.general.alerts=Alertas Gerais label.generating.url=Criando URL +label.gluster.volume=Disco label.go.step.2=V\u00e1 para passo 2 label.go.step.3=V\u00e1 para passo 3 label.go.step.4=V\u00e1 para passo 4 @@ -519,7 +584,7 @@ label.guest.gateway=Gateway de rede Convidado label.guest=Guest label.guest.ip=Endere\u00e7o IP Convidado label.guest.ip.range=Intervalo de rede convidado -label.guest.netmask=M\u00e1scara de rede Convidado +label.guest.netmask=M\u00e1scara de rede Guest label.guest.networks=Redes Guest label.guest.start.ip=IP de in\u00edcio do guest label.guest.traffic=Tr\u00e1fego de h\u00f3spedes @@ -528,6 +593,7 @@ label.ha.enabled=HA Ativado label.help=Ajuda label.hide.ingress.rule=Ocultar Regra de Entrada label.hints=Dicas +label.home=Home label.host.alerts=Alertas de Host label.host=Host label.host.MAC=Host MAC @@ -537,12 +603,15 @@ label.host.tags=Tags de Host label.hourly=A cada hora label.hypervisor.capabilities=Recursos de Virtualizador label.hypervisor=Hipervisor +label.hypervisors=Hypervisors +label.hypervisor.snapshot.reserve=Reserva de Snapshot do Hypervisor label.hypervisor.type=Tipo do Hypervisor label.hypervisor.version=Vers\u00e3o de Virtualizador label.id=ID label.IKE.DH=DH IKE label.IKE.encryption=Encripta\u00e7\u00e3o IKE label.IKE.hash=Hash IKE +label.IKE.lifetime=Tempo de vida IKE (segundos) label.IKE.policy=Pol\u00edtica IKE label.info=Info label.ingress.rule=Regra de Entrada @@ -563,10 +632,10 @@ label.installWizard.addZone.title=Adicionar zona label.installWizard.click.launch=Click no bot\u00e3o executar. label.installWizard.subtitle=Este tour vai auxiliar voc\u00ea na configura\u00e7\u00e3o da sua instala\u00e7\u00e3o de CloudStack&\#8482 label.installWizard.title=Ol\u00e1, seja bem vindo ao CloudStack&\#8482 -label.instance=Cloud Server -label.instance.limits=Limites do Cloud Server -label.instance.name=Nome do Cloud Server -label.instances=Cloud Servers +label.instance=Inst\u00e2ncia +label.instance.limits=Limites da Inst\u00e2ncia +label.instance.name=Nome da Inst\u00e2ncia +label.instances=Inst\u00e2ncias label.internal.dns.1=DNS 1 Interno label.internal.dns.2=DNS 2 Interno label.internal.name=Nome interno @@ -605,12 +674,19 @@ label.keyboard.type=Tipo de Teclado label.key=Chave label.kvm.traffic.label=Etiqueta de tr\u00e1fego KVM label.label=Etiqueta +label.lang.arabic=Arabe label.lang.brportugese=Portugu\u00eas brasileiro +label.lang.catalan=Catal\u00e3o label.lang.chinese=Chinese (Simplified) +label.lang.dutch=Holand\u00eas (Holanda) label.lang.english=English label.lang.french=Franc\u00eas +label.lang.german=Alem\u00e3o +label.lang.italian=Italiano label.lang.japanese=Japanese label.lang.korean=Coreano +label.lang.norwegian=Noruegu\u00eas +label.lang.polish=Polon\u00eas label.lang.russian=Russo label.lang.spanish=Spanish label.last.disconnected=Last Disconnected @@ -625,6 +701,7 @@ label.ldap.group.name=Grupo LDAP label.ldap.port=Porta do LDAP label.least.connections=Least connections label.level=N\u00edvel +label.linklocal.ip=Endere\u00e7o IP do Link Local label.load.balancer=Load Balancer label.load.balancing=Balanceamento de Carga label.load.balancing.policies=Pol\u00edticas de balanceamento de carga @@ -641,16 +718,22 @@ label.manage=Gerenciar label.management=Gerenciamento label.management.ips=Gerenciamento de Endere\u00e7os IP label.manage.resources=Gerenciar Recursos +label.max.cpus=M\u00e1ximo de cores de CPU label.max.guest.limit=Limite m\u00e1x. de guest label.maximum=M\u00e1ximo +label.max.memory=M\u00e1x. de mem\u00f3ria (MiB) label.max.networks=M\u00e1x. de redes +label.max.primary.storage=M\u00e1x. prim\u00e1rio (GiB) label.max.public.ips=M\u00e1x. IPs p\u00fablicos +label.max.secondary.storage=Max. Secund\u00e1rio (GiB) label.max.snapshots=Max. snapshots label.max.templates=M\u00e1x. templates label.max.vms=M\u00e1x. VMs de usu\u00e1rio label.max.volumes=M\u00e1x. volumes +label.max.vpcs=M\u00e1x. VPCs label.may.continue=Voc\u00ea pode continuar agora label.memory.allocated=Mem\u00f3ria Alocada +label.memory.limits=Limites de mem\u00f3ria (MiB) label.memory.mb=Mem\u00f3ria (em MB) label.memory=Mem\u00f3ria (em MB) label.memory.total=Mem\u00f3ria Total @@ -658,34 +741,35 @@ label.memory.used=Mem\u00f3ria Usada label.menu.accounts=Contas label.menu.alerts=Alertas label.menu.all.accounts=Todas as Contas -label.menu.all.instances=Todos Cloud Servers +label.menu.all.instances=Todas Inst\u00e2ncias label.menu.community.isos=ISOs P\u00fablicas label.menu.community.templates=Templates P\u00fablicos label.menu.configuration=Configura\u00e7\u00e3o label.menu.dashboard=Dashboard -label.menu.destroyed.instances=Cloud Servers Apagados +label.menu.destroyed.instances=Inst\u00e2ncias Apagadas label.menu.disk.offerings=Oferta de Discos -label.menu.domains=dom\u00ednios +label.menu.domains=Dom\u00ednios label.menu.events=Eventos label.menu.featured.isos=ISOs Customizada label.menu.featured.templates=Templates Customizados label.menu.global.settings=Configura\u00e7\u00f5es Globais label.menu.infrastructure=Infra-estrutura -label.menu.instances=Cloud Servers +label.menu.instances=Inst\u00e2ncias label.menu.ipaddresses=Endere\u00e7os IP label.menu.isos=ISOs label.menu.my.accounts=Minhas Contas -label.menu.my.instances=Meus Cloud Servers +label.menu.my.instances=Minhas Inst\u00e2ncias label.menu.my.isos=Minhas ISOs label.menu.my.templates=Meus Templates label.menu.network.offerings=Oferta de Rede label.menu.network=Rede label.menu.physical.resources=Recursos B\u00e1\u00adsicos -label.menu.running.instances=Cloud Servers Rodando +label.menu.regions=Regi\u00f5es +label.menu.running.instances=Inst\u00e2ncias Rodando label.menu.security.groups=Grupos de seguran\u00e7a -label.menu.service.offerings=Planos +label.menu.service.offerings=Oferta de Servi\u00e7os label.menu.snapshots=Snapshots -label.menu.stopped.instances=Cloud Servers Parados +label.menu.stopped.instances=Inst\u00e2ncias Paradas label.menu.storage=Storage label.menu.system.service.offerings=Ofertas do Sistema label.menu.system=Sistema @@ -695,18 +779,21 @@ label.menu.virtual.appliances=Appliance Virtual label.menu.virtual.resources=Recursos Virtuais label.menu.volumes=Discos label.migrate.instance.to.host=Migrar inst\u00e2ncia para outro host -label.migrate.instance.to=Migrar Cloud Server para +label.migrate.instance.to=Migrar Inst\u00e2ncia para label.migrate.instance.to.ps=Migrar inst\u00e2ncia para outro storage prim\u00e1rio label.migrate.router.to=Migrar Roteador para label.migrate.systemvm.to=Migrar VM de sistema para label.migrate.to.host=Migrar para outro host +label.migrate.to.storage=Migrar para storage label.migrate.volume=Migrar volume para outro storage prim\u00e1rio label.minimum=M\u00ed\u00adnimo label.minute.past.hour=minuto(s) \u00daltima hora +label.mode=Modo label.monday=Segunda label.monthly=Mensal label.more.templates=Mais Templates label.move.down.row=Mover uma c\u00e9lula para baixo +label.move.to.bottom=Mover para baixo label.move.to.top=Mover para o topo label.move.up.row=Mover uma c\u00e9lula para cima label.my.account=Minha Conta @@ -715,10 +802,11 @@ label.my.templates=Meus templates label.name=Nome label.name.optional=Nome (Opcional) label.nat.port.range=Range de Portas NAT -label.netmask=M\u00c3\u00a1srca de Rede +label.netmask=M\u00e1scara de Rede label.netScaler=NetScaler label.network.ACL=ACL de rede label.network.ACLs=Network ACLs +label.network.ACL.total=Total de rede ACL label.network.desc=Descri\u00e7\u00e3o de Rede label.network.device=Dispositivo de Rede label.network.device.type=Tipo de Dispositivo de Rede @@ -727,11 +815,13 @@ label.network.domain.text=Texto do dom\ufffdnio de rede label.network.id=ID de Rede label.networking.and.security=Rede e seguran\u00e7a label.network.label.display.for.blank.value=Utilizar gateway default +label.network.limits=Limites de rede label.network.name=Nome da Rede label.network.offering.display.text=Network Offering Display Text label.network.offering.id=Network Offering ID label.network.offering.name=Network Offering Name label.network.offering=Network Offering +label.network.rate.megabytes=Taxa de Rede (MB/s) label.network.rate=Taxa de Transfer\u00eancia label.network.read=Network Read label.network=Rede @@ -748,8 +838,11 @@ label.nexusVswitch=Nexus Vswitch label.nfs=NFS label.nfs.server=Servidor NFS label.nfs.storage=Storage NFS -label.nic.adapter.type=Tipo de adaptador NIC -label.nics=REDE +label.nic.adapter.type=Tipo de adaptador de Rede +label.nicira.controller.address=Endere\u00e7o do Controlador +label.nicira.l3gatewayserviceuuid=Uuid do Servi\u00e7o de Gateway L3 +label.nicira.transportzoneuuid=Uuid da Zona de Transporte +label.nics=Adaptadores de Rede label.no.actions=Sem A\u00e7\u00f5es Dispon\u00edveis label.no.alerts=Sem Alertas Recentes label.no.data=Sem dados para mostrar @@ -780,10 +873,14 @@ label.os.type=Tipo de SO label.owned.public.ips=IP P\u00fablico Utilizado label.owner.account=Dono da Conta label.owner.domain=Dono do Dom\u00ednio +label.PA.log.profile=Palo Alto Log Profile +label.PA=Palo Alto label.parent.domain=Dom\u00ednio Principal label.password.enabled=Senha Ativada label.password=Senha label.path=Caminho (Path) +label.PA.threat.profile=Palo Alto Threat Profile +label.perfect.forward.secrecy=Perfect Forward Secrecy label.physical.network.ID=ID da rede f\u00edsica label.physical.network=Rede F\u00edsica label.PING.CIFS.password=PING CIFS password @@ -793,6 +890,8 @@ label.PING.storage.IP=Disparar PING para IP do Storage label.planner.mode=Modo planejado label.please.specify.netscaler.info=Por favor especifique as informa\u00e7\u00f5es do Netscaler label.please.wait=Por Favor Aguarde +label.plugin.details=Detalhes do plugin +label.plugins=Plugins label.pod.name=Nome do Pod label.pod=POD label.pods=Pods @@ -806,6 +905,7 @@ label.prev=Prev label.primary.allocated=Aloca\u00e7\u00e3o do Storage Prim\u00e1rio label.primary.network=Rede Prim\u00e1ria label.primary.storage.count=Pools de Storage Prim\u00e1rios +label.primary.storage.limits=Limites do Storage Prim\u00e1rio (GiB) label.primary.storage=Storage Prim\u00e1rio label.primary.used=Uso do Storage Prim\u00e1rio label.private.Gateway=Gateway privado @@ -836,6 +936,7 @@ label.public.traffic=Tr\u00e1fego P\u00fablico label.public.zone=Zona P\u00fablica label.purpose=Prop\u00f3sito label.Pxe.server.type=Tipo de Servidor PXE +label.qos.type=Tipo de QoS label.quickview=Visualiza\u00e7\u00e3o r\u00e1pida label.quiesce.vm=Quiesce VM label.rbd.id=Usu\u00e1rio Ceph @@ -847,17 +948,20 @@ label.reboot=Reiniciar label.recent.errors=Erros Recentes label.redundant.router.capability=Recurso de roteador redundante label.redundant.router=Roteador Redundantee +label.redundant.state=Estado redundante label.refresh=Atualizar +label.region=Regi\u00e3o label.related=Relacionado label.remind.later=Me lembre depois label.remove.ACL=Remove ACL label.remove.egress.rule=Remover regra egress -label.remove.from.load.balancer=Removendo Cloud Server do Load Balancer +label.remove.from.load.balancer=Removendo Inst\u00e2ncia do balanceador de carga label.remove.ingress.rule=Remover regra ingress label.remove.ip.range=Remover range de IP label.remove.ldap=Remover LDAP label.remove.pf=Remover regra de redirecionamento de porta label.remove.project.account=Remover conta de projeto +label.remove.region=Remover Regi\u00e3o label.remove.rule=Remover regra label.remove.static.nat.rule=Remover regra de NAT est\u00e1tico label.remove.static.route=Remover rota est\u00e1tica @@ -869,7 +973,7 @@ label.removing.user=Removendo Usu\u00e1rio label.required=Obrigat\u00f3rio label.reserved.system.gateway=Gateway de sistema reservado label.reserved.system.ip=IP de Sistema Reservado -label.reserved.system.netmask=M\u00e1scara de rede do sistema reservado +label.reserved.system.netmask=M\u00e1scara de rede reservada do sistema label.reset.VPN.connection=Resetar a conex\u00e3o VPN label.resize.new.offering.id=New Offering label.resize.new.size=New Size(GB) @@ -887,7 +991,9 @@ label.revoke.project.invite=Revogar convite label.role=Fun\u00e7\u00e3o label.root.disk.controller=Controlador do disco Root label.root.disk.offering=Oferta de Disco ROOT +label.root.disk.size=Tamanho do disco root label.round.robin=Round-robin +label.routing=Roteamento label.rules=Regras label.running.vms=VMs Rodando label.s3.access_key=Chave de acesso @@ -895,6 +1001,8 @@ label.s3.bucket=Balde label.s3.connection_timeout=Tempo limite de conex\u00e3o label.s3.endpoint=Ponto de acesso label.s3.max_error_retry=Limite de tentativas de recupera\u00e7\u00e3o de erro +label.s3.nfs.path=Caminho NFS S3 +label.s3.nfs.server=Servidor NFS S3 label.s3.secret_key=Chave Secreta label.s3.socket_timeout=Tempo limite no socket label.s3.use_https=Use HTTPS @@ -905,6 +1013,7 @@ label.saving.processing=Salvando.... label.scope=Escopo label.search=Pesquisar label.secondary.storage.count=Pools de Storage secund\u00e1rios +label.secondary.storage.limits=Limites do Storage Secund\u00e1rio (GiB) label.secondary.storage=Storage Secund\u00e1rio label.secondary.storage.vm=VM de storage secund\u00e1rio label.secondary.used=Uso do Storage Secund\u00c3\u00a1rio @@ -928,6 +1037,7 @@ label.sent=Enviado label.server=Servidor label.service.capabilities=Recursos de servi\u00e7os label.service.offering=Plano +label.service.state=Estado do Servi\u00e7o label.session.expired=Sess\u00e3o Expirada label.setup=Configura\u00e7\u00e3o label.setup.network=Configurar Rede @@ -936,6 +1046,7 @@ label.set.up.zone.type=Configurar tipo de zona label.shared=Compatilhado label.SharedMountPoint=SharedMountPoint label.show.ingress.rule=Mostrar Regra de Entrada +label.shutdown.provider=Desabilitar provider label.site.to.site.VPN=Site-to-site VPN label.size=Tamanho label.skip.guide=Eu utilizei o CloudStack antes, pular este guia @@ -944,9 +1055,11 @@ label.smb.password=Senha SMB label.smb.username=Usu\u00e1rio SMB label.snapshot.limits=Limites de Snapshot label.snapshot.name=Nome do Snapshot +label.snapshot.schedule=Configure Snapshots recorrentes label.snapshot=Snapshot label.snapshot.s=Snapshot (s) label.snapshots=Snapshots +label.sockets=Sockets label.source.nat=Source NAT label.source=Origem label.specify.IP.ranges=Especifique range de IP @@ -976,6 +1089,7 @@ label.step.4=Passo 4 label.step.4.title=Passo 4\: Rede label.step.5=Passo 5 label.step.5.title=Passo 5\: Revisar +label.stickiness=Ader\u00eancia label.sticky.cookie-name=Nome do Cookie label.sticky.domain=Dom\u00ednio label.sticky.expire=Expires @@ -986,6 +1100,7 @@ label.sticky.mode=Modo label.sticky.nocache=Sem Cache label.sticky.postonly=Apenas publicar label.sticky.prefix=Prefixo +label.sticky.request-learn=Solicitar para aprender label.sticky.tablesize=Tamanho da Tabela label.stop=Parar label.stopped.vms=VMs Paradas @@ -1002,6 +1117,7 @@ label.super.cidr.for.guest.networks=Super CIDR para redes h\u00f3spedes label.supported.services=Servi\u00e7os Suportados label.supported.source.NAT.type=Tipo de Source NAT Suportado label.suspend.project=Suspender Projeto +label.switch.type=Tipo de Switch label.system.capacity=Capacidade do Sistema label.system.offering=Ofertas de Sistema label.system.service.offering=System Service Offering @@ -1057,6 +1173,7 @@ label.used=Usado label.username=Nome de usu\u00e1rio label.users=Usu\u00e1rios label.user=Usu\u00e1rio +label.use.vm.ip=Usar IP da VM\: label.value=Valor label.vcdcname=Nome do vCenter DC label.vcenter.cluster=vCenter Cluster @@ -1071,6 +1188,7 @@ label.view.all=Visualizar tudo label.view.console=Visualizar Console label.viewing=Visualizar label.view.more=Ver mais +label.view.secondary.ips=Visualizar os IPs secund\u00e1rios label.view=Visualizar label.virtual.appliance=Appliance Virtual label.virtual.appliances=Appliance Virtual @@ -1081,10 +1199,8 @@ label.virtual.routers=Roteadores Virtuais label.vlan.id=VLAN ID label.vlan.range=Intervalo de VLAN label.vlan=VLAN -label.vxlan.id=VXLAN ID -label.vxlan.range=Intervalo de VXLAN -label.vxlan=VXLAN -label.vm.add=Adicionar Cloud Server +label.vlan.vni.range=Intervalo de VLAN +label.vm.add=Adicionar Inst\u00e2ncia label.vm.destroy=Apagar label.vm.display.name=Nome de exibi\u00e7\u00e3o da VM label.VMFS.datastore=VMFS datastore @@ -1092,6 +1208,10 @@ label.vmfs=VMFS label.vm.name=Nome da VM label.vm.reboot=Reiniciar label.VMs.in.tier=M\u00e1quinas virtuais em camadas +label.vmsnapshot.current=isCurrent +label.vmsnapshot.memory=Snapshot da mem\u00f3ria +label.vmsnapshot.parentname=Pai +label.vmsnapshot=Snapshot da VM label.vmsnapshot.type=Tipo label.vm.start=In\u00edcio label.vm.state=Estado da VM @@ -1118,6 +1238,9 @@ label.vsmctrlvlanid=Control VLAN ID label.vsmpktvlanid=Packet VLAN ID label.vsmstoragevlanid=Storage VLAN ID label.vsphere.managed=vSphere Managed +label.vxlan.id=VXLAN ID +label.vxlan.range=Intervalo de VXLAN +label.vxlan=VXLAN label.waiting=Aguardando label.warn=Avisar label.wednesday=Quarta-Feira @@ -1138,17 +1261,18 @@ label.zones=Zonas label.zone.type=Tipo de Zona label.zone.wide=Zone-Wide label.zoneWizard.trafficType.guest=H\u00f3spede\: tr\u00e1fego entre m\u00e1quinas virtuais de usu\u00e1rios finais -label.zoneWizard.trafficType.management=Ger\u00eancia\: tr\u00e1fego entre recursos internos do CloudStack, incluindo quaisquer componentes que se comunicam com o servidor de gerenciamento, tais como hosts e m\u00e1quinas virtuais de sistema do CloudStack +label.zoneWizard.trafficType.management=Ger\u00eancia\: Tr\u00e1fego entre recursos internos do CloudStack incluindo quaisquer componentes que se comunicam com o servidor de gerenciamento tais como hosts e m\u00e1quinas virtuais de sistema do CloudStack label.zoneWizard.trafficType.public=P\u00fablico\: tr\u00e1fego entre a internet e m\u00e1quinas virtuais na nuvem. label.zoneWizard.trafficType.storage=Storage\: tr\u00e1fego entre servidores de storage prim\u00e1ria e secund\u00e1ria, tais como templates de m\u00e1quinas virtuais e snapshots label.zone=Zona managed.state=Status do Gerenciamento +message.acquire.ip.nic=Por favor, confirme que voc\u00ea deseja adquirir um novo IP secund\u00e1rio para esta Interface de Rede.
NOTA\: Voc\u00ea precisa configurar manualmente o novo IP secund\u00e1rio dentro da maquinas virtual. message.acquire.new.ip=Por favor confirme que voc\u00ea gostaria de adquirir um novo IP para esta rede. message.acquire.new.ip.vpc=Por favor confirme que voc\u00ea gostaria de adquirir um novo IP para esta VPC. message.acquire.public.ip=Selecione a zona de onde voc\u00ea deseja adquirir o novo IP message.action.cancel.maintenance=A Manuten\u00e7\u00e3o do seu HOST foi cancelada com sucesso message.action.cancel.maintenance.mode=Confirme que voc\u00ea deseja cancelar esta Manuten\u00e7\u00e3o -message.action.change.service.warning.for.instance=Para troca de plano \u00e9 necess\u00e1rio parar o Cloud Server. +message.action.change.service.warning.for.instance=Sua inst\u00e2ncia deve ser desligada antes de tentar alterar a oferta de servi\u00e7os utilizada. message.action.change.service.warning.for.router=O roteador precisa ser desligado antes de trocar o plano/tamanho. message.action.delete.cluster=Confirme que voc\u00ea deseja excluir este HOST message.action.delete.disk.offering=Confirme que voc\u00ea deseja excluir esta oferta de disco @@ -1160,6 +1284,7 @@ message.action.delete.ISO=Confirme que voc\u00ea deseja excluir esta ISO message.action.delete.ISO.for.all.zones=Esta ISO \u00e9 usada por todas as Zonas. Confirme se voc\u00ea deseja excluir a ISO de todas as Zonas message.action.delete.network=Confirme que voc\u00ea deseja remover esta rede. message.action.delete.nexusVswitch=Por favor confirme que voc\ufffd deseja remover este nexusVswitch. +message.action.delete.nic=Por favor, confirme que deseja remover esta Interface de Rede, esta a\u00e7\u00e3o tamb\u00e9m ir\u00e1 remover a rede associada \u00e0 VM. message.action.delete.physical.network=Por favor confirme que voc\u00ea deseja deletar esta rede f\u00edsica message.action.delete.pod=Confirme que voc\u00ea deseja remover este POD. message.action.delete.primary.storage=Confirme que voc\u00ea deseja remover este Storage Prim\u00e1rio. @@ -1172,7 +1297,7 @@ message.action.delete.template=Confirme que voc\u00ea deseja remover este Templa message.action.delete.template.for.all.zones=Este Template \u00e9 usado por todas as zonas. Confirme que voc\u00ea deseja remover o Template de todas as zonas. message.action.delete.volume=Confirme que voc\u00ea deseja remover este Disco. message.action.delete.zone=Confirme que voc\u00ea deseja remover esta Zona. -message.action.destroy.instance=Confirme que voc\u00ea deseja excluir este Cloud Server. +message.action.destroy.instance=Por favor, confirme que voc\u00ea deseja excluir esta Inst\u00e2ncia. message.action.destroy.systemvm=Confirme que voc\u00ea deseja excluir esta VM de Sistema. message.action.disable.cluster=Confirma a desativa\u00e7\u00e3o do cluster. message.action.disable.nexusVswitch=Por favor confirme que voc\ufffd deseja desabilitar este nexusVswitch @@ -1188,27 +1313,31 @@ message.action.enable.nexusVswitch=Por favor confirme que voc\ufffd deseja habil message.action.enable.physical.network=Por favor confirme que voc\u00ea deseja habilitar esta rede f\u00edsica. message.action.enable.pod=Confirma a ativa\u00e7\u00e3o do POD. message.action.enable.zone=Confirma a ativa\u00e7\u00e3o da zona. +message.action.expunge.instance=Por favor, confirme que voc\u00ea deseja eliminar esta inst\u00e2ncia. message.action.force.reconnect=O procedimento de reconex\u00e3o for\u00e7ada foi preparado com sucesso. Este processo poder\u00e1 levar alguns minutos. -message.action.host.enable.maintenance.mode=Ativar o modo de Manuten\u00e7\u00e3o ir\u00e1 causar o live migration de todos Cloud Server hospedados neste Host para o pr\u00f3ximo dispon\u00edvel. +message.action.host.enable.maintenance.mode=Ativar o modo de Manuten\u00e7\u00e3o ir\u00e1 causar o live migration de todas as Inst\u00e2ncias hospedadas neste Host para o pr\u00f3ximo dispon\u00edvel. message.action.instance.reset.password=Por favor confirme que voc\u00ea deseja alterar a senha de ROOT para est\u00e1 m\u00e1quina virtual. message.action.manage.cluster=Confirma a vincula\u00e7\u00e3o do cluster. message.action.primarystorage.enable.maintenance.mode=Aviso\: Colocar o Storage prim\u00e1rio em modo de Manuten\u00e7\u00e3o ir\u00e1 causar a parada de todas as VMs hospedadas nesta unidade. Deseja continuar? -message.action.reboot.instance=Confirme que voc\u00ea deseja reiniciar este Cloud Server. +message.action.reboot.instance=Por favor, confirme que voc\u00ea deseja reiniciar esta inst\u00e2ncia. message.action.reboot.router=Confirme que voc\ufffd deseja reiniciar este roteador. message.action.reboot.systemvm=Confirme que voc\u00ea deseja reiniciar esta VM de sistema. message.action.release.ip=Confirme que voc\u00ea deseja liberar este IP. message.action.remove.host=Favor confirmar que voc\u00ea deseja remover este host. -message.action.reset.password.off=Seu Cloud Server n\u00e3o suporta esta funcionalidade. -message.action.reset.password.warning=Para recuperar a senha \u00e9 necess\u00e1rio parar o Cloud Server. -message.action.restore.instance=Confirme que voc\u00ea deseja restaurar este Cloud Server. -message.action.start.instance=Confirme que voc\u00ea deseja iniciar este Cloud Server. +message.action.reset.password.off=Sua Inst\u00e2ncia n\u00e3o suporta esta funcionalidade. +message.action.reset.password.warning=Para recuperar a senha \u00e9 necess\u00e1rio parar a Inst\u00e2ncia. +message.action.restore.instance=Por favor, confirme que voc\u00ea deseja restaurar esta Inst\u00e2ncia. +message.action.revert.snapshot=Por favor, confirme que voc\u00ea deseja reverter o seu volume deste snapshot. +message.action.start.instance=Por favor, confirme que voc\u00ea deseja iniciar esta Inst\u00e2ncia. message.action.start.router=Confirme que voc\u00ea deseja inciar este roteador. message.action.start.systemvm=Confirme que voc\u00ea deseja iniciar esta VM de sistema. -message.action.stop.instance=Confirme que voc\u00ea deseja parar este Cloud Server. +message.action.stop.instance=Por favor, confirme que voc\u00ea deseja parar esta inst\u00e2ncia. message.action.stop.router=Confirme que voc\ufffd deseja parar este roteador. message.action.stop.systemvm=Confirme que voc\u00ea deseja parar esta VM de Sistema. message.action.take.snapshot=Por favor confirme que voc\u00ea deseja criar um snapshot deste volume. message.action.unmanage.cluster=Confirma a desvincula\u00e7\u00e3o do cluster. +message.action.vmsnapshot.delete=Por favor, confirme que voc\u00ea deseja excluir este snapshot da VM. +message.action.vmsnapshot.revert=Reverter snapshot da VM message.activate.project=Voc\u00ea tem certeza que deseja ativar este projeto ? message.add.cluster=Add a hypervisor managed cluster for zone , pod message.add.cluster.zone=Add a hypervisor managed cluster for zone @@ -1223,14 +1352,16 @@ message.adding.Netscaler.provider=Adicionando Netscaler provider message.add.ip.range=Add an IP range to public network in zone message.add.ip.range.direct.network=Add an IP range to direct network in zone message.add.ip.range.to.pod=

Add an IP range to pod\:

-message.additional.networks.desc=Selecione a(s) rede(s) adicionais que seu Cloud Server ter\u00c3\u00a1 acesso. +message.additional.networks.desc=Por favor, selecione a(s) rede(s) adicionais que sua inst\u00e2ncia virtual estar\u00e1 conectada. message.add.load.balancer=Add a load balancer to zone message.add.load.balancer.under.ip=A regra do balanceador de carga foi adicionada para o IP\: message.add.network=Add a new network for zone\: message.add.new.gateway.to.vpc=Favor especificar a informa\u00e7\u00e3o para adicionar um novo gateway a esta VPC. message.add.pod=Add a new pod for zone +message.add.pod.during.zone.creation=Cada zona deve conter um ou mais pods e iremos adicionar o primeiro pod agora. Um pod cont\u00e9m hosts e servidores de storage prim\u00e1rio que ser\u00e3o adicionados em uma etapa posterior. Inicialmente, configure um intervalo de endere\u00e7os IP reservados para o tr\u00e1fego de gerenciamento interno do CloudStack. A faixa de IP reservados devem ser \u00fanicos para cada zona na nuvem. message.add.primary=Especifique os seguintes par\u00e2metros para adicionar um novo Storage prim\u00e1rio. message.add.primary.storage=Adicionar novo Storage prim\u00e1rio \u00c3\u00a0 zona , pod +message.add.region=Por favor, especifique as informa\u00e7\u00f5es necess\u00e1rias para adicionar uma nova regi\u00e3o. message.add.secondary.storage=Add a new storage for zone message.add.service.offering=Por favor preencha os dados abaixo para adicionar uma nova oferta de computa\u00e7\u00e3o. message.add.system.service.offering=Por favor preencha os dados abaixo para adicionar uma nova oferta de servi\u00e7o de sistema. @@ -1245,10 +1376,10 @@ message.after.enable.swift=Swift Configurado. Nota\: Ap\u00f3s deixar esta p\u00 message.alert.state.detected=Alerta de estado detectado message.allow.vpn.access=Entre com nome de Usu\u00e1rio e senha do Usu\u00e1rio que ter\u00e1 acesso VPN. message.apply.snapshot.policy=Voc\u00ea atualizou com sucesso sua pol\u00edtica de Snapshot. -message.attach.iso.confirm=Confirme que voc\u00ea deseja conectar a ISO ao Cloud Server. -message.attach.volume=Preencha os seguintes dados para conectar o novo disco. Se voc\u00ea Est\u00e1 conectando um disco a um Cloud Server Windows, ser\u00e1 necess\u00e1rio reiniciar o Cloud Server para visualizar o novo disco. -message.basic.mode.desc=Escolha este modelo de rede se voc\u00ea *n\u00e3o* quer suporte a VLAN. Todo Cloud Server criado neste modelo de rede estar\u00e1 ligado diretamente a um IP da rede e ser\u00e1 usado Security Groups para prover seguran\u00e7a e separa\u00e7\u00e3o. -message.change.offering.confirm=Confirme que voc\u00ea deseja mudar o plano deste Cloud Server. +message.attach.iso.confirm=Por favor, confirme que voc\u00ea deseja conectar o ISO \u00e0 esta inst\u00e2ncia virtual. +message.attach.volume=Preencha os seguintes dados para conectar o novo disco. Se voc\u00ea Est\u00e1 conectando um disco a uma maquina virtual Windows, ser\u00e1 necess\u00e1rio reiniciar a Inst\u00e2ncia para visualizar o novo disco. +message.basic.mode.desc=Escolha este modelo de rede se voc\u00ea *n\u00e3o* quer suporte a VLAN. Toda Inst\u00e2ncia criada neste modelo de rede estar\u00e1 ligado diretamente a um IP da rede e ser\u00e1 usado Security Groups para prover seguran\u00e7a e segrega\u00e7\u00e3o. +message.change.offering.confirm=Por favor, confirme que voc\u00ea deseja mudar a oferta de servi\u00e7o desta inst\u00e2ncia virtual. message.change.password=Por favor, troque sua senha. message.configure.all.traffic.types=Voc\u00ea tem m\u00faltiplas redes f\u00edsicas; favor configurar etiquetas para cada tipo de tr\u00e1fego clicando no bot\u00e3o Edit. message.configure.ldap=Por favor, confirme que voc\u00ea deseja configurar o LDAP. @@ -1259,6 +1390,7 @@ message.configuring.storage.traffic=Configurando tr\u00e1fego de storage message.confirm.action.force.reconnect=Por favor confirme que voc\u00ea deseja for\u00e7ar a reconex\u00e3o com este host. message.confirm.delete.F5=Por favor confirme que voc\u00ea deseja remover o F5 message.confirm.delete.NetScaler=Por favor confirme que voc\u00ea deseja remover o NetScaler +message.confirm.delete.PA=Por favor, confirme que voc\u00ea deseja remover Palo Alto message.confirm.delete.SRX=Por favor confirme que voc\u00ea deseja remover o SRX message.confirm.destroy.router=Por favor confirme que voc\u00ea gostaria de destruir este roteador message.confirm.disable.provider=Por favor confirme que voc\u00ea gostaria de desabilitar este provider @@ -1279,15 +1411,24 @@ message.creating.primary.storage=Criando storage prim\u00e1rio message.creating.secondary.storage=Criando storage secund\u00e1rio message.creating.zone=Criando zona. message.decline.invitation=Voc\u00ea tem certeza que quer rejeitar este convite de projeto ? +message.dedicate.zone=Zona dedicada message.delete.account=Confirme se voc\u00ea deseja excluir esta conta. +message.delete.affinity.group=Por favor, confirme que voc\u00ea deseja remover este grupo de afinidade message.delete.gateway=Favor confirmar que voc\u00ea deseja deleta o gateway message.delete.project=Voc\u00ea tem certeza que deseja deletar este projeto ? message.delete.user=Por favor confirme que voc\u00ea deseja deletar este usu\u00e1rio. message.delete.VPN.connection=Favor confirmar que voc\u00ea deseja deletar esta conex\u00e3o VPN message.delete.VPN.customer.gateway=Favor confirmar que voc\u00ea deseja deletar este gateway de VPN de usu\u00e1rio message.delete.VPN.gateway=Favor confirmar que voc\u00ea deseja deletar este gateway de VPN +message.desc.advanced.zone=Para topologias de rede mais sofisticadas. Este modelo fornece maior flexibilidade na defini\u00e7\u00e3o de redes de clientes e fornece ofertas de rede personalizadas, tais como firewall, VPN ou de balanceamento de carga. +message.desc.basic.zone=Fornece uma \u00fanica rede onde em cada inst\u00e2ncia de VM \u00e9 atribu\u00eddo um IP diretamente na rede. O isolamento Guest podem ser fornecidos atrav\u00e9s de camada-3 da rede com grupos de seguran\u00e7a (filtragem da fonte de endere\u00e7os IP). +message.desc.cluster=Cada pod deve conter um ou mais clusters, e iremos adicionar o primeiro cluster agora. Um cluster fornece uma maneira de agrupamento de hosts. Os hosts de um cluster t\u00eam hardware id\u00eantico, executam o mesmo hypervisor, est\u00e3o na mesma sub-rede e acessam o mesmo storage compartilhado. Cada cluster \u00e9 constitu\u00eddo por um ou mais hosts e um ou mais servidores de storage prim\u00e1rio. +message.desc.host=Cada cluster deve conter pelo menos um host (computador) para as VMs guest serem executadas e iremos adicionar o primeira host agora. Para um host funcionar no CloudStack, voc\u00ea deve instalar um hypervisor no host, atribuir um endere\u00e7o IP e garantir que o host est\u00e1 conectado ao servidor de gerenciamento do CloudStack.

Forne\u00e7a o hostname ou o endere\u00e7o IP do host, o nome de usu\u00e1rio (geralmente root) e a senha e qualquer label que voc\u00ea utiliza para categorizar os hosts. +message.desc.primary.storage=Cada cluster deve conter um ou mais servidores de storage prim\u00e1rio e iremos adicionar o primeiro agora. Um storage prim\u00e1rio, cont\u00e9m os volumes de disco para todas as VMs em execu\u00e7\u00e3o nos hosts do cluster. Utiliza qualquer protocolo compat\u00edvel com os padr\u00f5es que \u00e9 suportado pelo hypervisor utilizado. +message.desc.secondary.storage=Cada zona deve ter pelo menos um NFS ou servidor de storage secund\u00e1rio e iremos adicionar o primeiro agora. Um storage secund\u00e1rios armazena templates de VM, imagens ISO e snapshots do volume de disco da VM. Esse servidor deve estar dispon\u00edvel para todos os hosts na zona.

Fornecer o endere\u00e7o IP e o caminho exportados. +message.desc.zone=Uma zona \u00e9 a maior unidade organizacional no CloudStack e normalmente corresponde \u00e0 um \u00fanico datacenter. As Zonas disponibilizam isolamento f\u00edsico e redund\u00e2ncia. Uma zona \u00e9 composta por um ou mais pods (cada um dos quais cont\u00e9m os hosts e servidores de storage prim\u00e1rio) e um servidor de storage secund\u00e1rio que \u00e9 compartilhado por todos os pods na zona. message.detach.disk=Voc\u00ea tem certeza que deseja desconectar este disco ? -message.detach.iso.confirm=Confirme se voc\u00ea deseja desconectar a ISO do Cloud Server. +message.detach.iso.confirm=Confirme se voc\u00ea deseja desconectar o ISO da inst\u00e2ncia virtual. message.disable.account=Por favor confirme que voc\u00ea deseja desabilitar esta conta. Ap\u00f3s desabilitar uma conta, todos os usu\u00e1rios desta conta n\u00e3o ir\u00e3o possuir mais acesso aos seus recursos da cloud. Todas as m\u00e1quinas virtuais ser\u00e3o automaticamente desligadas. message.disable.snapshot.policy=Voc\u00ea desativou com sucesso sua pol\u00edtica de Snapshot. message.disable.user=Por favor confirme que voc\u00ea deseja desabilitar este usu\u00e1rio. @@ -1311,6 +1452,8 @@ message.enabling.security.group.provider=Habilitar provider de grupo de seguran\ message.enabling.zone=Habilitando zona message.enter.token=Por favor entre o token que voc\u00ea recebeu no e-mail privado. message.generate.keys=Por favor confirme que voc\u00ea deseja gerar novas chaves para este usu\u00e1rio. +message.guest.traffic.in.advanced.zone=O tr\u00e1fego de rede guest \u00e9 para comunica\u00e7\u00e3o entre m\u00e1quinas virtuais do usu\u00e1rio final. Especifique um intervalo de IDs de VLAN para transportar o tr\u00e1fego do guest para cada rede f\u00edsica. +message.guest.traffic.in.basic.zone=O tr\u00e1fego de rede guest \u00e9 para comunica\u00e7\u00e3o entre m\u00e1quinas virtuais do usu\u00e1rio final. Especifique um intervalo de endere\u00e7os IP para que CloudStack possa atribuir \u00e0s VMs. Certifique-se que este intervalo n\u00e3o se sobreponha o range de IPs reservados do sistema. message.installWizard.click.retry=Click no bot\u00e3o para tentar executar novamente. message.installWizard.copy.whatIsACluster=Um cluster prov\u00ea uma maneira de agrupar hosts. Os hosts em um cluster tem hardware id\u00eantico, rodam o mesmo hypervisor, est\u00e3o na mesma subnet, acessam o mesmo storage compartilhado. Inst\u00e2ncias de m\u00e1quinas virtuais (VMs) podem ser migradas a quente - live migration - de um host para outro host no mesmo cluster, sem interromper o servi\u00e7o para o usu\u00e1rio. Um Cluster \u00e9 a terceira maior unidade organizacional em uma instala\u00e7\u00e3o CloudStack&\#8482; . Clusters est\u00e3o contidos em pods e pods est\u00e3o contidos em zonas.

O CloudStack&\#8482; permite m\u00faltiplos clusters em uma mesma cloud, entretanto para a instala\u00e7\u00e3o b\u00e1sica, n\u00f3s iremos precisar apenas de um cluster. message.installWizard.copy.whatIsAHost=Um host \u00e9 um \u00fanico computador. Os Hosts prov\u00eaem os recursos computacionais para executar as m\u00e1quinas virtuais. Cada host possu\u00ed o software do hypervisor instalado nele para gerenciar as guest VMs (Exceto os hosts bare metal, que s\u00e3o um caso especial discutido no Guia Avan\u00e7ado de Instala\u00e7\u00e3o). Por exemplo, um servidor Linux com KVM habilitado, um servidor Citrix XenServer e um servidor ESXi s\u00e3o hosts. Na Instala\u00e7\u00e3o B\u00e1sica, n\u00f3s utilizamos um \u00fanico host rodando XenServer ou KVM.

O host \u00e9 a menor unidade organizacional dentro de uma instala\u00e7\u00e3o CloudStack&\#8482; . Hosts est\u00e3o contidos dentro de Clusters, clusters est\u00e3o contidos dentro de pods e pods est\u00e3o contidos dentro de zonas. @@ -1340,25 +1483,26 @@ message.installWizard.tooltip.addZone.internaldns1=Estes s\u00e3o os servidores message.installWizard.tooltip.addZone.internaldns2=Estes s\u00e3o os servidores DNS utilizados pelas VMs de sistema nesta zona. Estes servidores DNS ser\u00e3o acessados atrav\u00e9s da interface de rede privada das VMs de sistema. O endere\u00e7o IP privado que voc\u00ea configurar para os pods deve possuir uma rota para os servidores DNS configurados aqui. message.installWizard.tooltip.addZone.name=Um nome para a zona message.installWizard.tooltip.configureGuestTraffic.description=Uma descri\u00e7\u00e3o da sua rede -message.installWizard.tooltip.configureGuestTraffic.guestEndIp=O range de endere\u00e7os IP que estar\u00e1 dispon\u00edvel para aloca\u00e7\u00e3o para os guests nesta zona. Caso uma NIC seja utilizada, estes IPs devem estar no mesmo CIDR que o CIDR do pod. +message.installWizard.tooltip.configureGuestTraffic.guestEndIp=O range de endere\u00e7os IP que estar\u00e1 dispon\u00edvel para aloca\u00e7\u00e3o para os guests nesta zona. Caso uma Interface de Rede seja utilizada, estes IPs devem estar no mesmo CIDR que o CIDR do pod. message.installWizard.tooltip.configureGuestTraffic.guestGateway=O gateway que os guests devem usar message.installWizard.tooltip.configureGuestTraffic.guestNetmask=A m\u00e1scara de rede da subrede que os guests devem usar -message.installWizard.tooltip.configureGuestTraffic.guestStartIp=O range de endere\u00e7os IP que estar\u00e1 dispon\u00edvel para aloca\u00e7\u00e3o para os guests nesta zona. Caso uma NIC seja utilizada, estes IPs devem estar no mesmo CIDR que o CIDR do pod. +message.installWizard.tooltip.configureGuestTraffic.guestStartIp=O range de endere\u00e7os IP que estar\u00e1 dispon\u00edvel para aloca\u00e7\u00e3o para os guests nesta zona. Caso uma Interface de Rede seja utilizada, estes IPs devem estar no mesmo CIDR que o CIDR do pod. message.installWizard.tooltip.configureGuestTraffic.name=Um nome para sua rede message.instanceWizard.noTemplates=Voc\u00ea n\u00e3o possui nenhum template dispon\u00edvel; por favor adicione um template compat\u00edvel e reinicie o wizard de inst\u00e2ncia. message.ip.address.changed=Seu endere\u00e7o IP pode ter mudado; voc\u00ea gostaria de atualizar a listagem ? Note que neste caso o painel de detalhes ir\u00e1 fechar. message.iso.desc=Imagem de disco contendo dados ou m\u00eddia de sistema operacional boot\u00e1vel message.join.project=Voc\u00ea agora entrou em um projeto. Por favor troque para a vis\u00e3o de Projeto para visualizar o projeto. -message.launch.vm.on.private.network=Voc\u00ea deseja executar sua inst\u00e2ncia na sua pr\u00f3pria rede privada dedicada ? -message.launch.zone=A zona est\u00e1 pronta para ser executada; por favor continue para o pr\u00f3ximo passo. +message.launch.vm.on.private.network=Voc\u00ea deseja executar a sua inst\u00e2ncia na sua pr\u00f3pria rede privada dedicada? +message.launch.zone=A zona est\u00e1 pronta para ser executada; por favor, v\u00e1 para o pr\u00f3ximo passo. message.lock.account=Confirme se voc\u00ea deseja bloquear esta conta. Bloqueando a conta, todos os Usu\u00e1rios desta conta n\u00e3o estar\u00e3o mais habilitados a gerenciar os recursos na nuvem. Os recursos existentes (Cloud Server) ainda poder\u00e3o ser acessados. -message.migrate.instance.confirm=Confirme o host que voc\u00ea deseja migrar o Cloud Server. +message.migrate.instance.confirm=Confirme o host que voc\u00ea deseja migrar a inst\u00e2ncia virtual. message.migrate.instance.to.host=Por favor confirme que voc\u00ea deseja migrar a inst\u00e2ncia para outro host. message.migrate.instance.to.ps=Por favor confirme que voc\u00ea deseja migrar a inst\u00e2ncia para outro storage prim\u00e1rio. message.migrate.router.confirm=Por favor confirme o host que voc\u00ea deseja migrar o roteador para\: message.migrate.systemvm.confirm=Por favor confirme o host para o qual voc\u00ea deseja migrar a VM de sistema\: message.migrate.volume=Por favor confirme que voc\u00ea deseja migrar o volume para outro storage prim\u00e1rio. message.new.user=Especifique abaixo para adicionar novos usu\u00e1rios para a conta +message.no.affinity.groups=Voc\u00ea n\u00e3o tem nenhum grupo de afinidade. Por favor, v\u00e1 para o pr\u00f3ximo passo. message.no.network.support.configuration.not.true=Voc\u00ea n\u00e3o possui nenhuma zona com grupos de seguran\u00e7a habilitado. Assim sendo, n\u00e3o possui recursos adicionais de rede. Por favor continue para o passo 5. message.no.network.support=O hypervisor escolhido, vSphere, n\u00e3o possui nenhum recurso de rede adicional. Por favor, v\u00e1 para o passo 5. message.no.projects.adminOnly=Voc\u00ea n\u00e3o possui nenhum projeto.
Por favor solicite ao seu administrador a cria\u00e7\u00e3o de um novo projeto. @@ -1371,7 +1515,7 @@ message.number.zones=

Zonas

message.pending.projects.1=Voc\u00ea possui convites de projetos pendentes\: message.pending.projects.2=Para visualizar, por favor acesse a se\u00e7\u00e3o de projetos, depois selecione os convites no menu drop-down. message.please.add.at.lease.one.traffic.range=Por favor adicione pelo menos um range de tr\u00e1fego. -message.please.proceed=Por favor continue para o pr\u00f3ximo passo. +message.please.proceed=Por favor, v\u00e1 para o pr\u00f3ximo passo. message.please.select.a.configuration.for.your.zone=Por favor selecione uma configuracao para sua zona. message.please.select.a.different.public.and.management.network.before.removing=Por favor selecione uma rede p\u00fablica e de gerenciamento diferente antes de remover message.please.select.networks=Por favor selecione as redes para sua m\u00e1quina virtual. @@ -1384,7 +1528,7 @@ message.remove.ldap=Voc\u00ea tem certeza que deseja deletar a configura\u00e7\u message.remove.region=Voc\u00ea tem certeza que deseja remover esta regi\u00e3o deste servidor de gerenciamento? message.remove.vpc=Favor confirmar que voc\u00ea deseja remover a VPC message.remove.vpn.access=Confirme se voc\u00ea deseja remover acesso VPN do seguinte Usu\u00e1rio. -message.reset.password.warning.notPasswordEnabled=O template desta inst\u00e2ncia foi criado sem senha habilitada +message.reset.password.warning.notPasswordEnabled=O template desta inst\u00e2ncia foi criado sem uma senha habilitada message.reset.password.warning.notStopped=Sua inst\u00e2ncia deve estar parada antes de tentar trocar sua senha atual message.reset.VPN.connection=Favor confirmar que voc\u00ea deseja resetar a conex\u00e3o VPN message.restart.mgmt.server=Reinicie o(s) servidor(es) de gerenciamento para que a nova configura\u00c3\u00a7\u00c3\u00a3o tenha efeito. @@ -1392,26 +1536,30 @@ message.restart.mgmt.usage.server=Por favor reinicie seu servidor(es) de gerenci message.restart.network=Por favor confirme que voc\ufffd deseja reiniciar a rede message.restart.vpc=Favor confirmar que voc\u00ea deseja reiniciar a VPC message.security.group.usage=(Use Ctrl-clique para selecionar todos os Security Groups) +message.select.affinity.groups=Por favor, selecione quaisquer grupos de afinidade que voc\u00ea deseja que esta VM perten\u00e7a\: message.select.a.zone=A zone tipicamente corresponde a um \u00fanico datacenter. M\u00faltiplas zonas auxiliam a cloud a ser mais confi\u00e1vel provendo isolamento f\u00edsico e redund\u00e2ncia. message.select.instance=Por favor selecione uma inst\u00e2ncia. message.select.iso=Por favor selecione um ISO para sua nova inst\u00e2ncia virtual message.select.item=Por favor selecione um item. message.select.security.groups=Por favor selecione o(s) grupo(s) de seguran\u00e7a para sua nova VM message.select.template=Por favor selecione um template para sua nova inst\u00e2ncia virtual. -message.setup.physical.network.during.zone.creation.basic=Quando adicionar uma zona b\u00e1sica, voc\u00ea pode configurar uma rede f\u00edsica, que corresponde a uma NIC no hypervisor. A rede carrega diversos tipos de tr\u00e1fego.

Voc\u00ea pode adicionar e remover outros tipos de tr\u00e1fego na mesma interface de rede f\u00edsica. +message.setup.physical.network.during.zone.creation=Ao adicionar uma zona avan\u00e7ada, voc\u00ea precisa configurar uma ou mais redes f\u00edsicas. Cada rede corresponde \u00e0 uma Interface de Rede no hypervisor. Cada rede f\u00edsica pode ser utilizada para transportar um ou mais tipos de tr\u00e1fego, com certas restri\u00e7\u00f5es sobre como eles podem ser combinados.
Arraste e solte um ou mais tipos de tr\u00e1fego em cada rede f\u00edsica. +message.setup.physical.network.during.zone.creation.basic=Quando adicionar uma zona b\u00e1sica, voc\u00ea pode configurar uma rede f\u00edsica, que corresponde a uma Interface de Rede no hypervisor. A rede carrega diversos tipos de tr\u00e1fego.

Voc\u00ea pode adicionar e remover outros tipos de tr\u00e1fego na mesma interface de rede f\u00edsica. message.setup.successful=Cloud configurada com sucesso\! message.snapshot.schedule=Voc\u00ea pode configurar Snapshots recorrentes agendados selecionando as op\u00e7\u00f5es Dispon\u00edveis abaixo message.specify.url=Por favor especifique a URL message.step.1.continue=Selecione o template ou ISO para continuar -message.step.1.desc=Selecione o template para o novo Cloud Server. +message.step.1.desc=Por favor, selecione um template para a sua nova inst\u00e2ncia virtual. Voc\u00ea pode tamb\u00e9m escolher um template limpo e instalar a partir de uma imagem ISO. message.step.2.continue=Selecione o plano message.step.2.desc= message.step.3.continue=Seleciona a oferta de disco message.step.3.desc= message.step.4.continue=Selecione pelo menos uma rede para continuar -message.step.4.desc=Selecione a rede principal que seu Cloud Server ser\u00e1 conectado. +message.step.4.desc=Selecione a rede principal que a sua inst\u00e2ncia virtual estar\u00e1 conectada. +message.storage.traffic=Tr\u00e1fego entre os recursos internos do CloudStack, incluindo todos os componentes que se comunicam com o servidor de gerenciamento tais como hosts e m\u00e1quinas virtuais de sistema CloudStack. Por favor, configure o tr\u00e1fego do storage aqui. message.suspend.project=Voc\u00ea tem certeza que deseja suspender este projeto ? message.template.desc=Imagem de SO que pode ser utilizada para bootar VMs +message.tooltip.dns.1=Endere\u00e7o de um servidor DNS que ser\u00e1 utilizado por todas as VMs da Zone. A faixa de IPs p\u00fablicos para essa Zone deve possuir uma rota para o servidor configurado. message.tooltip.dns.2=Um servidor DNS secund\u00e1rio para ser utilizado pelas VMs nesta zona. Os endere\u00e7os IP p\u00fablicos nesta zona devem ter rota para este servidor. message.tooltip.internal.dns.1=Nome de um servidor DNS que ser\u00e1 utilizado pelas VMs internas de sistema do CloudStack nesta zona. Os endere\u00e7os privados dos pods devem ter uma rota para este servidor. message.tooltip.internal.dns.2=Nome de um servidor DNS que ser\u00e1 utilizado pelas VMs internas de sistema do CloudStack nesta zona. Os endere\u00e7os privados dos pods devem ter uma rota para este servidor. @@ -1420,10 +1568,11 @@ message.tooltip.pod.name=Um nome para este pod. message.tooltip.reserved.system.gateway=O gateway para os hosts neste pod. message.tooltip.reserved.system.netmask=O prefixo de rede que define a subrede deste pod. Utilize a nota\u00e7\u00e3o CIDR. message.tooltip.zone.name=Um nome para a zona. -message.update.os.preference=Escolha o SO de preferencia para este host. Todos Cloud Server com preferencias similares ser\u00e3o alocados neste host antes de tentar em outro. +message.update.os.preference=Escolha o SO de preferencia para este host. Todas Inst\u00e2ncias com preferencias similares ser\u00e3o alocadas neste host antes de tentar em outro. message.update.resource.count=Por favor confirme que voc\u00ea quer atualizar a contagem de recursos para esta conta. message.update.ssl=Envie o novo certificado SSL X.509 para ser atualizado em cada console proxy\: message.validate.instance.name=Nomes de inst\u00e2ncias n\u00e3o podem ter mais de 63 caracteres. Somente letras ASCII a~z, A~Z, d\u00edgitos 0~9 e h\u00edfen s\u00e3o permitidos. Deve come\u00e7ar com uma letra e terminar com uma letra ou d\u00edgito. +message.validate.invalid.characters=Caracteres inv\u00e1lidos encontrados, por favor corrija. message.virtual.network.desc=Rede virtual dedicado para sua conta. O Dom\u00ednio de broadcast Est\u00e1 na VLAN e todo acesso a internet \u00e9 roteado atrav\u00e9s do virtual router. message.vm.create.template.confirm=Criar Template reiniciar\u00e1 a VM automaticamente. message.vm.review.launch=Por favor revise a informa\u00e7\u00e3o abaixo e confirme que sua inst\u00e2ncia virtual est\u00e1 correta antes de executa-la. @@ -1435,7 +1584,6 @@ message.zone.no.network.selection=A zona que voc\u00ea selecionou n\u00e3o possu message.zone.step.1.desc=Seleciona o modelo de rede para a zona. message.zone.step.2.desc=Entre a informa\u00e7\u00e3o a seguir para adicionar uma nova zona message.zone.step.3.desc=Entre a informa\u00e7\u00e3o a seguir para adicionar um novo pod -message.zoneWizard.enable.local.storage=ALERTA\: se voc\u00ea habilitar storage local para esta zona, voc\u00ea deve fazer o seguinte, dependendo se voc\u00ea quiser que suas m\u00e1quinas virtuais de sistema inicializem\:

1. Se m\u00e1quinas virtuais de sistema precisam ser iniciadas em storage prim\u00e1ria, storage prim\u00e1ria precisa ser adicionada \u00e0 zona ap\u00f3s a cria\u00e7\u00e3o. Voc\u00ea tamb\u00e9m deve ativar a zona em um estado desabilitado.

2. Se m\u00e1quinas virtuais de sistema precisam ser iniciadas em storage local, system.vm.use.local.storage precisa ser estabelecida como verdadeira antes de voc\u00ea habilitar a zona.


Voc\u00ea quer continuar? mode=Modo network.rate=Taxa de Transfer\u00eancia notification.reboot.instance=Reiniciar inst\u00e2ncia @@ -1446,6 +1594,8 @@ state.Accepted=Aceito state.Active=Ativo state.Allocated=Alocado state.Allocating=Alocando +state.BackedUp=Back up realizado com sucesso +state.BackingUp=Realizando Back up state.Completed=Completo state.Creating=Criando state.Declined=Recusado @@ -1454,6 +1604,7 @@ state.Disabled=Desativado state.enabled=Habilitado state.Enabled=Habilitado state.Error=Erro +state.Expunging=Removendo state.Migrating=Migrando state.Pending=Pendente state.ready=Pronto diff --git a/client/WEB-INF/classes/resources/messages_ru_RU.properties b/client/WEB-INF/classes/resources/messages_ru_RU.properties index 62c791f61b..ff68668e6f 100644 --- a/client/WEB-INF/classes/resources/messages_ru_RU.properties +++ b/client/WEB-INF/classes/resources/messages_ru_RU.properties @@ -16,6 +16,7 @@ # under the License. changed.item.properties=\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b +confirm.enable.s3=\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f S3-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0433\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 confirm.enable.swift=\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043d\u0438\u0436\u0435\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438 Swift error.could.not.enable.zone=\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0437\u043e\u043d\u0443 error.installWizard.message=\u0427\u0442\u043e-\u0442\u043e \u043d\u0435 \u0442\u0430\u043a. \u0412\u0435\u0440\u043d\u0438\u0442\u0435\u0441\u044c \u043d\u0430\u0437\u0430\u0434 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0438. @@ -41,6 +42,8 @@ ICMP.type=\u0422\u0438\u043f ICMP image.directory=\u041a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441 \u043e\u0431\u0440\u0430\u0437\u0430\u043c\u0438 inline=\u0412\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 instances.actions.reboot.label=\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u0443 +label.about.app=\u041e CloudStack +label.about=\u041e label.accept.project.invitation=\u041f\u0440\u0438\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442 label.account.and.security.group=\u0410\u043a\u043a\u0430\u0443\u043d\u0442, \u0433\u0440\u0443\u043f\u043f\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 label.account.id=ID \u0443\u0447\u0451\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 @@ -49,6 +52,7 @@ label.account.specific=\u0421\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430 \u label.accounts=\u0423\u0447\u0451\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 label.account=\u0423\u0447\u0451\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c label.acquire.new.ip=\u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 IP +label.acquire.new.secondary.ip=\u0417\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 IP-\u0430\u0434\u0440\u0435\u0441 label.action.attach.disk.processing=\u041f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u0435 \u0434\u0438\u0441\u043a\u0430... label.action.attach.disk=\u041f\u0440\u0438\u043a\u0440\u0435\u043f\u0438\u0442\u044c \u0434\u0438\u0441\u043a label.action.attach.iso.processing=\u041f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u0438\u0435 ISO... @@ -91,6 +95,7 @@ label.action.delete.load.balancer=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0 label.action.delete.network.processing=\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0435\u0442\u0438... label.action.delete.network=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0435\u0442\u044c label.action.delete.nexusVswitch=\u0423\u0434\u0430\u043b\u0438\u0442\u044c NexusVswitch +label.action.delete.nic=\u0423\u0434\u0430\u043b\u0438\u0442\u044c NIC label.action.delete.physical.network=\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0435\u0442\u0438 label.action.delete.pod.processing=\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0435\u043d\u0434\u0430... label.action.delete.pod=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0442\u0435\u043d\u0434 @@ -207,6 +212,8 @@ label.action.resize.volume=Resize Volume label.action.resource.limits=\u041f\u0440\u0435\u0434\u0435\u043b\u044b \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 label.action.restore.instance.processing=\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043c\u0430\u0448\u0438\u043d\u044b... label.action.restore.instance=\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u0443 +label.action.revert.snapshot.processing=\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u0441\u043d\u0438\u043c\u043a\u0443... +label.action.revert.snapshot=\u0412\u043e\u0437\u0432\u0440\u0430\u0442 \u043a \u0441\u043d\u0438\u043c\u043a\u0443 label.action.start.instance.processing=\u0417\u0430\u043f\u0443\u0441\u043a \u043c\u0430\u0448\u0438\u043d\u044b... label.action.start.instance=\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u0443 label.action.start.router.processing=\u0417\u0430\u043f\u0443\u0441\u043a \u0440\u043e\u0443\u0442\u0435\u0440\u0430 @@ -228,12 +235,18 @@ label.action.update.OS.preference.processing=\u041e\u0431\u043d\u043e\u0432\u043 label.action.update.OS.preference=\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u041e\u0421 label.action.update.resource.count.processing=\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0447\u0435\u0442\u0447\u0438\u043a\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432... label.action.update.resource.count=\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 +label.action.vmsnapshot.create=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043d\u0438\u043c\u043e\u043a \u0412\u041c +label.action.vmsnapshot.delete=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u043d\u0438\u043c\u043e\u043a \u0412\u041c +label.action.vmsnapshot.revert=\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043d\u0438\u043c\u043e\u043a \u0412\u041c label.activate.project=\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 label.active.sessions=\u0410\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u0435\u0441\u0441\u0438\u0438 label.add.accounts.to=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0447\u0451\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 label.add.accounts=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u044b label.add.account.to.project=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 label.add.account=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u043a\u043a\u0430\u0443\u043d\u0442 +label.add.ACL=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c ACL +label.add.affinity.group=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e affinity group +label.add.BigSwitchVns.device=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c BigSwitch Vns Controller label.add.by.cidr=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a CIDR label.add.by.group=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a \u0433\u0440\u0443\u043f\u043f\u0435 label.add.by=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c @@ -261,40 +274,55 @@ label.additional.networks=\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435 label.add.load.balancer=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 label.add.more=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0435\u0449\u0435 label.add.netScaler.device=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c Netscaler \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e +label.add.network.ACL=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u0443\u044e ACL label.add.network.device=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e label.add.network.offering=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 label.add.network=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0435\u0442\u044c label.add.new.F5=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 F5 +label.add.new.gateway=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0448\u043b\u044e\u0437 label.add.new.NetScaler=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 NetScaler +label.add.new.PA=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c Palo Alto label.add.new.SRX=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 SRX +label.add.new.tier=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 Tier +label.add.NiciraNvp.device=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 Nvp +label.add.PA.device=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e Palo Alto label.add.physical.network=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0435\u0442\u044c label.add.pod=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0435\u043d\u0434 +label.add.port.forwarding.rule=\u0414\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u0440\u0442\u0430 label.add.primary.storage=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 +label.add.region=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0433\u0438\u043e\u043d label.add.resources=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 +label.add.route=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 label.add.rule=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e label.add.secondary.storage=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 label.add.security.group=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 label.add.service.offering=\u041d\u043e\u0432\u044b\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 label.add.SRX.device=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c SRX \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e label.add.static.nat.rule=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u043e\u0433\u043e NAT +label.add.static.route=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 label.add.system.service.offering=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 label.add.template=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d label.add.to.group=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0433\u0440\u0443\u043f\u043f\u0443 label.add=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c label.add.user=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f label.add.vlan=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c VLAN -label.add.vxlan=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c VXLAN label.add.vms.to.lb=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0412\u041c \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 label.add.vms=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0412\u041c +label.add.VM.to.tier=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0412\u041c \u043a tier label.add.vm=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0412\u041c label.add.volume=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u043e\u043c +label.add.vpc=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c VPC +label.add.vpn.customer.gateway=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c VPN \u0448\u043b\u044e\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 +label.add.VPN.gateway=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c VPN \u0448\u043b\u044e\u0437 label.add.vpn.user=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f VPN +label.add.vxlan=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c VXLAN label.add.zone=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0437\u043e\u043d\u0443 label.admin.accounts=\u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0441\u043a\u0438\u0435 \u0443\u0447\u0451\u0442\u043d\u044b\u0435 \u0437\u0430\u043f\u0438\u0441\u0438 label.admin=\u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 label.advanced.mode=\u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u0440\u0435\u0436\u0438\u043c label.advanced.search=\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a label.advanced=\u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 +label.affinity=\ \u0421\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u044c label.agent.password=\u041f\u0430\u0440\u043e\u043b\u044c \u0430\u0433\u0435\u043d\u0442\u0430 label.agent.username=\u0418\u043c\u044f \u0430\u0433\u0435\u043d\u0442\u0430 label.agree=\u0421\u043e\u0433\u043b\u0430\u0441\u0435\u043d @@ -304,10 +332,16 @@ label.allocated=\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u04 label.allocation.state=\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f label.api.key=\u041a\u043b\u044e\u0447 API label.apply=\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c +label.app.name=CloudStack +label.archive.alerts=\u0410\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0440\u0435\u0432\u043e\u0433\u0438 +label.archive.events=\u0430\u0440\u0445\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f label.assign.to.load.balancer=\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0430\u0448\u0438\u043d\u044b \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 label.assign=\u041f\u0440\u0438\u0441\u0432\u043e\u0438\u0442\u044c label.associated.network.id=\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 ID \u0441\u0435\u0442\u0438 +label.associated.network=\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441\u0435\u0442\u044c label.attached.iso=\u041f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0435\u043d\u043d\u044b\u0439 ISO +label.author.email=E-mail \u0430\u0432\u0442\u043e\u0440\u0430 +label.author.name=\u0418\u043c\u044f \u0430\u0432\u0442\u043e\u0440\u0430 label.availability=\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c label.availability.zone=\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u044c \u0437\u043e\u043d\u044b label.available.public.ips=\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430 @@ -316,13 +350,19 @@ label.back=\u041d\u0430\u0437\u0430\u0434 label.bandwidth=\u041f\u0440\u043e\u043f\u0443\u0441\u043a\u043d\u0430\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c label.basic.mode=\u041f\u0440\u043e\u0441\u0442\u043e \u0440\u0435\u0436\u0438\u043c label.basic=\u041f\u0440\u043e\u0441\u0442\u043e\u0439 +label.bigswitch.controller.address=\u0410\u0434\u0440\u0435\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 BigSwitch VNC label.bootable=\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c\u044b\u0439 label.broadcast.domain.range=\u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0448\u0438\u0440\u043e\u043a\u043e\u0432\u0435\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 label.broadcast.domain.type=\u0422\u0438\u043f \u0448\u0438\u0440\u043e\u043a\u043e\u0432\u0435\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u043e\u043c\u0435\u043d\u0430 +label.broadcast.uri=\u0428\u0438\u0440\u043e\u043a\u043e\u0432\u0435\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 URI label.by.account=\u041f\u043e \u0443\u0447\u0451\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 +label.by.alert.type=\u041f\u043e \u0442\u0438\u043f\u0443 \u0442\u0440\u0435\u0432\u043e\u0433\u0438 label.by.availability=\u041f\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0441\u0442\u0438 +label.by.date.end=\u041f\u043e \u0434\u0430\u0442\u0435(\u043a\u043e\u043d\u0435\u0446) +label.by.date.start=\u041f\u043e \u0434\u0430\u0442\u0435(\u043d\u0430\u0447\u0430\u043b\u043e) label.by.domain=\u0414\u043e \u0434\u043e\u043c\u0435\u043d\u0443 label.by.end.date=\u041f\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044e +label.by.event.type=\u041f\u043e \u0442\u0438\u043f\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u044f label.by.level=\u041f\u043e \u0443\u0440\u043e\u0432\u043d\u044e label.by.pod=\u041f\u043e \u0441\u0442\u0435\u043d\u0434\u0443 label.by.role=\u041f\u043e \u0440\u043e\u043b\u0438 @@ -344,6 +384,8 @@ label.checksum=\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c MD5 \u0441 label.cidr.account=CIDR \u0438\u043b\u0438 \u0443\u0447\u0451\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c/\u0433\u0440\u0443\u043f\u043f\u0430 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 label.cidr=CIDR label.cidr.list=CIDR \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 +label.CIDR.list=\u0421\u043f\u0438\u0441\u043e\u043a CIDR +label.CIDR.of.destination.network=CIDR \u0441\u0435\u0442\u0438 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f label.clean.up=\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c label.clear.list=\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a label.close=\u0417\u0430\u043a\u0440\u044b\u0442\u044c @@ -357,10 +399,13 @@ label.clvm=CLVM label.code=\u041a\u043e\u0434 label.community=\u0421\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e label.compute.and.storage=\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 +label.compute.offerings=\u0423\u0441\u043b\u0443\u0433\u0438 \u0432\u044b\u0447\u0435\u0441\u043b\u0435\u043d\u0438\u044f label.compute.offering=\u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 label.compute=\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 label.configuration=\u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f +label.configure.network.ACLs=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 ACL \u0441\u0435\u0442\u0438 label.configure=\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c +label.configure.vpc=\u041d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c VPC label.confirmation=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u0435 label.confirm.password=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u043f\u0430\u0440\u043e\u043b\u044c label.congratulations=\u041f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u044f\u0435\u043c\! @@ -373,29 +418,43 @@ label.cpu.allocated.for.VMs=\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u04 label.cpu.allocated=\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0426\u041f\u0423 label.CPU.cap=CPU Cap label.cpu=CPU +label.cpu.limits=\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f CPU label.cpu.mhz=CPU (\u0432 \u041c\u0433\u0446) label.cpu.utilized=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 CPU label.created.by.system=\u0421\u043e\u0437\u0434\u0430\u043d\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 label.created=\u0421\u043e\u0437\u0434\u0430\u043d\u043e label.create.project=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 label.create.template=\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d +label.create.VPN.connection=\u0421\u043e\u0437\u0434\u0430\u0442\u044c VPN \u043f\u043e\u0434\u043b\u044e\u0447\u0435\u043d\u0438\u0435 label.cross.zones=\u041e\u0431\u0449\u0438\u0435 \u0434\u043b\u044f \u0437\u043e\u043d +label.custom.disk.iops=\u0421\u0432\u043e\u0435 \u043a\u043e\u043b-\u0432\u043e IPOS label.custom.disk.size=\u0421\u0432\u043e\u0439 \u0440\u0430\u0437\u043c\u0435\u0440 \u0434\u0438\u0441\u043a\u0430 label.daily=\u0415\u0436\u0435\u0434\u043d\u0435\u0432\u043d\u043e label.data.disk.offering=\u0414\u0430\u043d\u043d\u044b\u0435 \u0434\u0438\u0441\u043a\u0430 label.date=\u0414\u0430\u0442\u0430 label.day.of.month=\u0414\u0435\u043d\u044c \u043c\u0435\u0441\u044f\u0446\u0430 label.day.of.week=\u0414\u0435\u043d\u044c \u043d\u0435\u0434\u0435\u043b\u0438 +label.dead.peer.detection=Dead Peer Detection label.decline.invitation=\u041e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 label.dedicated=\u0412\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 label.default=\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e label.default.use=\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e label.default.view=\u041e\u0431\u044b\u0447\u043d\u044b\u0439 \u0432\u0438\u0434 +label.delete.affinity.group=\u0423\u0434\u0430\u043b\u0438\u0442\u044c affinity group +label.delete.alerts=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u0440\u0435\u0432\u043e\u0433\u0438 +label.delete.BigSwitchVns=\u0423\u0434\u0430\u043b\u0438\u0442\u044c BigSwitch VNC \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 +label.delete.events=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f label.delete.F5=\u0423\u0434\u0430\u043b\u0438\u0442\u044c F5 +label.delete.gateway=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0448\u043b\u044e\u0437 label.delete.NetScaler=\u0423\u0434\u0430\u043b\u0438\u0442\u044c NetScaler +label.delete.NiciraNvp=\u0423\u0434\u0430\u043b\u0438\u0442\u044c Nvp \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 +label.delete.PA=\u0423\u0434\u0430\u043b\u0438\u0442\u044c Palo Alto label.delete.project=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 label.delete.SRX=\u0423\u0434\u0430\u043b\u0438\u0442\u044c SRX label.delete=\u0423\u0434\u0430\u043b\u0438\u0442\u044c +label.delete.VPN.connection=\u0423\u0434\u0430\u043b\u0438\u0442\u044c VPN \u043f\u043e\u0434\u043b\u044e\u0447\u0435\u043d\u0438\u0435 +label.delete.VPN.customer.gateway=\u0423\u0434\u0430\u043b\u0438\u0442\u044c VPN \u0448\u043b\u044e\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 +label.delete.VPN.gateway=\u0423\u0434\u0430\u043b\u0438\u0442\u044c VPN \u0448\u043b\u044e\u0437 label.delete.vpn.user=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f VPN label.deleting.failed=\u041d\u0435 \u0443\u0434\u0430\u043b\u043e\u0441\u044c \u0443\u0434\u0430\u043b\u0438\u0442\u044c label.deleting.processing=\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435... @@ -416,15 +475,28 @@ label.disable.provider=\u0412\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u label.disable.vpn=\u0412\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c VPN label.disabling.vpn.access=\u0412\u044b\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a VPN label.disk.allocated=\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u0434\u0438\u0441\u043a\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 +label.disk.bytes.read.rate=\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0447\u0442\u0435\u043d\u0438\u044f \u0434\u0438\u0441\u043a\u0430 (BPS) +label.disk.bytes.write.rate=\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0438\u0441\u043a\u0430 (BPS) +label.disk.iops.max=\u041c\u0430\u043a\u0441. IOPS +label.disk.iops.min=\u041c\u0438\u043d. IOPS +label.disk.iops.read.rate=\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0438\u0441\u043a\u0430 (IOPS) +label.disk.iops.total=\u0412\u0441\u0435\u0433\u043e IOPS +label.disk.iops.write.rate=\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0438 \u0434\u0438\u0441\u043a\u0430 (IOPS) label.disk.offering=\u0414\u0438\u0441\u043a\u043e\u0432\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 +label.disk.read.bytes=\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043e \u0441 \u0434\u0438\u0441\u043a\u0430 (\u0411\u0430\u0439\u0442) +label.disk.read.io=\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043e \u0441 \u0434\u0438\u0441\u043a\u0430 (IO) label.disk.size.gb=\u0420\u0430\u0437\u043c\u0435\u0440 \u0434\u0438\u0441\u043a\u0430 (\u0432 \u0413\u0411) label.disk.size=\u0420\u0430\u0437\u043c\u0435\u0440 \u0434\u0438\u0441\u043a\u0430 label.disk.total=\u0412\u0441\u0435\u0433\u043e \u0432 \u0434\u0438\u0441\u043a\u0430\u0445 label.disk.volume=\u0422\u043e\u043c \u0434\u0438\u0441\u043a\u0430 +label.disk.write.bytes=\u0417\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 \u0434\u0438\u0441\u043a (\u0411\u0430\u0439\u0442) +label.disk.write.io=\u0417\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0430 \u0434\u0438\u0441\u043a (IO) label.display.name=\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0435 \u0438\u043c\u044f label.display.text=\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u044b\u0439 \u0442\u0435\u043a\u0441\u0442 label.dns.1=DNS 1 label.dns.2=DNS 2 +label.dns=DNS +label.DNS.domain.for.guest.networks=DNS \u0434\u043e\u043c\u0435\u043d \u0434\u043b\u044f \u0433\u043e\u0441\u0442\u0435\u0432\u043e\u0439 \u0441\u0435\u0442\u0438 label.domain.admin=\u0410\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440 \u0434\u043e\u043c\u0435\u043d\u0430 label.domain.id=ID \u0434\u043e\u043c\u0435\u043d\u0430 label.domain.name=\u0418\u043c\u044f \u0434\u043e\u043c\u0435\u043d\u0430 @@ -435,23 +507,30 @@ label.done=\u0413\u043e\u0442\u043e\u0432\u043e label.double.quotes.are.not.allowed=\u0414\u0432\u043e\u0439\u043d\u044b\u0435 \u043a\u0430\u0432\u044b\u0447\u043a\u0438 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u044b label.download.progress=\u0421\u0442\u0430\u0442\u0443\u0441 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 label.drag.new.position=\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u043f\u043e\u0437\u0438\u0446\u0438\u044e +label.edit.affinity.group=\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c affinity group label.edit.lb.rule=\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c LB \u043f\u0440\u0430\u0432\u0438\u043b\u0430 label.edit.network.details=\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u0438 \u0441\u0435\u0442\u0438 label.edit.project.details=\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 +label.edit.tags=\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u044d\u0433\u0438 label.edit.traffic.type=\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0442\u0438\u043f \u0442\u0440\u0430\u0444\u0438\u043a\u0430 label.edit=\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c +label.edit.vpc=\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c VPC +label.egress.default.policy=\u0418\u0441\u0445\u043e\u0434\u044f\u0449\u0430\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e +label.egress.rules=\u0418\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 label.egress.rule=\u0412\u044b\u0445\u043e\u0434\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e label.elastic.IP=\u0413\u0438\u0431\u043a\u0438\u0439 IP label.elastic.LB=\u0413\u0438\u0431\u043a\u0438\u0439 LB label.elastic=\u0413\u0438\u0431\u043a\u0438\u0439 label.email=E-mail label.enable.provider=\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0430 +label.enable.s3=\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c S3-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 label.enable.swift=\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c Swift label.enable.vpn=\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c VPN label.enabling.vpn.access=\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a VPN label.enabling.vpn=\u0412\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 VPN label.end.IP=\u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 IP label.endpoint.or.operation=\u041a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0438\u043b\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f +label.endpoint=\u041a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 label.end.port=\u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u043f\u043e\u0440\u0442 label.end.reserved.system.IP=\u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0437\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 IP-\u0430\u0434\u0440\u0435\u0441 label.end.vlan=\u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 VLAN @@ -459,8 +538,13 @@ label.end.vxlan=\u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 VXLAN label.enter.token=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0442\u0430\u043b\u043e\u043d label.error.code=\u041a\u043e\u0434 \u043e\u0448\u0438\u0431\u043a\u0438 label.error=\u041e\u0448\u0438\u0431\u043a\u0430 +label.ESP.encryption=\u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 ESP +label.ESP.hash=\u0445\u044d\u0448 ESP +label.ESP.lifetime=\u0412\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 ESP (\u0432 \u0441\u0435\u043a\u0443\u043d\u0434\u0430\u0445) +label.ESP.policy=\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 ESP label.esx.host=\u0423\u0437\u0435\u043b ESX/ESXi label.example=\u041f\u0440\u0438\u043c\u0435\u0440 +label.external.link=\u0412\u043d\u0435\u0448\u043d\u0435\u0435 \u043f\u043e\u0434\u043b\u044e\u0447\u0435\u043d\u0438\u0435 label.f5=F5 label.failed=\u041d\u0435\u0443\u0434\u0430\u0447\u043d\u043e label.featured=\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 @@ -475,6 +559,7 @@ label.full=\u041f\u043e\u043b\u043d\u044b\u0439 label.gateway=\u0428\u043b\u044e\u0437 label.general.alerts=\u041e\u0431\u0449\u0438\u0435 \u0442\u0440\u0435\u0432\u043e\u0433\u0438 label.generating.url=\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 URL +label.gluster.volume=\u0422\u043e\u043c label.go.step.2=\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0448\u0430\u0433\u0443 2 label.go.step.3=\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0448\u0430\u0433\u0443 3 label.go.step.4=\u041f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0448\u0430\u0433\u0443 4 @@ -496,6 +581,7 @@ label.ha.enabled=HA \u0432\u043a\u043b\u044e\u0447\u0435\u043d label.help=\u041f\u043e\u043c\u043e\u0449\u044c label.hide.ingress.rule=\u0421\u043a\u0440\u044b\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e label.hints=\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0438 +label.home=\u0413\u043b\u0430\u0432\u043d\u0430\u044f label.host.alerts=\u0422\u0440\u0435\u0432\u043e\u0433\u0438 \u0443\u0437\u043b\u0430 label.host.MAC=MAC \u0443\u0437\u043b\u0430 label.host.name=\u0418\u043c\u044f \u0443\u0437\u043b\u0430 @@ -504,10 +590,16 @@ label.host.tags=\u041c\u0435\u0442\u043a\u0438 \u0443\u0437\u043b\u0430 label.host=\u0423\u0437\u0435\u043b label.hourly=\u0427\u0430\u0441\u043e\u0432\u0430\u044f label.hypervisor.capabilities=\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0430 +label.hypervisors=\u0413\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u044b label.hypervisor.type=\u0422\u0438\u043f \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0430 label.hypervisor=\u0413\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440 label.hypervisor.version=\u0412\u0435\u0440\u0441\u0438\u044f \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0430 label.id=ID +label.IKE.DH=IKE DH +label.IKE.encryption=\u0428\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u0435 IKE +label.IKE.hash=IKE Hash +label.IKE.lifetime=IKE lifetime (second) +label.IKE.policy=\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 IKE label.info=\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f label.ingress.rule=\u0412\u043d\u0443\u0442\u0440\u0438\u043d\u0435\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e label.initiated.by=\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c @@ -550,6 +642,7 @@ label.ip.limits=\u041f\u0440\u0435\u0434\u0435\u043b\u044b \u043f\u0443\u0431\u0 label.ip.or.fqdn=IP \u0438\u043b\u0438 FQDN label.ip.ranges=\u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u044b IP label.ip.range=\u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d IP +label.IPsec.preshared.key=IPsec Preshared-Key label.ips=IP label.iscsi=iSCSI label.is.default=\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e @@ -558,6 +651,7 @@ label.iso=ISO label.isolated.networks=\u0418\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 label.isolation.method=\u041c\u0435\u0442\u043e\u0434 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 label.isolation.mode=\u0420\u0435\u0436\u0438\u043c \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 +label.isolation.uri=\u0418\u0437\u043e\u043b\u044f\u0446\u0438\u044f URI label.is.redundant.router=\u0420\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0439 label.is.shared=\u043e\u0431\u0449\u0438\u0435 label.is.system=\u0415\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0430 @@ -571,6 +665,7 @@ label.lang.chinese=\u041a\u0438\u0442\u0430\u0439\u0441\u043a\u0438\u0439 (\u044 label.lang.english=\u0410\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439 label.lang.japanese=\u042f\u043f\u043e\u043d\u0441\u043a\u0438\u0439 label.lang.korean=\u043a\u043e\u0440\u0435\u0439\u0441\u043a\u0438\u0439 +label.lang.russian=\u0420\u0443\u0441\u0441\u043a\u0438\u0439 label.lang.spanish=\u0418\u0441\u043f\u0430\u043d\u0441\u043a\u0438\u0439 label.last.disconnected=\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 label.last.name=\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u0438\u043c\u044f @@ -581,10 +676,12 @@ label.launch.zone=\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0437\ label.LB.isolation=\u0418\u0437\u043e\u043b\u044f\u0446\u0438\u044f LB label.least.connections=Least connections label.level=\u0423\u0440\u043e\u0432\u0435\u043d\u044c +label.linklocal.ip=\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 IP \u0430\u0434\u0440\u0435\u0441 label.load.balancer=\u0411\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 label.load.balancing.policies=\u041f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 label.load.balancing=\u0411\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 label.loading=\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 +label.local.storage.enabled=\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043e label.local.storage=\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 label.local=\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 label.login=\u0412\u0445\u043e\u0434 @@ -596,16 +693,22 @@ label.management.ips=\u041f\u0430\u043d\u0435\u043b\u044c \u0443\u043f\u0440\u04 label.management=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 label.manage.resources=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 label.manage=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 +label.max.cpus=\u041c\u0430\u043a\u0441. \u044f\u0434\u0435\u0440 \u0426\u041f label.max.guest.limit=\u041f\u0440\u0435\u0434\u0435\u043b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0433\u043e\u0441\u0442\u0435\u0439 label.maximum=\u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c +label.max.memory=\u041c\u0430\u043a\u0441. \u043f\u0430\u043c\u044f\u0442\u0438 (\u0432 \u041c\u0438\u0411) label.max.networks=\u041c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0441\u0435\u0442\u0435\u0439 +label.max.primary.storage=\u041c\u0430\u043a\u0441. \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 (\u0432 \u0413\u0438\u0411) label.max.public.ips=\u041c\u0430\u043a\u0441. \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 IP +label.max.secondary.storage=\u041c\u0430\u043a\u0441. \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 (\u0432 \u0413\u0438\u0411) label.max.snapshots=\u041c\u0430\u043a\u0441. \u0441\u043d\u0438\u043c\u043a\u043e\u0432 label.max.templates=\u041c\u0430\u043a\u0441. \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 label.max.vms=\u041c\u0430\u043a\u0441. \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0412\u041c label.max.volumes=\u041c\u0430\u043a\u0441. \u0442\u043e\u043c\u043e\u0432 +label.max.vpcs=\u041c\u0430\u043a\u0441. VPC label.may.continue=\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c. label.memory.allocated=\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e \u043f\u0430\u043c\u044f\u0442\u0438 +label.memory.limits=\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438 (\u0432 \u041c\u0438\u0411) label.memory.mb=\u041f\u0430\u043c\u044f\u0442\u044c (\u0432 \u041c\u0411) label.memory.total=\u0412\u0441\u0435\u0433\u043e \u043f\u0430\u043c\u044f\u0442\u0438 label.memory=\u041f\u0430\u043c\u044f\u0442\u044c @@ -636,6 +739,7 @@ label.menu.my.templates=\u041c\u043e\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\ label.menu.network.offerings=\u041f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0438 label.menu.network=\u0421\u0435\u0442\u044c label.menu.physical.resources=\u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b +label.menu.regions=\u0420\u0435\u0433\u0438\u043e\u043d label.menu.running.instances=\u0417\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b label.menu.security.groups=\u0413\u0440\u0443\u043f\u043f\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 label.menu.service.offerings=\u0423\u0441\u043b\u0443\u0433\u0438 @@ -654,13 +758,17 @@ label.migrate.instance.to.ps=\u041f\u0435\u0440\u0435\u043d\u043e\u0441 \u043c\u label.migrate.instance.to=\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043c\u0430\u0448\u0438\u043d\u0443 \u0432 label.migrate.router.to=\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0440\u043e\u0443\u0442\u0435\u0440 \u0432 label.migrate.systemvm.to=\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0412\u041c \u0432 +label.migrate.to.host=\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 \u0443\u0437\u0435\u043b +label.migrate.to.storage=\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u043d\u0430 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 label.migrate.volume=\u041f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0442\u043e\u043c \u0432 \u0434\u0440\u0443\u0433\u043e\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 label.minimum=\u041c\u0438\u043d\u0438\u043c\u0443\u043c label.minute.past.hour=\u041c\u0438\u043d\u0443\u0442\u0430 +label.mode=\u0420\u0435\u0436\u0438\u043c label.monday=\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a label.monthly=\u041a\u0430\u0436\u0434\u044b\u0439 \u043c\u0435\u0441\u044f\u0446 label.more.templates=\u0411\u043e\u043b\u044c\u0448\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 label.move.down.row=\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u043d\u0438\u0436\u0435 +label.move.to.bottom=\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u0437 label.move.to.top=\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u0441\u0430\u043c\u044b\u0439 \u0432\u0435\u0440\u0445 label.move.up.row=\u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443 \u0432\u044b\u0448\u0435 label.my.account=\u041c\u043e\u044f \u0443\u0447\u0451\u0442\u043d\u0430\u044f \u0437\u0430\u043f\u0438\u0441\u044c @@ -671,6 +779,9 @@ label.name=\u0418\u043c\u044f label.nat.port.range=NAT \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u043f\u043e\u0440\u0442\u043e\u0432 label.netmask=\u0421\u0435\u0442\u0435\u0432\u0430\u044f \u043c\u0430\u0441\u043a\u0430 label.netScaler=NetScaler +label.network.ACL=ACL \u0441\u0435\u0442\u0438 +label.network.ACLs=\u0421\u0435\u0442\u0435\u0432\u044b\u0435 ACL +label.network.ACL.total=\u0412\u0441\u0435\u0433\u043e ACL \u0441\u0435\u0442\u0438 label.network.desc=\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0435\u0442\u0438 label.network.device.type=\u0422\u0438\u043f \u0441\u0435\u0442\u0435\u0432\u043e\u0433\u043e \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 label.network.device=\u0421\u0435\u0442\u0435\u0432\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e @@ -679,11 +790,13 @@ label.network.domain=\u0414\u043e\u043c\u0435\u043d \u0441\u0435\u0442\u0438 label.network.id=ID \u0441\u0435\u0442\u0438 label.networking.and.security=\u0421\u0435\u0442\u044c \u0438 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c label.network.label.display.for.blank.value=\u0418\u0441\u043f. \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u0448\u043b\u044e\u0437 +label.network.limits=\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0438 label.network.name=\u0418\u043c\u044f \u0441\u0435\u0442\u0438 label.network.offering.display.text=\u0441\u0435\u0442\u044c, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0443\u044e \u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u0430 label.network.offering.id=\u0441\u0435\u0442\u044c, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0443\u044e ID label.network.offering.name=\u0441\u0435\u0442\u044c, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0449\u0443\u044e \u0418\u043c\u044f label.network.offering=\u0421\u0435\u0442\u0435\u0432\u044b\u0435 \u0443\u0441\u043b\u0443\u0433\u0438 +label.network.rate.megabytes=\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0435\u0442\u0438 (MB/s) label.network.rate=\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0435\u0442\u0438 label.network.read=\u041f\u0440\u043e\u0447\u0438\u0442\u0430\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u0441\u0435\u0442\u044c label.network.service.providers=\u041f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0441\u043b\u0443\u0436\u0431 @@ -701,6 +814,9 @@ label.nfs=NFS label.nfs.server=\u0421\u0435\u0440\u0432\u0435\u0440 NFS label.nfs.storage=\u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 NFS label.nic.adapter.type=\u0422\u0438\u043f \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043a\u0430\u0440\u0442\u044b (NIC) +label.nicira.controller.address=\u0410\u0434\u0440\u0435\u0441 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 +label.nicira.l3gatewayserviceuuid=L3 Gateway Service Uuid +label.nicira.transportzoneuuid=Transport Zone Uuid label.nics=\u0421\u0435\u0442\u0435\u0432\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 (NIC) label.no.actions=\u041d\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 label.no.alerts=\u0422\u0440\u0435\u0432\u043e\u0433 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e @@ -736,6 +852,7 @@ label.parent.domain=\u0420\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a label.password.enabled=\u041f\u0430\u0440\u043e\u043b\u044c \u0432\u043a\u043b\u044e\u0447\u0435\u043d label.password=\u041f\u0430\u0440\u043e\u043b\u044c label.path=\u041f\u0443\u0442\u044c +label.perfect.forward.secrecy=Perfect Forward Secrecy label.physical.network.ID=ID \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0441\u0435\u0442\u0438 label.physical.network=\u0424\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0441\u0435\u0442\u0438 label.PING.CIFS.password=\u041f\u0430\u0440\u043e\u043b\u044c PING CIFS @@ -744,6 +861,8 @@ label.PING.dir=\u041a\u0430\u0442\u0430\u043b\u043e\u0433 PING label.PING.storage.IP=IP \u0430\u0434\u0440\u0435\u0441 PING-\u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 label.please.specify.netscaler.info=\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 NetScaler label.please.wait=\u041f\u043e\u0434\u043e\u0436\u0434\u0438\u0442\u0435 +label.plugin.details=\u0414\u0435\u0442\u0430\u043b\u0438 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 +label.plugins=\u041f\u043b\u0430\u0433\u0438\u043d\u044b label.pod.name=\u0418\u043c\u044f \u0441\u0442\u0435\u043d\u0434\u0430 label.pods=\u0421\u0442\u0435\u043d\u0434\u044b label.pod=\u0421\u0442\u0435\u043d\u0434 @@ -756,8 +875,10 @@ label.prev=\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0448\u0438\u0439 label.primary.allocated=\u0420\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 label.primary.network=\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0441\u0435\u0442\u044c label.primary.storage.count=\u041f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u0439 \u0430\u0440\u0445\u0438\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f +label.primary.storage.limits=\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 (\u0432 \u0413\u0438\u0411) label.primary.storage=\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 label.primary.used=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 +label.private.Gateway=\u0427\u0430\u0441\u0442\u043d\u044b\u0439 \u0448\u043b\u044e\u0437 label.private.interface=\u0427\u0430\u0441\u0442\u043d\u044b\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 label.private.ip.range=\u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0447\u0430\u0441\u0442\u043d\u044b\u0445 IP label.private.ips=\u0427\u0430\u0441\u0442\u043d\u044b\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430 @@ -785,29 +906,38 @@ label.public=\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 label.public.zone=\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u0430\u044f \u0437\u043e\u043d\u0430 label.purpose=\u041d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 label.Pxe.server.type=\u0422\u0438\u043f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 PXE +label.qos.type=\u0422\u0438\u043f QoS +label.quickview=\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 label.reboot=\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c label.recent.errors=\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 label.redundant.router.capability=\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0433\u043e \u0440\u043e\u0443\u0442\u0435\u0440\u0430 label.redundant.router=\u0420\u0435\u0437\u0435\u0440\u0432\u043d\u043e\u0439 \u0440\u043e\u0443\u0442\u0435\u0440 label.redundant.state=\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0440\u0435\u0437\u0435\u0440\u0432\u0430 label.refresh=\u041e\u0431\u043d\u043e\u0432\u0438\u0442\u044c +label.region=\u0420\u0435\u0433\u0438\u043e\u043d label.related=\u0421\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0439 label.remind.later=\u041f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0434\u0438\u0442\u044c \u043f\u043e\u0437\u0436\u0435 +label.remove.ACL=\u0423\u0434\u0430\u043b\u0438\u0442\u044c ACL label.remove.egress.rule=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e label.remove.from.load.balancer=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u0443 \u0441 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 label.remove.ingress.rule=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0432\u0445\u043e\u0434\u043d\u043e\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u043e label.remove.ip.range=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d IP label.remove.pf=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043f\u0440\u043e\u0431\u0440\u043e\u0441\u0430 \u043f\u043e\u0440\u0442\u0430 label.remove.project.account=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430 +label.remove.region=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0440\u0435\u0433\u0438\u043e\u043d label.remove.rule=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e label.remove.static.nat.rule=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u043e\u0433\u043e NAT +label.remove.static.route=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 +label.remove.tier=\u0423\u0434\u0430\u043b\u0438\u0442\u044c tier label.remove.vm.from.lb=\u0423\u0434\u0430\u043b\u0438\u0442\u044c \u0412\u041c \u0441 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 +label.remove.vpc=\u0423\u0434\u0430\u043b\u0438\u0442\u044c VPC label.removing=\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 label.removing.user=\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f label.required=\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f label.reserved.system.gateway=\u0417\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0448\u043b\u044e\u0437 label.reserved.system.ip=\u0417\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 IP label.reserved.system.netmask=\u0417\u0430\u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0430\u044f \u043c\u0430\u0441\u043a\u0430 +label.reset.VPN.connection=\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 label.resize.new.offering.id=New Offering label.resize.new.size=New Size(GB) label.resize.shrink.ok=Shrink OK @@ -817,15 +947,27 @@ label.resources=\u0420\u0435\u0441\u0443\u0440\u0441\u044b label.resource=\u0420\u0435\u0441\u0443\u0440\u0441 label.restart.network=\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0442\u044c label.restart.required=\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a +label.restart.vpc=\u041f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c VPC +label.restore=\u0412\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c label.review=\u041e\u0431\u0437\u043e\u0440 label.revoke.project.invite=\u041e\u0442\u043e\u0437\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 label.role=\u0420\u043e\u043b\u044c label.root.disk.controller=\u041a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 label.root.disk.offering=\u0420\u0435\u0441\u0443\u0440\u0441 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 +label.root.disk.size=\u0420\u0430\u0437\u043c\u0435\u0440 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0434\u0438\u0441\u043a\u0430 label.round.robin=Round-robin +label.routing=\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f label.rules=\u041f\u0440\u0430\u0432\u0438\u043b\u0430 label.running.vms=\u0417\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0435 \u0412\u041c +label.s3.access_key=\u041a\u043b\u044e\u0447 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 +label.s3.bucket=Bucket +label.s3.connection_timeout=\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f +label.s3.endpoint=\u041a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 +label.s3.nfs.path=S3 NFS \u043f\u0443\u0442\u044c +label.s3.nfs.server=S3 NFS \u0421\u0435\u0440\u0432\u0435\u0440 label.s3.secret_key=\u0421\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 +label.s3.socket_timeout=\u041f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u043a\u0435\u0442\u0430 +label.s3.use_https=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 HTTPS label.saturday=\u0421\u0443\u0431\u0431\u043e\u0442\u0430 label.save.and.continue=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0438\u0442\u044c label.save=\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c @@ -833,6 +975,7 @@ label.saving.processing=\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u label.scope=\u041e\u0445\u0432\u0430\u0442 label.search=\u041f\u043e\u0438\u0441\u043a label.secondary.storage.count=\u0412\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0439 \u0430\u0440\u0445\u0438\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f +label.secondary.storage.limits=\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 (\u0432 \u0413\u0438\u0411) label.secondary.storage=\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 label.secondary.storage.vm=\u0412\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b\u043e\u0432\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 label.secondary.used=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 @@ -848,6 +991,7 @@ label.select.instance=\u0412\u044b\u0431\u0438\u0440\u0438\u0442\u0435 \u0441\u0 label.select.iso.or.template=\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 ISO \u0438\u043b\u0438 \u0448\u0430\u0431\u043b\u043e\u043d label.select.offering=\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 label.select.project=\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442 +label.select.tier=\u0412\u044b\u0431\u0440\u0430\u0442\u044c Tier label.select=\u0412\u044b\u0431\u0440\u0430\u0442\u044c label.select-view=\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0432\u0438\u0434 label.select.vm.for.static.nat=\u0412\u044b\u0431\u043e\u0440 VM \u0434\u043b\u044f NAT @@ -855,6 +999,7 @@ label.sent=\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e label.server=\u0421\u0435\u0440\u0432\u0435\u0440 label.service.capabilities=\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0441\u043b\u0443\u0436\u0431\u044b label.service.offering=\u0421\u043b\u0443\u0436\u0435\u0431\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 +label.service.state=\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0441\u043b\u0443\u0436\u0431 label.session.expired=\u0412\u0440\u0435\u043c\u044f \u0441\u0435\u0441\u0441\u0438\u0438 \u0432\u044b\u0448\u043b\u043e label.setup.network=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0441\u0435\u0442\u0438 label.setup=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 @@ -925,9 +1070,11 @@ label.submitted.by=[\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430 label.submit=\u041e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c label.succeeded=\u0423\u0441\u043f\u0435\u0448\u043d\u043e label.sunday=\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435 +label.super.cidr.for.guest.networks=Super CIDR \u0433\u043e\u0441\u0442\u0435\u0432\u043e\u0439 \u0441\u0435\u0442\u0438 label.supported.services=\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0441\u043b\u0443\u0436\u0431\u044b label.supported.source.NAT.type=\u041f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u044b\u0435 \u0442\u0438\u043f\u044b NAT-\u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 label.suspend.project=\u041f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 +label.switch.type=\u0422\u0438\u043f \u0441\u0432\u0438\u0447\u0430 label.system.capacity=\u041c\u043e\u0449\u043d\u043e\u0441\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u044b label.system.offering=\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u044f label.system.service.offering=\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0440\u0435\u0441\u0443\u0440\u0441 @@ -946,6 +1093,7 @@ label.theme.default=\u0421\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430 label.theme.grey=\u0421\u0435\u0440\u0430\u044f \u0442\u0435\u043c\u0430 label.theme.lightblue=\u0413\u043e\u043b\u0443\u0431\u0430\u044f \u0442\u0435\u043c\u0430 label.thursday=\u0427\u0435\u0442\u0432\u0435\u0440\u0433 +label.tier.details=\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 Tier label.timeout.in.second = \u0412\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 (\u0441\u0435\u043a.) label.timeout=\u0412\u0440\u0435\u043c\u044f \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f label.time=\u0412\u0440\u0435\u043c\u044f @@ -981,6 +1129,7 @@ label.used=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0 label.username=\u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f label.users=\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 label.user=\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c +label.use.vm.ip=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 IP \u0412\u041c\: label.value=\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 label.vcdcname=\u0418\u043c\u044f vCenter DC label.vcenter.cluster=\u041a\u043b\u0430\u0441\u0442\u0435\u0440 vCenter @@ -995,6 +1144,7 @@ label.view.all=\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044 label.view.console=\u041f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c label.viewing=\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 label.view.more=\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 +label.view.secondary.ips=\u041f\u0440\u043e\u0441\u043c\u043e\u0442\u0440 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 label.view=\u0412\u0438\u0434 label.virtual.appliances=\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 label.virtual.appliance=\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e @@ -1005,9 +1155,7 @@ label.virtual.router=\u0412\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044 label.vlan.id=ID VLAN label.vlan.range=\u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d VLAN label.vlan=VLAN -label.vxlan.id=VXLAN ID -label.vxlan.range=\u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d Range -label.vxlan=VXLAN +label.vlan.vni.range=\u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d VLAN label.vm.add=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u044b label.vm.destroy=\u0423\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442\u044c label.vm.display.name=\u041e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u043e\u0435 \u0438\u043c\u044f \u0412\u041c @@ -1015,22 +1163,39 @@ label.VMFS.datastore=\u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 VMFS label.vmfs=VMFS label.vm.name=\u0418\u043c\u044f VM label.vm.reboot=\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c +label.VMs.in.tier=Tier \u0412\u041c +label.vmsnapshot.current=\u0422\u0435\u043a\u0443\u0449\u0435\u0439 +label.vmsnapshot.memory=\u0421\u043d\u0438\u043c\u043e\u043a \u043f\u0430\u043c\u044f\u0442\u0438 +label.vmsnapshot.parentname=\u0420\u043e\u0434\u0438\u0442\u0435\u043b\u044c label.vmsnapshot.type=\u0422\u0438\u043f +label.vmsnapshot=\u0421\u043d\u0438\u043c\u043e\u043a \u0412\u041c label.vm.start=\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c label.vm.state=\u0421\u0442\u0430\u0442\u0443\u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 label.vm.stop=\u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c label.vms=\u0412\u041c label.vmware.traffic.label=\u041c\u0435\u0442\u043a\u0430 \u0442\u0440\u0430\u0444\u0438\u043a\u0430 VMware +label.vnet.id=ID VLAN +label.vnet=VLAN label.volgroup=\u0413\u0440\u0443\u043f\u043f\u0430 \u0442\u043e\u043c\u0430 label.volume.limits=\u041f\u0440\u0435\u0434\u0435\u043b\u044b \u0442\u043e\u043c\u043e\u0432 label.volume.name=\u0418\u043c\u044f \u0442\u043e\u043c\u0430 label.volumes=\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f label.volume=\u0422\u043e\u043c +label.vpc.id=VPC ID +label.VPC.router.details=\u0414\u0435\u0442\u0430\u043b\u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430 VPC +label.vpc=VPC +label.VPN.connection=VPN \u043f\u043e\u0434\u043b\u044e\u0447\u0435\u043d\u0438\u0435 +label.vpn.customer.gateway=VPN \u0448\u043b\u044e\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 +label.VPN.customer.gateway=VPN \u0448\u043b\u044e\u0437 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 +label.VPN.gateway=VPN \u0448\u043b\u044e\u0437 label.vpn=VPN label.vsmctrlvlanid=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 VLAN ID label.vsmpktvlanid=\u041f\u0430\u043a\u0435\u0442 VLAN ID label.vsmstoragevlanid=\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 VLAN ID label.vsphere.managed=\u041e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u0435 vSphere +label.vxlan.id=VXLAN ID +label.vxlan.range=\u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d Range +label.vxlan=VXLAN label.waiting=\u041e\u0436\u0438\u0434\u0430\u043d\u0438\u0435 label.warn=\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435 label.wednesday=\u0421\u0440\u0435\u0434\u0430 @@ -1051,8 +1216,14 @@ label.zones=\u0417\u043e\u043d\u044b label.zone.type=\u0422\u0438\u043f \u0437\u043e\u043d\u044b label.zone=\u0417\u043e\u043d\u0430 label.zone.wide=\u0412\u0441\u0435\u0439 \u0437\u043e\u043d\u044b +label.zoneWizard.trafficType.guest=\u0413\u043e\u0441\u0442\u0435\u0432\u043e\u0439\: \u0422\u0440\u0430\u0444\u0438\u043a \u043c\u0435\u0436\u0434\u0443 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 +label.zoneWizard.trafficType.management=\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\: \u0422\u0440\u0430\u0444\u0438\u043a \u043c\u0435\u0436\u0434\u0443 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c CloudStack, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043b\u044e\u0431\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0443\u0437\u043b\u044b \u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u043c\u0430\u0448\u0438\u043d\u044b. +label.zoneWizard.trafficType.public=\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439\: \u0442\u0440\u0430\u0444\u0438\u043a \u043c\u0435\u0436\u0434\u0443 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u043e\u043c \u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438 \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 +label.zoneWizard.trafficType.storage=\u0425\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435\: \u0422\u0440\u0430\u0444\u0438\u043a \u043c\u0435\u0436\u0434\u0443 \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u044b\u043c\u0438 \u0438 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u043c\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u043c\u0438 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u0448\u0430\u0431\u043b\u043e\u043d\u044b \u0438 \u0441\u043d\u0438\u043c\u043a\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043c\u0430\u0448\u0438\u043d. managed.state=\u0421\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f +message.acquire.ip.nic=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0445\u043e\u0442\u0435\u043b\u0438 \u0431\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u044b\u0439 IP \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e NIC.
\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435\: \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043d\u0435\u0434\u0430\u0432\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0439 IP \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b. message.acquire.new.ip=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c "\u0431\u0435\u043b\u044b\u0439" IP \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0441\u0435\u0442\u0438. +message.acquire.new.ip.vpc=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c "\u0431\u0435\u043b\u044b\u0439" IP \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e VPC. message.acquire.public.ip=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0437\u043e\u043d\u0443, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u043e\u0431\u0440\u0435\u0441\u0442\u0438 \u043d\u043e\u0432\u044b\u0439 IP. message.action.cancel.maintenance.mode=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0440\u0435\u0436\u0438\u043c \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f. message.action.cancel.maintenance=\u0423\u0437\u0435\u043b \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0432\u044b\u0448\u0435\u043b \u0438\u0437 \u0440\u0435\u0436\u0438\u043c\u0430 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f. \u042d\u0442\u043b\u044c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043c\u043e\u0436\u0435\u0442 \u0434\u043b\u0438\u0442\u044c\u0441\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0438\u043d\u0443\u0442. @@ -1068,6 +1239,7 @@ message.action.delete.ISO.for.all.zones=\u042d\u0442\u043e ISO, \u0438\u0441\u04 message.action.delete.ISO=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 ISO. message.action.delete.network=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0435\u0442\u044c. message.action.delete.nexusVswitch=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e nexusVswitch. +message.action.delete.nic=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 NIC, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0430\u043a\u0436\u0435 \u0443\u0434\u0430\u043b\u0438\u0442 \u0432\u0441\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 \u0438\u0437 \u0412\u041c. message.action.delete.physical.network=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0441\u0435\u0442\u044c message.action.delete.pod=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u0442\u0435\u043d\u0434. message.action.delete.primary.storage=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. @@ -1109,6 +1281,7 @@ message.action.remove.host=\u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u04 message.action.reset.password.off=\u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u0430\u0448\u0438\u043d\u0430 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e message.action.reset.password.warning=\u041c\u0430\u0448\u0438\u043d\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f message.action.restore.instance=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u043c\u0430\u0448\u0438\u043d\u0443. +message.action.revert.snapshot=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0434\u0438\u0441\u043a \u043a \u044d\u0442\u043e\u043c\u0443 \u0442\u043e\u043c \u0441\u043d\u0438\u043c\u043a\u0443 message.action.start.instance=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u0443 \u043c\u0430\u0448\u0438\u043d\u0443. message.action.start.router=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0440\u043e\u0443\u0442\u0435\u0440. message.action.start.systemvm=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0412\u041c. @@ -1117,6 +1290,8 @@ message.action.stop.router=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u043 message.action.stop.systemvm=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u0443\u044e \u0412\u041c. message.action.take.snapshot=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u043d\u0438\u043c\u043e\u043a \u044d\u0442\u043e\u0433\u043e \u0442\u043e\u043c\u0430. message.action.unmanage.cluster=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0432 \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0440\u0435\u0436\u0438\u043c. +message.action.vmsnapshot.delete=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u043d\u0438\u043c\u043e\u043a \u0412\u041c. +message.action.vmsnapshot.revert=\u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043d\u0438\u043c\u043e\u043a \u0412\u041c message.activate.project=\u0412\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442? message.add.cluster=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u0437\u043e\u043d\u044b , \u043c\u043e\u0434\u0443\u043b\u044c message.add.cluster.zone=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u043c \u0434\u043b\u044f \u0437\u043e\u043d\u044b @@ -1135,18 +1310,22 @@ message.additional.networks.desc=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u044 message.add.load.balancer=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u0437\u043e\u043d\u0443 message.add.load.balancer.under.ip=\u041f\u0440\u0430\u0432\u0438\u043b\u043e \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0431\u044b\u043b \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 IP\: message.add.network=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u0441\u0435\u0442\u044c \u0434\u043b\u044f \u0437\u043e\u043d\u044b\: +message.add.new.gateway.to.vpc=\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0448\u043b\u044e\u0437\u0430 \u0432 VPC message.add.pod.during.zone.creation=\u041a\u0430\u0436\u0434\u0430\u044f \u0437\u043e\u043d\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0435\u043d\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0435 \u043f\u0435\u0440\u0432\u044b\u043c. \u0421\u0442\u0435\u043d\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0443\u0437\u043b\u044b \u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u044b \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u043c \u0448\u0430\u0433\u0435. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 IP \u0434\u043b\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0439 \u0441\u0435\u0442\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0414\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0440\u0435\u0437\u0435\u0440\u0432\u043d\u044b\u0445 IP \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u043e\u043d\u044b \u043e\u0431\u043b\u0430\u043a\u0430. message.add.pod=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0441\u0442\u0435\u043d\u0434 \u0434\u043b\u044f \u0437\u043e\u043d\u044b message.add.primary.storage=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0434\u043b\u044f \u0437\u043e\u043d\u044b , \u0441\u0442\u0435\u043d\u0434\u0430 message.add.primary=\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 +message.add.region=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u0433\u0438\u043e\u043d\u0430. message.add.secondary.storage=\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u0432 \u0437\u043e\u043d\u0443 message.add.service.offering=\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430. message.add.system.service.offering=\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u0441\u0443\u0440\u0441\u0430 \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0441\u043b\u0443\u0436\u0431. message.add.template=\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0430 message.add.volume=\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0442\u043e\u043c\u0430 +message.add.VPN.gateway=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c VPN \u0448\u043b\u044e\u0437 message.advanced.mode.desc=\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u044d\u0442\u0443 \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u0435\u0442\u0438, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0443 VLAN. \u042d\u0442\u0430 \u0441\u0435\u0442\u0435\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0430\u043c \u0434\u043b\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441\u0435\u0442\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u043c\u0435\u0436\u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u044d\u043a\u0440\u0430\u043d, VPN, \u0438\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u044f\u043c\u043e\u0435 \u043f\u0440\u043e\u0442\u0438\u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0439. message.advanced.security.group=\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. message.advanced.virtual=\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435\u0439 \u0437\u043e\u043d\u044b \u0441\u0435\u0442\u0438 VLAN, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. +message.after.enable.s3=S3-\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e. \u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435\: \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043a\u0438\u043d\u0435\u0442\u0435 \u044d\u0442\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0432\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c S3 \u0441\u043d\u043e\u0432\u0430. message.after.enable.swift=Swift \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d. \u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435\: \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u043a\u0438\u043d\u0435\u0442\u0435 \u044d\u0442\u0443 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0432\u0430\u043c \u043d\u0435 \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c Swift \u0441\u043d\u043e\u0432\u0430 message.alert.state.detected=\u041e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d \u0441\u0438\u0433\u043d\u0430\u043b \u0442\u0440\u0435\u0432\u043e\u0433\u0438 message.allow.vpn.access=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043b\u044f VPN-\u0434\u043e\u0441\u0442\u0443\u043f\u0430. @@ -1164,6 +1343,7 @@ message.configuring.storage.traffic=\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u message.confirm.action.force.reconnect=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0443\u0437\u043b\u0443 message.confirm.delete.F5=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c F5 message.confirm.delete.NetScaler=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c NetScaler +message.confirm.delete.PA=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c Palo Alto message.confirm.delete.SRX=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c SRX message.confirm.destroy.router=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0440\u043e\u0443\u0442\u0435\u0440 message.confirm.disable.provider=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0430 @@ -1184,9 +1364,15 @@ message.creating.primary.storage=\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u043 message.creating.secondary.storage=\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0430 message.creating.zone=\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0437\u043e\u043d\u044b message.decline.invitation=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442. +message.dedicate.zone=\u0412\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u0430\u044f \u0437\u043e\u043d\u0430 message.delete.account=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0430\u043a\u043a\u0430\u0443\u043d\u0442. +message.delete.affinity.group=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u0443 affinity group +message.delete.gateway=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0448\u043b\u044e\u0437. message.delete.project=\u0412\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442? message.delete.user=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. +message.delete.VPN.connection=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. +message.delete.VPN.customer.gateway=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0448\u043b\u044e\u0437 VPN. +message.delete.VPN.gateway=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0448\u043b\u044e\u0437 VPN. message.desc.advanced.zone=\u0414\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0435\u0442\u0435\u0432\u044b\u0445 \u0442\u043e\u043f\u043e\u043b\u043e\u0433\u0438\u0439. \u042d\u0442\u0430 \u0441\u0435\u0442\u0435\u0432\u0430\u044f \u043c\u043e\u0434\u0435\u043b\u044c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0433\u0438\u0431\u043a\u043e\u0441\u0442\u044c \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 \u0433\u043e\u0441\u0442\u0435\u0432\u043e\u0439 \u0441\u0435\u0442\u0438 \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0443\u0441\u043b\u0443\u0433, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a \u043c\u0435\u0436\u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u044d\u043a\u0440\u0430\u043d, VPN, \u0438\u043b\u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0438. message.desc.basic.zone=\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0435\u0434\u0438\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0441\u0435\u0442\u044c, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u0430\u044f \u0412\u041c \u0438\u043c\u0435\u0435\u0442 \u00ab\u0431\u0435\u043b\u044b\u0439\u00bb IP-\u0430\u0434\u0440\u0435\u0441 \u0441\u0435\u0442\u0438. \u0418\u0437\u043e\u043b\u044f\u0446\u0438\u0438 \u0433\u043e\u0441\u0442\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0435\u0442\u0438 3-\u0433\u043e \u0443\u0440\u043e\u0432\u043d\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0433\u0440\u0443\u043f\u043f\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 (\u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f IP-\u0432\u0434\u0440\u0435\u0441\u043e\u0432) message.desc.cluster=\u041a\u0430\u0436\u0434\u044b\u0439 \u0441\u0442\u0435\u043d\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u043e\u0432, \u043f\u0435\u0440\u0432\u044b\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0432\u044b \u0441\u0435\u0439\u0447\u0430\u0441 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0435. \u041a\u043b\u0430\u0441\u0442\u0435\u0440 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0433\u0440\u0443\u043f\u043f\u0443 \u0443\u0437\u043b\u043e\u0432. \u0423\u0437\u043b\u044b \u0432 \u043a\u043b\u0430\u0441\u0442\u0435\u0440\u0435 \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u043e\u0431\u043e\u0440\u0443\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0434\u0438\u043d \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440, \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043e\u0434\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0438 \u0438\u043c\u0435\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438 \u0442\u043e\u043c\u0443 \u0436\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u043c\u0443 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0443. \u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u043b\u0430\u0441\u0442\u0435\u0440 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u0431\u043e\u043b\u0435\u0435 \u0443\u0437\u043b\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0435\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449. @@ -1269,6 +1455,7 @@ message.migrate.router.confirm=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\ message.migrate.systemvm.confirm=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0440\u043e\u0443\u0442\u0435\u0440 \u0432 \u0443\u0437\u0435\u043b message.migrate.volume=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0442\u043e\u043c \u0432 \u0434\u0440\u0443\u0433\u043e\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u043b\u0438\u0449\u0435. message.new.user=\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u0443\u0447\u0451\u0442\u043d\u0443\u044e \u0437\u0430\u043f\u0438\u0441\u044c. +message.no.affinity.groups=\u0412\u044b \u043d\u0435 \u0438\u043c\u0435\u0435\u0442\u0435 affinity groups. \u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0448\u0430\u0433\u0443. message.no.network.support.configuration.not.true=\u041d\u0438 \u0432 \u043e\u0434\u043d\u043e\u0439 \u0437\u043e\u043d\u0435 \u043d\u0435\u0442 \u0433\u0440\u0443\u043f\u043f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0442\u0435\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043a \u0448\u0430\u0433\u0443 5. message.no.network.support=\u0412\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u0433\u0438\u043f\u0435\u0440\u0432\u0438\u0437\u043e\u0440 (vSphere) \u043d\u0435 \u043e\u0431\u043b\u0430\u0434\u0430\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0441\u0435\u0442\u0435\u0432\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0434\u043d\u043e\u0441\u0442\u044f\u043c\u0438. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u043a \u0448\u0430\u0433\u0443 5. message.no.projects.adminOnly=\u0423 \u0432\u0430\u0441 \u043d\u0435\u0442 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432.
\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c \u043a \u0432\u0430\u0448\u0435\u043c\u0443 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. @@ -1289,13 +1476,19 @@ message.please.wait.while.zone.is.being.created=\u041f\u043e\u0434\u043e\u0436\u message.project.invite.sent=\u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u0431\u044b\u043b\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e; \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f. message.public.traffic.in.advanced.zone=\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0412\u041c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443. \u041f\u0443\u0431\u043b\u0438\u0447\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 IP \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u0438\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CloudStack UI \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f IP \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f NAT, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u0433\u043e\u0441\u0442\u0435\u0432\u043e\u0439 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u044c\u044e.

\u0423\u043a\u0430\u0436\u0438\u0442\u0435 \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043e\u0434\u0438\u043d \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442-\u0442\u0440\u0430\u0444\u0438\u043a\u0430. message.public.traffic.in.basic.zone=\u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0439 \u0442\u0440\u0430\u0444\u0438\u043a \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0412\u041c \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0443 \u0438\u043b\u0438 \u043f\u0440\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c \u0441\u043b\u0443\u0436\u0431 \u0447\u0435\u0440\u0435\u0437 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442. \u041f\u0443\u0431\u043b\u0438\u0447\u043d\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 IP \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u044b. \u041f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u0412\u041c, \u0430\u0434\u0440\u0435\u0441 \u0438\u0437 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 Ip \u043f\u0440\u0438\u0432\u044f\u0436\u0435\u0442\u0441\u044f \u043a \u043c\u0430\u0448\u0438\u043d\u0435 \u0432 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0433\u043e\u0441\u0442\u0435\u0432\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 IP. \u0421\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 1-1 NAT \u0434\u043e\u043b\u0436\u0435\u043d \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u043c\u0435\u0436\u0434\u0443 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0438 \u0433\u043e\u0441\u0442\u0435\u0432\u043e\u0439 \u0441\u0435\u0442\u044c\u044e. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0442\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CloudStack UI \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e NAT \u043c\u0435\u0436\u0434\u0443 \u043c\u0430\u0448\u0438\u043d\u0430\u043c\u0438 \u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u043e\u0439 \u0441\u0435\u0442\u044c\u044e. +message.redirecting.region=\u041f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432 \u0440\u0435\u0433\u0438\u043e\u043d +message.remove.region=\u0412\u044b \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u0440\u0435\u0433\u0438\u043e\u043d \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f? +message.remove.vpc=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u044d\u0442\u043e\u0442 VPC message.remove.vpn.access=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a VPN \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. message.reset.password.warning.notPasswordEnabled=\u0428\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u044b \u0441\u043e\u0437\u0434\u0430\u043d \u0431\u0435\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f message.reset.password.warning.notStopped=\u0414\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043c\u0430\u0448\u0438\u043d\u0443 +message.reset.VPN.connection=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0412\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u0442\u043e VPN \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435. message.restart.mgmt.server=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440(\u044b) \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a. message.restart.mgmt.usage.server=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440 \u0434\u043b\u044f \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 \u0441\u0438\u043b\u0443. message.restart.network=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0442\u044c. +message.restart.vpc=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c VPC message.security.group.usage=(\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 Ctrl-\u043a\u043b\u0438\u043a, \u0447\u0442\u043e\u0431\u044b \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438) +message.select.affinity.groups=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043b\u044e\u0431\u044b\u0435 affinity groups, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043d\u0430\u0434\u043b\u0435\u0436\u0438\u0442 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0448\u0438\u043d\u0430\: message.select.a.zone=\u0417\u043e\u043d\u0430 \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u043c\u0443 \u0446\u0435\u043d\u0442\u0440\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u043e\u043d\u044b\u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0435 \u043e\u0431\u043b\u0430\u043a\u0430, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044e \u0438 \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c. message.select.instance=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0441\u0435\u0440\u0432\u0435\u0440. message.select.iso=\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u0431\u0440\u0430\u0437 ISO \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0439 \u0412\u041c @@ -1315,7 +1508,7 @@ message.step.3.continue=\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0434\ message.step.3.desc= message.step.4.continue=\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u0443 \u0441\u0435\u0442\u044c \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f. message.step.4.desc=\u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u0441\u0435\u0442\u044c, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0430. -message.storage.traffic=\u0422\u0440\u0430\u0444\u0438\u043a \u043c\u0435\u0436\u0434\u0443 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 CloudStack, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u0441\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0445\u043e\u0441\u0442\u044b \u0438 CloudStack \u0441\u0438\u0441\u0442\u0435\u043c\u044b. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0442\u0440\u0430\u0444\u0438\u043a \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0437\u0434\u0435\u0441\u044c. +message.storage.traffic=\u0422\u0440\u0430\u0444\u0438\u043a \u043c\u0435\u0436\u0434\u0443 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u0430\u043c\u0438 CloudStack, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0432\u0441\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0442 \u0441 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0443\u0437\u043b\u044b \u0438 CloudStack \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0412\u041c. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0442\u0440\u0430\u0444\u0438\u043a \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0437\u0434\u0435\u0441\u044c. message.suspend.project=\u0412\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442? message.template.desc=\u041e\u0431\u0440\u0430\u0437 \u041e\u0421, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0437\u0430\u0433\u0440\u0443\u0437\u043e\u0447\u043d\u043e\u0439 \u0432 \u0412\u041c message.tooltip.dns.1=\u0418\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 DNS \u0434\u043b\u044f \u0412\u041c \u044d\u0442\u043e\u0439 \u0437\u043e\u043d\u044b. \u041f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 IP-\u0430\u0434\u0440\u0435\u0441\u0430 \u044d\u0442\u043e\u0439 \u0437\u043e\u043d\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0434\u043e \u044d\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. @@ -1331,6 +1524,7 @@ message.update.os.preference=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0 message.update.resource.count=\u041f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u044b \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0447\u0435\u0442\u0447\u0438\u043a \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430. message.update.ssl=\u041f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043e\u0442\u043f\u0440\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0439 X.509 SSL \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442 \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u043a\u0441\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440\: message.validate.instance.name=\u0418\u043c\u044f \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043b\u0438\u043d\u0435\u0435 63 \u0441\u0438\u043c\u0432\u043e\u043b\u0430. \u0422\u043e\u043b\u044c\u043a\u043e ASCII, \u0431\u0443\u043a\u0432\u044b a~z, A~Z, \u0446\u044b\u0444\u0440\u044b 0~9, \u0434\u0435\u0444\u0438\u0441 \u043d\u0435 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f. \u0414\u043e\u043b\u0436\u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 \u0431\u0443\u043a\u0432\u044b \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0431\u0443\u043a\u0432\u043e\u0439 \u0438\u043b\u0438 \u0446\u0438\u0444\u0440\u043e\u0439. +message.validate.invalid.characters=\u041d\u0430\u0439\u0434\u0435\u043d\u044b \u043d\u0435\u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c\u044b\u0435 \u0441\u0438\u043c\u0432\u043e\u043b\u044b; \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u043f\u043e\u043f\u0440\u0430\u0432\u044c\u0442\u0435. message.virtual.network.desc=\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0435\u0442\u0438 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0439 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438. \u0428\u0438\u0440\u043e\u043a\u043e\u0432\u0435\u0449\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0434\u043e\u043c\u0435\u043d \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 VLAN \u0438 \u0432\u0435\u0441\u044c \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0442\u0438 \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0443\u0442\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0442\u043e\u0440\u0430. message.vm.create.template.confirm=\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0412\u041c message.vm.review.launch=\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u044c\u0442\u0435\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0430\u0448\u0430 \u043c\u0430\u0448\u0438\u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u0430 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e. diff --git a/client/WEB-INF/classes/resources/messages_zh_CN.properties b/client/WEB-INF/classes/resources/messages_zh_CN.properties index ea7bfd4c6e..1ec4e9537a 100644 --- a/client/WEB-INF/classes/resources/messages_zh_CN.properties +++ b/client/WEB-INF/classes/resources/messages_zh_CN.properties @@ -14,57 +14,12 @@ # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. -label.port=\u7aef\u53e3 -label.remove.ldap=\u5220\u9664 LDAP -label.configure.ldap=\u914d\u7f6e LDAP -label.ldap.configuration=LDAP \u914d\u7f6e -label.ldap.port=LDAP \u7aef\u53e3 -label.create.nfs.secondary.staging.store=\u521b\u5efa NFS \u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8 -label.volatile=\u53ef\u53d8 -label.planner.mode=\u89c4\u5212\u5668\u6a21\u5f0f -label.deployment.planner=\u90e8\u7f72\u89c4\u5212\u5668 -label.quiesce.vm=\u9759\u9ed8 VM -label.smb.username=SMB \u7528\u6237\u540d -label.smb.password=SMB \u5bc6\u7801 -label.smb.domain=SMB \u57df -label.hypervisors=\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f -label.home=\u9996\u9875 -label.sockets=CPU \u63d2\u69fd -label.root.disk.size=\u6839\u78c1\u76d8\u5927\u5c0f -label.s3.nfs.server=S3 NFS \u670d\u52a1\u5668 -label.s3.nfs.path=S3 NFS \u8def\u5f84 -label.delete.events=\u5220\u9664\u4e8b\u4ef6 -label.delete.alerts=\u5220\u9664\u8b66\u62a5 -label.archive.alerts=\u5b58\u6863\u8b66\u62a5 -label.archive.events=\u5b58\u6863\u4e8b\u4ef6 -label.by.alert.type=\u6309\u8b66\u62a5\u7c7b\u578b -label.by.event.type=\u6309\u4e8b\u4ef6\u7c7b\u578b -label.by.date.start=\u6309\u65e5\u671f(\u5f00\u59cb\u65e5\u671f) -label.by.date.end=\u6309\u65e5\u671f(\u7ed3\u675f\u65e5\u671f) -label.switch.type=\u4ea4\u6362\u673a\u7c7b\u578b -label.service.state=\u670d\u52a1\u72b6\u6001 -label.egress.default.policy=\u51fa\u53e3\u9ed8\u8ba4\u7b56\u7565 -label.routing=\u6b63\u5728\u8def\u7531 -label.about=\u5173\u4e8e -label.app.name=CloudStack -label.about.app=\u5173\u4e8e CloudStack -label.custom.disk.iops=\u81ea\u5b9a\u4e49 IOPS -label.disk.iops.min=\u6700\u5c0f IOPS -label.disk.iops.max=\u6700\u5927 IOPS -label.disk.iops.total=\u603b IOPS -label.hypervisor.snapshot.reserve=\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u5feb\u7167\u9884\u7559 -label.view.secondary.ips=\u67e5\u770b\u4e8c\u7ea7 IP -message.validate.invalid.characters=\u67e5\u627e\u5230\u65e0\u6548\u5b57\u7b26\uff0c\u8bf7\u66f4\u6b63\u3002 -message.acquire.ip.nic=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u83b7\u53d6\u6b64 NIC \u7684\u65b0\u4e8c\u7ea7 IP\u3002
\u6ce8\u610f: \u60a8\u9700\u8981\u5728\u865a\u62df\u673a\u5185\u90e8\u624b\u52a8\u914d\u7f6e\u65b0\u83b7\u53d6\u7684\u4e8c\u7ea7 IP\u3002 -message.select.affinity.groups=\u8bf7\u9009\u62e9\u60a8\u5e0c\u671b\u6b64 VM \u6240\u5c5e\u7684\u4efb\u4f55\u5173\u8054\u6027\u7ec4: -message.no.affinity.groups=\u60a8\u6ca1\u6709\u4efb\u4f55\u5173\u8054\u6027\u7ec4\u3002\u8bf7\u7ee7\u7eed\u6267\u884c\u4e0b\u4e00\u6b65\u64cd\u4f5c\u3002 -label.action.delete.nic=\u79fb\u9664 NIC -message.action.delete.nic=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u79fb\u9664\u6b64 NIC\uff0c\u6b64\u64cd\u4f5c\u8fd8\u5c06\u4ece VM \u4e2d\u79fb\u9664\u5173\u8054\u7684\u7f51\u7edc\u3002 + changed.item.properties=\u66f4\u6539\u9879\u76ee\u5c5e\u6027 -confirm.enable.s3=\u8bf7\u586b\u5199\u4ee5\u4e0b\u4fe1\u606f\u4ee5\u542f\u7528\u5bf9 S3 \u652f\u6301\u7684\u4e8c\u7ea7\u5b58\u50a8\u7684\u652f\u6301 +confirm.enable.s3=\u8bf7\u586b\u5199\u4ee5\u4e0b\u4fe1\u606f\u4ee5\u542f\u7528\u5bf9 S3 \u652f\u6301\u7684\u8f85\u52a9\u5b58\u50a8\u7684\u652f\u6301 confirm.enable.swift=\u8bf7\u586b\u5199\u4ee5\u4e0b\u4fe1\u606f\u4ee5\u542f\u7528\u5bf9 SWIFT \u7684\u652f\u6301 error.could.not.change.your.password.because.ldap.is.enabled=\u9519\u8bef\u3002LDAP \u5904\u4e8e\u542f\u7528\u72b6\u6001\uff0c\u65e0\u6cd5\u66f4\u6539\u60a8\u7684\u5bc6\u7801\u3002 -error.could.not.enable.zone=\u65e0\u6cd5\u542f\u7528\u8d44\u6e90\u57df +error.could.not.enable.zone=\u65e0\u6cd5\u542f\u7528\u533a\u57df error.installWizard.message=\u51fa\u73b0\u95ee\u9898\uff1b\u8bf7\u8fd4\u56de\u5e76\u66f4\u6b63\u4efb\u4f55\u9519\u8bef error.invalid.username.password=\u7528\u6237\u540d\u6216\u5bc6\u7801\u65e0\u6548 error.login=\u60a8\u7684\u7528\u6237\u540d/\u5bc6\u7801\u4e0e\u6211\u4eec\u7684\u8bb0\u5f55\u4e0d\u4e00\u81f4\u3002 @@ -88,15 +43,19 @@ ICMP.type=ICMP \u7c7b\u578b image.directory=\u56fe\u7247\u76ee\u5f55 inline=\u5185\u8054 instances.actions.reboot.label=\u91cd\u65b0\u542f\u52a8\u5b9e\u4f8b +label.about.app=\u5173\u4e8e CloudStack +label.about=\u5173\u4e8e label.accept.project.invitation=\u63a5\u53d7\u9879\u76ee\u9080\u8bf7 label.account.and.security.group=\u5e10\u6237\u3001\u5b89\u5168\u7ec4 label.account.id=\u5e10\u6237 ID +label.account.lower=\u5e10\u6237 label.account.name=\u5e10\u6237\u540d\u79f0 label.account.specific=\u5e10\u6237\u4e13\u7528 -label.account=\u5e10\u6237 label.accounts=\u5e10\u6237 +label.account=\u5e10\u6237 +label.acl=ACL label.acquire.new.ip=\u83b7\u53d6\u65b0 IP -label.acquire.new.secondary.ip=\u83b7\u53d6\u65b0\u4e8c\u7ea7 IP +label.acquire.new.secondary.ip=\u83b7\u53d6\u65b0\u8f85\u52a9 IP label.action.attach.disk.processing=\u6b63\u5728\u9644\u52a0\u78c1\u76d8... label.action.attach.disk=\u9644\u52a0\u78c1\u76d8 label.action.attach.iso.processing=\u6b63\u5728\u9644\u52a0 ISO... @@ -139,13 +98,14 @@ label.action.delete.load.balancer=\u5220\u9664\u8d1f\u8f7d\u5e73\u8861\u5668\u89 label.action.delete.network.processing=\u6b63\u5728\u5220\u9664\u7f51\u7edc... label.action.delete.network=\u5220\u9664\u7f51\u7edc label.action.delete.nexusVswitch=\u5220\u9664 Nexus 1000v +label.action.delete.nic=\u79fb\u9664 NIC label.action.delete.physical.network=\u5220\u9664\u7269\u7406\u7f51\u7edc label.action.delete.pod.processing=\u6b63\u5728\u5220\u9664\u63d0\u4f9b\u70b9... label.action.delete.pod=\u5220\u9664\u63d0\u4f9b\u70b9 label.action.delete.primary.storage.processing=\u6b63\u5728\u5220\u9664\u4e3b\u5b58\u50a8... label.action.delete.primary.storage=\u5220\u9664\u4e3b\u5b58\u50a8 -label.action.delete.secondary.storage.processing=\u6b63\u5728\u5220\u9664\u4e8c\u7ea7\u5b58\u50a8... -label.action.delete.secondary.storage=\u5220\u9664\u4e8c\u7ea7\u5b58\u50a8 +label.action.delete.secondary.storage.processing=\u6b63\u5728\u5220\u9664\u8f85\u52a9\u5b58\u50a8... +label.action.delete.secondary.storage=\u5220\u9664\u8f85\u52a9\u5b58\u50a8 label.action.delete.security.group.processing=\u6b63\u5728\u5220\u9664\u5b89\u5168\u7ec4... label.action.delete.security.group=\u5220\u9664\u5b89\u5168\u7ec4 label.action.delete.service.offering.processing=\u6b63\u5728\u5220\u9664\u670d\u52a1\u65b9\u6848... @@ -159,8 +119,8 @@ label.action.delete.user.processing=\u6b63\u5728\u5220\u9664\u7528\u6237... label.action.delete.user=\u5220\u9664\u7528\u6237 label.action.delete.volume.processing=\u6b63\u5728\u5220\u9664\u5377... label.action.delete.volume=\u5220\u9664\u5377 -label.action.delete.zone.processing=\u6b63\u5728\u5220\u9664\u8d44\u6e90\u57df... -label.action.delete.zone=\u5220\u9664\u8d44\u6e90\u57df +label.action.delete.zone.processing=\u6b63\u5728\u5220\u9664\u533a\u57df... +label.action.delete.zone=\u5220\u9664\u533a\u57df label.action.destroy.instance.processing=\u6b63\u5728\u9500\u6bc1\u5b9e\u4f8b... label.action.destroy.instance=\u9500\u6bc1\u5b9e\u4f8b label.action.destroy.systemvm.processing=\u6b63\u5728\u9500\u6bc1\u7cfb\u7edf VM... @@ -181,8 +141,8 @@ label.action.disable.static.NAT.processing=\u6b63\u5728\u7981\u7528\u9759\u6001 label.action.disable.static.NAT=\u7981\u7528\u9759\u6001 NAT label.action.disable.user.processing=\u6b63\u5728\u7981\u7528\u7528\u6237... label.action.disable.user=\u7981\u7528\u7528\u6237 -label.action.disable.zone.processing=\u6b63\u5728\u7981\u7528\u8d44\u6e90\u57df... -label.action.disable.zone=\u7981\u7528\u8d44\u6e90\u57df +label.action.disable.zone.processing=\u6b63\u5728\u7981\u7528\u533a\u57df... +label.action.disable.zone=\u7981\u7528\u533a\u57df label.action.download.ISO=\u4e0b\u8f7d ISO label.action.download.template=\u4e0b\u8f7d\u6a21\u677f label.action.download.volume.processing=\u6b63\u5728\u4e0b\u8f7d\u5377... @@ -203,7 +163,7 @@ label.action.edit.resource.limits=\u7f16\u8f91\u8d44\u6e90\u9650\u5236 label.action.edit.service.offering=\u7f16\u8f91\u670d\u52a1\u65b9\u6848 label.action.edit.template=\u7f16\u8f91\u6a21\u677f label.action.edit.user=\u7f16\u8f91\u7528\u6237 -label.action.edit.zone=\u7f16\u8f91\u8d44\u6e90\u57df +label.action.edit.zone=\u7f16\u8f91\u533a\u57df label.action.enable.account.processing=\u6b63\u5728\u542f\u7528\u5e10\u6237... label.action.enable.account=\u542f\u7528\u5e10\u6237 label.action.enable.cluster.processing=\u6b63\u5728\u542f\u7528\u7fa4\u96c6... @@ -218,10 +178,10 @@ label.action.enable.static.NAT.processing=\u6b63\u5728\u542f\u7528\u9759\u6001 N label.action.enable.static.NAT=\u542f\u7528\u9759\u6001 NAT label.action.enable.user.processing=\u6b63\u5728\u542f\u7528\u7528\u6237... label.action.enable.user=\u542f\u7528\u7528\u6237 -label.action.enable.zone.processing=\u6b63\u5728\u542f\u7528\u8d44\u6e90\u57df... -label.action.enable.zone=\u542f\u7528\u8d44\u6e90\u57df -label.action.expunge.instance=\u5220\u9664\u5b9e\u4f8b +label.action.enable.zone.processing=\u6b63\u5728\u542f\u7528\u533a\u57df... +label.action.enable.zone=\u542f\u7528\u533a\u57df label.action.expunge.instance.processing=\u6b63\u5728\u5220\u9664\u5b9e\u4f8b... +label.action.expunge.instance=\u5220\u9664\u5b9e\u4f8b label.action.force.reconnect.processing=\u6b63\u5728\u91cd\u65b0\u8fde\u63a5... label.action.force.reconnect=\u5f3a\u5236\u91cd\u65b0\u8fde\u63a5 label.action.generate.keys.processing=\u6b63\u5728\u751f\u6210\u5bc6\u94a5... @@ -257,6 +217,8 @@ label.action.resize.volume=\u8c03\u6574\u5377\u5927\u5c0f label.action.resource.limits=\u8d44\u6e90\u9650\u5236 label.action.restore.instance.processing=\u6b63\u5728\u8fd8\u539f\u5b9e\u4f8b... label.action.restore.instance=\u8fd8\u539f\u5b9e\u4f8b +label.action.revert.snapshot.processing=\u6b63\u5728\u8fd8\u539f\u5230\u5feb\u7167... +label.action.revert.snapshot=\u8fd8\u539f\u5230\u5feb\u7167 label.action.start.instance.processing=\u6b63\u5728\u542f\u52a8\u5b9e\u4f8b... label.action.start.instance=\u542f\u52a8\u5b9e\u4f8b label.action.start.router.processing=\u6b63\u5728\u542f\u52a8\u8def\u7531\u5668... @@ -269,10 +231,10 @@ label.action.stop.router.processing=\u6b63\u5728\u505c\u6b62\u8def\u7531\u5668.. label.action.stop.router=\u505c\u6b62\u8def\u7531\u5668 label.action.stop.systemvm.processing=\u6b63\u5728\u505c\u6b62\u7cfb\u7edf VM... label.action.stop.systemvm=\u505c\u6b62\u7cfb\u7edf VM +label.actions=\u64cd\u4f5c label.action.take.snapshot.processing=\u6b63\u5728\u521b\u5efa\u5feb\u7167... label.action.take.snapshot=\u521b\u5efa\u5feb\u7167 -label.action.revert.snapshot.processing=\u6b63\u5728\u8fd8\u539f\u5230\u5feb\u7167... -label.action.revert.snapshot=\u8fd8\u539f\u5230\u5feb\u7167 +label.action=\u64cd\u4f5c label.action.unmanage.cluster.processing=\u6b63\u5728\u53d6\u6d88\u6258\u7ba1\u7fa4\u96c6... label.action.unmanage.cluster=\u53d6\u6d88\u6258\u7ba1\u7fa4\u96c6 label.action.update.OS.preference.processing=\u6b63\u5728\u66f4\u65b0\u64cd\u4f5c\u7cfb\u7edf\u9996\u9009\u9879... @@ -282,15 +244,15 @@ label.action.update.resource.count=\u66f4\u65b0\u8d44\u6e90\u6570\u91cf label.action.vmsnapshot.create=\u521b\u5efa VM \u5feb\u7167 label.action.vmsnapshot.delete=\u5220\u9664 VM \u5feb\u7167 label.action.vmsnapshot.revert=\u8fd8\u539f\u5230 VM \u5feb\u7167 -label.actions=\u64cd\u4f5c label.activate.project=\u6fc0\u6d3b\u9879\u76ee label.active.sessions=\u6d3b\u52a8\u4f1a\u8bdd -label.add.account.to.project=\u5411\u9879\u76ee\u4e2d\u6dfb\u52a0\u5e10\u6237 -label.add.account=\u6dfb\u52a0\u5e10\u6237 label.add.accounts.to=\u6dfb\u52a0\u5e10\u6237\u81f3 label.add.accounts=\u6dfb\u52a0\u5e10\u6237 +label.add.account.to.project=\u5411\u9879\u76ee\u4e2d\u6dfb\u52a0\u5e10\u6237 +label.add.account=\u6dfb\u52a0\u5e10\u6237 label.add.ACL=\u6dfb\u52a0 ACL label.add.affinity.group=\u6dfb\u52a0\u65b0\u5173\u8054\u6027\u7ec4 +label.add.baremetal.dhcp.device=\u6dfb\u52a0\u88f8\u673a DHCP \u8bbe\u5907 label.add.BigSwitchVns.device=\u6dfb\u52a0 BigSwitch Vns \u63a7\u5236\u5668 label.add.by.cidr=\u6309 CIDR \u6dfb\u52a0 label.add.by.group=\u6309\u7ec4\u6dfb\u52a0 @@ -300,13 +262,26 @@ label.add.compute.offering=\u6dfb\u52a0\u8ba1\u7b97\u65b9\u6848 label.add.direct.iprange=\u6dfb\u52a0\u76f4\u63a5 IP \u8303\u56f4 label.add.disk.offering=\u6dfb\u52a0\u78c1\u76d8\u65b9\u6848 label.add.domain=\u6dfb\u52a0\u57df +label.added.new.bigswitch.vns.controller=\u5df2\u6dfb\u52a0\u65b0 BigSwitch VNS \u63a7\u5236\u5668 label.add.egress.rule=\u6dfb\u52a0\u51fa\u53e3\u89c4\u5219 +label.addes.new.f5=\u5df2\u6dfb\u52a0\u65b0 F5 label.add.F5.device=\u6dfb\u52a0 F5 \u8bbe\u5907 label.add.firewall=\u6dfb\u52a0\u9632\u706b\u5899\u89c4\u5219 +label.add.gslb=\u6dfb\u52a0 GSLB label.add.guest.network=\u6dfb\u52a0\u6765\u5bbe\u7f51\u7edc label.add.host=\u6dfb\u52a0\u4e3b\u673a +label.adding.cluster=\u6b63\u5728\u6dfb\u52a0\u7fa4\u96c6 +label.adding.failed=\u6dfb\u52a0\u5931\u8d25 +label.adding.pod=\u6b63\u5728\u6dfb\u52a0\u63d0\u4f9b\u70b9 +label.adding.processing=\u6b63\u5728\u6dfb\u52a0... label.add.ingress.rule=\u6dfb\u52a0\u5165\u53e3\u89c4\u5219 +label.adding.succeeded=\u5df2\u6210\u529f\u6dfb\u52a0 +label.adding=\u6b63\u5728\u6dfb\u52a0 +label.adding.user=\u6b63\u5728\u6dfb\u52a0\u7528\u6237 +label.adding.zone=\u6b63\u5728\u6dfb\u52a0\u533a\u57df label.add.ip.range=\u6dfb\u52a0 IP \u8303\u56f4 +label.add.isolated.network=\u6dfb\u52a0\u9694\u79bb\u7f51\u7edc +label.additional.networks=\u5176\u4ed6\u7f51\u7edc label.add.load.balancer=\u6dfb\u52a0\u8d1f\u8f7d\u5e73\u8861\u5668 label.add.more=\u6dfb\u52a0\u66f4\u591a label.add.netScaler.device=\u6dfb\u52a0 Netscaler \u8bbe\u5907 @@ -317,58 +292,56 @@ label.add.network=\u6dfb\u52a0\u7f51\u7edc label.add.new.F5=\u6dfb\u52a0\u65b0 F5 label.add.new.gateway=\u6dfb\u52a0\u65b0\u7f51\u5173 label.add.new.NetScaler=\u6dfb\u52a0\u65b0 NetScaler -label.add.new.SRX=\u6dfb\u52a0\u65b0 SRX label.add.new.PA=\u6dfb\u52a0\u65b0 Palo Alto +label.add.new.SRX=\u6dfb\u52a0\u65b0 SRX label.add.new.tier=\u6dfb\u52a0\u65b0\u5c42 +label.add.nfs.secondary.staging.store=\u6dfb\u52a0 NFS \u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8 label.add.NiciraNvp.device=\u6dfb\u52a0 Nvp \u63a7\u5236\u5668 +label.add.OpenDaylight.device=\u6dfb\u52a0 OpenDaylight \u63a7\u5236\u5668 +label.add.PA.device=\u6dfb\u52a0 Palo Alto \u8bbe\u5907 label.add.physical.network=\u6dfb\u52a0\u7269\u7406\u7f51\u7edc label.add.pod=\u6dfb\u52a0\u63d0\u4f9b\u70b9 +label.add.portable.ip.range=\u6dfb\u52a0\u53ef\u79fb\u690d IP \u8303\u56f4 label.add.port.forwarding.rule=\u6dfb\u52a0\u7aef\u53e3\u8f6c\u53d1\u89c4\u5219 label.add.primary.storage=\u6dfb\u52a0\u4e3b\u5b58\u50a8 -label.add.region=\u6dfb\u52a0\u5730\u7406\u533a\u57df +label.add.region=\u6dfb\u52a0\u533a\u57df label.add.resources=\u6dfb\u52a0\u8d44\u6e90 label.add.route=\u6dfb\u52a0\u8def\u7531 label.add.rule=\u6dfb\u52a0\u89c4\u5219 -label.add.secondary.storage=\u6dfb\u52a0\u4e8c\u7ea7\u5b58\u50a8 +label.add.secondary.storage=\u6dfb\u52a0\u8f85\u52a9\u5b58\u50a8 label.add.security.group=\u6dfb\u52a0\u5b89\u5168\u7ec4 label.add.service.offering=\u6dfb\u52a0\u670d\u52a1\u65b9\u6848 label.add.SRX.device=\u6dfb\u52a0 SRX \u8bbe\u5907 -label.add.PA.device=\u6dfb\u52a0 Palo Alto \u8bbe\u5907 label.add.static.nat.rule=\u6dfb\u52a0\u9759\u6001 NAT \u89c4\u5219 label.add.static.route=\u6dfb\u52a0\u9759\u6001\u8def\u7531 label.add.system.service.offering=\u6dfb\u52a0\u7cfb\u7edf\u670d\u52a1\u65b9\u6848 label.add.template=\u6dfb\u52a0\u6a21\u677f label.add.to.group=\u6dfb\u52a0\u5230\u7ec4 +label.add=\u6dfb\u52a0 +label.add.ucs.manager=\u6dfb\u52a0 UCS \u7ba1\u7406\u5668 label.add.user=\u6dfb\u52a0\u7528\u6237 label.add.vlan=\u6dfb\u52a0 VLAN -label.add.vxlan=\u6dfb\u52a0 VXLAN -label.add.VM.to.tier=\u5411\u5c42\u4e2d\u6dfb\u52a0 VM -label.add.vm=\u6dfb\u52a0 VM label.add.vms.to.lb=\u5411\u8d1f\u8f7d\u5e73\u8861\u5668\u89c4\u5219\u4e2d\u6dfb\u52a0 VM label.add.vms=\u6dfb\u52a0 VM +label.add.VM.to.tier=\u5411\u5c42\u4e2d\u6dfb\u52a0 VM +label.add.vm=\u6dfb\u52a0 VM +label.add.vmware.datacenter=\u6dfb\u52a0 VMware \u6570\u636e\u4e2d\u5fc3 +label.add.vnmc.device=\u6dfb\u52a0 VNMC \u8bbe\u5907 +label.add.vnmc.provider=\u6dfb\u52a0 VNMC \u63d0\u4f9b\u7a0b\u5e8f label.add.volume=\u6dfb\u52a0\u5377 label.add.vpc=\u6dfb\u52a0 VPC label.add.vpn.customer.gateway=\u6dfb\u52a0 VPN \u5ba2\u6237\u7f51\u5173 label.add.VPN.gateway=\u6dfb\u52a0 VPN \u7f51\u5173 label.add.vpn.user=\u6dfb\u52a0 VPN \u7528\u6237 -label.add.zone=\u6dfb\u52a0\u8d44\u6e90\u57df -label.add=\u6dfb\u52a0 -label.adding.cluster=\u6b63\u5728\u6dfb\u52a0\u7fa4\u96c6 -label.adding.failed=\u6dfb\u52a0\u5931\u8d25 -label.adding.pod=\u6b63\u5728\u6dfb\u52a0\u63d0\u4f9b\u70b9 -label.adding.processing=\u6b63\u5728\u6dfb\u52a0... -label.adding.succeeded=\u5df2\u6210\u529f\u6dfb\u52a0 -label.adding.user=\u6b63\u5728\u6dfb\u52a0\u7528\u6237 -label.adding.zone=\u6b63\u5728\u6dfb\u52a0\u8d44\u6e90\u57df -label.adding=\u6b63\u5728\u6dfb\u52a0 -label.additional.networks=\u5176\u4ed6\u7f51\u7edc +label.add.vxlan=\u6dfb\u52a0 VXLAN +label.add.zone=\u6dfb\u52a0\u533a\u57df label.admin.accounts=\u7ba1\u7406\u5458\u5e10\u6237 label.admin=\u7ba1\u7406\u5458 label.advanced.mode=\u9ad8\u7ea7\u6a21\u5f0f label.advanced.search=\u9ad8\u7ea7\u641c\u7d22 label.advanced=\u9ad8\u7ea7 -label.affinity.group=\u5173\u8054\u6027\u7ec4 label.affinity.groups=\u5173\u8054\u6027\u7ec4 +label.affinity.group=\u5173\u8054\u6027\u7ec4 label.affinity=\u5173\u8054\u6027 label.agent.password=\u4ee3\u7406\u5bc6\u7801 label.agent.username=\u4ee3\u7406\u7528\u6237\u540d @@ -377,152 +350,210 @@ label.alert=\u8b66\u62a5 label.algorithm=\u7b97\u6cd5 label.allocated=\u5df2\u5206\u914d label.allocation.state=\u5206\u914d\u72b6\u6001 -label.anti.affinity.group=\u53cd\u5173\u8054\u6027\u7ec4 +label.allow=\u5141\u8bb8 label.anti.affinity.groups=\u53cd\u5173\u8054\u6027\u7ec4 +label.anti.affinity.group=\u53cd\u5173\u8054\u6027\u7ec4 label.anti.affinity=\u53cd\u5173\u8054\u6027 label.api.key=API \u5bc6\u94a5 label.apply=\u5e94\u7528 +label.app.name=CloudStack +label.archive.alerts=\u5b58\u6863\u8b66\u62a5 +label.archive.events=\u5b58\u6863\u4e8b\u4ef6 +label.assign.instance.another=\u5c06\u5b9e\u4f8b\u5206\u914d\u7ed9\u5176\u4ed6\u5e10\u6237 label.assign.to.load.balancer=\u6b63\u5728\u5c06\u5b9e\u4f8b\u5206\u914d\u7ed9\u8d1f\u8f7d\u5e73\u8861\u5668 label.assign=\u5206\u914d label.associated.network.id=\u5df2\u5173\u8054\u7f51\u7edc ID label.associated.network=\u5173\u8054\u7f51\u7edc +label.associated.profile=\u5df2\u5173\u8054\u914d\u7f6e\u6587\u4ef6 +label.associate.public.ip=\u5173\u8054\u516c\u7528 IP label.attached.iso=\u5df2\u9644\u52a0 ISO label.author.email=\u4f5c\u8005\u7535\u5b50\u90ae\u4ef6 label.author.name=\u4f5c\u8005\u59d3\u540d -label.availability.zone=\u53ef\u7528\u8d44\u6e90\u57df +label.autoscale=\u81ea\u52a8\u6269\u5c55 label.availability=\u53ef\u7528\u6027 +label.availability.zone=\u53ef\u7528\u533a\u57df label.available.public.ips=\u53ef\u7528\u516c\u7528 IP \u5730\u5740 label.available=\u53ef\u7528 label.back=\u540e\u9000 label.bandwidth=\u5e26\u5bbd +label.baremetal.dhcp.devices=\u88f8\u673a DHCP \u8bbe\u5907 +label.baremetal.dhcp.provider=\u88f8\u673a DHCP \u63d0\u4f9b\u7a0b\u5e8f +label.baremetal.pxe.devices=\u88f8\u673a PXE \u8bbe\u5907 +label.baremetal.pxe.device=\u6dfb\u52a0\u88f8\u673a PXE \u8bbe\u5907 +label.baremetal.pxe.provider=\u88f8\u673a PXE \u63d0\u4f9b\u7a0b\u5e8f label.basic.mode=\u57fa\u672c\u6a21\u5f0f label.basic=\u57fa\u672c label.bigswitch.controller.address=BigSwitch Vns \u63a7\u5236\u5668\u5730\u5740 +label.bigswitch.vns.details=BigSwitch VNS \u8be6\u7ec6\u4fe1\u606f +label.blade.id=\u5200\u7247\u5f0f\u670d\u52a1\u5668 ID +label.blades=\u5200\u7247\u5f0f\u670d\u52a1\u5668 label.bootable=\u53ef\u542f\u52a8 label.broadcast.domain.range=\u5e7f\u64ad\u57df\u8303\u56f4 label.broadcast.domain.type=\u5e7f\u64ad\u57df\u7c7b\u578b label.broadcast.uri=\u5e7f\u64ad URI +label.broadcasturi=\u5e7f\u64ad URI +label.broadcat.uri=\u5e7f\u64ad URI label.by.account=\u6309\u5e10\u6237 +label.by.alert.type=\u6309\u8b66\u62a5\u7c7b\u578b label.by.availability=\u6309\u53ef\u7528\u6027 +label.by.date.end=\u6309\u65e5\u671f(\u7ed3\u675f\u65e5\u671f) +label.by.date.start=\u6309\u65e5\u671f(\u5f00\u59cb\u65e5\u671f) label.by.domain=\u6309\u57df label.by.end.date=\u6309\u7ed3\u675f\u65e5\u671f +label.by.event.type=\u6309\u4e8b\u4ef6\u7c7b\u578b label.by.level=\u6309\u7ea7\u522b label.by.pod=\u6309\u63d0\u4f9b\u70b9 label.by.role=\u6309\u89d2\u8272 label.by.start.date=\u6309\u5f00\u59cb\u65e5\u671f label.by.state=\u6309\u72b6\u6001 -label.by.traffic.type=\u6309\u6d41\u91cf\u7c7b\u578b -label.by.type.id=\u6309\u7c7b\u578b ID -label.by.type=\u6309\u7c7b\u578b -label.by.zone=\u6309\u8d44\u6e90\u57df label.bytes.received=\u63a5\u6536\u7684\u5b57\u8282\u6570 label.bytes.sent=\u53d1\u9001\u7684\u5b57\u8282\u6570 +label.by.traffic.type=\u6309\u901a\u4fe1\u7c7b\u578b +label.by.type.id=\u6309\u7c7b\u578b ID +label.by.type=\u6309\u7c7b\u578b +label.by.zone=\u6309\u533a\u57df +label.cache.mode=\u5199\u5165\u7f13\u5b58\u7c7b\u578b label.cancel=\u53d6\u6d88 label.capacity=\u5bb9\u91cf label.certificate=\u8bc1\u4e66 +label.change.affinity=\u66f4\u6539\u5173\u8054\u6027 label.change.service.offering=\u66f4\u6539\u670d\u52a1\u65b9\u6848 label.change.value=\u66f4\u6539\u503c label.character=\u5b57\u7b26 +label.chassis=\u673a\u7bb1 label.checksum=MD5 \u6821\u9a8c\u548c label.cidr.account=CIDR \u6216\u5e10\u6237/\u5b89\u5168\u7ec4 +label.cidr=CIDR label.CIDR.list=CIDR \u5217\u8868 label.cidr.list=\u6e90 CIDR label.CIDR.of.destination.network=\u76ee\u7684\u5730\u7f51\u7edc\u7684 CIDR -label.cidr=CIDR +label.cisco.nexus1000v.ip.address=Nexus 1000v IP \u5730\u5740 +label.cisco.nexus1000v.password=Nexus 1000v \u5bc6\u7801 +label.cisco.nexus1000v.username=Nexus 1000v \u7528\u6237\u540d +label.ciscovnmc.resource.details=CiscoVNMC \u8d44\u6e90\u8be6\u7ec6\u4fe1\u606f label.clean.up=\u6e05\u7406 label.clear.list=\u6e05\u9664\u5217\u8868 label.close=\u5173\u95ed label.cloud.console=\u4e91\u7ba1\u7406\u63a7\u5236\u53f0 label.cloud.managed=\u7531 Cloud.com \u7ba1\u7406 label.cluster.name=\u7fa4\u96c6\u540d\u79f0 +label.clusters=\u7fa4\u96c6 label.cluster.type=\u7fa4\u96c6\u7c7b\u578b label.cluster=\u7fa4\u96c6 -label.clusters=\u7fa4\u96c6 label.clvm=CLVM -label.rbd=RBD -label.rbd.monitor=Ceph \u76d1\u89c6\u5668 -label.rbd.pool=Ceph \u6c60 -label.rbd.id=Cephx \u7528\u6237 -label.rbd.secret=Cephx \u5bc6\u94a5 label.code=\u4ee3\u7801 label.community=\u793e\u533a label.compute.and.storage=\u8ba1\u7b97\u4e0e\u5b58\u50a8 -label.compute.offering=\u8ba1\u7b97\u65b9\u6848 label.compute.offerings=\u8ba1\u7b97\u65b9\u6848 +label.compute.offering=\u8ba1\u7b97\u65b9\u6848 label.compute=\u8ba1\u7b97 label.configuration=\u914d\u7f6e +label.configure.ldap=\u914d\u7f6e LDAP label.configure.network.ACLs=\u914d\u7f6e\u7f51\u7edc ACL -label.configure.vpc=\u914d\u7f6e VPC label.configure=\u914d\u7f6e -label.confirm.password=\u786e\u8ba4\u5bc6\u7801 +label.configure.vpc=\u914d\u7f6e VPC label.confirmation=\u786e\u8ba4 +label.confirm.password=\u786e\u8ba4\u5bc6\u7801 label.congratulations=\u795d\u8d3a\u60a8\! label.conserve.mode=\u4fdd\u62a4\u6a21\u5f0f label.console.proxy=\u63a7\u5236\u53f0\u4ee3\u7406 +label.console.proxy.vm=\u63a7\u5236\u5668\u4ee3\u7406 VM label.continue.basic.install=\u7ee7\u7eed\u6267\u884c\u57fa\u672c\u5b89\u88c5 label.continue=\u7ee7\u7eed label.corrections.saved=\u5df2\u4fdd\u5b58\u4fee\u6b63 label.cpu.allocated.for.VMs=\u5df2\u5206\u914d\u7ed9 VM \u7684 CPU label.cpu.allocated=\u5df2\u5206\u914d\u7684 CPU label.CPU.cap=CPU \u4e0a\u9650 +label.cpu=CPU label.cpu.limits=CPU \u9650\u5236 label.cpu.mhz=CPU (MHz) label.cpu.utilized=CPU \u5229\u7528\u7387 -label.cpu=CPU +label.created.by.system=\u7531\u7cfb\u7edf\u521b\u5efa +label.created=\u521b\u5efa\u65e5\u671f +label.create.nfs.secondary.staging.storage=\u521b\u5efa NFS \u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8 +label.create.nfs.secondary.staging.store=\u521b\u5efa NFS \u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8 label.create.project=\u521b\u5efa\u9879\u76ee label.create.template=\u521b\u5efa\u6a21\u677f label.create.VPN.connection=\u521b\u5efa VPN \u8fde\u63a5 -label.created.by.system=\u7531\u7cfb\u7edf\u521b\u5efa -label.created=\u521b\u5efa\u65e5\u671f -label.cross.zones=\u8de8\u8d44\u6e90\u57df +label.cross.zones=\u8de8\u533a\u57df +label.custom.disk.iops=\u81ea\u5b9a\u4e49 IOPS label.custom.disk.size=\u81ea\u5b9a\u4e49\u78c1\u76d8\u5927\u5c0f +label.custom=\u81ea\u5b9a\u4e49 label.daily=\u6bcf\u5929 label.data.disk.offering=\u6570\u636e\u78c1\u76d8\u65b9\u6848 label.date=\u65e5\u671f label.day.of.month=\u65e5\u671f label.day.of.week=\u661f\u671f +label.dc.name=\u6570\u636e\u4e2d\u5fc3\u540d\u79f0 label.dead.peer.detection=\u5931\u6548\u5bf9\u7b49\u4f53\u68c0\u6d4b label.decline.invitation=\u62d2\u7edd\u9080\u8bf7 +label.dedicate.cluster=\u5c06\u7fa4\u96c6\u4e13\u7528 label.dedicated=\u4e13\u7528 +label.dedicated.vlan.vni.ranges=VLAN/VNI \u8303\u56f4\u5df2\u4e13\u7528 +label.dedicate.host=\u5c06\u4e3b\u673a\u4e13\u7528 +label.dedicate.pod=\u5c06\u63d0\u4f9b\u70b9\u4e13\u7528 +label.dedicate=\u4e13\u7528 +label.dedicate.vlan.vni.range=\u5c06 VLAN/VNI \u8303\u56f4\u4e13\u7528 +label.dedicate.zone=\u5c06\u8d44\u6e90\u57df\u4e13\u7528 +label.default.egress.policy=\u9ed8\u8ba4\u51fa\u53e3\u89c4\u5219 +label.default=\u9ed8\u8ba4\u8bbe\u7f6e label.default.use=\u9ed8\u8ba4\u4f7f\u7528 label.default.view=\u9ed8\u8ba4\u89c6\u56fe -label.default=\u9ed8\u8ba4\u8bbe\u7f6e label.delete.affinity.group=\u5220\u9664\u5173\u8054\u6027\u7ec4 +label.delete.alerts=\u5220\u9664\u8b66\u62a5 label.delete.BigSwitchVns=\u79fb\u9664 BigSwitch Vns \u63a7\u5236\u5668 +label.delete.ciscovnmc.resource=\u5220\u9664 CiscoVNMC \u8d44\u6e90 +label.delete.events=\u5220\u9664\u4e8b\u4ef6 label.delete.F5=\u5220\u9664 F5 label.delete.gateway=\u5220\u9664\u7f51\u5173 label.delete.NetScaler=\u5220\u9664 NetScaler label.delete.NiciraNvp=\u79fb\u9664 Nvp \u63a7\u5236\u5668 +label.delete.OpenDaylight.device=\u5220\u9664 OpenDaylight \u63a7\u5236\u5668 +label.delete.PA=\u5220\u9664 Palo Alto +label.delete.portable.ip.range=\u5220\u9664\u53ef\u79fb\u690d IP \u8303\u56f4 +label.delete.profile=\u5220\u9664\u914d\u7f6e\u6587\u4ef6 label.delete.project=\u5220\u9664\u9879\u76ee +label.delete.secondary.staging.store=\u5220\u9664\u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8 label.delete.SRX=\u5220\u9664 SRX -label.delete.PA=\u5220\u9664 Palo Alto +label.delete=\u5220\u9664 +label.delete.ucs.manager=\u5220\u9664 UCS Manager label.delete.VPN.connection=\u5220\u9664 VPN \u8fde\u63a5 label.delete.VPN.customer.gateway=\u5220\u9664 VPN \u5ba2\u6237\u7f51\u5173 label.delete.VPN.gateway=\u5220\u9664 VPN \u7f51\u5173 label.delete.vpn.user=\u5220\u9664 VPN \u7528\u6237 -label.delete=\u5220\u9664 label.deleting.failed=\u5220\u9664\u5931\u8d25 label.deleting.processing=\u6b63\u5728\u5220\u9664... +label.deny=\u62d2\u7edd +label.deployment.planner=\u90e8\u7f72\u89c4\u5212\u5668 label.description=\u8bf4\u660e label.destination.physical.network.id=\u76ee\u6807\u7269\u7406\u7f51\u7edc ID -label.destination.zone=\u76ee\u6807\u8d44\u6e90\u57df +label.destination.zone=\u76ee\u6807\u533a\u57df label.destroy.router=\u9500\u6bc1\u8def\u7531\u5668 label.destroy=\u9500\u6bc1 +label.destroy.vm.graceperiod=\u9500\u6bc1 VM \u5bbd\u9650\u671f label.detaching.disk=\u6b63\u5728\u53d6\u6d88\u9644\u52a0\u78c1\u76d8 label.details=\u8be6\u7ec6\u4fe1\u606f label.device.id=\u8bbe\u5907 ID label.devices=\u8bbe\u5907 -label.DHCP.server.type=DHCP \u670d\u52a1\u5668\u7c7b\u578b label.dhcp=DHCP +label.DHCP.server.type=DHCP \u670d\u52a1\u5668\u7c7b\u578b label.direct.ips=\u5171\u4eab\u7f51\u7edc IP +label.disable.autoscale=\u7981\u7528\u81ea\u52a8\u6269\u5c55 +label.disabled=\u5df2\u7981\u7528 +label.disable.network.offering=\u7981\u7528\u7f51\u7edc\u65b9\u6848 label.disable.provider=\u7981\u7528\u63d0\u4f9b\u7a0b\u5e8f +label.disable.vnmc.provider=\u7981\u7528 VNMC \u63d0\u4f9b\u7a0b\u5e8f label.disable.vpn=\u7981\u7528 VPN -label.disabled=\u5df2\u7981\u7528 label.disabling.vpn.access=\u6b63\u5728\u7981\u7528 VPN \u8bbf\u95ee +label.disassociate.profile.blade=\u53d6\u6d88\u5c06\u914d\u7f6e\u6587\u4ef6\u4e0e\u5200\u7247\u5f0f\u670d\u52a1\u5668\u5173\u8054 +label.disbale.vnmc.device=\u7981\u7528 VNMC \u8bbe\u5907 label.disk.allocated=\u5df2\u5206\u914d\u7684\u78c1\u76d8 label.disk.bytes.read.rate=\u78c1\u76d8\u8bfb\u53d6\u901f\u5ea6(BPS) label.disk.bytes.write.rate=\u78c1\u76d8\u5199\u5165\u901f\u5ea6(BPS) +label.disk.iops.max=\u6700\u5927 IOPS +label.disk.iops.min=\u6700\u5c0f IOPS label.disk.iops.read.rate=\u78c1\u76d8\u8bfb\u53d6\u901f\u5ea6(IOPS) +label.disk.iops.total=\u603b IOPS label.disk.iops.write.rate=\u78c1\u76d8\u5199\u5165\u901f\u5ea6(IOPS) label.disk.offering=\u78c1\u76d8\u65b9\u6848 label.disk.read.bytes=\u78c1\u76d8\u8bfb\u53d6(\u5b57\u8282) @@ -537,10 +568,11 @@ label.display.name=\u663e\u793a\u540d\u79f0 label.display.text=\u663e\u793a\u6587\u672c label.dns.1=DNS 1 label.dns.2=DNS 2 -label.DNS.domain.for.guest.networks=\u6765\u5bbe\u7f51\u7edc\u7684 DNS \u57df label.dns=DNS +label.DNS.domain.for.guest.networks=\u6765\u5bbe\u7f51\u7edc\u7684 DNS \u57df label.domain.admin=\u57df\u7ba1\u7406\u5458 label.domain.id=\u57df ID +label.domain.lower=\u57df label.domain.name=\u57df\u540d label.domain.router=\u57df\u8def\u7531\u5668 label.domain.suffix=DNS \u57df\u540e\u7f00(\u4f8b\u5982 xyz.com) @@ -549,33 +581,41 @@ label.done=\u5b8c\u6210 label.double.quotes.are.not.allowed=\u4e0d\u5141\u8bb8\u4f7f\u7528\u53cc\u5f15\u53f7 label.download.progress=\u4e0b\u8f7d\u8fdb\u5ea6 label.drag.new.position=\u62d6\u52a8\u5230\u65b0\u4f4d\u7f6e +label.dynamically.scalable=\u53ef\u52a8\u6001\u6269\u5c55 label.edit.affinity.group=\u7f16\u8f91\u5173\u8054\u6027\u7ec4 label.edit.lb.rule=\u7f16\u8f91\u8d1f\u8f7d\u5e73\u8861\u5668\u89c4\u5219 label.edit.network.details=\u7f16\u8f91\u7f51\u7edc\u8be6\u60c5 label.edit.project.details=\u7f16\u8f91\u9879\u76ee\u8be6\u60c5 +label.edit.region=\u7f16\u8f91\u5730\u7406\u533a\u57df label.edit.tags=\u7f16\u8f91\u6807\u7b7e -label.edit.traffic.type=\u7f16\u8f91\u6d41\u91cf\u7c7b\u578b -label.edit.vpc=\u7f16\u8f91 VPC +label.edit.traffic.type=\u7f16\u8f91\u901a\u4fe1\u7c7b\u578b label.edit=\u7f16\u8f91 -label.egress.rule=\u51fa\u53e3\u89c4\u5219 +label.edit.vpc=\u7f16\u8f91 VPC +label.egress.default.policy=\u51fa\u53e3\u9ed8\u8ba4\u7b56\u7565 label.egress.rules=\u51fa\u53e3\u89c4\u5219 +label.egress.rule=\u51fa\u53e3\u89c4\u5219 label.elastic.IP=\u5f39\u6027 IP label.elastic.LB=\u5f39\u6027\u8d1f\u8f7d\u5e73\u8861\u5668 label.elastic=\u5f39\u6027 +label.email.lower=\u7535\u5b50\u90ae\u4ef6 label.email=\u7535\u5b50\u90ae\u4ef6 +label.enable.autoscale=\u542f\u7528\u81ea\u52a8\u6269\u5c55 +label.enable.network.offering=\u542f\u7528\u7f51\u7edc\u65b9\u6848 label.enable.provider=\u542f\u7528\u63d0\u4f9b\u7a0b\u5e8f -label.enable.s3=\u542f\u7528 S3 \u652f\u6301\u7684\u4e8c\u7ea7\u5b58\u50a8 +label.enable.s3=\u542f\u7528 S3 \u652f\u6301\u7684\u8f85\u52a9\u5b58\u50a8 label.enable.swift=\u542f\u7528 SWIFT +label.enable.vnmc.device=\u542f\u7528 VNMC \u8bbe\u5907 +label.enable.vnmc.provider=\u542f\u7528 VNMC \u63d0\u4f9b\u7a0b\u5e8f label.enable.vpn=\u542f\u7528 VPN label.enabling.vpn.access=\u6b63\u5728\u542f\u7528 VPN \u8bbf\u95ee label.enabling.vpn=\u6b63\u5728\u542f\u7528 VPN label.end.IP=\u7ed3\u675f IP +label.endpoint.or.operation=\u7aef\u70b9\u6216\u64cd\u4f5c +label.endpoint=\u7aef\u70b9 label.end.port=\u7ed3\u675f\u7aef\u53e3 label.end.reserved.system.IP=\u7ed3\u675f\u9884\u7559\u7cfb\u7edf IP label.end.vlan=\u7ed3\u675f VLAN label.end.vxlan=\u7ed3\u675f VXLAN -label.endpoint.or.operation=\u7aef\u70b9\u6216\u64cd\u4f5c -label.endpoint=\u7aef\u70b9 label.enter.token=\u8f93\u5165\u4ee4\u724c label.error.code=\u9519\u8bef\u4ee3\u7801 label.error=\u9519\u8bef @@ -587,12 +627,14 @@ label.esx.host=ESX/ESXi \u4e3b\u673a label.example=\u793a\u4f8b label.expunge=\u5220\u9664 label.external.link=\u5916\u90e8\u94fe\u63a5 +label.f5.details=F5 \u8be6\u7ec6\u4fe1\u606f label.f5=F5 label.failed=\u5931\u8d25 label.featured=\u7cbe\u9009 label.fetch.latest=\u63d0\u53d6\u6700\u65b0\u5185\u5bb9 label.filterBy=\u8fc7\u6ee4\u4f9d\u636e label.firewall=\u9632\u706b\u5899 +label.firstname.lower=\u540d\u5b57 label.first.name=\u540d\u5b57 label.format=\u683c\u5f0f label.friday=\u661f\u671f\u4e94 @@ -606,34 +648,58 @@ label.go.step.2=\u8f6c\u81f3\u6b65\u9aa4 2 label.go.step.3=\u8f6c\u81f3\u6b65\u9aa4 3 label.go.step.4=\u8f6c\u81f3\u6b65\u9aa4 4 label.go.step.5=\u8f6c\u81f3\u6b65\u9aa4 5 +label.group.by.account=\u6309\u5e10\u6237\u5206\u7ec4 +label.group.by.cluster=\u6309\u7fa4\u96c6\u5206\u7ec4 +label.group.by.pod=\u6309\u63d0\u4f9b\u70b9\u5206\u7ec4 +label.group.by.zone=\u6309\u8d44\u6e90\u57df\u5206\u7ec4 label.group.optional=\u7ec4(\u53ef\u9009) label.group=\u7ec4 +label.gslb.assigned.lb.more=\u5206\u914d\u66f4\u591a\u8d1f\u8f7d\u5e73\u8861 +label.gslb.assigned.lb=\u5df2\u5206\u914d\u8d1f\u8f7d\u5e73\u8861 +label.gslb.delete=\u5220\u9664 GSLB +label.gslb.details=GSLB \u8be6\u7ec6\u4fe1\u606f +label.gslb.domain.name=GSLB \u57df\u540d +label.gslb.lb.details=\u8d1f\u8f7d\u5e73\u8861\u8be6\u7ec6\u4fe1\u606f +label.gslb.lb.remove=\u4ece\u6b64 GSLB \u4e2d\u5220\u9664\u8d1f\u8f7d\u5e73\u8861 +label.gslb.lb.rule=\u8d1f\u8f7d\u5e73\u8861\u89c4\u5219 +label.gslb.service=GSLB \u670d\u52a1 +label.gslb.service.private.ip=GSLB \u670d\u52a1\u4e13\u7528 IP +label.gslb.service.public.ip=GSLB \u670d\u52a1\u516c\u7528 IP +label.gslb.servicetype=\u670d\u52a1\u7c7b\u578b label.guest.cidr=\u6765\u5bbe CIDR label.guest.end.ip=\u6765\u5bbe\u7ed3\u675f IP label.guest.gateway=\u6765\u5bbe\u7f51\u5173 label.guest.ip.range=\u6765\u5bbe IP \u8303\u56f4 label.guest.ip=\u6765\u5bbe IP \u5730\u5740 label.guest.netmask=\u6765\u5bbe\u7f51\u7edc\u63a9\u7801 +label.guest.network.details=\u6765\u5bbe\u7f51\u7edc\u8be6\u7ec6\u4fe1\u606f label.guest.networks=\u6765\u5bbe\u7f51\u7edc label.guest.start.ip=\u6765\u5bbe\u8d77\u59cb IP -label.guest.traffic=\u6765\u5bbe\u6d41\u91cf +label.guest.traffic=\u6765\u5bbe\u901a\u4fe1 +label.guest.traffic.vswitch.name=\u6765\u5bbe\u6d41\u91cf\u865a\u62df\u4ea4\u6362\u673a\u540d\u79f0 +label.guest.traffic.vswitch.type=\u6765\u5bbe\u6d41\u91cf\u865a\u62df\u4ea4\u6362\u673a\u7c7b\u578b label.guest.type=\u6765\u5bbe\u7c7b\u578b label.guest=\u6765\u5bbe label.ha.enabled=\u5df2\u542f\u7528\u9ad8\u53ef\u7528\u6027 +label.health.check=\u8fd0\u884c\u72b6\u51b5\u68c0\u67e5 label.help=\u5e2e\u52a9 label.hide.ingress.rule=\u9690\u85cf\u5165\u53e3\u89c4\u5219 label.hints=\u63d0\u793a +label.home=\u9996\u9875 label.host.alerts=\u4e3b\u673a\u8b66\u62a5 label.host.MAC=\u4e3b\u673a MAC label.host.name=\u4e3b\u673a\u540d\u79f0 +label.hosts=\u4e3b\u673a label.host.tags=\u4e3b\u673a\u6807\u7b7e label.host=\u4e3b\u673a -label.hosts=\u4e3b\u673a label.hourly=\u6bcf\u5c0f\u65f6 label.hypervisor.capabilities=\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u529f\u80fd +label.hypervisor.snapshot.reserve=\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u5feb\u7167\u9884\u7559 +label.hypervisors=\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f label.hypervisor.type=\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u7c7b\u578b -label.hypervisor.version=\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u7248\u672c label.hypervisor=\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f +label.hypervisor.version=\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u7248\u672c +label.hyperv.traffic.label=HyperV \u6d41\u91cf\u6807\u7b7e label.id=ID label.IKE.DH=IKE DH \u7b97\u6cd5 label.IKE.encryption=IKE \u52a0\u5bc6\u7b97\u6cd5 @@ -651,18 +717,20 @@ label.installWizard.addPodIntro.subtitle=\u4ec0\u4e48\u662f\u63d0\u4f9b\u70b9? label.installWizard.addPodIntro.title=\u6dfb\u52a0\u4e00\u4e2a\u63d0\u4f9b\u70b9 label.installWizard.addPrimaryStorageIntro.subtitle=\u4ec0\u4e48\u662f\u4e3b\u5b58\u50a8? label.installWizard.addPrimaryStorageIntro.title=\u6dfb\u52a0\u4e00\u4e2a\u4e3b\u5b58\u50a8 -label.installWizard.addSecondaryStorageIntro.subtitle=\u4ec0\u4e48\u662f\u4e8c\u7ea7\u5b58\u50a8? -label.installWizard.addSecondaryStorageIntro.title=\u6dfb\u52a0\u4e00\u4e2a\u4e8c\u7ea7\u5b58\u50a8 -label.installWizard.addZone.title=\u6dfb\u52a0\u8d44\u6e90\u57df -label.installWizard.addZoneIntro.subtitle=\u4ec0\u4e48\u662f\u8d44\u6e90\u57df? -label.installWizard.addZoneIntro.title=\u6dfb\u52a0\u4e00\u4e2a\u8d44\u6e90\u57df +label.installWizard.addSecondaryStorageIntro.subtitle=\u4ec0\u4e48\u662f\u8f85\u52a9\u5b58\u50a8? +label.installWizard.addSecondaryStorageIntro.title=\u6dfb\u52a0\u4e00\u4e2a\u8f85\u52a9\u5b58\u50a8 +label.installWizard.addZoneIntro.subtitle=\u4ec0\u4e48\u662f\u533a\u57df? +label.installWizard.addZoneIntro.title=\u6dfb\u52a0\u4e00\u4e2a\u533a\u57df +label.installWizard.addZone.title=\u6dfb\u52a0\u533a\u57df label.installWizard.click.launch=\u8bf7\u5355\u51fb\u201c\u542f\u52a8\u201d\u6309\u94ae\u3002 label.installWizard.subtitle=\u6b64\u6559\u7a0b\u5c06\u5e2e\u52a9\u60a8\u8bbe\u7f6e CloudStack&\#8482 \u5b89\u88c5 label.installWizard.title=\u60a8\u597d\uff0c\u6b22\u8fce\u4f7f\u7528 CloudStack&\#8482 label.instance.limits=\u5b9e\u4f8b\u9650\u5236 label.instance.name=\u5b9e\u4f8b\u540d\u79f0 -label.instance=\u5b9e\u4f8b +label.instance.scaled.up=\u5df2\u6269\u5c55\u5b9e\u4f8b label.instances=\u5b9e\u4f8b +label.instance=\u5b9e\u4f8b +label.instanciate.template.associate.profile.blade=\u5c06\u6a21\u677f\u5b9e\u4f8b\u5316\u5e76\u5c06\u914d\u7f6e\u6587\u4ef6\u4e0e\u5200\u7247\u5f0f\u670d\u52a1\u5668\u5173\u8054 label.internal.dns.1=\u5185\u90e8 DNS 1 label.internal.dns.2=\u5185\u90e8 DNS 2 label.internal.name=\u5185\u90e8\u540d\u79f0 @@ -671,35 +739,47 @@ label.introduction.to.cloudstack=CloudStack&\#8482 \u7b80\u4ecb label.invalid.integer=\u65e0\u6548\u6574\u6570 label.invalid.number=\u65e0\u6548\u6570\u5b57 label.invitations=\u9080\u8bf7 +label.invited.accounts=\u5df2\u9080\u8bf7\u7684\u5e10\u6237 label.invite.to=\u9080\u8bf7\u52a0\u5165 label.invite=\u9080\u8bf7 -label.invited.accounts=\u5df2\u9080\u8bf7\u7684\u5e10\u6237 label.ip.address=IP \u5730\u5740 +label.ipaddress=IP \u5730\u5740 label.ip.allocations=IP \u5206\u914d +label.ip=IP label.ip.limits=\u516c\u7528 IP \u9650\u5236 label.ip.or.fqdn=IP \u6216 FQDN label.ip.range=IP \u8303\u56f4 label.ip.ranges=IP \u8303\u56f4 -label.ip=IP -label.ipaddress=IP \u5730\u5740 -label.ips=IP label.IPsec.preshared.key=IPsec \u9884\u5171\u4eab\u5bc6\u94a5 -label.is.default=\u662f\u5426\u4e3a\u9ed8\u8ba4\u8bbe\u7f6e -label.is.redundant.router=\u5197\u4f59 -label.is.shared=\u662f\u5426\u5171\u4eab -label.is.system=\u662f\u5426\u4e3a\u7cfb\u7edf +label.ips=IP +label.ipv4.cidr=IPv4 CIDR +label.ipv4.end.ip=IPv4 \u7ed3\u675f IP +label.ipv4.gateway=IPv4 \u7f51\u5173 +label.ipv4.netmask=IPv4 \u7f51\u7edc\u63a9\u7801 +label.ipv4.start.ip=IPv4 \u8d77\u59cb IP +label.ipv6.address=IPv6 IP \u5730\u5740 +label.ipv6.CIDR=IPv6 CIDR +label.ipv6.dns1=IPv6 DNS1 +label.ipv6.dns2=IPv6 DNS2 +label.ipv6.end.ip=IPv6 \u7ed3\u675f IP +label.ipv6.gateway=IPv6 \u7f51\u5173 +label.ipv6.start.ip=IPv6 \u8d77\u59cb IP label.iscsi=iSCSI +label.is.default=\u662f\u5426\u4e3a\u9ed8\u8ba4\u8bbe\u7f6e label.iso.boot=ISO \u542f\u52a8 label.iso=ISO label.isolated.networks=\u9694\u79bb\u7f51\u7edc label.isolation.method=\u9694\u79bb\u65b9\u6cd5 label.isolation.mode=\u9694\u79bb\u6a21\u5f0f label.isolation.uri=\u9694\u79bb URI +label.is.redundant.router=\u5197\u4f59 +label.is.shared=\u662f\u5426\u5171\u4eab +label.is.system=\u662f\u5426\u4e3a\u7cfb\u7edf label.item.listing=\u9879\u76ee\u5217\u8868 label.keep=\u4fdd\u7559 -label.key=\u5bc6\u94a5 label.keyboard.type=\u952e\u76d8\u7c7b\u578b -label.kvm.traffic.label=KVM \u6d41\u91cf\u6807\u7b7e +label.key=\u5bc6\u94a5 +label.kvm.traffic.label=KVM \u901a\u4fe1\u6807\u7b7e label.label=\u6807\u7b7e label.lang.arabic=\u963f\u62c9\u4f2f\u8bed label.lang.brportugese=\u8461\u8404\u7259\u8bed(\u5df4\u897f) @@ -717,12 +797,16 @@ label.lang.polish=\u6ce2\u5170\u8bed label.lang.russian=\u4fc4\u8bed label.lang.spanish=\u897f\u73ed\u7259\u8bed label.last.disconnected=\u4e0a\u6b21\u65ad\u5f00\u8fde\u63a5\u65f6\u95f4 +label.lastname.lower=\u59d3\u6c0f label.last.name=\u59d3\u6c0f label.latest.events=\u6700\u65b0\u4e8b\u4ef6 -label.launch.vm=\u542f\u52a8 VM -label.launch.zone=\u542f\u52a8\u8d44\u6e90\u57df label.launch=\u542f\u52a8 +label.launch.vm=\u542f\u52a8 VM +label.launch.zone=\u542f\u52a8\u533a\u57df label.LB.isolation=\u8d1f\u8f7d\u5e73\u8861\u5668\u9694\u79bb +label.ldap.configuration=LDAP \u914d\u7f6e +label.ldap.group.name=LDAP \u7ec4 +label.ldap.port=LDAP \u7aef\u53e3 label.least.connections=\u6700\u5c11\u8fde\u63a5\u7b97\u6cd5 label.level=\u7ea7\u522b label.linklocal.ip=\u94fe\u63a5\u672c\u5730 IP \u5730\u5740 @@ -735,33 +819,35 @@ label.local.storage=\u672c\u5730\u5b58\u50a8 label.local=\u672c\u5730 label.login=\u767b\u5f55 label.logout=\u6ce8\u9500 -label.LUN.number=LUN \u53f7 label.lun=LUN +label.LUN.number=LUN \u53f7 +label.lxc.traffic.label=LXC \u6d41\u91cf\u6807\u7b7e label.make.project.owner=\u8bbe\u4e3a\u5e10\u6237\u9879\u76ee\u6240\u6709\u8005 -label.manage.resources=\u7ba1\u7406\u8d44\u6e90 -label.manage=\u6258\u7ba1 label.management.ips=\u7ba1\u7406\u7c7b IP \u5730\u5740 label.management=\u7ba1\u7406 +label.manage.resources=\u7ba1\u7406\u8d44\u6e90 +label.manage=\u6258\u7ba1 label.max.cpus=\u6700\u5927 CPU \u5185\u6838\u6570 label.max.guest.limit=\u6700\u5927\u6765\u5bbe\u6570\u9650\u5236 +label.maximum=\u6700\u5927\u503c +label.max.instances=\u6700\u5927\u5b9e\u4f8b\u6570 label.max.memory=\u6700\u5927\u5185\u5b58(MiB) label.max.networks=\u6700\u5927\u7f51\u7edc\u6570 label.max.primary.storage=\u6700\u5927\u4e3b\u5b58\u50a8(GiB) label.max.public.ips=\u6700\u5927\u516c\u7528 IP \u6570 -label.max.secondary.storage=\u6700\u5927\u4e8c\u7ea7\u5b58\u50a8(GiB) +label.max.secondary.storage=\u6700\u5927\u8f85\u52a9\u5b58\u50a8(GiB) label.max.snapshots=\u6700\u5927\u5feb\u7167\u6570 label.max.templates=\u6700\u5927\u6a21\u677f\u6570 label.max.vms=\u6700\u5927\u7528\u6237 VM \u6570 label.max.volumes=\u6700\u5927\u5377\u6570 label.max.vpcs=\u6700\u5927 VPC \u6570 -label.maximum=\u6700\u5927\u503c label.may.continue=\u60a8\u73b0\u5728\u53ef\u4ee5\u7ee7\u7eed\u8fdb\u884c\u64cd\u4f5c\u3002 label.memory.allocated=\u5df2\u5206\u914d\u7684\u5185\u5b58 label.memory.limits=\u5185\u5b58\u9650\u5236(MiB) label.memory.mb=\u5185\u5b58(MB) label.memory.total=\u5185\u5b58\u603b\u91cf -label.memory.used=\u5df2\u4f7f\u7528\u7684\u5185\u5b58 label.memory=\u5185\u5b58 +label.memory.used=\u5df2\u4f7f\u7528\u7684\u5185\u5b58 label.menu.accounts=\u5e10\u6237 label.menu.alerts=\u8b66\u62a5 label.menu.all.accounts=\u6240\u6709\u5e10\u6237 @@ -788,7 +874,7 @@ label.menu.my.templates=\u6211\u7684\u6a21\u677f label.menu.network.offerings=\u7f51\u7edc\u65b9\u6848 label.menu.network=\u7f51\u7edc label.menu.physical.resources=\u7269\u7406\u8d44\u6e90 -label.menu.regions=\u5730\u7406\u533a\u57df +label.menu.regions=\u533a\u57df label.menu.running.instances=\u6b63\u5728\u8fd0\u884c\u7684\u5b9e\u4f8b label.menu.security.groups=\u5b89\u5168\u7ec4 label.menu.service.offerings=\u670d\u52a1\u65b9\u6848 @@ -796,8 +882,8 @@ label.menu.snapshots=\u5feb\u7167 label.menu.stopped.instances=\u5df2\u505c\u6b62\u7684\u5b9e\u4f8b label.menu.storage=\u5b58\u50a8 label.menu.system.service.offerings=\u7cfb\u7edf\u65b9\u6848 -label.menu.system.vms=\u7cfb\u7edf VM label.menu.system=\u7cfb\u7edf +label.menu.system.vms=\u7cfb\u7edf VM label.menu.templates=\u6a21\u677f label.menu.virtual.appliances=\u865a\u62df\u8bbe\u5907 label.menu.virtual.resources=\u865a\u62df\u8d44\u6e90 @@ -805,13 +891,16 @@ label.menu.volumes=\u5377 label.migrate.instance.to.host=\u5c06\u5b9e\u4f8b\u8fc1\u79fb\u5230\u5176\u4ed6\u4e3b\u673a label.migrate.instance.to.ps=\u5c06\u5b9e\u4f8b\u8fc1\u79fb\u5230\u5176\u4ed6\u4e3b\u5b58\u50a8 label.migrate.instance.to=\u8fc1\u79fb\u5b9e\u4f8b\u81f3 +label.migrate.lb.vm=\u8fc1\u79fb LB VM label.migrate.router.to=\u8fc1\u79fb\u8def\u7531\u5668\u81f3 label.migrate.systemvm.to=\u8fc1\u79fb\u7cfb\u7edf VM \u81f3 label.migrate.to.host=\u8fc1\u79fb\u5230\u4e3b\u673a label.migrate.to.storage=\u8fc1\u79fb\u5230\u5b58\u50a8 label.migrate.volume=\u5c06\u5377\u8fc1\u79fb\u5230\u5176\u4ed6\u4e3b\u5b58\u50a8 label.minimum=\u6700\u5c0f\u503c +label.min.instances=\u6700\u5c0f\u5b9e\u4f8b\u6570 label.minute.past.hour=\u5206 +label.mode=\u6a21\u5f0f label.monday=\u661f\u671f\u4e00 label.monthly=\u6bcf\u6708 label.more.templates=\u66f4\u591a\u6a21\u677f @@ -822,20 +911,25 @@ label.move.up.row=\u5411\u4e0a\u79fb\u52a8\u4e00\u884c label.my.account=\u6211\u7684\u5e10\u6237 label.my.network=\u6211\u7684\u7f51\u7edc label.my.templates=\u6211\u7684\u6a21\u677f +label.name.lower=\u540d\u79f0 label.name.optional=\u540d\u79f0(\u53ef\u9009) label.name=\u540d\u79f0 label.nat.port.range=NAT \u7aef\u53e3\u8303\u56f4 label.netmask=\u7f51\u7edc\u63a9\u7801 +label.netscaler.details=NetScaler \u8be6\u7ec6\u4fe1\u606f label.netScaler=NetScaler +label.network.ACLs=\u7f51\u7edc ACL label.network.ACL.total=\u7f51\u7edc ACL \u603b\u6570 label.network.ACL=\u7f51\u7edc ACL -label.network.ACLs=\u7f51\u7edc ACL +label.network.addVM=\u5c06\u7f51\u7edc\u6dfb\u52a0\u5230 VM +label.network.cidr=\u7f51\u7edc CIDR label.network.desc=\u7f51\u7edc\u63cf\u8ff0 label.network.device.type=\u7f51\u7edc\u8bbe\u5907\u7c7b\u578b label.network.device=\u7f51\u7edc\u8bbe\u5907 label.network.domain.text=\u7f51\u7edc\u57df label.network.domain=\u7f51\u7edc\u57df label.network.id=\u7f51\u7edc ID +label.networking.and.security=\u7f51\u7edc\u8fde\u63a5\u4e0e\u5b89\u5168 label.network.label.display.for.blank.value=\u4f7f\u7528\u9ed8\u8ba4\u7f51\u5173 label.network.limits=\u7f51\u7edc\u9650\u5236 label.network.name=\u7f51\u7edc\u540d\u79f0 @@ -847,81 +941,102 @@ label.network.rate.megabytes=\u7f51\u7edc\u901f\u7387(MB/\u79d2) label.network.rate=\u7f51\u7edc\u901f\u7387(MB/\u79d2) label.network.read=\u7f51\u7edc\u8bfb\u53d6\u91cf label.network.service.providers=\u7f51\u7edc\u670d\u52a1\u63d0\u4f9b\u7a0b\u5e8f +label.networks=\u7f51\u7edc label.network.type=\u7f51\u7edc\u7c7b\u578b -label.network.write=\u7f51\u7edc\u5199\u5165\u91cf label.network=\u7f51\u7edc -label.networking.and.security=\u7f51\u7edc\u8fde\u63a5\u4e0e\u5b89\u5168 -label.networks=\u7f51\u7edc +label.network.write=\u7f51\u7edc\u5199\u5165\u91cf label.new.password=\u65b0\u5bc6\u7801 label.new.project=\u65b0\u5efa\u9879\u76ee -label.new.vm=\u65b0\u5efa VM label.new=\u65b0\u5efa +label.new.vm=\u65b0\u5efa VM label.next=\u4e0b\u4e00\u6b65 label.nexusVswitch=Nexus 1000v +label.nfs=NFS label.nfs.server=NFS \u670d\u52a1\u5668 label.nfs.storage=NFS \u5b58\u50a8 -label.nfs=NFS label.nic.adapter.type=NIC \u9002\u914d\u5668\u7c7b\u578b label.nicira.controller.address=\u63a7\u5236\u5668\u5730\u5740 label.nicira.l3gatewayserviceuuid=L3 Gateway Service UUID -label.nicira.transportzoneuuid=\u4f20\u8f93\u8d44\u6e90\u57df UUID +label.nicira.transportzoneuuid=\u4f20\u8f93\u533a\u57df UUID label.nics=NIC label.no.actions=\u65e0\u53ef\u7528\u64cd\u4f5c label.no.alerts=\u65e0\u6700\u8fd1\u53d1\u51fa\u7684\u8b66\u62a5 label.no.data=\u65e0\u53ef\u663e\u793a\u7684\u6570\u636e label.no.errors=\u65e0\u6700\u8fd1\u51fa\u73b0\u7684\u9519\u8bef +label.no.grouping=(\u4e0d\u5206\u7ec4) label.no.isos=\u65e0\u53ef\u7528 ISO label.no.items=\u65e0\u53ef\u7528\u9879\u76ee -label.no.security.groups=\u65e0\u53ef\u7528\u5b89\u5168\u7ec4 -label.no.thanks=\u4e0d\uff0c\u8c22\u8c22 -label.no=\u5426 label.none=\u65e0 +label.no.security.groups=\u65e0\u53ef\u7528\u5b89\u5168\u7ec4 label.not.found=\u672a\u627e\u5230 +label.no.thanks=\u4e0d\uff0c\u8c22\u8c22 label.notifications=\u901a\u77e5 -label.num.cpu.cores=CPU \u5185\u6838\u6570 +label.no=\u5426 label.number.of.clusters=\u7fa4\u96c6\u6570\u91cf +label.number.of.cpu.sockets=CPU \u63d2\u69fd\u6570 label.number.of.hosts=\u4e3b\u673a\u6570\u91cf label.number.of.pods=\u63d0\u4f9b\u70b9\u6570\u91cf label.number.of.system.vms=\u7cfb\u7edf VM \u6570 label.number.of.virtual.routers=\u865a\u62df\u8def\u7531\u5668\u6570 -label.number.of.zones=\u8d44\u6e90\u57df\u6570\u91cf +label.number.of.zones=\u533a\u57df\u6570\u91cf +label.num.cpu.cores=CPU \u5185\u6838\u6570 label.numretries=\u91cd\u8bd5\u6b21\u6570 label.ocfs2=OCFS2 label.offer.ha=\u63d0\u4f9b\u9ad8\u53ef\u7528\u6027 label.ok=\u786e\u5b9a +label.opendaylight.controllerdetail=OpenDaylight \u63a7\u5236\u5668\u8be6\u7ec6\u4fe1\u606f +label.opendaylight.controller=OpenDaylight \u63a7\u5236\u5668 +label.opendaylight.controllers=OpenDaylight \u63a7\u5236\u5668 +label.openDaylight=OpenDaylight label.optional=\u53ef\u9009 label.order=\u6392\u5e8f label.os.preference=\u64cd\u4f5c\u7cfb\u7edf\u9996\u9009\u9879 label.os.type=\u64cd\u4f5c\u7cfb\u7edf\u7c7b\u578b +label.override.guest.traffic=\u66ff\u4ee3\u6765\u5bbe\u6d41\u91cf +label.override.public.traffic=\u66ff\u4ee3\u516c\u5171\u6d41\u91cf +label.ovm.traffic.label=OVM \u6d41\u91cf\u6807\u7b7e +label.ovs=OVS label.owned.public.ips=\u62e5\u6709\u7684\u516c\u7528 IP \u5730\u5740\u6570 label.owner.account=\u6240\u6709\u8005\u5e10\u6237 label.owner.domain=\u6240\u6709\u8005\u57df +label.palo.alto.details=Palo Alto \u8be6\u7ec6\u4fe1\u606f label.PA.log.profile=Palo Alto \u65e5\u5fd7\u914d\u7f6e\u6587\u4ef6 -label.PA.threat.profile=Palo Alto \u5a01\u80c1\u914d\u7f6e\u6587\u4ef6 +label.PA=Palo Alto label.parent.domain=\u7236\u57df label.password.enabled=\u5df2\u542f\u7528\u5bc6\u7801 +label.password.lower=\u5bc6\u7801 +label.password.reset.confirm=\u5bc6\u7801\u5df2\u91cd\u7f6e\u4e3a label.password=\u5bc6\u7801 +label.PA.threat.profile=Palo Alto \u5a01\u80c1\u914d\u7f6e\u6587\u4ef6 label.path=\u8def\u5f84 label.perfect.forward.secrecy=\u5b8c\u5168\u6b63\u5411\u4fdd\u5bc6 +label.persistent=\u6c38\u4e45 label.physical.network.ID=\u7269\u7406\u7f51\u7edc ID label.physical.network=\u7269\u7406\u7f51\u7edc label.PING.CIFS.password=PING CIFS \u5bc6\u7801 label.PING.CIFS.username=PING CIFS \u7528\u6237\u540d label.PING.dir=PING \u76ee\u5f55 label.PING.storage.IP=PING \u5b58\u50a8 IP +label.planner.mode=\u89c4\u5212\u5668\u6a21\u5f0f label.please.specify.netscaler.info=\u8bf7\u6307\u5b9a Netscaler \u4fe1\u606f label.please.wait=\u8bf7\u7a0d\u5019 label.plugin.details=\u63d2\u4ef6\u8be6\u7ec6\u4fe1\u606f label.plugins=\u63d2\u4ef6 +label.pod.dedicated=\u63d0\u4f9b\u70b9\u5df2\u4e13\u7528 label.pod.name=\u63d0\u4f9b\u70b9\u540d\u79f0 -label.pod=\u63d0\u4f9b\u70b9 label.pods=\u63d0\u4f9b\u70b9 +label.pod=\u63d0\u4f9b\u70b9 +label.polling.interval.sec=\u8f6e\u8be2\u65f6\u95f4\u95f4\u9694(\u79d2) +label.portable.ip.range.details=\u53ef\u79fb\u690d IP \u8303\u56f4\u8be6\u7ec6\u4fe1\u606f +label.portable.ip.ranges=\u53ef\u79fb\u690d IP \u8303\u56f4 +label.portable.ips=\u53ef\u79fb\u690d IP label.port.forwarding.policies=\u7aef\u53e3\u8f6c\u53d1\u7b56\u7565 label.port.forwarding=\u7aef\u53e3\u8f6c\u53d1 label.port.range=\u7aef\u53e3\u8303\u56f4 +label.port=\u7aef\u53e3 label.PreSetup=PreSetup -label.prev=\u4e0a\u4e00\u9875 label.previous=\u4e0a\u4e00\u6b65 +label.prev=\u4e0a\u4e00\u9875 label.primary.allocated=\u5df2\u5206\u914d\u7684\u4e3b\u5b58\u50a8 label.primary.network=\u4e3b\u7f51\u7edc label.primary.storage.count=\u4e3b\u5b58\u50a8\u6c60 @@ -931,69 +1046,98 @@ label.primary.used=\u5df2\u4f7f\u7528\u7684\u4e3b\u5b58\u50a8 label.private.Gateway=\u4e13\u7528\u7f51\u5173 label.private.interface=\u4e13\u7528\u63a5\u53e3 label.private.ip.range=\u4e13\u7528 IP \u8303\u56f4 -label.private.ip=\u4e13\u7528 IP \u5730\u5740 label.private.ips=\u4e13\u7528 IP \u5730\u5740 +label.private.ip=\u4e13\u7528 IP \u5730\u5740 +label.privatekey=PKCS\#8 \u79c1\u94a5 label.private.network=\u4e13\u7528\u7f51\u7edc label.private.port=\u4e13\u7528\u7aef\u53e3 -label.private.zone=\u4e13\u7528\u8d44\u6e90\u57df -label.privatekey=PKCS\#8 \u79c1\u94a5 +label.private.zone=\u4e13\u7528\u533a\u57df +label.profile=\u914d\u7f6e\u6587\u4ef6 label.project.dashboard=\u9879\u76ee\u63a7\u5236\u677f label.project.id=\u9879\u76ee ID label.project.invite=\u9080\u8bf7\u52a0\u5165\u9879\u76ee label.project.name=\u9879\u76ee\u540d\u79f0 -label.project.view=\u9879\u76ee\u89c6\u56fe -label.project=\u9879\u76ee label.projects=\u9879\u76ee +label.project=\u9879\u76ee +label.project.view=\u9879\u76ee\u89c6\u56fe label.protocol=\u534f\u8bae label.providers=\u63d0\u4f9b\u7a0b\u5e8f +label.provider=\u63d0\u4f9b\u7a0b\u5e8f label.public.interface=\u516c\u7528\u63a5\u53e3 -label.public.ip=\u516c\u7528 IP \u5730\u5740 label.public.ips=\u516c\u7528 IP \u5730\u5740 +label.public.ip=\u516c\u7528 IP \u5730\u5740 +label.public.load.balancer.provider=\u516c\u7528\u8d1f\u8f7d\u5e73\u8861\u5668\u63d0\u4f9b\u7a0b\u5e8f label.public.network=\u516c\u7528\u7f51\u7edc label.public.port=\u516c\u7528\u7aef\u53e3 -label.public.traffic=\u516c\u5171\u6d41\u91cf -label.public.zone=\u516c\u7528\u8d44\u6e90\u57df +label.public.traffic=\u516c\u5171\u901a\u4fe1 +label.public.traffic.vswitch.name=\u516c\u5171\u6d41\u91cf\u865a\u62df\u4ea4\u6362\u673a\u540d\u79f0 +label.public.traffic.vswitch.type=\u516c\u5171\u6d41\u91cf\u865a\u62df\u4ea4\u6362\u673a\u7c7b\u578b label.public=\u516c\u7528 +label.public.zone=\u516c\u7528\u533a\u57df label.purpose=\u76ee\u7684 label.Pxe.server.type=Pxe \u670d\u52a1\u5668\u7c7b\u578b +label.qos.type=QoS \u7c7b\u578b label.quickview=\u5feb\u901f\u67e5\u770b +label.quiesce.vm=\u9759\u9ed8 VM +label.quiet.time.sec=\u5b89\u9759\u65f6\u95f4(\u79d2) +label.rbd.id=Cephx \u7528\u6237 +label.rbd.monitor=Ceph \u76d1\u89c6\u5668 +label.rbd.pool=Ceph \u6c60 +label.rbd=RBD +label.rbd.secret=Cephx \u5bc6\u94a5 label.reboot=\u91cd\u65b0\u542f\u52a8 label.recent.errors=\u6700\u8fd1\u51fa\u73b0\u7684\u9519\u8bef label.redundant.router.capability=\u5197\u4f59\u8def\u7531\u5668\u529f\u80fd label.redundant.router=\u5197\u4f59\u8def\u7531\u5668 label.redundant.state=\u5197\u4f59\u72b6\u6001 +label.refresh.blades=\u5237\u65b0\u5200\u7247\u5f0f\u670d\u52a1\u5668 label.refresh=\u5237\u65b0 -label.region=\u5730\u7406\u533a\u57df +label.region=\u533a\u57df label.related=\u76f8\u5173\u8054 +label.release.account.lowercase=\u4ece\u5e10\u6237\u4e2d\u91ca\u653e +label.release.account=\u4ece\u5e10\u6237\u4e2d\u91ca\u653e +label.release.dedicated.cluster=\u91ca\u653e\u4e13\u7528\u7fa4\u96c6 +label.release.dedicated.host=\u91ca\u653e\u4e13\u7528\u4e3b\u673a +label.release.dedicated.pod=\u91ca\u653e\u4e13\u7528\u63d0\u4f9b\u70b9 +label.release.dedicated.vlan.range=\u91ca\u653e\u4e13\u7528 VLAN \u8303\u56f4 +label.release.dedicated.zone=\u91ca\u653e\u4e13\u7528\u8d44\u6e90\u57df label.remind.later=\u4ee5\u540e\u63d0\u9192\u6211 label.remove.ACL=\u5220\u9664 ACL label.remove.egress.rule=\u5220\u9664\u51fa\u53e3\u89c4\u5219 label.remove.from.load.balancer=\u6b63\u5728\u4ece\u8d1f\u8f7d\u5e73\u8861\u5668\u4e2d\u5220\u9664\u5b9e\u4f8b label.remove.ingress.rule=\u5220\u9664\u5165\u53e3\u89c4\u5219 label.remove.ip.range=\u5220\u9664 IP \u8303\u56f4 +label.remove.ldap=\u5220\u9664 LDAP +label.remove.network.offering=\u5220\u9664\u7f51\u7edc\u65b9\u6848 label.remove.pf=\u5220\u9664\u7aef\u53e3\u8f6c\u53d1\u89c4\u5219 label.remove.project.account=\u4ece\u9879\u76ee\u4e2d\u5220\u9664\u5e10\u6237 -label.remove.region=\u5220\u9664\u5730\u7406\u533a\u57df +label.remove.region=\u79fb\u9664\u533a\u57df label.remove.rule=\u5220\u9664\u89c4\u5219 label.remove.static.nat.rule=\u5220\u9664\u9759\u6001 NAT \u89c4\u5219 label.remove.static.route=\u5220\u9664\u9759\u6001\u8def\u7531 label.remove.tier=\u5220\u9664\u5c42 label.remove.vm.from.lb=\u4ece\u8d1f\u8f7d\u5e73\u8861\u5668\u89c4\u5219\u4e2d\u5220\u9664 VM +label.remove.vmware.datacenter=\u5220\u9664 VMware \u6570\u636e\u4e2d\u5fc3 label.remove.vpc=\u5220\u9664 VPC -label.removing.user=\u6b63\u5728\u5220\u9664\u7528\u6237 label.removing=\u6b63\u5728\u5220\u9664 +label.removing.user=\u6b63\u5728\u5220\u9664\u7528\u6237 +label.reource.id=\u8d44\u6e90 ID label.required=\u5fc5\u586b\u9879 +label.requires.upgrade=\u9700\u8981\u5347\u7ea7 +label.reserved.ip.range=\u9884\u7559 IP \u8303\u56f4 label.reserved.system.gateway=\u9884\u7559\u7684\u7cfb\u7edf\u7f51\u5173 label.reserved.system.ip=\u9884\u7559\u7684\u7cfb\u7edf IP label.reserved.system.netmask=\u9884\u7559\u7684\u7cfb\u7edf\u7f51\u7edc\u63a9\u7801 +label.resetVM=\u91cd\u7f6e VM label.reset.VPN.connection=\u91cd\u7f6e VPN \u8fde\u63a5 label.resize.new.offering.id=\u65b0\u65b9\u6848 label.resize.new.size=\u65b0\u5efa\u5927\u5c0f(GB) label.resize.shrink.ok=\u662f\u5426\u786e\u5b9e\u8981\u7f29\u5c0f\u5377\u5927\u5c0f label.resource.limits=\u8d44\u6e90\u9650\u5236 +label.resource.name=\u8d44\u6e90\u540d\u79f0 label.resource.state=\u8d44\u6e90\u72b6\u6001 -label.resource=\u8d44\u6e90 label.resources=\u8d44\u6e90 +label.resource=\u8d44\u6e90 label.restart.network=\u91cd\u65b0\u542f\u52a8\u7f51\u7edc label.restart.required=\u9700\u8981\u91cd\u65b0\u542f\u52a8 label.restart.vpc=\u91cd\u65b0\u542f\u52a8 VPC @@ -1003,7 +1147,11 @@ label.revoke.project.invite=\u64a4\u9500\u9080\u8bf7 label.role=\u89d2\u8272 label.root.disk.controller=\u6839\u78c1\u76d8\u63a7\u5236\u5668 label.root.disk.offering=\u6839\u78c1\u76d8\u65b9\u6848 +label.root.disk.size=\u6839\u78c1\u76d8\u5927\u5c0f label.round.robin=\u8f6e\u8be2\u7b97\u6cd5 +label.router.vm.scaled.up=\u5df2\u6269\u5c55\u8def\u7531\u5668 VM +label.routing=\u6b63\u5728\u8def\u7531 +label.rule.number=\u89c4\u5219\u7f16\u53f7 label.rules=\u89c4\u5219 label.running.vms=\u6b63\u5728\u8fd0\u884c\u7684 VM label.s3.access_key=\u8bbf\u95ee\u5bc6\u94a5 @@ -1011,6 +1159,8 @@ label.s3.bucket=\u5b58\u50a8\u6876 label.s3.connection_timeout=\u8fde\u63a5\u8d85\u65f6 label.s3.endpoint=\u7aef\u70b9 label.s3.max_error_retry=\u6700\u5927\u9519\u8bef\u91cd\u8bd5\u6b21\u6570 +label.s3.nfs.path=S3 NFS \u8def\u5f84 +label.s3.nfs.server=S3 NFS \u670d\u52a1\u5668 label.s3.secret_key=\u5bc6\u94a5 label.s3.socket_timeout=\u5957\u63a5\u5b57\u8d85\u65f6 label.s3.use_https=\u4f7f\u7528 HTTPS @@ -1020,67 +1170,84 @@ label.save=\u4fdd\u5b58 label.saving.processing=\u6b63\u5728\u4fdd\u5b58... label.scope=\u8303\u56f4 label.search=\u641c\u7d22 -label.secondary.storage.count=\u4e8c\u7ea7\u5b58\u50a8\u6c60 -label.secondary.storage.limits=\u4e8c\u7ea7\u5b58\u50a8\u9650\u5236(GiB) -label.secondary.storage.vm=\u4e8c\u7ea7\u5b58\u50a8 VM -label.secondary.storage=\u4e8c\u7ea7\u5b58\u50a8 -label.secondary.used=\u5df2\u4f7f\u7528\u7684\u4e8c\u7ea7\u5b58\u50a8 +label.secondary.isolated.vlan.id=\u4e8c\u7ea7\u9694\u79bb VLAN ID +label.secondary.staging.store.details=\u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8\u8be6\u7ec6\u4fe1\u606f +label.secondary.staging.store=\u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8 +label.secondary.storage.count=\u8f85\u52a9\u5b58\u50a8\u6c60 +label.secondary.storage.details=\u4e8c\u7ea7\u5b58\u50a8\u8be6\u7ec6\u4fe1\u606f +label.secondary.storage.limits=\u8f85\u52a9\u5b58\u50a8\u9650\u5236(GiB) +label.secondary.storage=\u8f85\u52a9\u5b58\u50a8 +label.secondary.storage.vm=\u8f85\u52a9\u5b58\u50a8 VM +label.secondary.used=\u5df2\u4f7f\u7528\u7684\u8f85\u52a9\u5b58\u50a8 label.secret.key=\u5bc6\u94a5 label.security.group.name=\u5b89\u5168\u7ec4\u540d\u79f0 -label.security.group=\u5b89\u5168\u7ec4 label.security.groups.enabled=\u5df2\u542f\u7528\u5b89\u5168\u7ec4 label.security.groups=\u5b89\u5168\u7ec4 -label.select-view=\u9009\u62e9\u89c6\u56fe +label.security.group=\u5b89\u5168\u7ec4 label.select.a.template=\u9009\u62e9\u4e00\u4e2a\u6a21\u677f -label.select.a.zone=\u9009\u62e9\u4e00\u4e2a\u8d44\u6e90\u57df +label.select.a.zone=\u9009\u62e9\u4e00\u4e2a\u533a\u57df label.select.instance.to.attach.volume.to=\u9009\u62e9\u8981\u5c06\u5377\u9644\u52a0\u5230\u7684\u5b9e\u4f8b label.select.instance=\u9009\u62e9\u5b9e\u4f8b label.select.iso.or.template=\u9009\u62e9 ISO \u6216\u6a21\u677f label.select.offering=\u9009\u62e9\u65b9\u6848 label.select.project=\u9009\u62e9\u9879\u76ee +label.select.template=\u9009\u62e9\u6a21\u677f label.select.tier=\u9009\u62e9\u5c42 -label.select.vm.for.static.nat=\u4e3a\u9759\u6001 NAT \u9009\u62e9 VM label.select=\u9009\u62e9 +label.select-view=\u9009\u62e9\u89c6\u56fe +label.select.vm.for.static.nat=\u4e3a\u9759\u6001 NAT \u9009\u62e9 VM label.sent=\u5df2\u53d1\u9001 label.server=\u670d\u52a1\u5668 label.service.capabilities=\u670d\u52a1\u529f\u80fd label.service.offering=\u670d\u52a1\u65b9\u6848 +label.service.state=\u670d\u52a1\u72b6\u6001 +label.services=\u670d\u52a1 label.session.expired=\u4f1a\u8bdd\u5df2\u8fc7\u671f -label.set.up.zone.type=\u8bbe\u7f6e\u8d44\u6e90\u57df\u7c7b\u578b +label.set.default.NIC=\u8bbe\u7f6e\u9ed8\u8ba4 NIC +label.settings=\u8bbe\u7f6e label.setup.network=\u8bbe\u7f6e\u7f51\u7edc -label.setup.zone=\u8bbe\u7f6e\u8d44\u6e90\u57df label.setup=\u8bbe\u7f6e -label.shared=\u5df2\u5171\u4eab +label.set.up.zone.type=\u8bbe\u7f6e\u533a\u57df\u7c7b\u578b +label.setup.zone=\u8bbe\u7f6e\u533a\u57df label.SharedMountPoint=SharedMountPoint +label.shared=\u5df2\u5171\u4eab +label.show.advanced.settings=\u663e\u793a\u9ad8\u7ea7\u8bbe\u7f6e label.show.ingress.rule=\u663e\u793a\u5165\u53e3\u89c4\u5219 label.shutdown.provider=\u5173\u95ed\u63d0\u4f9b\u7a0b\u5e8f label.site.to.site.VPN=\u70b9\u5bf9\u70b9 VPN label.size=\u5927\u5c0f label.skip.guide=\u6211\u4ee5\u524d\u4f7f\u7528\u8fc7 CloudStack\uff0c\u8df3\u8fc7\u6b64\u6307\u5357 +label.smb.domain=SMB \u57df +label.smb.password=SMB \u5bc6\u7801 +label.smb.username=SMB \u7528\u6237\u540d label.snapshot.limits=\u5feb\u7167\u9650\u5236 label.snapshot.name=\u5feb\u7167\u540d\u79f0 -label.snapshot.s=\u5feb\u7167 label.snapshot.schedule=\u8bbe\u7f6e\u91cd\u73b0\u5feb\u7167 -label.snapshot=\u5feb\u7167 +label.snapshot.s=\u5feb\u7167 label.snapshots=\u5feb\u7167 +label.snapshot=\u5feb\u7167 +label.SNMP.community=SNMP \u793e\u533a +label.SNMP.port=SNMP \u7aef\u53e3 +label.sockets=CPU \u63d2\u69fd label.source.nat=\u6e90 NAT label.source=\u6e90\u7b97\u6cd5 label.specify.IP.ranges=\u6307\u5b9a IP \u8303\u56f4 label.specify.vlan=\u6307\u5b9a VLAN label.specify.vxlan=\u6307\u5b9a VXLAN -label.SR.name=SR \u540d\u79f0\u6807\u7b7e +label.SR.name = SR \u540d\u79f0\u6807\u7b7e +label.srx.details=SRX \u8be6\u7ec6\u4fe1\u606f label.srx=SRX -label.PA=Palo Alto label.start.IP=\u8d77\u59cb IP +label.start.lb.vm=\u542f\u52a8 LB VM label.start.port=\u8d77\u59cb\u7aef\u53e3 label.start.reserved.system.IP=\u8d77\u59cb\u9884\u7559\u7cfb\u7edf IP label.start.vlan=\u8d77\u59cb VLAN -label.start.vxlan=\u542f\u52a8 VXLAN +label.start.vxlan=\u8d77\u59cb VXLAN label.state=\u72b6\u6001 label.static.nat.enabled=\u5df2\u542f\u7528\u9759\u6001 NAT label.static.nat.to=\u9759\u6001 NAT \u76ee\u6807 -label.static.nat.vm.details=\u9759\u6001 NAT VM \u8be6\u60c5 label.static.nat=\u9759\u6001 NAT +label.static.nat.vm.details=\u9759\u6001 NAT VM \u8be6\u60c5 label.statistics=\u7edf\u8ba1\u6570\u636e label.status=\u72b6\u6001 label.step.1.title=\u6b65\u9aa4 1\: \u9009\u62e9\u4e00\u4e2a\u6a21\u677f @@ -1106,79 +1273,93 @@ label.sticky.postonly=postonly label.sticky.prefix=prefix label.sticky.request-learn=request-learn label.sticky.tablesize=\u8868\u5927\u5c0f -label.stop=\u505c\u6b62 +label.stop.lb.vm=\u505c\u6b62 LB VM label.stopped.vms=\u5df2\u505c\u6b62\u7684 VM +label.stop=\u505c\u6b62 label.storage.tags=\u5b58\u50a8\u6807\u7b7e -label.storage.traffic=\u5b58\u50a8\u6d41\u91cf +label.storage.traffic=\u5b58\u50a8\u901a\u4fe1 label.storage.type=\u5b58\u50a8\u7c7b\u578b -label.qos.type=QoS \u7c7b\u578b -label.cache.mode=\u5199\u5165\u7f13\u5b58\u7c7b\u578b label.storage=\u5b58\u50a8 label.subdomain.access=\u5b50\u57df\u8bbf\u95ee -label.submit=\u63d0\u4ea4 label.submitted.by=[\u63d0\u4ea4\u8005\: ] +label.submit=\u63d0\u4ea4 label.succeeded=\u6210\u529f label.sunday=\u661f\u671f\u65e5 label.super.cidr.for.guest.networks=\u6765\u5bbe\u7f51\u7edc\u7684\u8d85\u7ea7 CIDR label.supported.services=\u652f\u6301\u7684\u670d\u52a1 label.supported.source.NAT.type=\u652f\u6301\u7684\u6e90 NAT \u7c7b\u578b label.suspend.project=\u6682\u505c\u9879\u76ee +label.switch.type=\u4ea4\u6362\u673a\u7c7b\u578b label.system.capacity=\u7cfb\u7edf\u5bb9\u91cf +label.system.offering.for.router=\u8def\u7531\u5668\u7684\u7cfb\u7edf\u65b9\u6848 label.system.offering=\u7cfb\u7edf\u65b9\u6848 label.system.service.offering=\u7cfb\u7edf\u670d\u52a1\u65b9\u6848 +label.system.vm.details=\u7cfb\u7edf VM \u8be6\u7ec6\u4fe1\u606f +label.system.vm.scaled.up=\u5df2\u6269\u5c55\u7cfb\u7edf VM +label.system.vms=\u7cfb\u7edf VM label.system.vm.type=\u7cfb\u7edf VM \u7c7b\u578b label.system.vm=\u7cfb\u7edf VM -label.system.vms=\u7cfb\u7edf VM label.system.wide.capacity=\u6574\u4e2a\u7cfb\u7edf\u7684\u5bb9\u91cf label.tagged=\u5df2\u6807\u8bb0 +label.tag.key=\u6807\u8bb0\u5bc6\u94a5 label.tags=\u6807\u7b7e +label.tag.value=\u6807\u8bb0\u503c label.target.iqn=\u76ee\u6807 IQN label.task.completed=\u5df2\u5b8c\u6210\u4efb\u52a1 label.template.limits=\u6a21\u677f\u9650\u5236 label.template=\u6a21\u677f label.TFTP.dir=TFTP \u76ee\u5f55 +label.tftp.root.directory=Tftp \u6839\u76ee\u5f55 label.theme.default=\u9ed8\u8ba4\u4e3b\u9898 label.theme.grey=\u81ea\u5b9a\u4e49 - \u7070\u8272 label.theme.lightblue=\u81ea\u5b9a\u4e49 - \u6de1\u84dd\u8272 label.thursday=\u661f\u671f\u56db label.tier.details=\u5c42\u8be6\u7ec6\u4fe1\u606f label.tier=\u5c42 -label.time.zone=\u65f6\u533a -label.time=\u65f6\u95f4 -label.timeout.in.second=\u8d85\u65f6(\u79d2) +label.timeout.in.second = \u8d85\u65f6(\u79d2) label.timeout=\u8d85\u65f6 +label.time=\u65f6\u95f4 +label.time.zone=\u65f6\u533a label.timezone=\u65f6\u533a label.token=\u4ee4\u724c -label.total.CPU=CPU \u603b\u91cf label.total.cpu=CPU \u603b\u91cf +label.total.CPU=CPU \u603b\u91cf label.total.hosts=\u603b\u4e3b\u673a\u6570 label.total.memory=\u5185\u5b58\u603b\u91cf label.total.of.ip=\u603b IP \u5730\u5740\u6570 label.total.of.vm=\u603b VM \u6570 label.total.storage=\u5b58\u50a8\u603b\u91cf +label.total.virtual.routers=\u865a\u62df\u8def\u7531\u5668\u603b\u6570 +label.total.virtual.routers.upgrade=\u9700\u8981\u5347\u7ea7\u7684\u865a\u62df\u8def\u7531\u5668\u603b\u6570 label.total.vms=\u603b VM \u6570 -label.traffic.label=\u6d41\u91cf\u6807\u7b7e -label.traffic.type=\u6d41\u91cf\u7c7b\u578b -label.traffic.types=\u6d41\u91cf\u7c7b\u578b +label.traffic.label=\u901a\u4fe1\u6807\u7b7e +label.traffic.types=\u901a\u4fe1\u7c7b\u578b +label.traffic.type=\u901a\u4fe1\u7c7b\u578b label.tuesday=\u661f\u671f\u4e8c label.type.id=\u7c7b\u578b ID +label.type.lower=\u7c7b\u578b label.type=\u7c7b\u578b +label.ucs=UCS label.unavailable=\u4e0d\u53ef\u7528 label.unlimited=\u65e0\u9650\u5236 label.untagged=\u5df2\u53d6\u6d88\u6807\u8bb0 label.update.project.resources=\u66f4\u65b0\u9879\u76ee\u8d44\u6e90 -label.update.ssl.cert=SSL \u8bc1\u4e66 -label.update.ssl=SSL \u8bc1\u4e66 +label.update.ssl.cert= SSL \u8bc1\u4e66 +label.update.ssl= SSL \u8bc1\u4e66 label.updating=\u6b63\u5728\u66f4\u65b0 -label.upload.volume=\u4e0a\u8f7d\u5377 +label.upgrade.required=\u9700\u8981\u5347\u7ea7 +label.upgrade.router.newer.template=\u5347\u7ea7\u8def\u7531\u5668\u4ee5\u4f7f\u7528\u66f4\u65b0\u7684\u6a21\u677f label.upload=\u4e0a\u8f7d +label.upload.volume=\u4e0a\u8f7d\u5377 label.url=URL label.usage.interface=\u4f7f\u7528\u754c\u9762 -label.use.vm.ip=\u4f7f\u7528 VM IP\: label.used=\u5df2\u4f7f\u7528 -label.user=\u7528\u6237 +label.user.data=\u7528\u6237\u6570\u636e +label.username.lower=\u7528\u6237\u540d label.username=\u7528\u6237\u540d label.users=\u7528\u6237 +label.user=\u7528\u6237 +label.use.vm.ip=\u4f7f\u7528 VM IP\: label.value=\u503c label.vcdcname=vCenter DC \u540d\u79f0 label.vcenter.cluster=vCenter \u7fa4\u96c6 @@ -1187,62 +1368,82 @@ label.vcenter.datastore=vCenter \u6570\u636e\u5b58\u50a8 label.vcenter.host=vCenter \u4e3b\u673a label.vcenter.password=vCenter \u5bc6\u7801 label.vcenter.username=vCenter \u7528\u6237\u540d +label.vcenter=vCenter label.vcipaddress=vCenter IP \u5730\u5740 label.version=\u7248\u672c label.view.all=\u67e5\u770b\u5168\u90e8 label.view.console=\u67e5\u770b\u63a7\u5236\u53f0 +label.viewing=\u67e5\u770b label.view.more=\u67e5\u770b\u66f4\u591a +label.view.secondary.ips=\u67e5\u770b\u8f85\u52a9 IP label.view=\u67e5\u770b -label.viewing=\u67e5\u770b -label.virtual.appliance=\u865a\u62df\u8bbe\u5907 +label.virtual.appliance.details=\u865a\u62df\u8bbe\u5907\u8be6\u7ec6\u4fe1\u606f label.virtual.appliances=\u865a\u62df\u8bbe\u5907 +label.virtual.appliance=\u865a\u62df\u8bbe\u5907 label.virtual.machines=\u865a\u62df\u673a +label.virtual.networking=\u865a\u62df\u7f51\u7edc\u8fde\u63a5 label.virtual.network=\u865a\u62df\u7f51\u7edc -label.virtual.router=\u865a\u62df\u8def\u7531\u5668 +label.virtual.routers.group.account=\u865a\u62df\u8def\u7531\u5668(\u6309\u5e10\u6237\u5206\u7ec4) +label.virtual.routers.group.cluster=\u865a\u62df\u8def\u7531\u5668(\u6309\u7fa4\u96c6\u5206\u7ec4) +label.virtual.routers.group.pod=\u865a\u62df\u8def\u7531\u5668(\u6309\u63d0\u4f9b\u70b9\u5206\u7ec4) +label.virtual.routers.group.zone=\u865a\u62df\u8def\u7531\u5668(\u6309\u8d44\u6e90\u57df\u5206\u7ec4) label.virtual.routers=\u865a\u62df\u8def\u7531\u5668 -label.vlan.id=VLAN/VNI ID -label.vlan.range=VLAN/VNI \u8303\u56f4 -label.vlan=VLAN/VNI -label.vnet=VLAN/VNI -label.vnet.id=VLAN/VNI ID -label.vxlan.id=VXLAN ID -label.vxlan.range=VXLAN \u8303\u56f4 -label.vxlan=VXLAN +label.virtual.router=\u865a\u62df\u8def\u7531\u5668 +label.vlan.id=VLAN ID +label.vlan.range.details=VLAN \u8303\u56f4\u8be6\u7ec6\u4fe1\u606f +label.vlan.ranges=VLAN \u8303\u56f4 +label.vlan.range=VLAN \u8303\u56f4 +label.vlan=VLAN +label.vlan.vni.ranges=VLAN/VNI \u8303\u56f4 +label.vlan.vni.range=VLAN/VNI \u8303\u56f4 label.vm.add=\u6dfb\u52a0\u5b9e\u4f8b label.vm.destroy=\u9500\u6bc1 label.vm.display.name=VM \u663e\u793a\u540d\u79f0 -label.vm.name=VM \u540d\u79f0 -label.vm.reboot=\u91cd\u65b0\u542f\u52a8 -label.vm.start=\u542f\u52a8 -label.vm.state=VM \u72b6\u6001 -label.vm.stop=\u505c\u6b62 label.VMFS.datastore=VMFS \u6570\u636e\u5b58\u50a8 label.vmfs=VMFS +label.vm.name=VM \u540d\u79f0 +label.vm.password=VM \u7684\u5bc6\u7801 +label.vm.reboot=\u91cd\u65b0\u542f\u52a8 label.VMs.in.tier=\u5c42\u4e2d\u7684 VM -label.vms=VM label.vmsnapshot.current=\u6700\u65b0\u7248\u672c label.vmsnapshot.memory=\u5feb\u7167\u5185\u5b58 label.vmsnapshot.parentname=\u7236\u540d\u79f0 label.vmsnapshot.type=\u7c7b\u578b label.vmsnapshot=VM \u5feb\u7167 -label.vmware.traffic.label=VMware \u6d41\u91cf\u6807\u7b7e -label.volgroup=\u5377\u7ec4 -label.volume.limits=\u5377\u9650\u5236 +label.vm.start=\u542f\u52a8 +label.vm.state=VM \u72b6\u6001 +label.vm.stop=\u505c\u6b62 +label.vms=VM +label.vmware.datacenter.id=VMware \u6570\u636e\u4e2d\u5fc3 ID +label.vmware.datacenter.name=VMware \u6570\u636e\u4e2d\u5fc3\u540d\u79f0 +label.vmware.datacenter.vcenter=VMware \u6570\u636e\u4e2d\u5fc3 vCenter +label.vmware.traffic.label=VMware \u901a\u4fe1\u6807\u7b7e +label.vnet.id=VLAN ID +label.vnet=VLAN +label.vnmc.devices=VNMC \u8bbe\u5907 +label.volatile=\u53ef\u53d8 +label.volgroup=\u5377\u7ec4 +label.volume.limits=\u5377\u9650\u5236 label.volume.name=\u5377\u540d\u79f0 -label.volume=\u5377 label.volumes=\u5377 +label.volume=\u5377 label.vpc.id=VPC ID +label.VPC.limits=VPC \u9650\u5236 label.VPC.router.details=VPC \u8def\u7531\u5668\u8be6\u7ec6\u4fe1\u606f +label.vpc.virtual.router=VPC \u865a\u62df\u8def\u7531\u5668 label.vpc=VPC label.VPN.connection=VPN \u8fde\u63a5 -label.VPN.customer.gateway=VPN \u5ba2\u6237\u7f51\u5173 label.vpn.customer.gateway=VPN \u5ba2\u6237\u7f51\u5173 +label.VPN.customer.gateway=VPN \u5ba2\u6237\u7f51\u5173 label.VPN.gateway=VPN \u7f51\u5173 label.vpn=VPN label.vsmctrlvlanid=\u63a7\u5236 VLAN ID label.vsmpktvlanid=\u6570\u636e\u5305 VLAN ID label.vsmstoragevlanid=\u5b58\u50a8 VLAN ID label.vsphere.managed=\u7531 vSphere \u7ba1\u7406 +label.vxlan.id=VXLAN ID +label.vxlan.range=VXLAN Range +label.vxlan=VXLAN label.waiting=\u6b63\u5728\u7b49\u5f85 label.warn=\u8b66\u544a label.wednesday=\u661f\u671f\u4e09 @@ -1250,240 +1451,32 @@ label.weekly=\u6bcf\u5468 label.welcome.cloud.console=\u6b22\u8fce\u4f7f\u7528\u7ba1\u7406\u63a7\u5236\u53f0 label.welcome=\u6b22\u8fce label.what.is.cloudstack=\u4ec0\u4e48\u662f CloudStack&\#8482? +label.xenserver.tools.version.61.plus=XenServer Tools \u7248\u672c 6.1\\+ +label.Xenserver.Tools.Version61plus=XenServer Tools \u7248\u672c 6.1\\+ label.xen.traffic.label=XenServer \u6d41\u91cf\u6807\u7b7e label.yes=\u662f -label.zone.details=\u8d44\u6e90\u57df\u8be6\u7ec6\u4fe1\u606f -label.zone.id=\u8d44\u6e90\u57df ID -label.zone.name=\u8d44\u6e90\u57df\u540d\u79f0 +label.zone.dedicated=\u8d44\u6e90\u57df\u5df2\u4e13\u7528 +label.zone.details=\u533a\u57df\u8be6\u60c5 +label.zone.id=\u533a\u57df ID +label.zone.lower=\u8d44\u6e90\u57df +label.zone.name=\u533a\u57df\u540d\u79f0 label.zone.step.1.title=\u6b65\u9aa4 1\: \u9009\u62e9\u4e00\u4e2a\u7f51\u7edc -label.zone.step.2.title=\u6b65\u9aa4 2\: \u6dfb\u52a0\u4e00\u4e2a\u8d44\u6e90\u57df +label.zone.step.2.title=\u6b65\u9aa4 2\: \u6dfb\u52a0\u4e00\u4e2a\u533a\u57df label.zone.step.3.title=\u6b65\u9aa4 3\: \u6dfb\u52a0\u4e00\u4e2a\u63d0\u4f9b\u70b9 label.zone.step.4.title=\u6b65\u9aa4 4\: \u6dfb\u52a0\u4e00\u4e2a IP \u8303\u56f4 -label.zone.type=\u8d44\u6e90\u57df\u7c7b\u578b -label.zone.wide=\u6574\u4e2a\u8d44\u6e90\u57df -label.zone=\u8d44\u6e90\u57df -label.zones=\u8d44\u6e90\u57df -label.zoneWizard.trafficType.guest=\u6765\u5bbe\: \u6700\u7ec8\u7528\u6237\u865a\u62df\u673a\u4e4b\u95f4\u7684\u6d41\u91cf -label.zoneWizard.trafficType.management=\u7ba1\u7406\: CloudStack \u7684\u5185\u90e8\u8d44\u6e90(\u5305\u62ec\u4e0e\u7ba1\u7406\u670d\u52a1\u5668\u901a\u4fe1\u7684\u4efb\u4f55\u7ec4\u4ef6\uff0c\u4f8b\u5982\u4e3b\u673a\u548c CloudStack \u7cfb\u7edf VM)\u4e4b\u95f4\u7684\u6d41\u91cf -label.zoneWizard.trafficType.public=\u516c\u5171\: \u4e91\u4e2d Internet \u4e0e\u865a\u62df\u673a\u4e4b\u95f4\u7684\u6d41\u91cf\u3002 -label.zoneWizard.trafficType.storage=\u5b58\u50a8\: \u4e3b\u5b58\u50a8\u670d\u52a1\u5668\u4e0e\u4e8c\u7ea7\u5b58\u50a8\u670d\u52a1\u5668(\u4f8b\u5982 VM \u6a21\u677f\u4e0e\u5feb\u7167)\u4e4b\u95f4\u7684\u6d41\u91cf -label.ldap.group.name=LDAP \u7ec4 -label.password.reset.confirm=\u5bc6\u7801\u5df2\u91cd\u7f6e\u4e3a -label.provider=\u63d0\u4f9b\u7a0b\u5e8f -label.resetVM=\u91cd\u7f6e VM -label.openDaylight=OpenDaylight -label.assign.instance.another=\u5c06\u5b9e\u4f8b\u5206\u914d\u7ed9\u5176\u4ed6\u5e10\u6237 -label.network.addVM=\u5c06\u7f51\u7edc\u6dfb\u52a0\u5230 VM -label.set.default.NIC=\u8bbe\u7f6e\u9ed8\u8ba4 NIC -label.Xenserver.Tools.Version61plus=XenServer Tools \u7248\u672c 6.1\+ -label.dynamically.scalable=\u53ef\u52a8\u6001\u6269\u5c55 -label.instance.scaled.up=\u5df2\u6269\u5c55\u5b9e\u4f8b -label.tag.key=\u6807\u8bb0\u5bc6\u94a5 -label.tag.value=\u6807\u8bb0\u503c -label.ipv6.address=IPv6 IP \u5730\u5740 -label.ipv6.gateway=IPv6 \u7f51\u5173 -label.ipv6.CIDR=IPv6 CIDR -label.VPC.limits=VPC \u9650\u5236 -label.edit.region=\u7f16\u8f91\u5730\u7406\u533a\u57df -label.gslb.domain.name=GSLB \u57df\u540d -label.add.gslb=\u6dfb\u52a0 GSLB -label.gslb.servicetype=\u670d\u52a1\u7c7b\u578b -label.gslb.details=GSLB \u8be6\u7ec6\u4fe1\u606f -label.gslb.delete=\u5220\u9664 GSLB -label.opendaylight.controller=OpenDaylight \u63a7\u5236\u5668 -label.opendaylight.controllers=OpenDaylight \u63a7\u5236\u5668 -label.portable.ip.ranges=\u53ef\u79fb\u690d IP \u8303\u56f4 -label.add.portable.ip.range=\u6dfb\u52a0\u53ef\u79fb\u690d IP \u8303\u56f4 -label.delete.portable.ip.range=\u5220\u9664\u53ef\u79fb\u690d IP \u8303\u56f4 -label.opendaylight.controllerdetail=OpenDaylight \u63a7\u5236\u5668\u8be6\u7ec6\u4fe1\u606f -label.portable.ip.range.details=\u53ef\u79fb\u690d IP \u8303\u56f4\u8be6\u7ec6\u4fe1\u606f -label.portable.ips=\u53ef\u79fb\u690d IP -label.gslb.assigned.lb=\u5df2\u5206\u914d\u8d1f\u8f7d\u5e73\u8861 -label.gslb.assigned.lb.more=\u5206\u914d\u66f4\u591a\u8d1f\u8f7d\u5e73\u8861 -label.gslb.lb.rule=\u8d1f\u8f7d\u5e73\u8861\u89c4\u5219 -label.gslb.lb.details=\u8d1f\u8f7d\u5e73\u8861\u8be6\u7ec6\u4fe1\u606f -label.gslb.lb.remove=\u4ece\u6b64 GSLB \u4e2d\u5220\u9664\u8d1f\u8f7d\u5e73\u8861 -label.enable.autoscale=\u542f\u7528\u81ea\u52a8\u6269\u5c55 -label.disable.autoscale=\u7981\u7528\u81ea\u52a8\u6269\u5c55 -label.min.instances=\u6700\u5c0f\u5b9e\u4f8b\u6570 -label.max.instances=\u6700\u5927\u5b9e\u4f8b\u6570 -label.add.OpenDaylight.device=\u6dfb\u52a0 OpenDaylight \u63a7\u5236\u5668 -label.show.advanced.settings=\u663e\u793a\u9ad8\u7ea7\u8bbe\u7f6e -label.delete.OpenDaylight.device=\u5220\u9664 OpenDaylight \u63a7\u5236\u5668 -label.polling.interval.sec=\u8f6e\u8be2\u65f6\u95f4\u95f4\u9694(\u79d2) -label.quiet.time.sec=\u5b89\u9759\u65f6\u95f4(\u79d2) -label.destroy.vm.graceperiod=\u9500\u6bc1 VM \u5bbd\u9650\u671f -label.SNMP.community=SNMP \u793e\u533a -label.SNMP.port=SNMP \u7aef\u53e3 -label.add.ucs.manager=\u6dfb\u52a0 UCS \u7ba1\u7406\u5668 -label.ovm.traffic.label=OVM \u6d41\u91cf\u6807\u7b7e -label.lxc.traffic.label=LXC \u6d41\u91cf\u6807\u7b7e -label.hyperv.traffic.label=HyperV \u6d41\u91cf\u6807\u7b7e -label.resource.name=\u8d44\u6e90\u540d\u79f0 -label.reource.id=\u8d44\u6e90 ID -label.vnmc.devices=VNMC \u8bbe\u5907 -label.add.vnmc.provider=\u6dfb\u52a0 VNMC \u63d0\u4f9b\u7a0b\u5e8f -label.enable.vnmc.provider=\u542f\u7528 VNMC \u63d0\u4f9b\u7a0b\u5e8f -label.add.vnmc.device=\u6dfb\u52a0 VNMC \u8bbe\u5907 -label.ciscovnmc.resource.details=CiscoVNMC \u8d44\u6e90\u8be6\u7ec6\u4fe1\u606f -label.delete.ciscovnmc.resource=\u5220\u9664 CiscoVNMC \u8d44\u6e90 -label.enable.vnmc.device=\u542f\u7528 VNMC \u8bbe\u5907 -label.disbale.vnmc.device=\u7981\u7528 VNMC \u8bbe\u5907 -label.disable.vnmc.provider=\u7981\u7528 VNMC \u63d0\u4f9b\u7a0b\u5e8f -label.services=\u670d\u52a1 -label.secondary.staging.store=\u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8 -label.release.account=\u4ece\u5e10\u6237\u4e2d\u91ca\u653e -label.release.account.lowercase=\u4ece\u5e10\u6237\u4e2d\u91ca\u653e -label.vlan.vni.ranges=VLAN/VNI \u8303\u56f4 -label.dedicated.vlan.vni.ranges=VLAN/VNI \u8303\u56f4\u5df2\u4e13\u7528 -label.dedicate.vlan.vni.range=\u5c06 VLAN/VNI \u8303\u56f4\u4e13\u7528 -label.vlan.vni.range=VLAN/VNI \u8303\u56f4 -label.vlan.range.details=VLAN \u8303\u56f4\u8be6\u7ec6\u4fe1\u606f -label.release.dedicated.vlan.range=\u91ca\u653e\u4e13\u7528 VLAN \u8303\u56f4 -label.broadcat.uri=\u5e7f\u64ad URI -label.ipv4.cidr=IPv4 CIDR -label.guest.network.details=\u6765\u5bbe\u7f51\u7edc\u8be6\u7ec6\u4fe1\u606f -label.ipv4.gateway=IPv4 \u7f51\u5173 -label.release.dedicated.vlan.range=\u91ca\u653e\u4e13\u7528 VLAN \u8303\u56f4 -label.vlan.ranges=VLAN \u8303\u56f4 -label.virtual.appliance.details=\u865a\u62df\u8bbe\u5907\u8be6\u7ec6\u4fe1\u606f -label.start.lb.vm=\u542f\u52a8 LB VM -label.stop.lb.vm=\u505c\u6b62 LB VM -label.migrate.lb.vm=\u8fc1\u79fb LB VM -label.vpc.virtual.router=VPC \u865a\u62df\u8def\u7531\u5668 -label.ovs=OVS -label.gslb.service=GSLB \u670d\u52a1 -label.gslb.service.public.ip=GSLB \u670d\u52a1\u516c\u7528 IP -label.gslb.service.private.ip=GSLB \u670d\u52a1\u4e13\u7528 IP -label.baremetal.dhcp.provider=\u88f8\u673a DHCP \u63d0\u4f9b\u7a0b\u5e8f -label.add.baremetal.dhcp.device=\u6dfb\u52a0\u88f8\u673a DHCP \u8bbe\u5907 -label.baremetal.pxe.provider=\u88f8\u673a PXE \u63d0\u4f9b\u7a0b\u5e8f -label.baremetal.pxe.device=\u6dfb\u52a0\u88f8\u673a PXE \u8bbe\u5907 -label.tftp.root.directory=Tftp \u6839\u76ee\u5f55 -label.add.vmware.datacenter=\u6dfb\u52a0 VMware \u6570\u636e\u4e2d\u5fc3 -label.remove.vmware.datacenter=\u5220\u9664 VMware \u6570\u636e\u4e2d\u5fc3 -label.dc.name=\u6570\u636e\u4e2d\u5fc3\u540d\u79f0 -label.vcenter=vCenter -label.dedicate.zone=\u5c06\u8d44\u6e90\u57df\u4e13\u7528 -label.zone.dedicated=\u8d44\u6e90\u57df\u5df2\u4e13\u7528 -label.release.dedicated.zone=\u91ca\u653e\u4e13\u7528\u8d44\u6e90\u57df -label.ipv6.dns1=IPv6 DNS1 -label.ipv6.dns2=IPv6 DNS2 -label.vmware.datacenter.name=VMware \u6570\u636e\u4e2d\u5fc3\u540d\u79f0 -label.vmware.datacenter.vcenter=VMware \u6570\u636e\u4e2d\u5fc3 vCenter -label.vmware.datacenter.id=VMware \u6570\u636e\u4e2d\u5fc3 ID -label.system.vm.details=\u7cfb\u7edf VM \u8be6\u7ec6\u4fe1\u606f -label.system.vm.scaled.up=\u5df2\u6269\u5c55\u7cfb\u7edf VM -label.console.proxy.vm=\u63a7\u5236\u5668\u4ee3\u7406 VM -label.settings=\u8bbe\u7f6e -label.requires.upgrade=\u9700\u8981\u5347\u7ea7 -label.upgrade.router.newer.template=\u5347\u7ea7\u8def\u7531\u5668\u4ee5\u4f7f\u7528\u66f4\u65b0\u7684\u6a21\u677f -label.router.vm.scaled.up=\u5df2\u6269\u5c55\u8def\u7531\u5668 VM -label.total.virtual.routers=\u865a\u62df\u8def\u7531\u5668\u603b\u6570 -label.upgrade.required=\u9700\u8981\u5347\u7ea7 -label.virtual.routers.group.zone=\u865a\u62df\u8def\u7531\u5668(\u6309\u8d44\u6e90\u57df\u5206\u7ec4) -label.total.virtual.routers.upgrade=\u9700\u8981\u5347\u7ea7\u7684\u865a\u62df\u8def\u7531\u5668\u603b\u6570 -label.virtual.routers.group.pod=\u865a\u62df\u8def\u7531\u5668(\u6309\u63d0\u4f9b\u70b9\u5206\u7ec4) -label.virtual.routers.group.cluster=\u865a\u62df\u8def\u7531\u5668(\u6309\u7fa4\u96c6\u5206\u7ec4) -label.zone.lower=\u8d44\u6e90\u57df -label.virtual.routers.group.account=\u865a\u62df\u8def\u7531\u5668(\u6309\u5e10\u6237\u5206\u7ec4) -label.netscaler.details=NetScaler \u8be6\u7ec6\u4fe1\u606f -label.baremetal.dhcp.devices=\u88f8\u673a DHCP \u8bbe\u5907 -label.baremetal.pxe.devices=\u88f8\u673a PXE \u8bbe\u5907 -label.addes.new.f5=\u5df2\u6dfb\u52a0\u65b0 F5 -label.f5.details=F5 \u8be6\u7ec6\u4fe1\u606f -label.srx.details=SRX \u8be6\u7ec6\u4fe1\u606f -label.palo.alto.details=Palo Alto \u8be6\u7ec6\u4fe1\u606f -label.added.nicira.nvp.controller=\u5df2\u6dfb\u52a0\u65b0 Nicira NVP \u63a7\u5236\u5668\ -label.nicira.nvp.details=Nicira NVP \u8be6\u7ec6\u4fe1\u606f -label.added.new.bigswitch.vns.controller=\u5df2\u6dfb\u52a0\u65b0 BigSwitch VNS \u63a7\u5236\u5668 -label.bigswitch.vns.details=BigSwitch VNS \u8be6\u7ec6\u4fe1\u606f -label.dedicate=\u4e13\u7528 -label.dedicate.pod=\u5c06\u63d0\u4f9b\u70b9\u4e13\u7528 -label.pod.dedicated=\u63d0\u4f9b\u70b9\u5df2\u4e13\u7528 -label.release.dedicated.pod=\u91ca\u653e\u4e13\u7528\u63d0\u4f9b\u70b9 -label.override.public.traffic=\u66ff\u4ee3\u516c\u5171\u6d41\u91cf -label.public.traffic.vswitch.type=\u516c\u5171\u6d41\u91cf\u865a\u62df\u4ea4\u6362\u673a\u7c7b\u578b -label.public.traffic.vswitch.name=\u516c\u5171\u6d41\u91cf\u865a\u62df\u4ea4\u6362\u673a\u540d\u79f0 -label.override.guest.traffic=\u66ff\u4ee3\u6765\u5bbe\u6d41\u91cf -label.guest.traffic.vswitch.type=\u6765\u5bbe\u6d41\u91cf\u865a\u62df\u4ea4\u6362\u673a\u7c7b\u578b -label.guest.traffic.vswitch.name=\u6765\u5bbe\u6d41\u91cf\u865a\u62df\u4ea4\u6362\u673a\u540d\u79f0 -label.cisco.nexus1000v.ip.address=Nexus 1000v IP \u5730\u5740 -label.cisco.nexus1000v.username=Nexus 1000v \u7528\u6237\u540d -label.cisco.nexus1000v.password=Nexus 1000v \u5bc6\u7801 -label.dedicate.cluster=\u5c06\u7fa4\u96c6\u4e13\u7528 -label.release.dedicated.cluster=\u91ca\u653e\u4e13\u7528\u7fa4\u96c6 -label.dedicate.host=\u5c06\u4e3b\u673a\u4e13\u7528 -label.release.dedicated.host=\u91ca\u653e\u4e13\u7528\u4e3b\u673a -label.number.of.cpu.sockets=CPU \u63d2\u69fd\u6570 -label.delete.ucs.manager=\u5220\u9664 UCS Manager -label.blades=\u5200\u7247\u5f0f\u670d\u52a1\u5668 -label.chassis=\u673a\u7bb1 -label.blade.id=\u5200\u7247\u5f0f\u670d\u52a1\u5668 ID -label.associated.profile=\u5df2\u5173\u8054\u914d\u7f6e\u6587\u4ef6 -label.refresh.blades=\u5237\u65b0\u5200\u7247\u5f0f\u670d\u52a1\u5668 -label.instanciate.template.associate.profile.blade=\u5c06\u6a21\u677f\u5b9e\u4f8b\u5316\u5e76\u5c06\u914d\u7f6e\u6587\u4ef6\u4e0e\u5200\u7247\u5f0f\u670d\u52a1\u5668\u5173\u8054 -label.select.template=\u9009\u62e9\u6a21\u677f -label.profile=\u914d\u7f6e\u6587\u4ef6 -label.delete.profile=\u5220\u9664\u914d\u7f6e\u6587\u4ef6 -label.disassociate.profile.blade=\u53d6\u6d88\u5c06\u914d\u7f6e\u6587\u4ef6\u4e0e\u5200\u7247\u5f0f\u670d\u52a1\u5668\u5173\u8054 -label.secondary.storage.details=\u4e8c\u7ea7\u5b58\u50a8\u8be6\u7ec6\u4fe1\u606f -label.secondary.staging.store.details=\u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8\u8be6\u7ec6\u4fe1\u606f -label.add.nfs.secondary.staging.store=\u6dfb\u52a0 NFS \u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8 -label.delete.secondary.staging.store=\u5220\u9664\u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8 -label.ipv4.start.ip=IPv4 \u8d77\u59cb IP -label.ipv4.end.ip=IPv4 \u7ed3\u675f IP -label.ipv6.start.ip=IPv6 \u8d77\u59cb IP -label.ipv6.end.ip=IPv6 \u7ed3\u675f IP -label.vm.password=VM \u7684\u5bc6\u7801 -label.group.by.zone=\u6309\u8d44\u6e90\u57df\u5206\u7ec4 -label.group.by.pod=\u6309\u63d0\u4f9b\u70b9\u5206\u7ec4 -label.group.by.cluster=\u6309\u7fa4\u96c6\u5206\u7ec4 -label.group.by.account=\u6309\u5e10\u6237\u5206\u7ec4 -label.no.grouping=(\u4e0d\u5206\u7ec4) -label.create.nfs.secondary.staging.storage=\u521b\u5efa NFS \u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8 -label.username.lower=\u7528\u6237\u540d -label.password.lower=\u5bc6\u7801 -label.email.lower=\u7535\u5b50\u90ae\u4ef6 -label.firstname.lower=\u540d\u5b57 -label.lastname.lower=\u59d3\u6c0f -label.domain.lower=\u57df -label.account.lower=\u5e10\u6237 -label.type.lower=\u7c7b\u578b -label.rule.number=\u89c4\u5219\u7f16\u53f7 -label.action=\u64cd\u4f5c -label.name.lower=\u540d\u79f0 -label.ucs=UCS -label.change.affinity=\u66f4\u6539\u5173\u8054\u6027 -label.persistent=\u6c38\u4e45 -label.broadcasturi=\u5e7f\u64ad URI -label.network.cidr=\u7f51\u7edc CIDR -label.reserved.ip.range=\u9884\u7559 IP \u8303\u56f4 -label.autoscale=\u81ea\u52a8\u6269\u5c55 -label.health.check=\u8fd0\u884c\u72b6\u51b5\u68c0\u67e5 -label.public.load.balancer.provider=\u516c\u7528\u8d1f\u8f7d\u5e73\u8861\u5668\u63d0\u4f9b\u7a0b\u5e8f -label.add.isolated.network=\u6dfb\u52a0\u9694\u79bb\u7f51\u7edc -label.vlan=VLAN -label.secondary.isolated.vlan.id=\u4e8c\u7ea7\u9694\u79bb VLAN ID -label.ipv4.netmask=IPv4 \u7f51\u7edc\u63a9\u7801 -label.custom=\u81ea\u5b9a\u4e49 -label.disable.network.offering=\u7981\u7528\u7f51\u7edc\u65b9\u6848 -label.enable.network.offering=\u542f\u7528\u7f51\u7edc\u65b9\u6848 -label.remove.network.offering=\u5220\u9664\u7f51\u7edc\u65b9\u6848 -label.system.offering.for.router=\u8def\u7531\u5668\u7684\u7cfb\u7edf\u65b9\u6848 -label.mode=\u6a21\u5f0f -label.associate.public.ip=\u5173\u8054\u516c\u7528 IP -label.acl=ACL -label.user.data=\u7528\u6237\u6570\u636e -label.virtual.networking=\u865a\u62df\u7f51\u7edc\u8fde\u63a5 -label.allow=\u5141\u8bb8 -label.deny=\u62d2\u7edd -label.default.egress.policy=\u9ed8\u8ba4\u51fa\u53e3\u89c4\u5219 -label.xenserver.tools.version.61.plus=XenServer Tools \u7248\u672c 6.1\+ +label.zones=\u533a\u57df +label.zone.type=\u533a\u57df\u7c7b\u578b +label.zone=\u533a\u57df +label.zone.wide=\u6574\u4e2a\u533a\u57df +label.zoneWizard.trafficType.guest=\u6765\u5bbe\: \u6700\u7ec8\u7528\u6237\u865a\u62df\u673a\u4e4b\u95f4\u7684\u901a\u4fe1 +label.zoneWizard.trafficType.management=\u7ba1\u7406\: CloudStack \u7684\u5185\u90e8\u8d44\u6e90(\u5305\u62ec\u4e0e\u7ba1\u7406\u670d\u52a1\u5668\u901a\u4fe1\u7684\u4efb\u4f55\u7ec4\u4ef6\uff0c\u4f8b\u5982\u4e3b\u673a\u548c CloudStack \u7cfb\u7edf VM)\u4e4b\u95f4\u7684\u901a\u4fe1 +label.zoneWizard.trafficType.public=\u516c\u7528\: \u4e91\u4e2d Internet \u4e0e\u865a\u62df\u673a\u4e4b\u95f4\u7684\u901a\u4fe1\u3002 +label.zoneWizard.trafficType.storage=\u5b58\u50a8\: \u4e3b\u5b58\u50a8\u670d\u52a1\u5668\u4e0e\u8f85\u52a9\u5b58\u50a8\u670d\u52a1\u5668(\u4f8b\u5982 VM \u6a21\u677f\u4e0e\u5feb\u7167)\u4e4b\u95f4\u7684\u901a\u4fe1 managed.state=\u6258\u7ba1\u72b6\u6001 -message.acquire.new.ip.vpc=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4e3a\u6b64 VPC \u83b7\u53d6\u4e00\u4e2a\u65b0 IP\u3002 +message.acquire.ip.nic=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u83b7\u53d6\u6b64 NIC \u7684\u65b0\u8f85\u52a9 IP\u3002
\u6ce8\u610f\: \u60a8\u9700\u8981\u5728\u865a\u62df\u673a\u5185\u90e8\u624b\u52a8\u914d\u7f6e\u65b0\u83b7\u53d6\u7684\u8f85\u52a9 IP\u3002 message.acquire.new.ip=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4e3a\u6b64\u7f51\u7edc\u83b7\u53d6\u4e00\u4e2a\u65b0 IP\u3002 -message.acquire.public.ip=\u8bf7\u9009\u62e9\u4e00\u4e2a\u8981\u4ece\u4e2d\u83b7\u53d6\u65b0 IP \u7684\u8d44\u6e90\u57df\u3002 +message.acquire.new.ip.vpc=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4e3a\u6b64 VPC \u83b7\u53d6\u4e00\u4e2a\u65b0 IP\u3002 +message.acquire.public.ip=\u8bf7\u9009\u62e9\u4e00\u4e2a\u8981\u4ece\u4e2d\u83b7\u53d6\u65b0 IP \u7684\u533a\u57df\u3002 message.action.cancel.maintenance.mode=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u53d6\u6d88\u6b64\u7ef4\u62a4\u6a21\u5f0f\u3002 message.action.cancel.maintenance=\u5df2\u6210\u529f\u53d6\u6d88\u7ef4\u62a4\u60a8\u7684\u4e3b\u673a\u3002\u6b64\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u957f\u8fbe\u51e0\u5206\u949f\u65f6\u95f4\u3002 message.action.change.service.warning.for.instance=\u5fc5\u987b\u5148\u7981\u7528\u60a8\u7684\u5b9e\u4f8b\uff0c\u7136\u540e\u518d\u5c1d\u8bd5\u66f4\u6539\u5176\u5f53\u524d\u7684\u670d\u52a1\u65b9\u6848\u3002 @@ -1494,22 +1487,23 @@ message.action.delete.domain=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9 message.action.delete.external.firewall=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u5916\u90e8\u9632\u706b\u5899\u3002\u8b66\u544a\: \u5982\u679c\u60a8\u8ba1\u5212\u91cd\u65b0\u6dfb\u52a0\u540c\u4e00\u4e2a\u5916\u90e8\u9632\u706b\u5899\uff0c\u5219\u5fc5\u987b\u5728\u8bbe\u5907\u4e0a\u91cd\u7f6e\u4f7f\u7528\u6570\u636e\u3002 message.action.delete.external.load.balancer=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u5916\u90e8\u8d1f\u8f7d\u5e73\u8861\u5668\u3002\u8b66\u544a\: \u5982\u679c\u60a8\u8ba1\u5212\u91cd\u65b0\u6dfb\u52a0\u540c\u4e00\u4e2a\u5916\u90e8\u8d1f\u8f7d\u5e73\u8861\u5668\uff0c\u5219\u5fc5\u987b\u5728\u8bbe\u5907\u4e0a\u91cd\u7f6e\u4f7f\u7528\u6570\u636e\u3002 message.action.delete.ingress.rule=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u5165\u53e3\u89c4\u5219\u3002 -message.action.delete.ISO.for.all.zones=\u6b64 ISO \u7531\u6240\u6709\u8d44\u6e90\u57df\u4f7f\u7528\u3002\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5c06\u5176\u4ece\u6240\u6709\u8d44\u6e90\u57df\u4e2d\u5220\u9664\u3002 +message.action.delete.ISO.for.all.zones=\u6b64 ISO \u7531\u6240\u6709\u533a\u57df\u4f7f\u7528\u3002\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5c06\u5176\u4ece\u6240\u6709\u533a\u57df\u4e2d\u5220\u9664\u3002 message.action.delete.ISO=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64 ISO\u3002 message.action.delete.network=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u7f51\u7edc\u3002 message.action.delete.nexusVswitch=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64 Nexus 1000v +message.action.delete.nic=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u79fb\u9664\u6b64 NIC\uff0c\u6b64\u64cd\u4f5c\u8fd8\u5c06\u4ece VM \u4e2d\u79fb\u9664\u5173\u8054\u7684\u7f51\u7edc\u3002 message.action.delete.physical.network=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u7269\u7406\u7f51\u7edc message.action.delete.pod=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u63d0\u4f9b\u70b9\u3002 message.action.delete.primary.storage=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u4e3b\u5b58\u50a8\u3002 -message.action.delete.secondary.storage=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u4e8c\u7ea7\u5b58\u50a8\u3002 +message.action.delete.secondary.storage=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u8f85\u52a9\u5b58\u50a8\u3002 message.action.delete.security.group=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u5b89\u5168\u7ec4\u3002 message.action.delete.service.offering=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u670d\u52a1\u65b9\u6848\u3002 message.action.delete.snapshot=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u5feb\u7167\u3002 message.action.delete.system.service.offering=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u7cfb\u7edf\u670d\u52a1\u65b9\u6848\u3002 -message.action.delete.template.for.all.zones=\u6b64\u6a21\u677f\u7531\u6240\u6709\u8d44\u6e90\u57df\u4f7f\u7528\u3002\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5c06\u5176\u4ece\u6240\u6709\u8d44\u6e90\u57df\u4e2d\u5220\u9664\u3002 +message.action.delete.template.for.all.zones=\u6b64\u6a21\u677f\u7531\u6240\u6709\u533a\u57df\u4f7f\u7528\u3002\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5c06\u5176\u4ece\u6240\u6709\u533a\u57df\u4e2d\u5220\u9664\u3002 message.action.delete.template=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u6a21\u677f\u3002 message.action.delete.volume=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u5377\u3002 -message.action.delete.zone=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u8d44\u6e90\u57df\u3002 +message.action.delete.zone=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u533a\u57df\u3002 message.action.destroy.instance=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u9500\u6bc1\u6b64\u5b9e\u4f8b\u3002 message.action.destroy.systemvm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u9500\u6bc1\u6b64\u7cfb\u7edf VM\u3002 message.action.disable.cluster=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u7981\u7528\u6b64\u7fa4\u96c6\u3002 @@ -1517,7 +1511,8 @@ message.action.disable.nexusVswitch=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u message.action.disable.physical.network=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u7981\u7528\u6b64\u7269\u7406\u7f51\u7edc\u3002 message.action.disable.pod=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u7981\u7528\u6b64\u63d0\u4f9b\u70b9\u3002 message.action.disable.static.NAT=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u7981\u7528\u9759\u6001 NAT\u3002 -message.action.disable.zone=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u7981\u7528\u6b64\u8d44\u6e90\u57df\u3002 +message.action.disable.zone=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u7981\u7528\u6b64\u533a\u57df\u3002 +message.action.downloading.template=\u6b63\u5728\u4e0b\u8f7d\u6a21\u677f\u3002 message.action.download.iso=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4e0b\u8f7d\u6b64 ISO\u3002 message.action.download.template=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4e0b\u8f7d\u6b64\u6a21\u677f\u3002 message.action.enable.cluster=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u7528\u6b64\u7fa4\u96c6\u3002 @@ -1525,7 +1520,7 @@ message.action.enable.maintenance=\u5df2\u6210\u529f\u51c6\u5907\u597d\u7ef4\u62 message.action.enable.nexusVswitch=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u7528\u6b64 Nexus 1000v message.action.enable.physical.network=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u7528\u6b64\u7269\u7406\u7f51\u7edc\u3002 message.action.enable.pod=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u7528\u6b64\u63d0\u4f9b\u70b9\u3002 -message.action.enable.zone=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u7528\u6b64\u8d44\u6e90\u57df\u3002 +message.action.enable.zone=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u7528\u6b64\u533a\u57df\u3002 message.action.expunge.instance=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u5b9e\u4f8b\u3002 message.action.force.reconnect=\u5df2\u6210\u529f\u5f3a\u5236\u91cd\u65b0\u8fde\u63a5\u60a8\u7684\u4e3b\u673a\u3002\u6b64\u8fc7\u7a0b\u53ef\u80fd\u9700\u8981\u957f\u8fbe\u51e0\u5206\u949f\u65f6\u95f4\u3002 message.action.host.enable.maintenance.mode=\u542f\u7528\u7ef4\u62a4\u6a21\u5f0f\u4f1a\u5bfc\u81f4\u5c06\u6b64\u4e3b\u673a\u4e0a\u6b63\u5728\u8fd0\u884c\u7684\u6240\u6709\u5b9e\u4f8b\u5b9e\u65f6\u8fc1\u79fb\u5230\u4efb\u4f55\u53ef\u7528\u7684\u4e3b\u673a\u3002 @@ -1540,6 +1535,7 @@ message.action.remove.host=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u966 message.action.reset.password.off=\u60a8\u7684\u5b9e\u4f8b\u5f53\u524d\u4e0d\u652f\u6301\u6b64\u529f\u80fd\u3002 message.action.reset.password.warning=\u5fc5\u987b\u5148\u505c\u6b62\u60a8\u7684\u5b9e\u4f8b\uff0c\u7136\u540e\u518d\u5c1d\u8bd5\u66f4\u6539\u5176\u5f53\u524d\u7684\u5bc6\u7801\u3002 message.action.restore.instance=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u8fd8\u539f\u6b64\u5b9e\u4f8b\u3002 +message.action.revert.snapshot=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5c06\u62e5\u6709\u7684\u5377\u8fd8\u539f\u4e3a\u6b64\u5feb\u7167\u3002 message.action.start.instance=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u52a8\u6b64\u5b9e\u4f8b\u3002 message.action.start.router=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u52a8\u6b64\u8def\u7531\u5668\u3002 message.action.start.systemvm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u52a8\u6b64\u7cfb\u7edf VM\u3002 @@ -1547,44 +1543,44 @@ message.action.stop.instance=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u505c\u6 message.action.stop.router=\u6b64\u865a\u62df\u8def\u7531\u5668\u63d0\u4f9b\u7684\u6240\u6709\u670d\u52a1\u90fd\u5c06\u4e2d\u65ad\u3002\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u505c\u6b62\u6b64\u8def\u7531\u5668\u3002 message.action.stop.systemvm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u505c\u6b62\u6b64\u7cfb\u7edf VM\u3002 message.action.take.snapshot=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u521b\u5efa\u6b64\u5377\u7684\u5feb\u7167\u3002 -message.action.revert.snapshot=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5c06\u62e5\u6709\u7684\u5377\u8fd8\u539f\u4e3a\u6b64\u5feb\u7167\u3002 message.action.unmanage.cluster=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u53d6\u6d88\u6258\u7ba1\u6b64\u7fa4\u96c6\u3002 message.action.vmsnapshot.delete=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64 VM \u5feb\u7167\u3002 message.action.vmsnapshot.revert=\u8fd8\u539f VM \u5feb\u7167 message.activate.project=\u662f\u5426\u786e\u5b9e\u8981\u6fc0\u6d3b\u6b64\u9879\u76ee? -message.add.cluster.zone=\u5411\u8d44\u6e90\u57df \u4e2d\u6dfb\u52a0\u4e00\u4e2a\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u6258\u7ba1\u7684\u7fa4\u96c6 -message.add.cluster=\u5411\u8d44\u6e90\u57df \u3001\u63d0\u4f9b\u70b9 \u4e2d\u6dfb\u52a0\u4e00\u4e2a\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u6258\u7ba1\u7684\u7fa4\u96c6 +message.add.cluster=\u5411\u533a\u57df \u3001\u63d0\u4f9b\u70b9 \u4e2d\u6dfb\u52a0\u4e00\u4e2a\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u6258\u7ba1\u7684\u7fa4\u96c6 +message.add.cluster.zone=\u5411\u533a\u57df \u4e2d\u6dfb\u52a0\u4e00\u4e2a\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u6258\u7ba1\u7684\u7fa4\u96c6 message.add.disk.offering=\u8bf7\u6307\u5b9a\u4ee5\u4e0b\u53c2\u6570\u4ee5\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u78c1\u76d8\u65b9\u6848 message.add.domain=\u8bf7\u6307\u5b9a\u8981\u5728\u6b64\u57df\u4e0b\u521b\u5efa\u7684\u5b50\u57df -message.add.firewall=\u5411\u8d44\u6e90\u57df\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u9632\u706b\u5899 +message.add.firewall=\u5411\u533a\u57df\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u9632\u706b\u5899 message.add.guest.network=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u6dfb\u52a0\u4e00\u4e2a\u6765\u5bbe\u7f51\u7edc message.add.host=\u8bf7\u6307\u5b9a\u4ee5\u4e0b\u53c2\u6570\u4ee5\u6dfb\u52a0\u4e00\u53f0\u65b0\u4e3b\u673a -message.add.ip.range.direct.network=\u5411\u8d44\u6e90\u57df \u4e2d\u7684\u76f4\u63a5\u7f51\u7edc \u6dfb\u52a0\u4e00\u4e2a IP \u8303\u56f4 +message.adding.host=\u6b63\u5728\u6dfb\u52a0\u4e3b\u673a +message.adding.Netscaler.device=\u6b63\u5728\u6dfb\u52a0 Netscaler \u8bbe\u5907 +message.adding.Netscaler.provider=\u6b63\u5728\u6dfb\u52a0 Netscaler \u63d0\u4f9b\u7a0b\u5e8f +message.add.ip.range.direct.network=\u5411\u533a\u57df \u4e2d\u7684\u76f4\u63a5\u7f51\u7edc \u6dfb\u52a0\u4e00\u4e2a IP \u8303\u56f4 message.add.ip.range.to.pod=

\u5411\u63d0\u4f9b\u70b9\u6dfb\u52a0\u4e00\u4e2a IP \u8303\u56f4\:

-message.add.ip.range=\u5411\u8d44\u6e90\u57df\u4e2d\u7684\u516c\u7528\u7f51\u7edc\u6dfb\u52a0\u4e00\u4e2a IP \u8303\u56f4 +message.add.ip.range=\u5411\u533a\u57df\u4e2d\u7684\u516c\u7528\u7f51\u7edc\u6dfb\u52a0\u4e00\u4e2a IP \u8303\u56f4 +message.additional.networks.desc=\u8bf7\u9009\u62e9\u865a\u62df\u673a\u8981\u8fde\u63a5\u5230\u7684\u5176\u4ed6\u7f51\u7edc\u3002 +message.add.load.balancer=\u5411\u533a\u57df\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u8d1f\u8f7d\u5e73\u8861\u5668 message.add.load.balancer.under.ip=\u5df2\u5728\u4ee5\u4e0b IP \u4e0b\u6dfb\u52a0\u8d1f\u8f7d\u5e73\u8861\u5668\u89c4\u5219\: -message.add.load.balancer=\u5411\u8d44\u6e90\u57df\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u8d1f\u8f7d\u5e73\u8861\u5668 -message.add.network=\u4e3a\u8d44\u6e90\u57df \u6dfb\u52a0\u4e00\u4e2a\u65b0\u7f51\u7edc +message.add.network=\u4e3a\u533a\u57df \u6dfb\u52a0\u4e00\u4e2a\u65b0\u7f51\u7edc message.add.new.gateway.to.vpc=\u8bf7\u6307\u5b9a\u5c06\u65b0\u7f51\u5173\u6dfb\u52a0\u5230\u6b64 VPC \u6240\u9700\u7684\u4fe1\u606f\u3002 -message.add.pod.during.zone.creation=\u6bcf\u4e2a\u8d44\u6e90\u57df\u4e2d\u5fc5\u987b\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u63d0\u4f9b\u70b9\uff0c\u73b0\u5728\u6211\u4eec\u5c06\u6dfb\u52a0\u7b2c\u4e00\u4e2a\u63d0\u4f9b\u70b9\u3002\u63d0\u4f9b\u70b9\u4e2d\u5305\u542b\u4e3b\u673a\u548c\u4e3b\u5b58\u50a8\u670d\u52a1\u5668\uff0c\u60a8\u5c06\u5728\u968f\u540e\u7684\u67d0\u4e2a\u6b65\u9aa4\u4e2d\u6dfb\u52a0\u8fd9\u4e9b\u4e3b\u673a\u548c\u670d\u52a1\u5668\u3002\u9996\u5148\uff0c\u8bf7\u4e3a CloudStack \u7684\u5185\u90e8\u7ba1\u7406\u6d41\u91cf\u914d\u7f6e\u4e00\u4e2a\u9884\u7559 IP \u5730\u5740\u8303\u56f4\u3002\u9884\u7559\u7684 IP \u8303\u56f4\u5bf9\u4e91\u4e2d\u7684\u6bcf\u4e2a\u8d44\u6e90\u57df\u6765\u8bf4\u5fc5\u987b\u552f\u4e00\u3002 -message.add.pod=\u4e3a\u8d44\u6e90\u57df \u6dfb\u52a0\u4e00\u4e2a\u65b0\u63d0\u4f9b\u70b9 -message.add.primary.storage=\u4e3a\u8d44\u6e90\u57df \u3001\u63d0\u4f9b\u70b9 \u6dfb\u52a0\u4e00\u4e2a\u65b0\u4e3b\u5b58\u50a8 +message.add.pod.during.zone.creation=\u6bcf\u4e2a\u533a\u57df\u4e2d\u5fc5\u987b\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u63d0\u4f9b\u70b9\uff0c\u73b0\u5728\u6211\u4eec\u5c06\u6dfb\u52a0\u7b2c\u4e00\u4e2a\u63d0\u4f9b\u70b9\u3002\u63d0\u4f9b\u70b9\u4e2d\u5305\u542b\u4e3b\u673a\u548c\u4e3b\u5b58\u50a8\u670d\u52a1\u5668\uff0c\u60a8\u5c06\u5728\u968f\u540e\u7684\u67d0\u4e2a\u6b65\u9aa4\u4e2d\u6dfb\u52a0\u8fd9\u4e9b\u4e3b\u673a\u548c\u670d\u52a1\u5668\u3002\u9996\u5148\uff0c\u8bf7\u4e3a CloudStack \u7684\u5185\u90e8\u7ba1\u7406\u901a\u4fe1\u914d\u7f6e\u4e00\u4e2a\u9884\u7559 IP \u5730\u5740\u8303\u56f4\u3002\u9884\u7559\u7684 IP \u8303\u56f4\u5bf9\u4e91\u4e2d\u7684\u6bcf\u4e2a\u533a\u57df\u6765\u8bf4\u5fc5\u987b\u552f\u4e00\u3002 +message.add.pod=\u4e3a\u533a\u57df \u6dfb\u52a0\u4e00\u4e2a\u65b0\u63d0\u4f9b\u70b9 +message.add.primary.storage=\u4e3a\u533a\u57df \u3001\u63d0\u4f9b\u70b9 \u6dfb\u52a0\u4e00\u4e2a\u65b0\u4e3b\u5b58\u50a8 message.add.primary=\u8bf7\u6307\u5b9a\u4ee5\u4e0b\u53c2\u6570\u4ee5\u6dfb\u52a0\u4e00\u4e2a\u65b0\u4e3b\u5b58\u50a8 -message.add.region=\u8bf7\u6307\u5b9a\u6dfb\u52a0\u65b0\u5730\u7406\u533a\u57df\u6240\u9700\u7684\u4fe1\u606f\u3002 -message.add.secondary.storage=\u4e3a\u8d44\u6e90\u57df \u6dfb\u52a0\u4e00\u4e2a\u65b0\u5b58\u50a8 +message.add.region=\u8bf7\u6307\u5b9a\u6dfb\u52a0\u65b0\u533a\u57df\u6240\u9700\u7684\u4fe1\u606f\u3002 +message.add.secondary.storage=\u4e3a\u533a\u57df \u6dfb\u52a0\u4e00\u4e2a\u65b0\u5b58\u50a8 message.add.service.offering=\u8bf7\u586b\u5199\u4ee5\u4e0b\u6570\u636e\u4ee5\u6dfb\u52a0\u4e00\u4e2a\u65b0\u8ba1\u7b97\u65b9\u6848\u3002 message.add.system.service.offering=\u8bf7\u586b\u5199\u4ee5\u4e0b\u6570\u636e\u4ee5\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u7cfb\u7edf\u670d\u52a1\u65b9\u6848\u3002 message.add.template=\u8bf7\u8f93\u5165\u4ee5\u4e0b\u6570\u636e\u4ee5\u521b\u5efa\u65b0\u6a21\u677f message.add.volume=\u8bf7\u586b\u5199\u4ee5\u4e0b\u6570\u636e\u4ee5\u6dfb\u52a0\u4e00\u4e2a\u65b0\u5377\u3002 message.add.VPN.gateway=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u6dfb\u52a0 VPN \u7f51\u5173 -message.adding.host=\u6b63\u5728\u6dfb\u52a0\u4e3b\u673a -message.adding.Netscaler.device=\u6b63\u5728\u6dfb\u52a0 Netscaler \u8bbe\u5907 -message.adding.Netscaler.provider=\u6b63\u5728\u6dfb\u52a0 Netscaler \u63d0\u4f9b\u7a0b\u5e8f -message.additional.networks.desc=\u8bf7\u9009\u62e9\u865a\u62df\u673a\u8981\u8fde\u63a5\u5230\u7684\u5176\u4ed6\u7f51\u7edc\u3002 +message.admin.guide.read=\u5bf9\u4e8e\u57fa\u4e8e VMware \u7684 VM\uff0c\u8bf7\u5148\u9605\u8bfb\u7ba1\u7406\u6307\u5357\u4e2d\u7684\u52a8\u6001\u6269\u5c55\u90e8\u5206\uff0c\u7136\u540e\u518d\u8fdb\u884c\u6269\u5c55\u3002\u662f\u5426\u8981\u7ee7\u7eed?\\, message.advanced.mode.desc=\u5982\u679c\u60a8\u5e0c\u671b\u542f\u7528 VLAN \u652f\u6301\uff0c\u8bf7\u9009\u62e9\u6b64\u7f51\u7edc\u6a21\u5f0f\u3002\u6b64\u7f51\u7edc\u6a21\u5f0f\u5728\u5141\u8bb8\u7ba1\u7406\u5458\u63d0\u4f9b\u9632\u706b\u5899\u3001VPN \u6216\u8d1f\u8f7d\u5e73\u8861\u5668\u652f\u6301\u7b49\u81ea\u5b9a\u4e49\u7f51\u7edc\u65b9\u6848\u4ee5\u53ca\u542f\u7528\u76f4\u63a5\u7f51\u7edc\u8fde\u63a5\u4e0e\u865a\u62df\u7f51\u7edc\u8fde\u63a5\u7b49\u65b9\u9762\u63d0\u4f9b\u4e86\u6700\u5927\u7684\u7075\u6d3b\u6027\u3002 message.advanced.security.group=\u5982\u679c\u8981\u4f7f\u7528\u5b89\u5168\u7ec4\u63d0\u4f9b\u6765\u5bbe VM \u9694\u79bb\uff0c\u8bf7\u9009\u62e9\u6b64\u6a21\u5f0f\u3002 -message.advanced.virtual=\u5982\u679c\u8981\u4f7f\u7528\u6574\u4e2a\u8d44\u6e90\u57df\u7684 VLAN \u63d0\u4f9b\u6765\u5bbe VM \u9694\u79bb\uff0c\u8bf7\u9009\u62e9\u6b64\u6a21\u5f0f\u3002 -message.after.enable.s3=\u5df2\u914d\u7f6e S3 \u652f\u6301\u7684\u4e8c\u7ea7\u5b58\u50a8\u3002\u6ce8\u610f\: \u9000\u51fa\u6b64\u9875\u9762\u540e\uff0c\u60a8\u5c06\u65e0\u6cd5\u518d\u6b21\u91cd\u65b0\u914d\u7f6e S3\u3002 +message.advanced.virtual=\u5982\u679c\u8981\u4f7f\u7528\u6574\u4e2a\u533a\u57df\u7684 VLAN \u63d0\u4f9b\u6765\u5bbe VM \u9694\u79bb\uff0c\u8bf7\u9009\u62e9\u6b64\u6a21\u5f0f\u3002 +message.after.enable.s3=\u5df2\u914d\u7f6e S3 \u652f\u6301\u7684\u8f85\u52a9\u5b58\u50a8\u3002\u6ce8\u610f\: \u9000\u51fa\u6b64\u9875\u9762\u540e\uff0c\u60a8\u5c06\u65e0\u6cd5\u518d\u6b21\u91cd\u65b0\u914d\u7f6e S3\u3002 message.after.enable.swift=\u5df2\u914d\u7f6e SWIFT\u3002\u6ce8\u610f\: \u9000\u51fa\u6b64\u9875\u9762\u540e\uff0c\u60a8\u5c06\u65e0\u6cd5\u518d\u6b21\u91cd\u65b0\u914d\u7f6e SWIFT\u3002 message.alert.state.detected=\u68c0\u6d4b\u5230\u8b66\u62a5\u72b6\u6001 message.allow.vpn.access=\u8bf7\u8f93\u5165\u8981\u5141\u8bb8\u8fdb\u884c VPN \u8bbf\u95ee\u7684\u7528\u6237\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002 @@ -1594,36 +1590,71 @@ message.attach.volume=\u8bf7\u586b\u5199\u4ee5\u4e0b\u6570\u636e\u4ee5\u9644\u52 message.basic.mode.desc=\u5982\u679c\u60a8*\u4e0d*\u5e0c\u671b\u542f\u7528\u4efb\u4f55 VLAN \u652f\u6301\uff0c\u8bf7\u9009\u62e9\u6b64\u7f51\u7edc\u6a21\u5f0f\u3002\u5c06\u76f4\u63a5\u4ece\u6b64\u7f51\u7edc\u4e2d\u4e3a\u5728\u6b64\u7f51\u7edc\u6a21\u5f0f\u4e0b\u521b\u5efa\u7684\u6240\u6709\u865a\u62df\u673a\u5b9e\u4f8b\u5206\u914d\u4e00\u4e2a IP\uff0c\u5e76\u4f7f\u7528\u5b89\u5168\u7ec4\u63d0\u4f9b\u5b89\u5168\u6027\u548c\u9694\u79bb\u3002 message.change.offering.confirm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u66f4\u6539\u6b64\u865a\u62df\u5b9e\u4f8b\u7684\u670d\u52a1\u65b9\u6848\u3002 message.change.password=\u8bf7\u66f4\u6539\u60a8\u7684\u5bc6\u7801\u3002 -message.configure.all.traffic.types=\u60a8\u6709\u591a\u4e2a\u7269\u7406\u7f51\u7edc\uff0c\u8bf7\u5355\u51fb\u201c\u7f16\u8f91\u201d\u6309\u94ae\u4e3a\u6bcf\u79cd\u6d41\u91cf\u7c7b\u578b\u914d\u7f6e\u6807\u7b7e\u3002 -message.configuring.guest.traffic=\u6b63\u5728\u914d\u7f6e\u6765\u5bbe\u6d41\u91cf +message.cluster.dedicated=\u7fa4\u96c6\u5df2\u4e13\u7528 +message.cluster.dedication.released=\u5df2\u91ca\u653e\u4e13\u7528\u7fa4\u96c6 +message.configure.all.traffic.types=\u60a8\u6709\u591a\u4e2a\u7269\u7406\u7f51\u7edc\uff0c\u8bf7\u5355\u51fb\u201c\u7f16\u8f91\u201d\u6309\u94ae\u4e3a\u6bcf\u79cd\u901a\u4fe1\u7c7b\u578b\u914d\u7f6e\u6807\u7b7e\u3002 +message.configure.ldap=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u914d\u7f6e LDAP\u3002 +message.configuring.guest.traffic=\u6b63\u5728\u914d\u7f6e\u6765\u5bbe\u901a\u4fe1 message.configuring.physical.networks=\u6b63\u5728\u914d\u7f6e\u7269\u7406\u7f51\u7edc -message.configuring.public.traffic=\u6b63\u5728\u914d\u7f6e\u516c\u5171\u6d41\u91cf -message.configuring.storage.traffic=\u6b63\u5728\u914d\u7f6e\u5b58\u50a8\u6d41\u91cf +message.configuring.public.traffic=\u6b63\u5728\u914d\u7f6e\u516c\u5171\u901a\u4fe1 +message.configuring.storage.traffic=\u6b63\u5728\u914d\u7f6e\u5b58\u50a8\u901a\u4fe1 message.confirm.action.force.reconnect=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5f3a\u5236\u91cd\u65b0\u8fde\u63a5\u6b64\u4e3b\u673a\u3002 +message.confirm.add.vnmc.provider=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u6dfb\u52a0 VNMC \u63d0\u4f9b\u7a0b\u5e8f\u3002 +message.confirm.dedicate.cluster.domain.account=\u662f\u5426\u786e\u5b9e\u8981\u5c06\u6b64\u7fa4\u96c6\u4e13\u7528\u4e8e\u57df/\u5e10\u6237? +message.confirm.dedicate.host.domain.account=\u662f\u5426\u786e\u5b9e\u8981\u5c06\u6b64\u4e3b\u673a\u4e13\u7528\u4e8e\u57df/\u5e10\u6237? +message.confirm.dedicate.pod.domain.account=\u662f\u5426\u786e\u5b9e\u8981\u5c06\u6b64\u63d0\u4f9b\u70b9\u4e13\u7528\u4e8e\u57df/\u5e10\u6237? +message.confirm.dedicate.zone=\u662f\u5426\u8981\u5c06\u6b64\u8d44\u6e90\u57df\u4e13\u7528\u4e8e\u57df/\u5e10\u6237? +message.confirm.delete.ciscovnmc.resource=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 CiscoVNMC \u8d44\u6e90 message.confirm.delete.F5=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 F5 message.confirm.delete.NetScaler=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 NetScaler -message.confirm.delete.SRX=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 SRX message.confirm.delete.PA=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 Palo Alto +message.confirm.delete.secondary.staging.store=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8\u3002 +message.confirm.delete.SRX=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 SRX +message.confirm.delete.ucs.manager=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 UCS Manager message.confirm.destroy.router=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u9500\u6bc1\u6b64\u8def\u7531\u5668 +message.confirm.disable.network.offering=\u662f\u5426\u786e\u5b9e\u8981\u7981\u7528\u6b64\u7f51\u7edc\u65b9\u6848? message.confirm.disable.provider=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u7981\u7528\u6b64\u63d0\u4f9b\u7a0b\u5e8f +message.confirm.disable.vnmc.provider=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u7981\u7528 VNMC \u63d0\u4f9b\u7a0b\u5e8f\u3002 +message.confirm.enable.network.offering=\u662f\u5426\u786e\u5b9e\u8981\u542f\u7528\u6b64\u7f51\u7edc\u65b9\u6848? message.confirm.enable.provider=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u7528\u6b64\u63d0\u4f9b\u7a0b\u5e8f +message.confirm.enable.vnmc.provider=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u7528 VNMC \u63d0\u4f9b\u7a0b\u5e8f\u3002 message.confirm.join.project=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u52a0\u5165\u6b64\u9879\u76ee\u3002 +message.confirm.refresh.blades=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5237\u65b0\u5200\u7247\u5f0f\u670d\u52a1\u5668\u3002 +message.confirm.release.dedicated.cluster=\u662f\u5426\u8981\u91ca\u653e\u6b64\u4e13\u7528\u7fa4\u96c6? +message.confirm.release.dedicated.host=\u662f\u5426\u8981\u91ca\u653e\u6b64\u4e13\u7528\u4e3b\u673a? +message.confirm.release.dedicated.pod=\u662f\u5426\u8981\u91ca\u653e\u6b64\u4e13\u7528\u63d0\u4f9b\u70b9? +message.confirm.release.dedicated.zone=\u662f\u5426\u8981\u91ca\u653e\u6b64\u4e13\u7528\u8d44\u6e90\u57df? +message.confirm.release.dedicate.vlan.range=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u91ca\u653e\u4e13\u7528 VLAN \u8303\u56f4 message.confirm.remove.IP.range=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64 IP \u8303\u56f4\u3002 +message.confirm.remove.network.offering=\u662f\u5426\u786e\u5b9e\u8981\u5220\u9664\u6b64\u7f51\u7edc\u65b9\u6848? +message.confirm.remove.vmware.datacenter=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 VMware \u6570\u636e\u4e2d\u5fc3 +message.confirm.scale.up.router.vm=\u662f\u5426\u786e\u5b9e\u8981\u6269\u5c55\u8def\u7531\u5668 VM? +message.confirm.scale.up.system.vm=\u662f\u5426\u786e\u5b9e\u8981\u6269\u5c55\u7cfb\u7edf VM? message.confirm.shutdown.provider=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5173\u95ed\u6b64\u63d0\u4f9b\u7a0b\u5e8f +message.confirm.start.lb.vm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u52a8 LB VM +message.confirm.stop.lb.vm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u505c\u6b62 LB VM +message.confirm.upgrade.router.newer.template=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5347\u7ea7\u8def\u7531\u5668\u4ee5\u4f7f\u7528\u66f4\u65b0\u7684\u6a21\u677f +message.confirm.upgrade.routers.account.newtemplate=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5347\u7ea7\u6b64\u5e10\u6237\u4e2d\u7684\u6240\u6709\u8def\u7531\u5668\u4ee5\u4f7f\u7528\u66f4\u65b0\u7684\u6a21\u677f +message.confirm.upgrade.routers.cluster.newtemplate=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5347\u7ea7\u6b64\u7fa4\u96c6\u4e2d\u7684\u6240\u6709\u8def\u7531\u5668\u4ee5\u4f7f\u7528\u66f4\u65b0\u7684\u6a21\u677f +message.confirm.upgrade.routers.newtemplate=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5347\u7ea7\u6b64\u8d44\u6e90\u57df\u4e2d\u7684\u6240\u6709\u8def\u7531\u5668\u4ee5\u4f7f\u7528\u66f4\u65b0\u7684\u6a21\u677f +message.confirm.upgrade.routers.pod.newtemplate=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5347\u7ea7\u6b64\u63d0\u4f9b\u70b9\u4e2d\u7684\u6240\u6709\u8def\u7531\u5668\u4ee5\u4f7f\u7528\u66f4\u65b0\u7684\u6a21\u677f message.copy.iso.confirm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5c06 ISO \u590d\u5236\u5230 -message.copy.template=\u5c06\u6a21\u677f XXX \u4ece\u8d44\u6e90\u57df \u590d\u5236\u5230 +message.copy.template.confirm=\u662f\u5426\u786e\u5b9e\u8981\u590d\u5236\u6a21\u677f? +message.copy.template=\u5c06\u6a21\u677f XXX \u4ece\u533a\u57df \u590d\u5236\u5230 +message.create.template=\u662f\u5426\u786e\u5b9e\u8981\u521b\u5efa\u6a21\u677f? message.create.template.vm=\u57fa\u4e8e\u6a21\u677f \u521b\u5efa VM message.create.template.volume=\u8bf7\u5148\u6307\u5b9a\u4ee5\u4e0b\u4fe1\u606f\uff0c\u7136\u540e\u518d\u521b\u5efa\u78c1\u76d8\u5377 \u7684\u6a21\u677f\u3002\u521b\u5efa\u6a21\u677f\u53ef\u80fd\u9700\u8981\u51e0\u5206\u949f\u5230\u66f4\u957f\u7684\u65f6\u95f4\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u78c1\u76d8\u5377\u7684\u5927\u5c0f\u3002 -message.create.template=\u662f\u5426\u786e\u5b9e\u8981\u521b\u5efa\u6a21\u677f? message.creating.cluster=\u6b63\u5728\u521b\u5efa\u7fa4\u96c6 message.creating.guest.network=\u6b63\u5728\u521b\u5efa\u6765\u5bbe\u7f51\u7edc message.creating.physical.networks=\u6b63\u5728\u521b\u5efa\u7269\u7406\u7f51\u7edc message.creating.pod=\u6b63\u5728\u521b\u5efa\u63d0\u4f9b\u70b9 message.creating.primary.storage=\u6b63\u5728\u521b\u5efa\u4e3b\u5b58\u50a8 -message.creating.secondary.storage=\u6b63\u5728\u521b\u5efa\u4e8c\u7ea7\u5b58\u50a8 -message.creating.zone=\u6b63\u5728\u521b\u5efa\u8d44\u6e90\u57df +message.creating.secondary.storage=\u6b63\u5728\u521b\u5efa\u8f85\u52a9\u5b58\u50a8 +message.creating.systemVM=\u6b63\u5728\u521b\u5efa\u7cfb\u7edf VM (\u6b64\u64cd\u4f5c\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u65f6\u95f4) +message.creating.zone=\u6b63\u5728\u521b\u5efa\u533a\u57df message.decline.invitation=\u662f\u5426\u786e\u5b9e\u8981\u62d2\u7edd\u6b64\u9879\u76ee\u9080\u8bf7? -message.dedicate.zone=\u6b63\u5728\u5c06\u8d44\u6e90\u57df\u4e13\u7528 +message.dedicated.zone.released=\u5df2\u91ca\u653e\u4e13\u7528\u8d44\u6e90\u57df +message.dedicate.zone=\u6b63\u5728\u5c06\u533a\u57df\u4e13\u6709\u5316 message.delete.account=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u5e10\u6237\u3002 message.delete.affinity.group=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u5173\u8054\u6027\u7ec4\u3002 message.delete.gateway=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64\u7f51\u5173 @@ -1637,8 +1668,8 @@ message.desc.basic.zone=\u63d0\u4f9b\u4e00\u4e2a\u7f51\u7edc\uff0c\u5c06\u76f4\u message.desc.cluster=\u6bcf\u4e2a\u63d0\u4f9b\u70b9\u4e2d\u5fc5\u987b\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u7fa4\u96c6\uff0c\u73b0\u5728\u6211\u4eec\u5c06\u6dfb\u52a0\u7b2c\u4e00\u4e2a\u7fa4\u96c6\u3002\u7fa4\u96c6\u63d0\u4f9b\u4e86\u4e00\u79cd\u7f16\u7ec4\u4e3b\u673a\u7684\u65b9\u6cd5\u3002\u7fa4\u96c6\u4e2d\u7684\u6240\u6709\u4e3b\u673a\u90fd\u5177\u6709\u76f8\u540c\u7684\u786c\u4ef6\uff0c\u8fd0\u884c\u76f8\u540c\u7684\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\uff0c\u4f4d\u4e8e\u76f8\u540c\u7684\u5b50\u7f51\u4e2d\uff0c\u5e76\u8bbf\u95ee\u76f8\u540c\u7684\u5171\u4eab\u5b58\u50a8\u3002\u6bcf\u4e2a\u7fa4\u96c6\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u4e3b\u673a\u4ee5\u53ca\u4e00\u4e2a\u6216\u591a\u4e2a\u4e3b\u5b58\u50a8\u670d\u52a1\u5668\u7ec4\u6210\u3002 message.desc.host=\u6bcf\u4e2a\u7fa4\u96c6\u4e2d\u5fc5\u987b\u81f3\u5c11\u5305\u542b\u4e00\u4e2a\u4e3b\u673a\u4ee5\u4f9b\u6765\u5bbe VM \u5728\u4e0a\u9762\u8fd0\u884c\uff0c\u73b0\u5728\u6211\u4eec\u5c06\u6dfb\u52a0\u7b2c\u4e00\u4e2a\u4e3b\u673a\u3002\u8981\u4f7f\u4e3b\u673a\u5728 CloudStack \u4e2d\u8fd0\u884c\uff0c\u5fc5\u987b\u5728\u6b64\u4e3b\u673a\u4e0a\u5b89\u88c5\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u8f6f\u4ef6\uff0c\u4e3a\u5176\u5206\u914d\u4e00\u4e2a IP \u5730\u5740\uff0c\u5e76\u786e\u4fdd\u5c06\u5176\u8fde\u63a5\u5230 CloudStack \u7ba1\u7406\u670d\u52a1\u5668\u3002

\u8bf7\u63d0\u4f9b\u4e3b\u673a\u7684 DNS \u6216 IP \u5730\u5740\u3001\u7528\u6237\u540d(\u901a\u5e38\u4e3a root)\u548c\u5bc6\u7801\uff0c\u4ee5\u53ca\u7528\u4e8e\u5bf9\u4e3b\u673a\u8fdb\u884c\u5206\u7c7b\u7684\u4efb\u4f55\u6807\u7b7e\u3002 message.desc.primary.storage=\u6bcf\u4e2a\u7fa4\u96c6\u4e2d\u5fc5\u987b\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u4e3b\u5b58\u50a8\u670d\u52a1\u5668\uff0c\u73b0\u5728\u6211\u4eec\u5c06\u6dfb\u52a0\u7b2c\u4e00\u4e2a\u4e3b\u5b58\u50a8\u670d\u52a1\u5668\u3002\u4e3b\u5b58\u50a8\u4e2d\u5305\u542b\u5728\u7fa4\u96c6\u4e2d\u7684\u4e3b\u673a\u4e0a\u8fd0\u884c\u7684\u6240\u6709 VM \u7684\u78c1\u76d8\u5377\u3002\u8bf7\u4f7f\u7528\u5e95\u5c42\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u652f\u6301\u7684\u7b26\u5408\u6807\u51c6\u7684\u534f\u8bae\u3002 -message.desc.secondary.storage=\u6bcf\u4e2a\u8d44\u6e90\u57df\u4e2d\u5fc5\u987b\u81f3\u5c11\u5305\u542b\u4e00\u4e2a NFS \u6216\u4e8c\u7ea7\u5b58\u50a8\u670d\u52a1\u5668\uff0c\u73b0\u5728\u6211\u4eec\u5c06\u6dfb\u52a0\u7b2c\u4e00\u4e2a NFS \u6216\u4e8c\u7ea7\u5b58\u50a8\u670d\u52a1\u5668\u3002\u4e8c\u7ea7\u5b58\u50a8\u7528\u4e8e\u5b58\u50a8 VM \u6a21\u677f\u3001ISO \u6620\u50cf\u548c VM \u78c1\u76d8\u5377\u5feb\u7167\u3002\u6b64\u670d\u52a1\u5668\u5fc5\u987b\u5bf9\u8d44\u6e90\u57df\u4e2d\u7684\u6240\u6709\u670d\u52a1\u5668\u53ef\u7528\u3002

\u8bf7\u63d0\u4f9b IP \u5730\u5740\u548c\u5bfc\u51fa\u8def\u5f84\u3002 -message.desc.zone=\u8d44\u6e90\u57df\u662f CloudStack \u4e2d\u6700\u5927\u7684\u7ec4\u7ec7\u5355\u4f4d\uff0c\u4e00\u4e2a\u8d44\u6e90\u57df\u901a\u5e38\u4e0e\u4e00\u4e2a\u6570\u636e\u4e2d\u5fc3\u76f8\u5bf9\u5e94\u3002\u8d44\u6e90\u57df\u53ef\u63d0\u4f9b\u7269\u7406\u9694\u79bb\u548c\u5197\u4f59\u3002\u4e00\u4e2a\u8d44\u6e90\u57df\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u63d0\u4f9b\u70b9\u4ee5\u53ca\u7531\u8d44\u6e90\u57df\u4e2d\u7684\u6240\u6709\u63d0\u4f9b\u70b9\u5171\u4eab\u7684\u4e00\u4e2a\u4e8c\u7ea7\u5b58\u50a8\u670d\u52a1\u5668\u7ec4\u6210\uff0c\u5176\u4e2d\u6bcf\u4e2a\u63d0\u4f9b\u70b9\u4e2d\u5305\u542b\u591a\u4e2a\u4e3b\u673a\u548c\u4e3b\u5b58\u50a8\u670d\u52a1\u5668\u3002 +message.desc.secondary.storage=\u6bcf\u4e2a\u533a\u57df\u4e2d\u5fc5\u987b\u81f3\u5c11\u5305\u542b\u4e00\u4e2a NFS \u6216\u8f85\u52a9\u5b58\u50a8\u670d\u52a1\u5668\uff0c\u73b0\u5728\u6211\u4eec\u5c06\u6dfb\u52a0\u7b2c\u4e00\u4e2a NFS \u6216\u8f85\u52a9\u5b58\u50a8\u670d\u52a1\u5668\u3002\u8f85\u52a9\u5b58\u50a8\u7528\u4e8e\u5b58\u50a8 VM \u6a21\u677f\u3001ISO \u6620\u50cf\u548c VM \u78c1\u76d8\u5377\u5feb\u7167\u3002\u6b64\u670d\u52a1\u5668\u5fc5\u987b\u5bf9\u533a\u57df\u4e2d\u7684\u6240\u6709\u670d\u52a1\u5668\u53ef\u7528\u3002

\u8bf7\u63d0\u4f9b IP \u5730\u5740\u548c\u5bfc\u51fa\u8def\u5f84\u3002 +message.desc.zone=\u533a\u57df\u662f CloudStack \u4e2d\u6700\u5927\u7684\u7ec4\u7ec7\u5355\u4f4d\uff0c\u4e00\u4e2a\u533a\u57df\u901a\u5e38\u4e0e\u4e00\u4e2a\u6570\u636e\u4e2d\u5fc3\u76f8\u5bf9\u5e94\u3002\u533a\u57df\u53ef\u63d0\u4f9b\u7269\u7406\u9694\u79bb\u548c\u5197\u4f59\u3002\u4e00\u4e2a\u533a\u57df\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u63d0\u4f9b\u70b9\u4ee5\u53ca\u7531\u533a\u57df\u4e2d\u7684\u6240\u6709\u63d0\u4f9b\u70b9\u5171\u4eab\u7684\u4e00\u4e2a\u8f85\u52a9\u5b58\u50a8\u670d\u52a1\u5668\u7ec4\u6210\uff0c\u5176\u4e2d\u6bcf\u4e2a\u63d0\u4f9b\u70b9\u4e2d\u5305\u542b\u591a\u4e2a\u4e3b\u673a\u548c\u4e3b\u5b58\u50a8\u670d\u52a1\u5668\u3002 message.detach.disk=\u662f\u5426\u786e\u5b9e\u8981\u53d6\u6d88\u9644\u52a0\u6b64\u78c1\u76d8? message.detach.iso.confirm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4ece\u6b64\u865a\u62df\u673a\u4e2d\u53d6\u6d88\u9644\u52a0\u6b64 ISO\u3002 message.disable.account=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u7981\u7528\u6b64\u5e10\u6237\u3002\u7981\u7528\u540e\uff0c\u6b64\u5e10\u6237\u7684\u6240\u6709\u7528\u6237\u5c06\u4e0d\u518d\u6709\u6743\u8bbf\u95ee\u5404\u81ea\u7684\u4e91\u8d44\u6e90\u3002\u6240\u6709\u6b63\u5728\u8fd0\u884c\u7684\u865a\u62df\u673a\u5c06\u7acb\u5373\u5173\u95ed\u3002 @@ -1646,6 +1677,8 @@ message.disable.snapshot.policy=\u60a8\u5df2\u6210\u529f\u7981\u7528\u5f53\u524d message.disable.user=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u7981\u7528\u6b64\u7528\u6237\u3002 message.disable.vpn.access=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u7981\u7528 VPN \u8bbf\u95ee\u3002 message.disable.vpn=\u662f\u5426\u786e\u5b9e\u8981\u7981\u7528 VPN? +message.disabling.network.offering=\u6b63\u5728\u7981\u7528\u7f51\u7edc\u65b9\u6848 +message.disallowed.characters=\u7981\u7528\u5b57\u7b26\: \\<\\,\\> message.download.ISO=\u8bf7\u5355\u51fb 00000 \u4e0b\u8f7d ISO message.download.template=\u8bf7\u5355\u51fb 00000 \u4e0b\u8f7d\u6a21\u677f message.download.volume.confirm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4e0b\u8f7d\u6b64\u5377 @@ -1653,59 +1686,67 @@ message.download.volume=\u8bf7\u5355\u51fb 00000 \u4e0b\u8f7d\ message.edit.account=\u7f16\u8f91(\u201c-1\u201d\u8868\u793a\u5bf9\u8981\u521b\u5efa\u7684\u8d44\u6e90\u6570\u91cf\u6ca1\u6709\u4efb\u4f55\u9650\u5236) message.edit.confirm=\u8bf7\u5148\u786e\u8ba4\u60a8\u6240\u505a\u7684\u66f4\u6539\uff0c\u7136\u540e\u5355\u51fb\u201c\u4fdd\u5b58\u201d\u3002 message.edit.limits=\u8bf7\u6307\u5b9a\u5bf9\u4ee5\u4e0b\u8d44\u6e90\u7684\u9650\u5236\u3002\u201c-1\u201d\u8868\u793a\u4e0d\u9650\u5236\u8981\u521b\u5efa\u7684\u8d44\u6e90\u6570\u3002 -message.edit.traffic.type=\u8bf7\u6307\u5b9a\u60a8\u5e0c\u671b\u4e0e\u6b64\u6d41\u91cf\u7c7b\u578b\u5173\u8054\u7684\u6d41\u91cf\u6807\u7b7e\u3002 +message.edit.traffic.type=\u8bf7\u6307\u5b9a\u60a8\u5e0c\u671b\u4e0e\u6b64\u901a\u4fe1\u7c7b\u578b\u5173\u8054\u7684\u901a\u4fe1\u6807\u7b7e\u3002 message.enable.account=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u7528\u6b64\u5e10\u6237\u3002 +message.enabled.vpn.ip.sec=\u60a8\u7684 IPSec \u9884\u5171\u4eab\u5bc6\u94a5 +message.enabled.vpn=\u60a8\u7684 VPN \u8bbf\u95ee\u529f\u80fd\u5f53\u524d\u5df2\u542f\u7528\uff0c\u53ef\u4ee5\u901a\u8fc7 IP \u8fdb\u884c\u8bbf\u95ee message.enable.user=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u7528\u6b64\u7528\u6237\u3002 message.enable.vpn.access=\u5f53\u524d\u5df2\u5bf9\u6b64 IP \u5730\u5740\u7981\u7528\u4e86 VPN\u3002\u662f\u5426\u8981\u542f\u7528 VPN \u8bbf\u95ee? message.enable.vpn=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5bf9\u6b64 IP \u5730\u5740\u542f\u7528 VPN \u8bbf\u95ee\u3002 -message.enabled.vpn.ip.sec=\u60a8\u7684 IPSec \u9884\u5171\u4eab\u5bc6\u94a5 -message.enabled.vpn=\u60a8\u7684 VPN \u8bbf\u95ee\u529f\u80fd\u5f53\u524d\u5df2\u542f\u7528\uff0c\u53ef\u4ee5\u901a\u8fc7 IP \u8fdb\u884c\u8bbf\u95ee +message.enabling.network.offering=\u6b63\u5728\u542f\u7528\u7f51\u7edc\u65b9\u6848 message.enabling.security.group.provider=\u6b63\u5728\u542f\u7528\u5b89\u5168\u7ec4\u63d0\u4f9b\u7a0b\u5e8f -message.enabling.zone=\u6b63\u5728\u542f\u7528\u8d44\u6e90\u57df +message.enabling.zone.dots=\u6b63\u5728\u542f\u7528\u8d44\u6e90\u57df... +message.enabling.zone=\u6b63\u5728\u542f\u7528\u533a\u57df +message.enter.seperated.list.multiple.cidrs=\u5982\u679c\u5b58\u5728\u591a\u4e2a CIDR\uff0c\u8bf7\u8f93\u5165\u7528\u9017\u53f7\u5206\u9694\u7684 CIDR \u5217\u8868 message.enter.token=\u8bf7\u8f93\u5165\u60a8\u5728\u9080\u8bf7\u7535\u5b50\u90ae\u4ef6\u4e2d\u6536\u5230\u7684\u4ee4\u724c\u3002 message.generate.keys=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4e3a\u6b64\u7528\u6237\u751f\u6210\u65b0\u5bc6\u94a5\u3002 -message.guest.traffic.in.advanced.zone=\u6765\u5bbe\u7f51\u7edc\u6d41\u91cf\u662f\u6307\u6700\u7ec8\u7528\u6237\u865a\u62df\u673a\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u6307\u5b9a\u4e00\u4e2a VLAN ID \u8303\u56f4\u53ef\u4f20\u9001\u6bcf\u4e2a\u7269\u7406\u7f51\u7edc\u7684\u6765\u5bbe\u6d41\u91cf\u3002 -message.guest.traffic.in.basic.zone=\u6765\u5bbe\u7f51\u7edc\u6d41\u91cf\u662f\u6307\u6700\u7ec8\u7528\u6237\u865a\u62df\u673a\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u5e94\u6307\u5b9a\u4e00\u4e2a CloudStack \u53ef\u4ee5\u5206\u914d\u7ed9\u6765\u5bbe VM \u7684 IP \u5730\u5740\u8303\u56f4\u3002\u8bf7\u786e\u4fdd\u6b64\u8303\u56f4\u4e0e\u9884\u7559\u7684\u7cfb\u7edf IP \u8303\u56f4\u4e0d\u91cd\u53e0\u3002 +message.gslb.delete.confirm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64 GSLB +message.gslb.lb.remove.confirm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4ece GSLB \u4e2d\u5220\u9664\u8d1f\u8f7d\u5e73\u8861 +message.guest.traffic.in.advanced.zone=\u6765\u5bbe\u7f51\u7edc\u901a\u4fe1\u662f\u6307\u6700\u7ec8\u7528\u6237\u865a\u62df\u673a\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u6307\u5b9a\u4e00\u4e2a VLAN ID \u8303\u56f4\u53ef\u4f20\u9001\u6bcf\u4e2a\u7269\u7406\u7f51\u7edc\u7684\u6765\u5bbe\u901a\u4fe1\u3002 +message.guest.traffic.in.basic.zone=\u6765\u5bbe\u7f51\u7edc\u901a\u4fe1\u662f\u6307\u6700\u7ec8\u7528\u6237\u865a\u62df\u673a\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u5e94\u6307\u5b9a\u4e00\u4e2a CloudStack \u53ef\u4ee5\u5206\u914d\u7ed9\u6765\u5bbe VM \u7684 IP \u5730\u5740\u8303\u56f4\u3002\u8bf7\u786e\u4fdd\u6b64\u8303\u56f4\u4e0e\u9884\u7559\u7684\u7cfb\u7edf IP \u8303\u56f4\u4e0d\u91cd\u53e0\u3002 +message.host.dedicated=\u4e3b\u673a\u5df2\u4e13\u7528 +message.host.dedication.released=\u5df2\u91ca\u653e\u4e13\u7528\u4e3b\u673a message.installWizard.click.retry=\u8bf7\u5355\u51fb\u6b64\u6309\u94ae\u91cd\u65b0\u5c1d\u8bd5\u542f\u52a8\u3002 -message.installWizard.copy.whatIsACluster=\u7fa4\u96c6\u63d0\u4f9b\u4e86\u4e00\u79cd\u7f16\u7ec4\u4e3b\u673a\u7684\u65b9\u6cd5\u3002\u7fa4\u96c6\u4e2d\u7684\u6240\u6709\u4e3b\u673a\u90fd\u5177\u6709\u76f8\u540c\u7684\u786c\u4ef6\uff0c\u8fd0\u884c\u76f8\u540c\u7684\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\uff0c\u4f4d\u4e8e\u540c\u4e00\u5b50\u7f51\u4e2d\uff0c\u5e76\u8bbf\u95ee\u76f8\u540c\u7684\u5171\u4eab\u5b58\u50a8\u3002\u53ef\u4ee5\u5b9e\u65f6\u5c06\u865a\u62df\u673a\u5b9e\u4f8b(VM)\u4ece\u4e00\u53f0\u4e3b\u673a\u8fc1\u79fb\u5230\u540c\u4e00\u7fa4\u96c6\u5185\u7684\u5176\u4ed6\u4e3b\u673a\uff0c\u800c\u65e0\u9700\u4e2d\u65ad\u5411\u7528\u6237\u63d0\u4f9b\u670d\u52a1\u3002\u7fa4\u96c6\u662f CloudStack&\#8482; \u90e8\u7f72\u4e2d\u7684\u7b2c\u4e09\u5927\u7ec4\u7ec7\u5355\u4f4d\u3002\u7fa4\u96c6\u5305\u542b\u5728\u63d0\u4f9b\u70b9\u4e2d\uff0c\u63d0\u4f9b\u70b9\u5305\u542b\u5728\u8d44\u6e90\u57df\u4e2d\u3002

CloudStack&\#8482; \u5141\u8bb8\u4e91\u90e8\u7f72\u4e2d\u5b58\u5728\u591a\u4e2a\u7fa4\u96c6\uff0c\u4f46\u5bf9\u4e8e\u57fa\u672c\u5b89\u88c5\uff0c\u6211\u4eec\u53ea\u9700\u8981\u4e00\u4e2a\u7fa4\u96c6\u3002 -message.installWizard.copy.whatIsAHost=\u4e3b\u673a\u662f\u6307\u4e00\u53f0\u8ba1\u7b97\u673a\u3002\u4e3b\u673a\u63d0\u4f9b\u8fd0\u884c\u6765\u5bbe\u865a\u62df\u673a\u7684\u8ba1\u7b97\u8d44\u6e90\u3002\u6bcf\u53f0\u4e3b\u673a\u4e0a\u90fd\u5b89\u88c5\u6709\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u8f6f\u4ef6\uff0c\u7528\u4e8e\u7ba1\u7406\u6765\u5bbe VM (\u88f8\u673a\u4e3b\u673a\u9664\u5916\uff0c\u5c06\u5728\u201c\u9ad8\u7ea7\u5b89\u88c5\u6307\u5357\u201d\u4e2d\u8ba8\u8bba\u8fd9\u4e00\u7279\u6b8a\u6848\u4f8b)\u3002\u4f8b\u5982\uff0c\u542f\u7528\u4e86 KVM \u7684 Linux \u670d\u52a1\u5668\u3001Citrix XenServer \u670d\u52a1\u5668\u548c ESXi \u670d\u52a1\u5668\u90fd\u53ef\u7528\u4f5c\u4e3b\u673a\u3002\u5728\u57fa\u672c\u5b89\u88c5\u4e2d\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u4e00\u53f0\u8fd0\u884c XenServer \u7684\u4e3b\u673a\u3002

\u4e3b\u673a\u662f CloudStack&\#8482; \u90e8\u7f72\u4e2d\u6700\u5c0f\u7684\u7ec4\u7ec7\u5355\u4f4d\u3002\u4e3b\u673a\u5305\u542b\u5728\u7fa4\u96c6\u4e2d\uff0c\u7fa4\u96c6\u5305\u542b\u5728\u63d0\u4f9b\u70b9\u4e2d\uff0c\u63d0\u4f9b\u70b9\u5305\u542b\u5728\u8d44\u6e90\u57df\u4e2d\u3002 -message.installWizard.copy.whatIsAPod=\u4e00\u4e2a\u63d0\u4f9b\u70b9\u901a\u5e38\u4ee3\u8868\u4e00\u4e2a\u673a\u67b6\u3002\u540c\u4e00\u63d0\u4f9b\u70b9\u4e2d\u7684\u4e3b\u673a\u4f4d\u4e8e\u540c\u4e00\u5b50\u7f51\u4e2d\u3002

\u63d0\u4f9b\u70b9\u662f CloudStack&\#8482; \u90e8\u7f72\u4e2d\u7684\u7b2c\u4e8c\u5927\u7ec4\u7ec7\u5355\u4f4d\u3002\u63d0\u4f9b\u70b9\u5305\u542b\u5728\u8d44\u6e90\u57df\u4e2d\u3002\u6bcf\u4e2a\u8d44\u6e90\u57df\u4e2d\u53ef\u4ee5\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u63d0\u4f9b\u70b9\uff1b\u5728\u57fa\u672c\u5b89\u88c5\u4e2d\uff0c\u60a8\u7684\u8d44\u6e90\u57df\u4e2d\u5c06\u4ec5\u5305\u542b\u4e00\u4e2a\u63d0\u4f9b\u70b9\u3002 -message.installWizard.copy.whatIsAZone=\u8d44\u6e90\u57df\u662f CloudStack&\#8482; \u90e8\u7f72\u4e2d\u6700\u5927\u7684\u7ec4\u7ec7\u5355\u4f4d\u3002\u867d\u7136\u5141\u8bb8\u4e00\u4e2a\u6570\u636e\u4e2d\u5fc3\u4e2d\u5b58\u5728\u591a\u4e2a\u8d44\u6e90\u57df\uff0c\u4f46\u662f\u4e00\u4e2a\u8d44\u6e90\u57df\u901a\u5e38\u4e0e\u4e00\u4e2a\u6570\u636e\u4e2d\u5fc3\u76f8\u5bf9\u5e94\u3002\u5c06\u57fa\u7840\u67b6\u6784\u7f16\u7ec4\u5230\u8d44\u6e90\u57df\u4e2d\u7684\u597d\u5904\u662f\u53ef\u4ee5\u63d0\u4f9b\u7269\u7406\u9694\u79bb\u548c\u5197\u4f59\u3002\u4f8b\u5982\uff0c\u6bcf\u4e2a\u8d44\u6e90\u57df\u90fd\u53ef\u4ee5\u62e5\u6709\u5404\u81ea\u7684\u7535\u6e90\u4f9b\u5e94\u548c\u7f51\u7edc\u4e0a\u884c\u65b9\u6848\uff0c\u5e76\u4e14\u5404\u8d44\u6e90\u57df\u53ef\u4ee5\u5728\u5730\u7406\u4f4d\u7f6e\u4e0a\u76f8\u9694\u5f88\u8fdc(\u867d\u7136\u5e76\u975e\u5fc5\u987b\u76f8\u9694\u5f88\u8fdc)\u3002 -message.installWizard.copy.whatIsCloudStack=CloudStack&\#8482 \u662f\u4e00\u4e2a\u8f6f\u4ef6\u5e73\u53f0\uff0c\u53ef\u5c06\u8ba1\u7b97\u8d44\u6e90\u96c6\u4e2d\u5728\u4e00\u8d77\u4ee5\u6784\u5efa\u516c\u6709\u3001\u79c1\u6709\u548c\u6df7\u5408\u57fa\u7840\u8bbe\u65bd\u5373\u670d\u52a1(IaaS)\u4e91\u3002CloudStack&\#8482 \u8d1f\u8d23\u7ba1\u7406\u7ec4\u6210\u4e91\u57fa\u7840\u67b6\u6784\u7684\u7f51\u7edc\u3001\u5b58\u50a8\u548c\u8ba1\u7b97\u8282\u70b9\u3002\u4f7f\u7528 CloudStack&\#8482 \u53ef\u4ee5\u90e8\u7f72\u3001\u7ba1\u7406\u548c\u914d\u7f6e\u4e91\u8ba1\u7b97\u73af\u5883\u3002

CloudStack&\#8482 \u901a\u8fc7\u6269\u5c55\u5546\u7528\u786c\u4ef6\u4e0a\u8fd0\u884c\u7684\u6bcf\u4e2a\u865a\u62df\u673a\u6620\u50cf\u7684\u8303\u56f4\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5b9e\u65f6\u53ef\u7528\u7684\u4e91\u57fa\u7840\u67b6\u6784\u8f6f\u4ef6\u5806\u6808\u7528\u4e8e\u4ee5\u670d\u52a1\u65b9\u5f0f\u4ea4\u4ed8\u865a\u62df\u6570\u636e\u4e2d\u5fc3\uff0c\u5373\u4ea4\u4ed8\u6784\u5efa\u3001\u90e8\u7f72\u548c\u7ba1\u7406\u591a\u5c42\u6b21\u548c\u591a\u79df\u6237\u4e91\u5e94\u7528\u7a0b\u5e8f\u5fc5\u9700\u7684\u6240\u6709\u7ec4\u4ef6\u3002\u5f00\u6e90\u7248\u672c\u548c Premium \u7248\u672c\u90fd\u5df2\u53ef\u7528\uff0c\u4e14\u63d0\u4f9b\u7684\u529f\u80fd\u51e0\u4e4e\u5b8c\u5168\u76f8\u540c\u3002 -message.installWizard.copy.whatIsPrimaryStorage=CloudStack&\#8482; \u4e91\u57fa\u7840\u67b6\u6784\u4f7f\u7528\u4ee5\u4e0b\u4e24\u79cd\u7c7b\u578b\u7684\u5b58\u50a8\: \u4e3b\u5b58\u50a8\u548c\u4e8c\u7ea7\u5b58\u50a8\u3002\u8fd9\u4e24\u79cd\u7c7b\u578b\u7684\u5b58\u50a8\u53ef\u4ee5\u662f iSCSI \u6216 NFS \u670d\u52a1\u5668\uff0c\u4e5f\u53ef\u4ee5\u662f\u672c\u5730\u78c1\u76d8\u3002

\u4e3b\u5b58\u50a8\u4e0e\u7fa4\u96c6\u76f8\u5173\u8054\uff0c\u7528\u4e8e\u5b58\u50a8\u8be5\u7fa4\u96c6\u4e2d\u7684\u4e3b\u673a\u4e0a\u6b63\u5728\u8fd0\u884c\u7684\u6240\u6709 VM \u5bf9\u5e94\u7684\u6bcf\u4e2a\u6765\u5bbe VM \u7684\u78c1\u76d8\u5377\u3002\u4e3b\u5b58\u50a8\u670d\u52a1\u5668\u901a\u5e38\u4f4d\u4e8e\u9760\u8fd1\u4e3b\u673a\u7684\u4f4d\u7f6e\u3002 -message.installWizard.copy.whatIsSecondaryStorage=\u4e8c\u7ea7\u5b58\u50a8\u4e0e\u8d44\u6e90\u57df\u76f8\u5173\u8054\uff0c\u7528\u4e8e\u5b58\u50a8\u4ee5\u4e0b\u9879\u76ee\:
  • \u6a21\u677f - \u53ef\u7528\u4e8e\u542f\u52a8 VM \u5e76\u53ef\u4ee5\u5305\u542b\u5176\u4ed6\u914d\u7f6e\u4fe1\u606f(\u4f8b\u5982\uff0c\u5df2\u5b89\u88c5\u7684\u5e94\u7528\u7a0b\u5e8f)\u7684\u64cd\u4f5c\u7cfb\u7edf\u6620\u50cf
  • ISO \u6620\u50cf - \u53ef\u91cd\u65b0\u542f\u52a8\u6216\u4e0d\u53ef\u91cd\u65b0\u542f\u52a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u6620\u50cf
  • \u78c1\u76d8\u5377\u5feb\u7167 - \u5df2\u4fdd\u5b58\u7684 VM \u6570\u636e\u526f\u672c\uff0c\u53ef\u7528\u4e8e\u6267\u884c\u6570\u636e\u6062\u590d\u6216\u521b\u5efa\u65b0\u6a21\u677f
+message.installWizard.copy.whatIsACluster=\u7fa4\u96c6\u63d0\u4f9b\u4e86\u4e00\u79cd\u7f16\u7ec4\u4e3b\u673a\u7684\u65b9\u6cd5\u3002\u7fa4\u96c6\u4e2d\u7684\u6240\u6709\u4e3b\u673a\u90fd\u5177\u6709\u76f8\u540c\u7684\u786c\u4ef6\uff0c\u8fd0\u884c\u76f8\u540c\u7684\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\uff0c\u4f4d\u4e8e\u540c\u4e00\u5b50\u7f51\u4e2d\uff0c\u5e76\u8bbf\u95ee\u76f8\u540c\u7684\u5171\u4eab\u5b58\u50a8\u3002\u53ef\u4ee5\u5b9e\u65f6\u5c06\u865a\u62df\u673a\u5b9e\u4f8b(VM)\u4ece\u4e00\u53f0\u4e3b\u673a\u8fc1\u79fb\u5230\u540c\u4e00\u7fa4\u96c6\u5185\u7684\u5176\u4ed6\u4e3b\u673a\uff0c\u800c\u65e0\u9700\u4e2d\u65ad\u5411\u7528\u6237\u63d0\u4f9b\u670d\u52a1\u3002\u7fa4\u96c6\u662f CloudStack&\#8482; \u90e8\u7f72\u4e2d\u7684\u7b2c\u4e09\u5927\u7ec4\u7ec7\u5355\u4f4d\u3002\u7fa4\u96c6\u5305\u542b\u5728\u63d0\u4f9b\u70b9\u4e2d\uff0c\u63d0\u4f9b\u70b9\u5305\u542b\u5728\u533a\u57df\u4e2d\u3002

CloudStack&\#8482; \u5141\u8bb8\u4e91\u90e8\u7f72\u4e2d\u5b58\u5728\u591a\u4e2a\u7fa4\u96c6\uff0c\u4f46\u5bf9\u4e8e\u57fa\u672c\u5b89\u88c5\uff0c\u6211\u4eec\u53ea\u9700\u8981\u4e00\u4e2a\u7fa4\u96c6\u3002 +message.installWizard.copy.whatIsAHost=\u4e3b\u673a\u662f\u6307\u4e00\u53f0\u8ba1\u7b97\u673a\u3002\u4e3b\u673a\u63d0\u4f9b\u8fd0\u884c\u6765\u5bbe\u865a\u62df\u673a\u7684\u8ba1\u7b97\u8d44\u6e90\u3002\u6bcf\u53f0\u4e3b\u673a\u4e0a\u90fd\u5b89\u88c5\u6709\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u8f6f\u4ef6\uff0c\u7528\u4e8e\u7ba1\u7406\u6765\u5bbe VM (\u88f8\u673a\u4e3b\u673a\u9664\u5916\uff0c\u5c06\u5728\u201c\u9ad8\u7ea7\u5b89\u88c5\u6307\u5357\u201d\u4e2d\u8ba8\u8bba\u8fd9\u4e00\u7279\u6b8a\u6848\u4f8b)\u3002\u4f8b\u5982\uff0c\u542f\u7528\u4e86 KVM \u7684 Linux \u670d\u52a1\u5668\u3001Citrix XenServer \u670d\u52a1\u5668\u548c ESXi \u670d\u52a1\u5668\u90fd\u53ef\u7528\u4f5c\u4e3b\u673a\u3002\u5728\u57fa\u672c\u5b89\u88c5\u4e2d\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u4e00\u53f0\u8fd0\u884c XenServer \u7684\u4e3b\u673a\u3002

\u4e3b\u673a\u662f CloudStack&\#8482; \u90e8\u7f72\u4e2d\u6700\u5c0f\u7684\u7ec4\u7ec7\u5355\u4f4d\u3002\u4e3b\u673a\u5305\u542b\u5728\u7fa4\u96c6\u4e2d\uff0c\u7fa4\u96c6\u5305\u542b\u5728\u63d0\u4f9b\u70b9\u4e2d\uff0c\u63d0\u4f9b\u70b9\u5305\u542b\u5728\u533a\u57df\u4e2d\u3002 +message.installWizard.copy.whatIsAPod=\u4e00\u4e2a\u63d0\u4f9b\u70b9\u901a\u5e38\u4ee3\u8868\u4e00\u4e2a\u673a\u67b6\u3002\u540c\u4e00\u63d0\u4f9b\u70b9\u4e2d\u7684\u4e3b\u673a\u4f4d\u4e8e\u540c\u4e00\u5b50\u7f51\u4e2d\u3002

\u63d0\u4f9b\u70b9\u662f CloudStack&\#8482; \u90e8\u7f72\u4e2d\u7684\u7b2c\u4e8c\u5927\u7ec4\u7ec7\u5355\u4f4d\u3002\u63d0\u4f9b\u70b9\u5305\u542b\u5728\u533a\u57df\u4e2d\u3002\u6bcf\u4e2a\u533a\u57df\u4e2d\u53ef\u4ee5\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u63d0\u4f9b\u70b9\uff1b\u5728\u57fa\u672c\u5b89\u88c5\u4e2d\uff0c\u60a8\u7684\u533a\u57df\u4e2d\u5c06\u4ec5\u5305\u542b\u4e00\u4e2a\u63d0\u4f9b\u70b9\u3002 +message.installWizard.copy.whatIsAZone=\u533a\u57df\u662f CloudStack&\#8482; \u90e8\u7f72\u4e2d\u6700\u5927\u7684\u7ec4\u7ec7\u5355\u4f4d\u3002\u867d\u7136\u5141\u8bb8\u4e00\u4e2a\u6570\u636e\u4e2d\u5fc3\u4e2d\u5b58\u5728\u591a\u4e2a\u533a\u57df\uff0c\u4f46\u662f\u4e00\u4e2a\u533a\u57df\u901a\u5e38\u4e0e\u4e00\u4e2a\u6570\u636e\u4e2d\u5fc3\u76f8\u5bf9\u5e94\u3002\u5c06\u57fa\u7840\u67b6\u6784\u7f16\u7ec4\u5230\u533a\u57df\u4e2d\u7684\u597d\u5904\u662f\u53ef\u4ee5\u63d0\u4f9b\u7269\u7406\u9694\u79bb\u548c\u5197\u4f59\u3002\u4f8b\u5982\uff0c\u6bcf\u4e2a\u533a\u57df\u90fd\u53ef\u4ee5\u62e5\u6709\u5404\u81ea\u7684\u7535\u6e90\u4f9b\u5e94\u548c\u7f51\u7edc\u4e0a\u884c\u65b9\u6848\uff0c\u5e76\u4e14\u5404\u533a\u57df\u53ef\u4ee5\u5728\u5730\u7406\u4f4d\u7f6e\u4e0a\u76f8\u9694\u5f88\u8fdc(\u867d\u7136\u5e76\u975e\u5fc5\u987b\u76f8\u9694\u5f88\u8fdc)\u3002 +message.installWizard.copy.whatIsCloudStack=CloudStack&\#8482 \u662f\u4e00\u4e2a\u8f6f\u4ef6\u5e73\u53f0\uff0c\u53ef\u5c06\u8ba1\u7b97\u8d44\u6e90\u96c6\u4e2d\u5728\u4e00\u8d77\u4ee5\u6784\u5efa\u516c\u5171\u3001\u79c1\u6709\u548c\u6df7\u5408\u57fa\u7840\u8bbe\u65bd\u5373\u670d\u52a1(IaaS)\u4e91\u3002CloudStack&\#8482 \u8d1f\u8d23\u7ba1\u7406\u7ec4\u6210\u4e91\u57fa\u7840\u67b6\u6784\u7684\u7f51\u7edc\u3001\u5b58\u50a8\u548c\u8ba1\u7b97\u8282\u70b9\u3002\u4f7f\u7528 CloudStack&\#8482 \u53ef\u4ee5\u90e8\u7f72\u3001\u7ba1\u7406\u548c\u914d\u7f6e\u4e91\u8ba1\u7b97\u73af\u5883\u3002

CloudStack&\#8482 \u901a\u8fc7\u6269\u5c55\u5546\u7528\u786c\u4ef6\u4e0a\u8fd0\u884c\u7684\u6bcf\u4e2a\u865a\u62df\u673a\u6620\u50cf\u7684\u8303\u56f4\uff0c\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5b9e\u65f6\u53ef\u7528\u7684\u4e91\u57fa\u7840\u67b6\u6784\u8f6f\u4ef6\u5806\u6808\u7528\u4e8e\u4ee5\u670d\u52a1\u65b9\u5f0f\u4ea4\u4ed8\u865a\u62df\u6570\u636e\u4e2d\u5fc3\uff0c\u5373\u4ea4\u4ed8\u6784\u5efa\u3001\u90e8\u7f72\u548c\u7ba1\u7406\u591a\u5c42\u6b21\u548c\u591a\u79df\u6237\u4e91\u5e94\u7528\u7a0b\u5e8f\u5fc5\u9700\u7684\u6240\u6709\u7ec4\u4ef6\u3002\u5f00\u6e90\u7248\u672c\u548c Premium \u7248\u672c\u90fd\u5df2\u53ef\u7528\uff0c\u4e14\u63d0\u4f9b\u7684\u529f\u80fd\u51e0\u4e4e\u5b8c\u5168\u76f8\u540c\u3002 +message.installWizard.copy.whatIsPrimaryStorage=CloudStack&\#8482; \u4e91\u57fa\u7840\u67b6\u6784\u4f7f\u7528\u4ee5\u4e0b\u4e24\u79cd\u7c7b\u578b\u7684\u5b58\u50a8\: \u4e3b\u5b58\u50a8\u548c\u8f85\u52a9\u5b58\u50a8\u3002\u8fd9\u4e24\u79cd\u7c7b\u578b\u7684\u5b58\u50a8\u53ef\u4ee5\u662f iSCSI \u6216 NFS \u670d\u52a1\u5668\uff0c\u4e5f\u53ef\u4ee5\u662f\u672c\u5730\u78c1\u76d8\u3002

\u4e3b\u5b58\u50a8\u4e0e\u7fa4\u96c6\u76f8\u5173\u8054\uff0c\u7528\u4e8e\u5b58\u50a8\u8be5\u7fa4\u96c6\u4e2d\u7684\u4e3b\u673a\u4e0a\u6b63\u5728\u8fd0\u884c\u7684\u6240\u6709 VM \u5bf9\u5e94\u7684\u6bcf\u4e2a\u6765\u5bbe VM \u7684\u78c1\u76d8\u5377\u3002\u4e3b\u5b58\u50a8\u670d\u52a1\u5668\u901a\u5e38\u4f4d\u4e8e\u9760\u8fd1\u4e3b\u673a\u7684\u4f4d\u7f6e\u3002 +message.installWizard.copy.whatIsSecondaryStorage=\u8f85\u52a9\u5b58\u50a8\u4e0e\u533a\u57df\u76f8\u5173\u8054\uff0c\u7528\u4e8e\u5b58\u50a8\u4ee5\u4e0b\u9879\u76ee\:
  • \u6a21\u677f - \u53ef\u7528\u4e8e\u542f\u52a8 VM \u5e76\u53ef\u4ee5\u5305\u542b\u5176\u4ed6\u914d\u7f6e\u4fe1\u606f(\u4f8b\u5982\uff0c\u5df2\u5b89\u88c5\u7684\u5e94\u7528\u7a0b\u5e8f)\u7684\u64cd\u4f5c\u7cfb\u7edf\u6620\u50cf
  • ISO \u6620\u50cf - \u53ef\u91cd\u65b0\u542f\u52a8\u6216\u4e0d\u53ef\u91cd\u65b0\u542f\u52a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u6620\u50cf
  • \u78c1\u76d8\u5377\u5feb\u7167 - \u5df2\u4fdd\u5b58\u7684 VM \u6570\u636e\u526f\u672c\uff0c\u53ef\u7528\u4e8e\u6267\u884c\u6570\u636e\u6062\u590d\u6216\u521b\u5efa\u65b0\u6a21\u677f
message.installWizard.now.building=\u73b0\u5728\u6b63\u5728\u6784\u5efa\u60a8\u7684\u4e91... message.installWizard.tooltip.addCluster.name=\u7fa4\u96c6\u7684\u540d\u79f0\u3002\u6b64\u540d\u79f0\u53ef\u4ee5\u662f\u60a8\u9009\u62e9\u7684\u6587\u672c\uff0c\u4e14\u672a\u7531 CloudStack \u4f7f\u7528\u3002 message.installWizard.tooltip.addHost.hostname=\u4e3b\u673a\u7684 DNS \u540d\u79f0\u6216 IP \u5730\u5740\u3002 message.installWizard.tooltip.addHost.password=\u6b64\u4e3a\u4e0a\u8ff0\u7528\u6237\u7684\u5bc6\u7801(\u6765\u81ea XenServer \u5b89\u88c5)\u3002 message.installWizard.tooltip.addHost.username=\u901a\u5e38\u4e3a root\u3002 message.installWizard.tooltip.addPod.name=\u63d0\u4f9b\u70b9\u7684\u540d\u79f0 -message.installWizard.tooltip.addPod.reservedSystemEndIp=\u6b64\u4e3a CloudStack \u7528\u4e8e\u7ba1\u7406\u4e8c\u7ea7\u5b58\u50a8 VM \u548c\u63a7\u5236\u53f0\u4ee3\u7406 VM \u7684\u4e13\u7528\u7f51\u7edc\u4e2d\u7684 IP \u8303\u56f4\u3002\u8fd9\u4e9b IP \u5730\u5740\u6765\u81ea\u4e0e\u8ba1\u7b97\u670d\u52a1\u5668\u76f8\u540c\u7684\u5b50\u7f51\u3002 +message.installWizard.tooltip.addPod.reservedSystemEndIp=\u6b64\u4e3a CloudStack \u7528\u4e8e\u7ba1\u7406\u8f85\u52a9\u5b58\u50a8 VM \u548c\u63a7\u5236\u53f0\u4ee3\u7406 VM \u7684\u4e13\u7528\u7f51\u7edc\u4e2d\u7684 IP \u8303\u56f4\u3002\u8fd9\u4e9b IP \u5730\u5740\u6765\u81ea\u4e0e\u8ba1\u7b97\u670d\u52a1\u5668\u76f8\u540c\u7684\u5b50\u7f51\u3002 message.installWizard.tooltip.addPod.reservedSystemGateway=\u8be5\u63d0\u4f9b\u70b9\u4e2d\u7684\u4e3b\u673a\u7f51\u5173\u3002 message.installWizard.tooltip.addPod.reservedSystemNetmask=\u6765\u5bbe\u5c06\u8981\u4f7f\u7528\u7684\u5b50\u7f51\u4e0a\u6b63\u5728\u4f7f\u7528\u7684\u7f51\u7edc\u63a9\u7801\u3002 -message.installWizard.tooltip.addPod.reservedSystemStartIp=\u6b64\u4e3a CloudStack \u7528\u4e8e\u7ba1\u7406\u4e8c\u7ea7\u5b58\u50a8 VM \u548c\u63a7\u5236\u53f0\u4ee3\u7406 VM \u7684\u4e13\u7528\u7f51\u7edc\u4e2d\u7684 IP \u8303\u56f4\u3002\u8fd9\u4e9b IP \u5730\u5740\u6765\u81ea\u4e0e\u8ba1\u7b97\u670d\u52a1\u5668\u76f8\u540c\u7684\u5b50\u7f51\u3002 +message.installWizard.tooltip.addPod.reservedSystemStartIp=\u6b64\u4e3a CloudStack \u7528\u4e8e\u7ba1\u7406\u8f85\u52a9\u5b58\u50a8 VM \u548c\u63a7\u5236\u53f0\u4ee3\u7406 VM \u7684\u4e13\u7528\u7f51\u7edc\u4e2d\u7684 IP \u8303\u56f4\u3002\u8fd9\u4e9b IP \u5730\u5740\u6765\u81ea\u4e0e\u8ba1\u7b97\u670d\u52a1\u5668\u76f8\u540c\u7684\u5b50\u7f51\u3002 message.installWizard.tooltip.addPrimaryStorage.name=\u5b58\u50a8\u8bbe\u5907\u7684\u540d\u79f0\u3002 -message.installWizard.tooltip.addPrimaryStorage.path=(\u9002\u7528\u4e8e NFS)\u5728 NFS \u4e2d\uff0c\u6b64\u8def\u5f84\u4e3a\u670d\u52a1\u5668\u7684\u5bfc\u51fa\u8def\u5f84\u3002\u8def\u5f84(\u9488\u5bf9 SharedMountPoint)\u3002\u5bf9\u4e8e KVM\uff0c\u6b64\u8def\u5f84\u4e3a\u88c5\u8f7d\u4e86\u4e8c\u7ea7\u5b58\u50a8\u7684\u6bcf\u4e2a\u4e3b\u673a\u4e0a\u7684\u8def\u5f84\u3002\u4f8b\u5982\uff0c/mnt/primary\u3002 +message.installWizard.tooltip.addPrimaryStorage.path=(\u9002\u7528\u4e8e NFS)\u5728 NFS \u4e2d\uff0c\u6b64\u8def\u5f84\u4e3a\u670d\u52a1\u5668\u7684\u5bfc\u51fa\u8def\u5f84\u3002\u8def\u5f84(\u9488\u5bf9 SharedMountPoint)\u3002\u5bf9\u4e8e KVM\uff0c\u6b64\u8def\u5f84\u4e3a\u88c5\u8f7d\u4e86\u8f85\u52a9\u5b58\u50a8\u7684\u6bcf\u4e2a\u4e3b\u673a\u4e0a\u7684\u8def\u5f84\u3002\u4f8b\u5982\uff0c/mnt/primary\u3002 message.installWizard.tooltip.addPrimaryStorage.server=(\u9002\u7528\u4e8e NFS\u3001iSCSI \u6216 PreSetup)\u5b58\u50a8\u8bbe\u5907\u7684 IP \u5730\u5740\u6216 DNS \u540d\u79f0\u3002 -message.installWizard.tooltip.addSecondaryStorage.nfsServer=\u6258\u7ba1\u4e8c\u7ea7\u5b58\u50a8\u7684 NFS \u670d\u52a1\u5668\u7684 IP \u5730\u5740 +message.installWizard.tooltip.addSecondaryStorage.nfsServer=\u6258\u7ba1\u8f85\u52a9\u5b58\u50a8\u7684 NFS \u670d\u52a1\u5668\u7684 IP \u5730\u5740 message.installWizard.tooltip.addSecondaryStorage.path=\u5bfc\u51fa\u8def\u5f84(\u4f4d\u4e8e\u4e0a\u8ff0\u6307\u5b9a\u670d\u52a1\u5668\u4e0a) -message.installWizard.tooltip.addZone.dns1=\u8fd9\u4e9b\u670d\u52a1\u5668\u662f\u4f9b\u6b64\u8d44\u6e90\u57df\u4e2d\u7684\u6765\u5bbe VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\uff0c\u5c06\u901a\u8fc7\u60a8\u7a0d\u540e\u8981\u6dfb\u52a0\u7684\u516c\u7528\u7f51\u7edc\u8fdb\u884c\u8bbf\u95ee\u3002\u6b64\u8d44\u6e90\u57df\u7684\u516c\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u5728\u6b64\u5904\u6307\u5b9a\u7684 DNS \u670d\u52a1\u5668\u3002 -message.installWizard.tooltip.addZone.dns2=\u8fd9\u4e9b\u670d\u52a1\u5668\u662f\u4f9b\u6b64\u8d44\u6e90\u57df\u4e2d\u7684\u6765\u5bbe VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\uff0c\u5c06\u901a\u8fc7\u60a8\u7a0d\u540e\u8981\u6dfb\u52a0\u7684\u516c\u7528\u7f51\u7edc\u8fdb\u884c\u8bbf\u95ee\u3002\u6b64\u8d44\u6e90\u57df\u7684\u516c\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u5728\u6b64\u5904\u6307\u5b9a\u7684 DNS \u670d\u52a1\u5668\u3002 -message.installWizard.tooltip.addZone.internaldns1=\u8fd9\u4e9b\u670d\u52a1\u5668\u662f\u4f9b\u6b64\u8d44\u6e90\u57df\u4e2d\u7684\u7cfb\u7edf VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\uff0c\u5c06\u901a\u8fc7\u7cfb\u7edf VM \u7684\u4e13\u7528\u7f51\u7edc\u63a5\u53e3\u8fdb\u884c\u8bbf\u95ee\u3002\u60a8\u4e3a\u63d0\u4f9b\u70b9\u63d0\u4f9b\u7684\u4e13\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u5728\u6b64\u5904\u6307\u5b9a\u7684 DNS \u670d\u52a1\u5668\u3002 -message.installWizard.tooltip.addZone.internaldns2=\u8fd9\u4e9b\u670d\u52a1\u5668\u662f\u4f9b\u6b64\u8d44\u6e90\u57df\u4e2d\u7684\u7cfb\u7edf VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\uff0c\u5c06\u901a\u8fc7\u7cfb\u7edf VM \u7684\u4e13\u7528\u7f51\u7edc\u63a5\u53e3\u8fdb\u884c\u8bbf\u95ee\u3002\u60a8\u4e3a\u63d0\u4f9b\u70b9\u63d0\u4f9b\u7684\u4e13\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u5728\u6b64\u5904\u6307\u5b9a\u7684 DNS \u670d\u52a1\u5668\u3002 -message.installWizard.tooltip.addZone.name=\u8d44\u6e90\u57df\u540d\u79f0 +message.installWizard.tooltip.addZone.dns1=\u8fd9\u4e9b\u670d\u52a1\u5668\u662f\u4f9b\u6b64\u533a\u57df\u4e2d\u7684\u6765\u5bbe VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\uff0c\u5c06\u901a\u8fc7\u60a8\u7a0d\u540e\u8981\u6dfb\u52a0\u7684\u516c\u7528\u7f51\u7edc\u8fdb\u884c\u8bbf\u95ee\u3002\u6b64\u533a\u57df\u7684\u516c\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u5728\u6b64\u5904\u6307\u5b9a\u7684 DNS \u670d\u52a1\u5668\u3002 +message.installWizard.tooltip.addZone.dns2=\u8fd9\u4e9b\u670d\u52a1\u5668\u662f\u4f9b\u6b64\u533a\u57df\u4e2d\u7684\u6765\u5bbe VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\uff0c\u5c06\u901a\u8fc7\u60a8\u7a0d\u540e\u8981\u6dfb\u52a0\u7684\u516c\u7528\u7f51\u7edc\u8fdb\u884c\u8bbf\u95ee\u3002\u6b64\u533a\u57df\u7684\u516c\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u5728\u6b64\u5904\u6307\u5b9a\u7684 DNS \u670d\u52a1\u5668\u3002 +message.installWizard.tooltip.addZone.internaldns1=\u8fd9\u4e9b\u670d\u52a1\u5668\u662f\u4f9b\u6b64\u533a\u57df\u4e2d\u7684\u7cfb\u7edf VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\uff0c\u5c06\u901a\u8fc7\u7cfb\u7edf VM \u7684\u4e13\u7528\u7f51\u7edc\u63a5\u53e3\u8fdb\u884c\u8bbf\u95ee\u3002\u60a8\u4e3a\u63d0\u4f9b\u70b9\u63d0\u4f9b\u7684\u4e13\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u5728\u6b64\u5904\u6307\u5b9a\u7684 DNS \u670d\u52a1\u5668\u3002 +message.installWizard.tooltip.addZone.internaldns2=\u8fd9\u4e9b\u670d\u52a1\u5668\u662f\u4f9b\u6b64\u533a\u57df\u4e2d\u7684\u7cfb\u7edf VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\uff0c\u5c06\u901a\u8fc7\u7cfb\u7edf VM \u7684\u4e13\u7528\u7f51\u7edc\u63a5\u53e3\u8fdb\u884c\u8bbf\u95ee\u3002\u60a8\u4e3a\u63d0\u4f9b\u70b9\u63d0\u4f9b\u7684\u4e13\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u5728\u6b64\u5904\u6307\u5b9a\u7684 DNS \u670d\u52a1\u5668\u3002 +message.installWizard.tooltip.addZone.name=\u533a\u57df\u540d\u79f0 message.installWizard.tooltip.configureGuestTraffic.description=\u60a8\u7684\u7f51\u7edc\u8bf4\u660e -message.installWizard.tooltip.configureGuestTraffic.guestEndIp=\u80fd\u591f\u5206\u914d\u7ed9\u6b64\u8d44\u6e90\u57df\u4e2d\u7684\u6765\u5bbe\u7684 IP \u5730\u5740\u8303\u56f4\u3002\u5982\u679c\u4f7f\u7528\u4e00\u4e2a NIC\uff0c\u8fd9\u4e9b IP \u5e94\u4f4d\u4e8e\u4e0e\u63d0\u4f9b\u70b9 CIDR \u76f8\u540c\u7684 CIDR \u4e2d\u3002 +message.installWizard.tooltip.configureGuestTraffic.guestEndIp=\u80fd\u591f\u5206\u914d\u7ed9\u6b64\u533a\u57df\u4e2d\u7684\u6765\u5bbe\u7684 IP \u5730\u5740\u8303\u56f4\u3002\u5982\u679c\u4f7f\u7528\u4e00\u4e2a NIC\uff0c\u8fd9\u4e9b IP \u5e94\u4f4d\u4e8e\u4e0e\u63d0\u4f9b\u70b9 CIDR \u76f8\u540c\u7684 CIDR \u4e2d\u3002 message.installWizard.tooltip.configureGuestTraffic.guestGateway=\u6765\u5bbe\u5e94\u4f7f\u7528\u7684\u7f51\u5173 message.installWizard.tooltip.configureGuestTraffic.guestNetmask=\u6765\u5bbe\u5e94\u4f7f\u7528\u7684\u5b50\u7f51\u4e0a\u6b63\u5728\u4f7f\u7528\u7684\u7f51\u7edc\u63a9\u7801 -message.installWizard.tooltip.configureGuestTraffic.guestStartIp=\u80fd\u591f\u5206\u914d\u7ed9\u6b64\u8d44\u6e90\u57df\u4e2d\u7684\u6765\u5bbe\u7684 IP \u5730\u5740\u8303\u56f4\u3002\u5982\u679c\u4f7f\u7528\u4e00\u4e2a NIC\uff0c\u8fd9\u4e9b IP \u5e94\u4f4d\u4e8e\u4e0e\u63d0\u4f9b\u70b9 CIDR \u76f8\u540c\u7684 CIDR \u4e2d\u3002 +message.installWizard.tooltip.configureGuestTraffic.guestStartIp=\u80fd\u591f\u5206\u914d\u7ed9\u6b64\u533a\u57df\u4e2d\u7684\u6765\u5bbe\u7684 IP \u5730\u5740\u8303\u56f4\u3002\u5982\u679c\u4f7f\u7528\u4e00\u4e2a NIC\uff0c\u8fd9\u4e9b IP \u5e94\u4f4d\u4e8e\u4e0e\u63d0\u4f9b\u70b9 CIDR \u76f8\u540c\u7684 CIDR \u4e2d\u3002 message.installWizard.tooltip.configureGuestTraffic.name=\u60a8\u7684\u7f51\u7edc\u540d\u79f0 +message.instance.scaled.up.confirm=\u662f\u5426\u786e\u5b9e\u8981\u6269\u5c55\u60a8\u7684\u5b9e\u4f8b? message.instanceWizard.noTemplates=\u60a8\u6ca1\u6709\u4efb\u4f55\u53ef\u7528\u6a21\u677f\uff1b\u8bf7\u6dfb\u52a0\u4e00\u4e2a\u517c\u5bb9\u7684\u6a21\u677f\uff0c\u7136\u540e\u91cd\u65b0\u542f\u52a8\u5b9e\u4f8b\u5411\u5bfc\u3002 message.ip.address.changed=\u60a8\u7684 IP \u5730\u5740\u53ef\u80fd\u5df2\u53d1\u751f\u53d8\u5316\uff1b\u662f\u5426\u8981\u5237\u65b0\u6b64\u5217\u8868? \u8bf7\u6ce8\u610f\uff0c\u5237\u65b0\u6b64\u5217\u8868\u65f6\uff0c\u201c\u8be6\u7ec6\u4fe1\u606f\u201d\u7a97\u683c\u5c06\u5173\u95ed\u3002 message.iso.desc=\u78c1\u76d8\u6620\u50cf\uff0c\u5176\u4e2d\u5305\u542b\u64cd\u4f5c\u7cfb\u7edf\u7684\u6570\u636e\u6216\u53ef\u542f\u52a8\u4ecb\u8d28 message.join.project=\u60a8\u73b0\u5728\u5df2\u52a0\u5165\u4e86\u4e00\u4e2a\u9879\u76ee\u3002\u8bf7\u5207\u6362\u5230\u201c\u9879\u76ee\u89c6\u56fe\u201d\u4ee5\u67e5\u770b\u9879\u76ee\u3002 message.launch.vm.on.private.network=\u662f\u5426\u8981\u5728\u60a8\u7684\u79c1\u4eba\u4e13\u7528\u7f51\u7edc\u4e2d\u542f\u52a8\u5b9e\u4f8b? -message.launch.zone=\u8d44\u6e90\u57df\u5df2\u51c6\u5907\u5c31\u7eea\uff0c\u53ef\u968f\u65f6\u542f\u52a8\uff1b\u8bf7\u7ee7\u7eed\u6267\u884c\u4e0b\u4e00\u6b65\u9aa4\u3002 +message.launch.zone=\u533a\u57df\u5df2\u51c6\u5907\u5c31\u7eea\uff0c\u53ef\u968f\u65f6\u542f\u52a8\uff1b\u8bf7\u7ee7\u7eed\u6267\u884c\u4e0b\u4e00\u6b65\u9aa4\u3002 message.lock.account=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u9501\u5b9a\u6b64\u5e10\u6237\u3002\u901a\u8fc7\u9501\u5b9a\u6b64\u5e10\u6237\uff0c\u6b64\u5e10\u6237\u7684\u6240\u6709\u7528\u6237\u5c06\u4e0d\u518d\u80fd\u591f\u7ba1\u7406\u5404\u81ea\u7684\u4e91\u8d44\u6e90\uff0c\u4f46\u4ecd\u7136\u53ef\u4ee5\u8bbf\u95ee\u73b0\u6709\u8d44\u6e90\u3002 message.migrate.instance.confirm=\u8bf7\u786e\u8ba4\u8981\u5c06\u865a\u62df\u5b9e\u4f8b\u8fc1\u79fb\u5230\u7684\u4e3b\u673a\u3002 message.migrate.instance.to.host=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5c06\u5b9e\u4f8b\u8fc1\u79fb\u5230\u5176\u4ed6\u4e3b\u673a\u3002 @@ -1713,8 +1754,12 @@ message.migrate.instance.to.ps=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5c06\ message.migrate.router.confirm=\u8bf7\u786e\u8ba4\u60a8\u8981\u5c06\u8def\u7531\u5668\u8fc1\u79fb\u5230\u7684\u4e3b\u673a\: message.migrate.systemvm.confirm=\u8bf7\u786e\u8ba4\u60a8\u8981\u5c06\u7cfb\u7edf VM \u8fc1\u79fb\u5230\u7684\u4e3b\u673a\: message.migrate.volume=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5c06\u5377\u8fc1\u79fb\u5230\u5176\u4ed6\u4e3b\u5b58\u50a8\u3002 +message.network.addVM.desc=\u8bf7\u6307\u5b9a\u8981\u5c06\u6b64 VM \u6dfb\u52a0\u5230\u7684\u7f51\u7edc\u3002\u5c06\u4e3a\u6b64\u7f51\u7edc\u6dfb\u52a0\u4e00\u4e2a\u65b0 NIC\u3002 +message.network.addVMNIC=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4e3a\u6b64\u7f51\u7edc\u6dfb\u52a0\u4e00\u4e2a\u65b0 VM NIC\u3002 message.new.user=\u8bf7\u6307\u5b9a\u4ee5\u4e0b\u4fe1\u606f\u4ee5\u5411\u5e10\u6237\u4e2d\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7528\u6237 -message.no.network.support.configuration.not.true=\u60a8\u7684\u6240\u6709\u8d44\u6e90\u57df\u90fd\u672a\u542f\u7528\u5b89\u5168\u7ec4\uff0c\u56e0\u6b64\u65e0\u5176\u4ed6\u7f51\u7edc\u529f\u80fd\u3002\u8bf7\u7ee7\u7eed\u6267\u884c\u6b65\u9aa4 5\u3002 +message.no.affinity.groups=\u60a8\u6ca1\u6709\u4efb\u4f55\u5173\u8054\u6027\u7ec4\u3002\u8bf7\u7ee7\u7eed\u6267\u884c\u4e0b\u4e00\u6b65\u64cd\u4f5c\u3002 +message.no.host.available=\u6ca1\u6709\u53ef\u7528\u4e8e\u8fc1\u79fb\u7684\u4e3b\u673a +message.no.network.support.configuration.not.true=\u60a8\u7684\u6240\u6709\u533a\u57df\u90fd\u672a\u542f\u7528\u5b89\u5168\u7ec4\uff0c\u56e0\u6b64\u65e0\u5176\u4ed6\u7f51\u7edc\u529f\u80fd\u3002\u8bf7\u7ee7\u7eed\u6267\u884c\u6b65\u9aa4 5\u3002 message.no.network.support=\u60a8\u9009\u62e9\u7684\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f vSphere \u6ca1\u6709\u4efb\u4f55\u5176\u4ed6\u7f51\u7edc\u529f\u80fd\u3002\u8bf7\u7ee7\u7eed\u6267\u884c\u6b65\u9aa4 5\u3002 message.no.projects.adminOnly=\u60a8\u6ca1\u6709\u4efb\u4f55\u9879\u76ee\u3002
\u8bf7\u8981\u6c42\u7ba1\u7406\u5458\u521b\u5efa\u4e00\u4e2a\u65b0\u9879\u76ee\u3002 message.no.projects=\u60a8\u6ca1\u6709\u4efb\u4f55\u9879\u76ee\u3002
\u8bf7\u4ece\u201c\u9879\u76ee\u201d\u90e8\u5206\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u9879\u76ee\u3002 @@ -1722,20 +1767,24 @@ message.number.clusters=

\u7fa4\u96c6\u6570

message.number.hosts=

\u4e3b\u673a\u6570

message.number.pods=

\u63d0\u4f9b\u70b9\u6570

message.number.storage=

\u4e3b\u5b58\u50a8\u5377\u6570

-message.number.zones=

\u8d44\u6e90\u57df\u6570

+message.number.zones=

\u533a\u57df\u6570

message.pending.projects.1=\u60a8\u6709\u5f85\u5b9a\u9879\u76ee\u9080\u8bf7\: message.pending.projects.2=\u8981\u67e5\u770b\uff0c\u8bf7\u8f6c\u81f3\u201c\u9879\u76ee\u201d\u90e8\u5206\uff0c\u7136\u540e\u4ece\u4e0b\u62c9\u5217\u8868\u4e2d\u9009\u62e9\u201c\u9080\u8bf7\u201d\u3002 -message.please.add.at.lease.one.traffic.range=\u8bf7\u81f3\u5c11\u6dfb\u52a0\u4e00\u4e2a\u6d41\u91cf\u8303\u56f4\u3002 +message.please.add.at.lease.one.traffic.range=\u8bf7\u81f3\u5c11\u6dfb\u52a0\u4e00\u4e2a\u901a\u4fe1\u8303\u56f4\u3002 message.please.proceed=\u8bf7\u7ee7\u7eed\u6267\u884c\u4e0b\u4e2a\u6b65\u9aa4\u3002 -message.please.select.a.configuration.for.your.zone=\u8bf7\u4e3a\u60a8\u7684\u8d44\u6e90\u57df\u9009\u62e9\u4e00\u79cd\u914d\u7f6e\u3002 -message.please.select.a.different.public.and.management.network.before.removing=\u8bf7\u5148\u9009\u62e9\u5176\u4ed6\u516c\u7528\u7ba1\u7406\u7f51\u7edc\uff0c\u7136\u540e\u518d\u5220\u9664 +message.please.select.a.configuration.for.your.zone=\u8bf7\u4e3a\u60a8\u7684\u533a\u57df\u9009\u62e9\u4e00\u79cd\u914d\u7f6e\u3002 +message.please.select.a.different.public.and.management.network.before.removing=\u8bf7\u5148\u9009\u62e9\u5176\u4ed6\u516c\u5171\u7ba1\u7406\u7f51\u7edc\uff0c\u7136\u540e\u518d\u5220\u9664 message.please.select.networks=\u8bf7\u4e3a\u60a8\u7684\u865a\u62df\u673a\u9009\u62e9\u7f51\u7edc\u3002 -message.please.wait.while.zone.is.being.created=\u6b63\u5728\u521b\u5efa\u8d44\u6e90\u57df\uff0c\u8bf7\u7a0d\u5019\uff1b\u6b64\u64cd\u4f5c\u53ef\u80fd\u9700\u8981\u4e00\u6bb5\u65f6\u95f4\u624d\u80fd\u5b8c\u6210... +message.please.wait.while.zone.is.being.created=\u6b63\u5728\u521b\u5efa\u533a\u57df\uff0c\u8bf7\u7a0d\u5019\uff1b\u6b64\u64cd\u4f5c\u53ef\u80fd\u9700\u8981\u4e00\u6bb5\u65f6\u95f4\u624d\u80fd\u5b8c\u6210... +message.pod.dedication.released=\u5df2\u91ca\u653e\u4e13\u7528\u63d0\u4f9b\u70b9 +message.portable.ip.delete.confirm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u53ef\u79fb\u690d IP \u8303\u56f4 message.project.invite.sent=\u53d1\u9001\u7ed9\u7528\u6237\u7684\u9080\u8bf7\uff1b\u7528\u6237\u63a5\u53d7\u9080\u8bf7\u540e\uff0c\u5c06\u52a0\u5165\u5230\u9879\u76ee\u4e2d -message.public.traffic.in.advanced.zone=\u4e91\u4e2d\u7684 VM \u8bbf\u95ee Internet \u65f6\u5c06\u751f\u6210\u516c\u5171\u6d41\u91cf\uff0c\u4f46\u5fc5\u987b\u5206\u914d\u53ef\u516c\u5f00\u8bbf\u95ee\u7684 IP \u624d\u80fd\u5b9e\u73b0\u3002\u6700\u7ec8\u7528\u6237\u53ef\u4ee5\u4f7f\u7528 CloudStack UI \u83b7\u53d6\u8fd9\u4e9b IP\uff0c\u4ee5\u5728\u5176\u6765\u5bbe\u7f51\u7edc\u4e0e\u516c\u7528\u7f51\u7edc\u4e4b\u95f4\u6267\u884c NAT\u3002

\u8bf7\u81f3\u5c11\u4e3a Internet \u6d41\u91cf\u63d0\u4f9b\u4e00\u4e2a IP \u5730\u5740\u8303\u56f4\u3002 -message.public.traffic.in.basic.zone=\u4e91\u4e2d\u7684 VM \u8bbf\u95ee Internet \u6216\u901a\u8fc7 Internet \u5411\u5ba2\u6237\u7aef\u63d0\u4f9b\u670d\u52a1\u65f6\u5c06\u751f\u6210\u516c\u5171\u6d41\u91cf\uff0c\u4f46\u5fc5\u987b\u5206\u914d\u53ef\u516c\u5f00\u8bbf\u95ee\u7684 IP \u624d\u80fd\u5b9e\u73b0\u3002\u521b\u5efa\u5b9e\u4f8b\u65f6\uff0c\u5c06\u628a\u8fd9\u4e00\u7ec4\u516c\u7528 IP \u4e2d\u7684 IP (\u6765\u5bbe IP \u5730\u5740\u9664\u5916)\u5206\u914d\u7ed9\u6b64\u5b9e\u4f8b\u3002\u9759\u6001 1-1 NAT \u5c06\u5728\u516c\u7528 IP \u4e0e\u6765\u5bbe IP \u4e4b\u95f4\u81ea\u52a8\u8bbe\u7f6e\u3002\u6700\u7ec8\u7528\u6237\u8fd8\u53ef\u4ee5\u4f7f\u7528 CloudStack UI \u83b7\u53d6\u5176\u4ed6 IP\uff0c\u4ee5\u5728\u5176\u5b9e\u4f8b\u4e0e\u516c\u7528 IP \u4e4b\u95f4\u6267\u884c\u9759\u6001 NAT\u3002 -message.redirecting.region=\u6b63\u5728\u91cd\u5b9a\u5411\u5230\u5730\u7406\u533a\u57df... -message.remove.region=\u662f\u5426\u786e\u5b9e\u8981\u4ece\u6b64\u7ba1\u7406\u670d\u52a1\u5668\u4e2d\u5220\u9664\u6b64\u5730\u7406\u533a\u57df? +message.public.traffic.in.advanced.zone=\u4e91\u4e2d\u7684 VM \u8bbf\u95ee Internet \u65f6\u5c06\u751f\u6210\u516c\u5171\u901a\u4fe1\uff0c\u4f46\u5fc5\u987b\u5206\u914d\u53ef\u516c\u5f00\u8bbf\u95ee\u7684 IP \u624d\u80fd\u5b9e\u73b0\u3002\u6700\u7ec8\u7528\u6237\u53ef\u4ee5\u4f7f\u7528 CloudStack UI \u83b7\u53d6\u8fd9\u4e9b IP\uff0c\u4ee5\u5728\u5176\u6765\u5bbe\u7f51\u7edc\u4e0e\u516c\u7528\u7f51\u7edc\u4e4b\u95f4\u6267\u884c NAT\u3002

\u8bf7\u81f3\u5c11\u4e3a Internet \u901a\u4fe1\u63d0\u4f9b\u4e00\u4e2a IP \u5730\u5740\u8303\u56f4\u3002 +message.public.traffic.in.basic.zone=\u4e91\u4e2d\u7684 VM \u8bbf\u95ee Internet \u6216\u901a\u8fc7 Internet \u5411\u5ba2\u6237\u7aef\u63d0\u4f9b\u670d\u52a1\u65f6\u5c06\u751f\u6210\u516c\u5171\u901a\u4fe1\uff0c\u4f46\u5fc5\u987b\u5206\u914d\u53ef\u516c\u5f00\u8bbf\u95ee\u7684 IP \u624d\u80fd\u5b9e\u73b0\u3002\u521b\u5efa\u5b9e\u4f8b\u65f6\uff0c\u5c06\u628a\u8fd9\u4e00\u7ec4\u516c\u7528 IP \u4e2d\u7684 IP (\u6765\u5bbe IP \u5730\u5740\u9664\u5916)\u5206\u914d\u7ed9\u6b64\u5b9e\u4f8b\u3002\u9759\u6001 1-1 NAT \u5c06\u5728\u516c\u7528 IP \u4e0e\u6765\u5bbe IP \u4e4b\u95f4\u81ea\u52a8\u8bbe\u7f6e\u3002\u6700\u7ec8\u7528\u6237\u8fd8\u53ef\u4ee5\u4f7f\u7528 CloudStack UI \u83b7\u53d6\u5176\u4ed6 IP\uff0c\u4ee5\u5728\u5176\u5b9e\u4f8b\u4e0e\u516c\u7528 IP \u4e4b\u95f4\u6267\u884c\u9759\u6001 NAT\u3002 +message.read.admin.guide.scaling.up=\u5f00\u59cb\u6269\u5c55\u4e4b\u524d\uff0c\u8bf7\u9605\u8bfb\u7ba1\u7406\u6307\u5357\u4e2d\u7684\u52a8\u6001\u6269\u5c55\u90e8\u5206\u3002 +message.redirecting.region=\u6b63\u5728\u91cd\u5b9a\u5411\u5230\u533a\u57df... +message.remove.ldap=\u662f\u5426\u786e\u5b9e\u8981\u5220\u9664 LDAP \u914d\u7f6e? +message.remove.region=\u662f\u5426\u786e\u5b9e\u8981\u4ece\u6b64\u7ba1\u7406\u670d\u52a1\u5668\u4e2d\u5220\u9664\u6b64\u533a\u57df? message.remove.vpc=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 VPC message.remove.vpn.access=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u4ee5\u4e0b\u7528\u6237\u7684 VPN \u8bbf\u95ee\u3002 message.reset.password.warning.notPasswordEnabled=\u521b\u5efa\u6b64\u5b9e\u4f8b\u7684\u6a21\u677f\u65f6\u672a\u542f\u7528\u5bc6\u7801 @@ -1745,17 +1794,23 @@ message.restart.mgmt.server=\u8bf7\u91cd\u65b0\u542f\u52a8\u7ba1\u7406\u670d\u52 message.restart.mgmt.usage.server=\u8bf7\u91cd\u65b0\u542f\u52a8\u7ba1\u7406\u670d\u52a1\u5668\u548c\u4f7f\u7528\u670d\u52a1\u5668\u4ee5\u4f7f\u60a8\u7684\u65b0\u8bbe\u7f6e\u751f\u6548\u3002 message.restart.network=\u6b64\u7f51\u7edc\u63d0\u4f9b\u7684\u6240\u6709\u670d\u52a1\u90fd\u5c06\u4e2d\u65ad\u3002\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u91cd\u65b0\u542f\u52a8\u6b64\u7f51\u7edc\u3002 message.restart.vpc=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u91cd\u65b0\u542f\u52a8 VPC +message.restoreVM=\u662f\u5426\u8981\u8fd8\u539f\u6b64 VM? message.security.group.usage=(\u6309\u4f4f Ctrl \u952e\u5e76\u5355\u51fb\u9f20\u6807\u53ef\u9009\u62e9\u6240\u6709\u9002\u7528\u7684\u5b89\u5168\u7ec4) -message.select.a.zone=\u4e00\u4e2a\u8d44\u6e90\u57df\u901a\u5e38\u4e0e\u4e00\u4e2a\u6570\u636e\u4e2d\u5fc3\u76f8\u5bf9\u5e94\u3002\u591a\u4e2a\u8d44\u6e90\u57df\u53ef\u4ee5\u63d0\u4f9b\u7269\u7406\u9694\u79bb\u548c\u5197\u4f59\uff0c\u6709\u52a9\u4e8e\u4f7f\u4e91\u66f4\u52a0\u53ef\u9760\u3002 +message.select.affinity.groups=\u8bf7\u9009\u62e9\u60a8\u5e0c\u671b\u6b64 VM \u6240\u5c5e\u7684\u4efb\u4f55\u5173\u8054\u6027\u7ec4\: +message.select.a.zone=\u4e00\u4e2a\u533a\u57df\u901a\u5e38\u4e0e\u4e00\u4e2a\u6570\u636e\u4e2d\u5fc3\u76f8\u5bf9\u5e94\u3002\u591a\u4e2a\u533a\u57df\u53ef\u4ee5\u63d0\u4f9b\u7269\u7406\u9694\u79bb\u548c\u5197\u4f59\uff0c\u6709\u52a9\u4e8e\u4f7f\u4e91\u66f4\u52a0\u53ef\u9760\u3002 message.select.instance=\u8bf7\u9009\u62e9\u4e00\u4e2a\u5b9e\u4f8b\u3002 message.select.iso=\u8bf7\u4e3a\u60a8\u7684\u65b0\u865a\u62df\u5b9e\u4f8b\u9009\u62e9\u4e00\u4e2a ISO\u3002 message.select.item=\u8bf7\u9009\u62e9\u4e00\u4e2a\u9879\u76ee\u3002 message.select.security.groups=\u8bf7\u4e3a\u60a8\u7684\u65b0 VM \u9009\u62e9\u5b89\u5168\u7ec4 message.select.template=\u8bf7\u4e3a\u60a8\u7684\u65b0\u865a\u62df\u5b9e\u4f8b\u9009\u62e9\u4e00\u4e2a\u6a21\u677f\u3002 -message.setup.physical.network.during.zone.creation.basic=\u6dfb\u52a0\u57fa\u7840\u8d44\u6e90\u57df\u65f6\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u7269\u7406\u7f51\u7edc\uff0c\u6b64\u7f51\u7edc\u5e94\u4e0e\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u4e2d\u7684 NIC \u76f8\u5bf9\u5e94\u3002\u6b64\u7f51\u7edc\u53ef\u4ee5\u627f\u8f7d\u591a\u79cd\u6d41\u91cf\u7c7b\u578b\u3002

\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u5c06\u5176\u4ed6\u6d41\u91cf\u7c7b\u578b\u62d6\u653e\u5230\u6b64\u7269\u7406\u7f51\u7edc\u3002 -message.setup.physical.network.during.zone.creation=\u6dfb\u52a0\u9ad8\u7ea7\u8d44\u6e90\u57df\u65f6\uff0c\u9700\u8981\u8bbe\u7f6e\u4e00\u4e2a\u6216\u591a\u4e2a\u7269\u7406\u7f51\u7edc\u3002\u6bcf\u4e2a\u7f51\u7edc\u90fd\u4e0e\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u4e2d\u7684\u4e00\u4e2a NIC \u76f8\u5bf9\u5e94\u3002\u6bcf\u4e2a\u7269\u7406\u7f51\u7edc\u4e2d\u53ef\u4ee5\u5305\u542b\u4e00\u79cd\u6216\u591a\u79cd\u6d41\u91cf\u7c7b\u578b\uff0c\u5e76\u5bf9\u8fd9\u4e9b\u6d41\u91cf\u7c7b\u578b\u53ef\u80fd\u7684\u7ec4\u5408\u65b9\u5f0f\u8bbe\u7f6e\u4e86\u67d0\u4e9b\u9650\u5236\u3002

\u53ef\u4ee5\u5c06\u4e00\u79cd\u6216\u591a\u79cd\u6d41\u91cf\u7c7b\u578b\u62d6\u653e\u5230\u6bcf\u4e2a\u7269\u7406\u7f51\u7edc\u4e2d\u3002 +message.select.tier=\u8bf7\u9009\u62e9\u4e00\u4e2a\u5c42 +message.set.default.NIC.manual=\u8bf7\u7acb\u5373\u624b\u52a8\u66f4\u65b0\u6b64 VM \u4e0a\u7684\u9ed8\u8ba4 NIC\u3002 +message.set.default.NIC=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5c06\u6b64 NIC \u8bbe\u7f6e\u4e3a\u6b64 VM \u7684\u9ed8\u8ba4 NIC\u3002 +message.setup.physical.network.during.zone.creation.basic=\u6dfb\u52a0\u57fa\u7840\u533a\u57df\u65f6\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u7269\u7406\u7f51\u7edc\uff0c\u6b64\u7f51\u7edc\u5e94\u4e0e\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u4e2d\u7684 NIC \u76f8\u5bf9\u5e94\u3002\u6b64\u7f51\u7edc\u53ef\u4ee5\u627f\u8f7d\u591a\u79cd\u901a\u4fe1\u7c7b\u578b\u3002

\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u5c06\u5176\u4ed6\u901a\u4fe1\u7c7b\u578b\u62d6\u653e\u5230\u6b64\u7269\u7406\u7f51\u7edc\u3002 +message.setup.physical.network.during.zone.creation=\u6dfb\u52a0\u9ad8\u7ea7\u533a\u57df\u65f6\uff0c\u9700\u8981\u8bbe\u7f6e\u4e00\u4e2a\u6216\u591a\u4e2a\u7269\u7406\u7f51\u7edc\u3002\u6bcf\u4e2a\u7f51\u7edc\u90fd\u4e0e\u865a\u62df\u673a\u7ba1\u7406\u7a0b\u5e8f\u4e2d\u7684\u4e00\u4e2a NIC \u76f8\u5bf9\u5e94\u3002\u6bcf\u4e2a\u7269\u7406\u7f51\u7edc\u4e2d\u53ef\u4ee5\u5305\u542b\u4e00\u79cd\u6216\u591a\u79cd\u901a\u4fe1\u7c7b\u578b\uff0c\u5e76\u5bf9\u8fd9\u4e9b\u901a\u4fe1\u7c7b\u578b\u53ef\u80fd\u7684\u7ec4\u5408\u65b9\u5f0f\u8bbe\u7f6e\u4e86\u67d0\u4e9b\u9650\u5236\u3002

\u53ef\u4ee5\u5c06\u4e00\u79cd\u6216\u591a\u79cd\u901a\u4fe1\u7c7b\u578b\u62d6\u653e\u5230\u6bcf\u4e2a\u7269\u7406\u7f51\u7edc\u4e2d\u3002 message.setup.successful=\u5df2\u6210\u529f\u8bbe\u7f6e\u4e91\! message.snapshot.schedule=\u53ef\u4ee5\u901a\u8fc7\u4ece\u4ee5\u4e0b\u53ef\u7528\u9009\u9879\u4e2d\u8fdb\u884c\u9009\u62e9\u5e76\u5e94\u7528\u60a8\u7684\u7b56\u7565\u9996\u9009\u9879\u6765\u8bbe\u7f6e\u91cd\u73b0\u5feb\u7167\u8ba1\u5212 +message.specifiy.tag.key.value=\u8bf7\u6307\u5b9a\u6807\u8bb0\u5bc6\u94a5\u548c\u503c message.specify.url=\u8bf7\u6307\u5b9a URL message.step.1.continue=\u8bf7\u9009\u62e9\u4e00\u4e2a\u6a21\u677f\u6216 ISO \u4ee5\u7ee7\u7eed message.step.1.desc=\u8bf7\u4e3a\u60a8\u7684\u65b0\u865a\u62df\u5b9e\u4f8b\u9009\u62e9\u4e00\u4e2a\u6a21\u677f\u3002\u8fd8\u53ef\u4ee5\u9009\u62e9\u4e00\u4e2a\u53ef\u5c06 ISO \u6620\u50cf\u5b89\u88c5\u5230\u5176\u4e2d\u7684\u7a7a\u6a21\u677f\u3002 @@ -1765,118 +1820,59 @@ message.step.3.continue=\u8bf7\u9009\u62e9\u4e00\u79cd\u78c1\u76d8\u65b9\u6848\u message.step.3.desc= message.step.4.continue=\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u4e2a\u7f51\u7edc\u4ee5\u7ee7\u7eed message.step.4.desc=\u8bf7\u9009\u62e9\u865a\u62df\u5b9e\u4f8b\u8981\u8fde\u63a5\u5230\u7684\u4e3b\u7f51\u7edc\u3002 -message.storage.traffic=CloudStack \u5185\u90e8\u8d44\u6e90(\u5305\u62ec\u4e0e\u7ba1\u7406\u670d\u52a1\u5668\u901a\u4fe1\u7684\u4efb\u4f55\u7ec4\u4ef6\uff0c\u4f8b\u5982\u4e3b\u673a\u548c CloudStack \u7cfb\u7edf VM)\u4e4b\u95f4\u7684\u6d41\u91cf\u3002\u8bf7\u5728\u6b64\u5904\u914d\u7f6e\u5b58\u50a8\u6d41\u91cf\u3002 +message.storage.traffic=CloudStack \u5185\u90e8\u8d44\u6e90(\u5305\u62ec\u4e0e\u7ba1\u7406\u670d\u52a1\u5668\u901a\u4fe1\u7684\u4efb\u4f55\u7ec4\u4ef6\uff0c\u4f8b\u5982\u4e3b\u673a\u548c CloudStack \u7cfb\u7edf VM)\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u8bf7\u5728\u6b64\u5904\u914d\u7f6e\u5b58\u50a8\u901a\u4fe1\u3002 message.suspend.project=\u662f\u5426\u786e\u5b9e\u8981\u6682\u505c\u6b64\u9879\u76ee? +message.systems.vms.ready=\u7cfb\u7edf VM \u5df2\u5c31\u7eea\u3002 +message.template.copying=\u6b63\u5728\u590d\u5236\u6a21\u677f\u3002 message.template.desc=\u64cd\u4f5c\u7cfb\u7edf\u6620\u50cf\uff0c\u53ef\u7528\u4e8e\u542f\u52a8 VM -message.tooltip.dns.1=\u4f9b\u8d44\u6e90\u57df\u4e2d\u7684 VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\u540d\u79f0\u3002\u8d44\u6e90\u57df\u7684\u516c\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u6b64\u670d\u52a1\u5668\u3002 -message.tooltip.dns.2=\u4f9b\u8d44\u6e90\u57df\u4e2d\u7684 VM \u4f7f\u7528\u7684\u4e8c\u7ea7 DNS \u670d\u52a1\u5668\u540d\u79f0\u3002\u8d44\u6e90\u57df\u7684\u516c\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u6b64\u670d\u52a1\u5668\u3002 -message.tooltip.internal.dns.1=\u4f9b\u8d44\u6e90\u57df\u4e2d\u7684 CloudStack \u5185\u90e8\u7cfb\u7edf VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\u540d\u79f0\u3002\u63d0\u4f9b\u70b9\u7684\u4e13\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u6b64\u670d\u52a1\u5668\u3002 -message.tooltip.internal.dns.2=\u4f9b\u8d44\u6e90\u57df\u4e2d\u7684 CloudStack \u5185\u90e8\u7cfb\u7edf VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\u540d\u79f0\u3002\u63d0\u4f9b\u70b9\u7684\u4e13\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u6b64\u670d\u52a1\u5668\u3002 +message.tier.required=\u201c\u5c42\u201d\u4e3a\u5fc5\u586b\u9879 +message.tooltip.dns.1=\u4f9b\u533a\u57df\u4e2d\u7684 VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\u540d\u79f0\u3002\u533a\u57df\u7684\u516c\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u6b64\u670d\u52a1\u5668\u3002 +message.tooltip.dns.2=\u4f9b\u533a\u57df\u4e2d\u7684 VM \u4f7f\u7528\u7684\u8f85\u52a9 DNS \u670d\u52a1\u5668\u540d\u79f0\u3002\u533a\u57df\u7684\u516c\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u6b64\u670d\u52a1\u5668\u3002 +message.tooltip.internal.dns.1=\u4f9b\u533a\u57df\u4e2d\u7684 CloudStack \u5185\u90e8\u7cfb\u7edf VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\u540d\u79f0\u3002\u63d0\u4f9b\u70b9\u7684\u4e13\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u6b64\u670d\u52a1\u5668\u3002 +message.tooltip.internal.dns.2=\u4f9b\u533a\u57df\u4e2d\u7684 CloudStack \u5185\u90e8\u7cfb\u7edf VM \u4f7f\u7528\u7684 DNS \u670d\u52a1\u5668\u540d\u79f0\u3002\u63d0\u4f9b\u70b9\u7684\u4e13\u7528 IP \u5730\u5740\u5fc5\u987b\u8def\u7531\u5230\u6b64\u670d\u52a1\u5668\u3002 message.tooltip.network.domain=DNS \u540e\u7f00\uff0c\u5c06\u4e3a\u7531\u6765\u5bbe VM \u8bbf\u95ee\u7684\u7f51\u7edc\u521b\u5efa\u4e00\u4e2a\u81ea\u5b9a\u4e49\u57df\u540d\u3002 message.tooltip.pod.name=\u6b64\u63d0\u4f9b\u70b9\u7684\u540d\u79f0\u3002 message.tooltip.reserved.system.gateway=\u63d0\u4f9b\u70b9\u4e2d\u7684\u4e3b\u673a\u7f51\u5173\u3002 message.tooltip.reserved.system.netmask=\u7528\u4e8e\u5b9a\u4e49\u63d0\u4f9b\u70b9\u5b50\u7f51\u7684\u7f51\u7edc\u524d\u7f00\u3002\u8bf7\u4f7f\u7528 CIDR \u7b26\u53f7\u3002 -message.tooltip.zone.name=\u8d44\u6e90\u57df\u540d\u79f0\u3002 +message.tooltip.zone.name=\u533a\u57df\u540d\u79f0\u3002 message.update.os.preference=\u8bf7\u4e3a\u6b64\u4e3b\u673a\u9009\u62e9\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u9996\u9009\u9879\u3002\u9996\u5148\u5c06\u5177\u6709\u76f8\u4f3c\u9996\u9009\u9879\u7684\u6240\u6709\u865a\u62df\u5b9e\u4f8b\u5206\u914d\u81f3\u6b64\u4e3b\u673a\uff0c\u7136\u540e\u518d\u9009\u62e9\u5176\u4ed6\u5b9e\u4f8b\u3002 message.update.resource.count=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u66f4\u65b0\u6b64\u5e10\u6237\u7684\u8d44\u6e90\u6570\u3002 message.update.ssl=\u8bf7\u63d0\u4ea4\u4e00\u4e2a\u65b0\u7684 X.509 \u517c\u5bb9\u7684 SSL \u8bc1\u4e66\uff0c\u4ee5\u4fbf\u5c06\u5176\u66f4\u65b0\u5230\u6bcf\u4e2a\u63a7\u5236\u53f0\u4ee3\u7406\u865a\u62df\u5b9e\u4f8b\: -message.validate.instance.name=\u5b9e\u4f8b\u540d\u79f0\u4e0d\u5f97\u8d85\u8fc7 63 \u4e2a\u5b57\u7b26\u3002\u4ec5\u5141\u8bb8\u4f7f\u7528 ASCII \u5b57\u6bcd a - z \u6216 A - Z\u3001\u6570\u5b57 0 - 9 \u4ee5\u53ca\u8fde\u5b57\u7b26\u3002\u5b9e\u4f8b\u540d\u79f0\u5fc5\u987b\u4ee5\u5b57\u6bcd\u5f00\u5934\u5e76\u4ee5\u5b57\u6bcd\u6216\u6570\u5b57\u7ed3\u675f\u3002 -message.virtual.network.desc=\u60a8\u7684\u5e10\u6237\u7684\u4e13\u7528\u865a\u62df\u7f51\u7edc\u3002\u5e7f\u64ad\u57df\u5305\u542b\u5728 VLAN \u4e2d\uff0c\u5e76\u4e14\u6240\u6709\u516c\u7528\u7f51\u7edc\u8bbf\u95ee\u90fd\u7531\u865a\u62df\u8def\u7531\u5668\u8def\u7531\u51fa\u53bb\u3002 -message.vm.create.template.confirm=\u521b\u5efa\u6a21\u677f\u5c06\u81ea\u52a8\u91cd\u65b0\u542f\u52a8 VM\u3002 -message.vm.review.launch=\u8bf7\u5148\u6838\u5bf9\u4ee5\u4e0b\u4fe1\u606f\uff0c\u786e\u8ba4\u60a8\u7684\u865a\u62df\u5b9e\u4f8b\u6b63\u786e\u65e0\u8bef\uff0c\u7136\u540e\u518d\u542f\u52a8\u3002 -message.volume.create.template.confirm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4e3a\u6b64\u78c1\u76d8\u5377\u521b\u5efa\u4e00\u4e2a\u6a21\u677f\u3002\u521b\u5efa\u6a21\u677f\u53ef\u80fd\u9700\u8981\u51e0\u5206\u949f\u5230\u66f4\u957f\u7684\u65f6\u95f4\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u5377\u7684\u5927\u5c0f\u3002 -message.you.must.have.at.least.one.physical.network=\u60a8\u5fc5\u987b\u81f3\u5c11\u62e5\u6709\u4e00\u4e2a\u7269\u7406\u7f51\u7edc -message.zone.creation.complete.would.you.like.to.enable.this.zone=\u5df2\u5b8c\u6210\u521b\u5efa\u8d44\u6e90\u57df\u3002\u662f\u5426\u8981\u542f\u7528\u6b64\u8d44\u6e90\u57df? -message.Zone.creation.complete=\u5df2\u5b8c\u6210\u521b\u5efa\u8d44\u6e90\u57df -message.zone.no.network.selection=\u6240\u9009\u8d44\u6e90\u57df\u65e0\u4efb\u4f55\u7f51\u7edc\u9009\u9879\u3002 -message.zone.step.1.desc=\u8bf7\u4e3a\u60a8\u7684\u8d44\u6e90\u57df\u9009\u62e9\u4e00\u79cd\u7f51\u7edc\u6a21\u5f0f\u3002 -message.zone.step.2.desc=\u8bf7\u8f93\u5165\u4ee5\u4e0b\u4fe1\u606f\u4ee5\u6dfb\u52a0\u4e00\u4e2a\u65b0\u8d44\u6e90\u57df -message.zone.step.3.desc=\u8bf7\u8f93\u5165\u4ee5\u4e0b\u4fe1\u606f\u4ee5\u6dfb\u52a0\u4e00\u4e2a\u65b0\u63d0\u4f9b\u70b9 -message.zoneWizard.enable.local.storage=\u8b66\u544a\: \u5982\u679c\u4e3a\u6b64\u8d44\u6e90\u57df\u542f\u7528\u4e86\u672c\u5730\u5b58\u50a8\uff0c\u5219\u5fc5\u987b\u6267\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u60a8\u5e0c\u671b\u542f\u52a8\u7cfb\u7edf VM \u7684\u4f4d\u7f6e\:

1. \u5982\u679c\u9700\u8981\u5728\u4e3b\u5b58\u50a8\u4e2d\u542f\u52a8\u7cfb\u7edf VM\uff0c\u5219\u5fc5\u987b\u5728\u5b8c\u6210\u521b\u5efa\u540e\u5c06\u4e3b\u5b58\u50a8\u6dfb\u52a0\u5230\u6b64\u8d44\u6e90\u57df\u4e2d\u3002

2. \u5982\u679c\u9700\u8981\u5728\u672c\u5730\u5b58\u50a8\u4e2d\u542f\u52a8\u7cfb\u7edf VM\uff0c\u5219\u5fc5\u987b\u5c06 system.vm.use.local.storage \u8bbe\u7f6e\u4e3a true\u3002


\u662f\u5426\u8981\u7ee7\u7eed? -message.validate.fieldrequired=\u6b64\u5b57\u6bb5\u4e3a\u5fc5\u586b\u5b57\u6bb5\u3002 -message.validate.fixfield=\u8bf7\u4fee\u590d\u6b64\u5b57\u6bb5\u3002 -message.validate.email.address=\u8bf7\u8f93\u5165\u4e00\u4e2a\u6709\u6548\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u3002 -message.validate.URL=\u8bf7\u8f93\u5165\u6709\u6548\u7684 URL\u3002 -message.validate.date=\u8bf7\u8f93\u5165\u6709\u6548\u7684\u65e5\u671f\u3002 +message.validate.accept=\u8bf7\u8f93\u5165\u4e00\u4e2a\u5e26\u6709\u6709\u6548\u6269\u5c55\u540d\u7684\u503c\u3002 +message.validate.creditcard=\u8bf7\u8f93\u5165\u4e00\u4e2a\u6709\u6548\u7684\u4fe1\u7528\u5361\u5361\u53f7\u3002 message.validate.date.ISO=\u8bf7\u8f93\u5165\u6709\u6548\u7684\u65e5\u671f(ISO)\u3002 -message.validate.number=\u8bf7\u8f93\u5165\u4e00\u4e2a\u6709\u6548\u6570\u5b57\u3002 +message.validate.date=\u8bf7\u8f93\u5165\u6709\u6548\u7684\u65e5\u671f\u3002 message.validate.digits=\u8bf7\u4ec5\u8f93\u5165\u6570\u5b57\u3002 -message.validate.creditcard=\u8bf7\u8f93\u5165\u4e00\u4e2a\u6709\u6548\u7684\u4fe1\u7528\u5361\u5361\u53f7\u3002 +message.validate.email.address=\u8bf7\u8f93\u5165\u4e00\u4e2a\u6709\u6548\u7684\u7535\u5b50\u90ae\u4ef6\u5730\u5740\u3002 message.validate.equalto=\u8bf7\u91cd\u65b0\u8f93\u5165\u76f8\u540c\u7684\u503c\u3002 -message.validate.accept=\u8bf7\u8f93\u5165\u4e00\u4e2a\u5e26\u6709\u6709\u6548\u6269\u5c55\u540d\u7684\u503c\u3002 +message.validate.fieldrequired=\u6b64\u5b57\u6bb5\u4e3a\u5fc5\u586b\u5b57\u6bb5\u3002 +message.validate.fixfield=\u8bf7\u4fee\u590d\u6b64\u5b57\u6bb5\u3002 +message.validate.instance.name=\u5b9e\u4f8b\u540d\u79f0\u4e0d\u5f97\u8d85\u8fc7 63 \u4e2a\u5b57\u7b26\u3002\u4ec5\u5141\u8bb8\u4f7f\u7528 ASCII \u5b57\u6bcd a - z \u6216 A - Z\u3001\u6570\u5b57 0 - 9 \u4ee5\u53ca\u8fde\u5b57\u7b26\u3002\u5b9e\u4f8b\u540d\u79f0\u5fc5\u987b\u4ee5\u5b57\u6bcd\u5f00\u5934\u5e76\u4ee5\u5b57\u6bcd\u6216\u6570\u5b57\u7ed3\u675f\u3002 +message.validate.invalid.characters=\u67e5\u627e\u5230\u65e0\u6548\u5b57\u7b26\uff0c\u8bf7\u66f4\u6b63\u3002 message.validate.maxlength=\u8bf7\u6700\u591a\u8f93\u5165 {0} \u4e2a\u5b57\u7b26\u3002 +message.validate.max=\u8bf7\u8f93\u5165\u4e00\u4e2a\u5c0f\u4e8e\u6216\u7b49\u4e8e {0} \u7684\u503c\u3002 message.validate.minlength=\u8bf7\u81f3\u5c11\u8f93\u5165 {0} \u4e2a\u5b57\u7b26\u3002 +message.validate.number=\u8bf7\u8f93\u5165\u4e00\u4e2a\u6709\u6548\u6570\u5b57\u3002 message.validate.range.length=\u8bf7\u8f93\u5165\u4e00\u4e2a\u957f\u5ea6\u4ecb\u4e8e {0} \u5230 {1} \u4e4b\u95f4\u7684\u503c\u3002 message.validate.range=\u8bf7\u8f93\u5165\u4e00\u4e2a\u4ecb\u4e8e {0} \u5230 {1} \u4e4b\u95f4\u7684\u503c\u3002 -message.validate.max=\u8bf7\u8f93\u5165\u4e00\u4e2a\u5c0f\u4e8e\u6216\u7b49\u4e8e {0} \u7684\u503c\u3002 -messgae.validate.min=\u8bf7\u8f93\u5165\u4e00\u4e2a\u5927\u4e8e\u6216\u7b49\u4e8e {0} \u7684\u503c\u3002 -message.creating.systemVM=\u6b63\u5728\u521b\u5efa\u7cfb\u7edf VM (\u6b64\u64cd\u4f5c\u53ef\u80fd\u9700\u8981\u4e00\u4e9b\u65f6\u95f4) -message.enabling.zone.dots=\u6b63\u5728\u542f\u7528\u8d44\u6e90\u57df... -message.restoreVM=\u662f\u5426\u8981\u8fd8\u539f\u6b64 VM? -message.no.host.available=\u6ca1\u6709\u53ef\u7528\u4e8e\u8fc1\u79fb\u7684\u4e3b\u673a -message.network.addVM.desc=\u8bf7\u6307\u5b9a\u8981\u5c06\u6b64 VM \u6dfb\u52a0\u5230\u7684\u7f51\u7edc\u3002\u5c06\u4e3a\u6b64\u7f51\u7edc\u6dfb\u52a0\u4e00\u4e2a\u65b0 NIC\u3002 -message.network.addVMNIC=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4e3a\u6b64\u7f51\u7edc\u6dfb\u52a0\u4e00\u4e2a\u65b0 VM NIC\u3002 -message.set.default.NIC=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5c06\u6b64 NIC \u8bbe\u7f6e\u4e3a\u6b64 VM \u7684\u9ed8\u8ba4 NIC\u3002 -message.set.default.NIC.manual=\u8bf7\u7acb\u5373\u624b\u52a8\u66f4\u65b0\u6b64 VM \u4e0a\u7684\u9ed8\u8ba4 NIC\u3002 -message.instance.scaled.up.confirm=\u662f\u5426\u786e\u5b9e\u8981\u6269\u5c55\u60a8\u7684\u5b9e\u4f8b? -message.copy.template.confirm=\u662f\u5426\u786e\u5b9e\u8981\u590d\u5236\u6a21\u677f? -message.template.copying=\u6b63\u5728\u590d\u5236\u6a21\u677f\u3002 -message.XSTools61plus.update.failed=\u65e0\u6cd5\u66f4\u65b0\u201cXenServer Tools \u7248\u672c 6.1\+\u201d\u5b57\u6bb5\u3002\u9519\u8bef\: -message.gslb.delete.confirm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u6b64 GSLB -message.portable.ip.delete.confirm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u53ef\u79fb\u690d IP \u8303\u56f4 -message.gslb.lb.remove.confirm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4ece GSLB \u4e2d\u5220\u9664\u8d1f\u8f7d\u5e73\u8861 -message.admin.guide.read=\u5bf9\u4e8e\u57fa\u4e8e VMware \u7684 VM\uff0c\u8bf7\u5148\u9605\u8bfb\u7ba1\u7406\u6307\u5357\u4e2d\u7684\u52a8\u6001\u6269\u5c55\u90e8\u5206\uff0c\u7136\u540e\u518d\u8fdb\u884c\u6269\u5c55\u3002\u662f\u5426\u8981\u7ee7\u7eed?\, -message.tier.required=\u201c\u5c42\u201d\u4e3a\u5fc5\u586b\u9879 -message.remove.ldap=\u662f\u5426\u786e\u5b9e\u8981\u5220\u9664 LDAP \u914d\u7f6e? -message.action.downloading.template=\u6b63\u5728\u4e0b\u8f7d\u6a21\u677f\u3002 -message.configure.ldap=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u914d\u7f6e LDAP\u3002 -message.confirm.delete.ciscovnmc.resource=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 CiscoVNMC \u8d44\u6e90 -message.confirm.add.vnmc.provider=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u6dfb\u52a0 VNMC \u63d0\u4f9b\u7a0b\u5e8f\u3002 -message.confirm.enable.vnmc.provider=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u7528 VNMC \u63d0\u4f9b\u7a0b\u5e8f\u3002 -message.confirm.disable.vnmc.provider=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u7981\u7528 VNMC \u63d0\u4f9b\u7a0b\u5e8f\u3002 +message.validate.URL=\u8bf7\u8f93\u5165\u6709\u6548\u7684 URL\u3002 +message.virtual.network.desc=\u60a8\u7684\u5e10\u6237\u7684\u4e13\u7528\u865a\u62df\u7f51\u7edc\u3002\u5e7f\u64ad\u57df\u5305\u542b\u5728 VLAN \u4e2d\uff0c\u5e76\u4e14\u6240\u6709\u516c\u7528\u7f51\u7edc\u8bbf\u95ee\u90fd\u7531\u865a\u62df\u8def\u7531\u5668\u8def\u7531\u51fa\u53bb\u3002 +message.vm.create.template.confirm=\u521b\u5efa\u6a21\u677f\u5c06\u81ea\u52a8\u91cd\u65b0\u542f\u52a8 VM\u3002 +message.vm.review.launch=\u8bf7\u5148\u6838\u5bf9\u4ee5\u4e0b\u4fe1\u606f\uff0c\u786e\u8ba4\u60a8\u7684\u865a\u62df\u5b9e\u4f8b\u6b63\u786e\u65e0\u8bef\uff0c\u7136\u540e\u518d\u542f\u52a8\u3002 message.vnmc.available.list=\u63d0\u4f9b\u7a0b\u5e8f\u5217\u8868\u4e2d\u672a\u63d0\u4f9b VNMC\u3002 message.vnmc.not.available.list=\u63d0\u4f9b\u7a0b\u5e8f\u5217\u8868\u4e2d\u672a\u63d0\u4f9b VNMC\u3002 -message.confirm.release.dedicate.vlan.range=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u91ca\u653e\u4e13\u7528 VLAN \u8303\u56f4 -message.confirm.start.lb.vm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u542f\u52a8 LB VM -message.confirm.stop.lb.vm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u505c\u6b62 LB VM -message.confirm.remove.vmware.datacenter=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 VMware \u6570\u636e\u4e2d\u5fc3 -message.confirm.dedicate.zone=\u662f\u5426\u8981\u5c06\u6b64\u8d44\u6e90\u57df\u4e13\u7528\u4e8e\u57df/\u5e10\u6237? -message.confirm.release.dedicated.zone=\u662f\u5426\u8981\u91ca\u653e\u6b64\u4e13\u7528\u8d44\u6e90\u57df? -message.dedicated.zone.released=\u5df2\u91ca\u653e\u4e13\u7528\u8d44\u6e90\u57df -message.read.admin.guide.scaling.up=\u5f00\u59cb\u6269\u5c55\u4e4b\u524d\uff0c\u8bf7\u9605\u8bfb\u7ba1\u7406\u6307\u5357\u4e2d\u7684\u52a8\u6001\u6269\u5c55\u90e8\u5206\u3002 -message.confirm.scale.up.system.vm=\u662f\u5426\u786e\u5b9e\u8981\u6269\u5c55\u7cfb\u7edf VM? -message.confirm.upgrade.router.newer.template=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5347\u7ea7\u8def\u7531\u5668\u4ee5\u4f7f\u7528\u66f4\u65b0\u7684\u6a21\u677f -message.confirm.scale.up.router.vm=\u662f\u5426\u786e\u5b9e\u8981\u6269\u5c55\u8def\u7531\u5668 VM? -message.confirm.upgrade.routers.newtemplate=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5347\u7ea7\u6b64\u8d44\u6e90\u57df\u4e2d\u7684\u6240\u6709\u8def\u7531\u5668\u4ee5\u4f7f\u7528\u66f4\u65b0\u7684\u6a21\u677f -message.confirm.upgrade.routers.pod.newtemplate=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5347\u7ea7\u6b64\u63d0\u4f9b\u70b9\u4e2d\u7684\u6240\u6709\u8def\u7531\u5668\u4ee5\u4f7f\u7528\u66f4\u65b0\u7684\u6a21\u677f -message.confirm.upgrade.routers.cluster.newtemplate=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5347\u7ea7\u6b64\u7fa4\u96c6\u4e2d\u7684\u6240\u6709\u8def\u7531\u5668\u4ee5\u4f7f\u7528\u66f4\u65b0\u7684\u6a21\u677f -message.confirm.upgrade.routers.account.newtemplate=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5347\u7ea7\u6b64\u5e10\u6237\u4e2d\u7684\u6240\u6709\u8def\u7531\u5668\u4ee5\u4f7f\u7528\u66f4\u65b0\u7684\u6a21\u677f -message.confirm.dedicate.pod.domain.account=\u662f\u5426\u786e\u5b9e\u8981\u5c06\u6b64\u63d0\u4f9b\u70b9\u4e13\u7528\u4e8e\u57df/\u5e10\u6237? -message.confirm.release.dedicated.pod=\u662f\u5426\u8981\u91ca\u653e\u6b64\u4e13\u7528\u63d0\u4f9b\u70b9? -message.pod.dedication.released=\u5df2\u91ca\u653e\u4e13\u7528\u63d0\u4f9b\u70b9 -message.confirm.dedicate.cluster.domain.account=\u662f\u5426\u786e\u5b9e\u8981\u5c06\u6b64\u7fa4\u96c6\u4e13\u7528\u4e8e\u57df/\u5e10\u6237? -message.cluster.dedicated=\u7fa4\u96c6\u5df2\u4e13\u7528 -message.confirm.release.dedicated.cluster=\u662f\u5426\u8981\u91ca\u653e\u6b64\u4e13\u7528\u7fa4\u96c6? -message.cluster.dedication.released=\u5df2\u91ca\u653e\u4e13\u7528\u7fa4\u96c6 -message.confirm.dedicate.host.domain.account=\u662f\u5426\u786e\u5b9e\u8981\u5c06\u6b64\u4e3b\u673a\u4e13\u7528\u4e8e\u57df/\u5e10\u6237? -message.host.dedicated=\u4e3b\u673a\u5df2\u4e13\u7528 -message.confirm.release.dedicated.host=\u662f\u5426\u8981\u91ca\u653e\u6b64\u4e13\u7528\u4e3b\u673a? -message.host.dedication.released=\u5df2\u91ca\u653e\u4e13\u7528\u4e3b\u673a -message.confirm.delete.ucs.manager=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664 UCS Manager -message.confirm.refresh.blades=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5237\u65b0\u5200\u7247\u5f0f\u670d\u52a1\u5668\u3002 -message.confirm.delete.secondary.staging.store=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u5220\u9664\u4e8c\u7ea7\u6682\u5b58\u5b58\u50a8\u3002 -message.select.tier=\u8bf7\u9009\u62e9\u4e00\u4e2a\u5c42 -message.disallowed.characters=\u7981\u7528\u5b57\u7b26: \<\,\> +message.volume.create.template.confirm=\u8bf7\u786e\u8ba4\u60a8\u786e\u5b9e\u8981\u4e3a\u6b64\u78c1\u76d8\u5377\u521b\u5efa\u4e00\u4e2a\u6a21\u677f\u3002\u521b\u5efa\u6a21\u677f\u53ef\u80fd\u9700\u8981\u51e0\u5206\u949f\u5230\u66f4\u957f\u7684\u65f6\u95f4\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u5377\u7684\u5927\u5c0f\u3002 message.waiting.for.builtin.templates.to.load=\u6b63\u5728\u7b49\u5f85\u52a0\u8f7d\u5185\u7f6e\u6a21\u677f... -message.systems.vms.ready=\u7cfb\u7edf VM \u5df2\u5c31\u7eea\u3002 +message.XSTools61plus.update.failed=\u65e0\u6cd5\u66f4\u65b0\u201cXenServer Tools \u7248\u672c 6.1\\+\u201d\u5b57\u6bb5\u3002\u9519\u8bef\: +message.you.must.have.at.least.one.physical.network=\u60a8\u5fc5\u987b\u81f3\u5c11\u62e5\u6709\u4e00\u4e2a\u7269\u7406\u7f51\u7edc message.your.cloudstack.is.ready=\u60a8\u7684 CloudStack \u5df2\u5c31\u7eea\! -message.specifiy.tag.key.value=\u8bf7\u6307\u5b9a\u6807\u8bb0\u5bc6\u94a5\u548c\u503c -message.enter.seperated.list.multiple.cidrs=\u5982\u679c\u5b58\u5728\u591a\u4e2a CIDR\uff0c\u8bf7\u8f93\u5165\u7528\u9017\u53f7\u5206\u9694\u7684 CIDR \u5217\u8868 -message.disabling.network.offering=\u6b63\u5728\u7981\u7528\u7f51\u7edc\u65b9\u6848 -message.confirm.enable.network.offering=\u662f\u5426\u786e\u5b9e\u8981\u542f\u7528\u6b64\u7f51\u7edc\u65b9\u6848? -message.enabling.network.offering=\u6b63\u5728\u542f\u7528\u7f51\u7edc\u65b9\u6848 -message.confirm.remove.network.offering=\u662f\u5426\u786e\u5b9e\u8981\u5220\u9664\u6b64\u7f51\u7edc\u65b9\u6848? -message.confirm.disable.network.offering=\u662f\u5426\u786e\u5b9e\u8981\u7981\u7528\u6b64\u7f51\u7edc\u65b9\u6848? +message.Zone.creation.complete=\u5df2\u5b8c\u6210\u521b\u5efa\u533a\u57df +message.zone.creation.complete.would.you.like.to.enable.this.zone=\u5df2\u5b8c\u6210\u521b\u5efa\u533a\u57df\u3002\u662f\u5426\u8981\u542f\u7528\u6b64\u533a\u57df? +message.zone.no.network.selection=\u6240\u9009\u533a\u57df\u65e0\u4efb\u4f55\u7f51\u7edc\u9009\u9879\u3002 +message.zone.step.1.desc=\u8bf7\u4e3a\u60a8\u7684\u533a\u57df\u9009\u62e9\u4e00\u79cd\u7f51\u7edc\u6a21\u5f0f\u3002 +message.zone.step.2.desc=\u8bf7\u8f93\u5165\u4ee5\u4e0b\u4fe1\u606f\u4ee5\u6dfb\u52a0\u4e00\u4e2a\u65b0\u533a\u57df +message.zone.step.3.desc=\u8bf7\u8f93\u5165\u4ee5\u4e0b\u4fe1\u606f\u4ee5\u6dfb\u52a0\u4e00\u4e2a\u65b0\u63d0\u4f9b\u70b9 +messgae.validate.min=\u8bf7\u8f93\u5165\u4e00\u4e2a\u5927\u4e8e\u6216\u7b49\u4e8e {0} \u7684\u503c\u3002 mode=\u6a21\u5f0f network.rate=\u7f51\u7edc\u901f\u7387 notification.reboot.instance=\u91cd\u65b0\u542f\u52a8\u5b9e\u4f8b @@ -1894,14 +1890,14 @@ state.Creating=\u6b63\u5728\u521b\u5efa state.Declined=\u5df2\u62d2\u7edd state.Destroyed=\u5df2\u9500\u6bc1 state.Disabled=\u5df2\u7981\u7528 -state.Enabled=\u5df2\u542f\u7528 state.enabled=\u5df2\u542f\u7528 +state.Enabled=\u5df2\u542f\u7528 state.Error=\u9519\u8bef state.Expunging=\u6b63\u5728\u5220\u9664 state.Migrating=\u6b63\u5728\u8fc1\u79fb state.Pending=\u5f85\u5b9a -state.Ready=\u5df2\u5c31\u7eea state.ready=\u5df2\u5c31\u7eea +state.Ready=\u5df2\u5c31\u7eea state.Running=\u6b63\u5728\u8fd0\u884c state.Starting=\u6b63\u5728\u542f\u52a8 state.Stopped=\u5df2\u505c\u6b62 From 32a7d5d387804374c38ed568e2dcd1e9c543873c Mon Sep 17 00:00:00 2001 From: Rajani Karuturi Date: Wed, 11 Jun 2014 14:36:06 +0530 Subject: [PATCH 583/683] Fixed few coverity issues unused assignments, boxing and unboxing of values etc. Signed-off-by: Koushik Das --- .../configuration/ConfigurationManagerImpl.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index d2f5af3b39..010ca7a085 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -954,9 +954,7 @@ private void checkPodAttributes(long podId, String podName, long zoneId, String } // Check if the IP range is valid - if (startIp != null || endIp != null) { - checkIpRange(startIp, endIp, cidrAddress, cidrSize); - } + checkIpRange(startIp, endIp, cidrAddress, cidrSize); // Check if the IP range overlaps with the public ip checkOverlapPublicIpRange(zoneId, startIp, endIp); @@ -1016,7 +1014,7 @@ public boolean deletePod(DeletePodCmd cmd) { @Override public void doInTransactionWithoutResult(TransactionStatus status) { // Delete private ip addresses for the pod if there are any - List privateIps = _privateIpAddressDao.listByPodIdDcId(Long.valueOf(podId), pod.getDataCenterId()); + List privateIps = _privateIpAddressDao.listByPodIdDcId(podId, pod.getDataCenterId()); if (!privateIps.isEmpty()) { if (!(_privateIpAddressDao.deleteIpAddressByPod(podId))) { throw new CloudRuntimeException("Failed to cleanup private ip addresses for pod " + podId); @@ -1517,13 +1515,8 @@ private void checkOverlapPrivateIpRange(Long zoneId, String startIp, String endI @ActionEvent(eventType = EventTypes.EVENT_ZONE_DELETE, eventDescription = "deleting zone", async = false) public boolean deleteZone(DeleteZoneCmd cmd) { - Long userId = CallContext.current().getCallingUserId(); final Long zoneId = cmd.getId(); - if (userId == null) { - userId = Long.valueOf(User.UID_SYSTEM); - } - // Make sure the zone exists if (!validZone(zoneId)) { throw new InvalidParameterValueException("A zone with ID: " + zoneId + " does not exist."); @@ -2044,7 +2037,6 @@ public ServiceOffering createServiceOffering(CreateServiceOfferingCmd cmd) { } } else { allowNetworkRate = true; - ; } if (cmd.getNetworkRate() != null && !allowNetworkRate) { From 9e4e62466a8c3d00ab5381d7ebfeb70466192a55 Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Thu, 12 Jun 2014 13:50:01 +0530 Subject: [PATCH 584/683] CLOUDSTACK-6755: [OVS] Can't create more than 7 GRE tunnel networks in xen cluster XenServer does not create a bridge automatically when VIF from domU is connected to internal network. So there is logic to force bridge creation by creating VIF in dom0 connected to GRE tunnel network. But there is no logic to delete the VIF after bridge gets created. So this fix ensure VIF is delted when atleast there is one domU VIF connected to the network. --- .../xen/resource/CitrixResourceBase.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 93feb07318..1a24f19c8f 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -902,7 +902,9 @@ protected XsLocalNetwork getNativeNetworkForTraffic(Connection conn, TrafficType * if you create a network then create bridge by brctl or openvswitch yourself, * then you will get an expection that is "REQUIRED_NETWROK" when you start a * vm with this network. The soultion is, create a vif of dom0 and plug it in - * network, xenserver will create the bridge on behalf of you + * network, xenserver will create the bridge on behalf of you. But we can not keep the dom0 vif for the entire + * existence of network, as we will seen reach max VIF (8) that can be conencted to a domain. So as soon as we have + * one more VIF for any of the VM, delete dom0 VIF so that we can scale beyond 8 networks on a host. * @throws XmlRpcException * @throws XenAPIException */ @@ -921,7 +923,17 @@ private void enableXenServerNetwork(Connection conn, Network nw, String vifNameL } } - if (dom0vif == null) { + int domuVifCount=0; + Set domUVifs = nw.getVIFs(conn); + Host host = Host.getByUuid(conn, _host.uuid); + for (VIF vif : domUVifs) { + vif.getRecord(conn); + if (vif.getVM(conn).getResidentOn(conn).equals(host)) { + domuVifCount++; + } + } + + if (dom0vif == null && domuVifCount == 0) { s_logger.debug("Create a vif on dom0 for " + networkDesc); VIF.Record vifr = new VIF.Record(); vifr.VM = dom0; @@ -948,6 +960,11 @@ private void enableXenServerNetwork(Connection conn, Network nw, String vifNameL } dom0vif.unplug(conn); } + + if (dom0vif != null && domuVifCount > 1) { + // now that there is at least one more VIF (other than dom0 vif) destroy dom0 VIF + dom0vif.destroy(conn); + } } private synchronized Network setupvSwitchNetwork(Connection conn) { From 62cc238e1276bad1af7934fe5c150fe801b89140 Mon Sep 17 00:00:00 2001 From: Santhosh Edukulla Date: Thu, 12 Jun 2014 16:22:32 +0530 Subject: [PATCH 585/683] CLOUDSTACK-6791 Fixed the issue --- .../cloud/network/guru/DirectNetworkGuru.java | 51 +++++++++++-------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/server/src/com/cloud/network/guru/DirectNetworkGuru.java b/server/src/com/cloud/network/guru/DirectNetworkGuru.java index e570dddfb9..d558a5703b 100755 --- a/server/src/com/cloud/network/guru/DirectNetworkGuru.java +++ b/server/src/com/cloud/network/guru/DirectNetworkGuru.java @@ -21,6 +21,7 @@ import javax.ejb.Local; import javax.inject.Inject; +import com.cloud.utils.exception.CloudRuntimeException; import org.apache.log4j.Logger; import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; @@ -47,10 +48,6 @@ import com.cloud.network.Networks.BroadcastDomainType; import com.cloud.network.Networks.Mode; import com.cloud.network.Networks.TrafficType; -import com.cloud.network.dao.IPAddressDao; -import com.cloud.network.dao.IPAddressVO; -import com.cloud.network.dao.NetworkVO; -import com.cloud.network.dao.UserIpv6AddressDao; import com.cloud.offering.NetworkOffering; import com.cloud.offerings.dao.NetworkOfferingDao; import com.cloud.user.Account; @@ -70,6 +67,11 @@ import com.cloud.vm.VirtualMachineProfile; import com.cloud.vm.dao.NicDao; import com.cloud.vm.dao.NicSecondaryIpDao; +import com.cloud.network.dao.IPAddressDao; +import com.cloud.network.dao.IPAddressVO; +import com.cloud.network.dao.NetworkVO; +import com.cloud.network.dao.UserIpv6AddressDao; + @Local(value = {NetworkGuru.class}) public class DirectNetworkGuru extends AdapterBase implements NetworkGuru { @@ -323,24 +325,33 @@ public void shutdown(NetworkProfile network, NetworkOffering offering) { @DB public boolean trash(Network network, NetworkOffering offering) { //Have to remove all placeholder nics - final List nics = _nicDao.listPlaceholderNicsByNetworkId(network.getId()); - Transaction.execute(new TransactionCallbackNoReturn() { - @Override - public void doInTransactionWithoutResult(TransactionStatus status) { - for (Nic nic : nics) { - if (nic.getIp4Address() != null) { - s_logger.debug("Releasing ip " + nic.getIp4Address() + " of placeholder nic " + nic); - IPAddressVO ip = _ipAddressDao.findByIpAndSourceNetworkId(nic.getNetworkId(), nic.getIp4Address()); - _ipAddrMgr.markIpAsUnavailable(ip.getId()); - _ipAddressDao.unassignIpAddress(ip.getId()); - s_logger.debug("Removing placeholder nic " + nic); - _nicDao.remove(nic.getId()); + try { + long id = network.getId(); + final List nics = _nicDao.listPlaceholderNicsByNetworkId(id); + if (nics != null) { + Transaction.execute(new TransactionCallbackNoReturn() { + @Override + public void doInTransactionWithoutResult(TransactionStatus status) { + for (Nic nic : nics) { + if (nic.getIp4Address() != null) { + s_logger.debug("Releasing ip " + nic.getIp4Address() + " of placeholder nic " + nic); + IPAddressVO ip = _ipAddressDao.findByIpAndSourceNetworkId(nic.getNetworkId(), nic.getIp4Address()); + if (ip != null) { + _ipAddrMgr.markIpAsUnavailable(ip.getId()); + _ipAddressDao.unassignIpAddress(ip.getId()); + s_logger.debug("Removing placeholder nic " + nic); + _nicDao.remove(nic.getId()); + } + } + } } - } + }); } - }); - - return true; + return true; + }catch (Exception e) { + s_logger.error("trash. Exception:" + e.getMessage()); + throw new CloudRuntimeException("trash. Exception:" + e.getMessage(),e); + } } @Override From e9f60ee292109633ae538694107f3450693716d2 Mon Sep 17 00:00:00 2001 From: Jayapal Date: Thu, 12 Jun 2014 16:50:17 +0530 Subject: [PATCH 586/683] CLOUDSTACK-6899: Added vmId in listnics response --- .../org/apache/cloudstack/api/response/NicResponse.java | 8 ++++++++ server/src/com/cloud/api/ApiResponseHelper.java | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/api/src/org/apache/cloudstack/api/response/NicResponse.java b/api/src/org/apache/cloudstack/api/response/NicResponse.java index 3dd8b297a2..2f79d7ff47 100644 --- a/api/src/org/apache/cloudstack/api/response/NicResponse.java +++ b/api/src/org/apache/cloudstack/api/response/NicResponse.java @@ -98,6 +98,14 @@ public class NicResponse extends BaseResponse { @Param(description = "device id for the network when plugged into the virtual machine", since = "4.4") private String deviceId; + @SerializedName(ApiConstants.VIRTUAL_MACHINE_ID) + @Param(description = "Id of the vm to which the nic belongs") + private String vmId; + + public void setVmId(String vmId) { + this.vmId = vmId; + } + public String getId() { return id; } diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index a47f62d718..c4d5ae6235 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -3573,9 +3573,15 @@ public NicSecondaryIpResponse createSecondaryIPToNicResponse(NicSecondaryIp resu public NicResponse createNicResponse(Nic result) { NicResponse response = new NicResponse(); NetworkVO network = _entityMgr.findById(NetworkVO.class, result.getNetworkId()); + VMInstanceVO vm = _entityMgr.findById(VMInstanceVO.class, result.getInstanceId()); response.setId(result.getUuid()); response.setNetworkid(network.getUuid()); + + if (vm != null) { + response.setVmId(vm.getUuid()); + } + response.setIpaddress(result.getIp4Address()); if (result.getSecondaryIp()) { From 4ba3aae2ea0290ca012623083e13625e08a9dde5 Mon Sep 17 00:00:00 2001 From: Santhosh Edukulla Date: Thu, 12 Jun 2014 17:45:48 +0530 Subject: [PATCH 587/683] Fixed coverity issues --- .../com/cloud/upgrade/DatabaseCreator.java | 45 ++-- .../upgrade/DatabaseIntegrityChecker.java | 203 +++++++++++------- .../cloud/upgrade/DatabaseUpgradeChecker.java | 10 +- .../crypt/EncryptionSecretKeyChanger.java | 92 ++------ .../src/com/cloud/utils/db/Merovingian2.java | 8 +- .../src/com/cloud/utils/db/ScriptRunner.java | 2 +- .../com/cloud/utils/db/TransactionLegacy.java | 2 +- server/src/com/cloud/test/IPRangeConfig.java | 168 +++++++-------- .../com/cloud/usage/UsageSanityChecker.java | 47 ++-- .../crypt/EncryptionSecretKeySender.java | 40 ++-- 10 files changed, 291 insertions(+), 326 deletions(-) diff --git a/engine/schema/src/com/cloud/upgrade/DatabaseCreator.java b/engine/schema/src/com/cloud/upgrade/DatabaseCreator.java index 91ef318873..b04607decc 100755 --- a/engine/schema/src/com/cloud/upgrade/DatabaseCreator.java +++ b/engine/schema/src/com/cloud/upgrade/DatabaseCreator.java @@ -20,14 +20,13 @@ import java.io.File; import java.io.FileInputStream; -import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.Reader; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; import java.sql.Statement; +import java.sql.SQLException; +import java.sql.DriverManager; +import java.sql.Connection; import java.util.ArrayList; import java.util.List; import java.util.Properties; @@ -75,13 +74,10 @@ private static void runScript(Connection conn, Reader reader, String filename, b private static void runQuery(String host, String port, String rootPassword, String query, boolean dryRun) { System.out.println("============> Running query: " + query); - Connection conn = null; - try { - conn = DriverManager.getConnection(String.format("jdbc:mysql://%s:%s/", host, port), "root", rootPassword); - Statement stmt = conn.createStatement(); - if (!dryRun) + try (Connection conn = DriverManager.getConnection(String.format("jdbc:mysql://%s:%s/", host, port), "root", rootPassword); + Statement stmt = conn.createStatement();){ + if (!dryRun) stmt.executeUpdate(query); - conn.close(); } catch (SQLException e) { System.out.println("SQL exception in trying initDB: " + e); System.exit(1); @@ -186,24 +182,23 @@ public static void main(String[] args) { } System.out.println("========> Processing SQL file at " + sqlScript.getAbsolutePath()); - Connection conn = TransactionLegacy.getStandaloneConnection(); - try { - FileReader reader = null; - try { - reader = new FileReader(sqlScript); - } catch (FileNotFoundException e) { - System.err.println("Unable to read " + sqlFile + ": " + e.getMessage()); - System.exit(1); - } + + try(Connection conn = TransactionLegacy.getStandaloneConnection(); + FileReader reader = new FileReader(sqlScript); + ) { if (!dryRun) runScript(conn, reader, sqlFile, verbosity); - } finally { - try { - conn.close(); - } catch (SQLException e) { - System.err.println("Unable to close DB connection: " + e.getMessage()); - } + }catch (SQLException e) + { + System.err.println("Sql Exception:" + e.getMessage()); + System.exit(1); + } + catch (IOException e) + { + System.err.println("File IO Exception : " + e.getMessage()); + System.exit(1); } + } TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.CLOUD_DB); diff --git a/engine/schema/src/com/cloud/upgrade/DatabaseIntegrityChecker.java b/engine/schema/src/com/cloud/upgrade/DatabaseIntegrityChecker.java index c20a418313..2001fae052 100755 --- a/engine/schema/src/com/cloud/upgrade/DatabaseIntegrityChecker.java +++ b/engine/schema/src/com/cloud/upgrade/DatabaseIntegrityChecker.java @@ -75,81 +75,106 @@ private String formatDuplicateHostToReadText(Long poolId, ResultSet rs) throws S } private Boolean checkDuplicateHostWithTheSameLocalStorage() { + TransactionLegacy txn = TransactionLegacy.open("Integrity"); - txn.start(); try { - Connection conn; + txn.start(); + Connection conn = txn.getConnection(); + try (PreparedStatement pstmt = + conn.prepareStatement("SELECT pool_id FROM host INNER JOIN storage_pool_host_ref INNER JOIN storage_pool WHERE storage_pool.id = storage_pool_host_ref.pool_id and storage_pool.pool_type='LVM' AND host.id=storage_pool_host_ref.host_id AND host.removed IS NULL group by pool_id having count(*) > 1"); + ResultSet rs = pstmt.executeQuery();) + { + boolean noDuplicate = true; + StringBuffer helpInfo = new StringBuffer(); + String note = + "DATABASE INTEGRITY ERROR\nManagement server detected there are some hosts connect to the same loacal storage, please contact CloudStack support team for solution. Below are detialed info, please attach all of them to CloudStack support. Thank you\n"; + helpInfo.append(note); + while (rs.next()) { + try ( PreparedStatement sel_pstmt = + conn.prepareStatement("select id, status, removed, private_ip_address from host where id in (select host_id from storage_pool_host_ref where pool_id=?)"); + ){ + long poolId = rs.getLong(1); + pstmt.setLong(1, poolId); + try(ResultSet dhrs = sel_pstmt.executeQuery();) { + String help = formatDuplicateHostToReadText(poolId, dhrs); + helpInfo.append(help); + helpInfo.append("\n"); + noDuplicate = false; + } + catch (Exception e) + { + s_logger.error("checkDuplicateHostWithTheSameLocalStorage: Exception :" + e.getMessage()); + throw new CloudRuntimeException("checkDuplicateHostWithTheSameLocalStorage: Exception :" + e.getMessage(),e); + } + } + catch (Exception e) + { + s_logger.error("checkDuplicateHostWithTheSameLocalStorage: Exception :" + e.getMessage()); + throw new CloudRuntimeException("checkDuplicateHostWithTheSameLocalStorage: Exception :" + e.getMessage(),e); + } + } + if (noDuplicate) { + s_logger.debug("No duplicate hosts with the same local storage found in database"); + } else { + s_logger.error(helpInfo.toString()); + } + txn.commit(); + return noDuplicate; + }catch (Exception e) + { + s_logger.error("checkDuplicateHostWithTheSameLocalStorage: Exception :" + e.getMessage()); + throw new CloudRuntimeException("checkDuplicateHostWithTheSameLocalStorage: Exception :" + e.getMessage(),e); + } + } + catch (Exception e) + { + s_logger.error("checkDuplicateHostWithTheSameLocalStorage: Exception :" + e.getMessage()); + throw new CloudRuntimeException("checkDuplicateHostWithTheSameLocalStorage: Exception :" + e.getMessage(),e); + } + finally + { try { - conn = txn.getConnection(); - PreparedStatement pstmt = - conn.prepareStatement("SELECT pool_id FROM host INNER JOIN storage_pool_host_ref INNER JOIN storage_pool WHERE storage_pool.id = storage_pool_host_ref.pool_id and storage_pool.pool_type='LVM' AND host.id=storage_pool_host_ref.host_id AND host.removed IS NULL group by pool_id having count(*) > 1"); - ResultSet rs = pstmt.executeQuery(); - - boolean noDuplicate = true; - StringBuffer helpInfo = new StringBuffer(); - String note = - "DATABASE INTEGRITY ERROR\nManagement server detected there are some hosts connect to the same loacal storage, please contact CloudStack support team for solution. Below are detialed info, please attach all of them to CloudStack support. Thank you\n"; - helpInfo.append(note); - while (rs.next()) { - long poolId = rs.getLong(1); - pstmt = - conn.prepareStatement("select id, status, removed, private_ip_address from host where id in (select host_id from storage_pool_host_ref where pool_id=?)"); - pstmt.setLong(1, poolId); - ResultSet dhrs = pstmt.executeQuery(); - String help = formatDuplicateHostToReadText(poolId, dhrs); - helpInfo.append(help); - helpInfo.append("\n"); - noDuplicate = false; + if (txn != null) { + txn.close(); } - - if (noDuplicate) { - s_logger.debug("No duplicate hosts with the same local storage found in database"); - } else { - s_logger.error(helpInfo.toString()); - } - - return noDuplicate; - } catch (SQLException e) { - s_logger.error("Unable to check duplicate hosts with the same local storage in database", e); - throw new CloudRuntimeException("Unable to check duplicate hosts with the same local storage in database", e); + }catch(Exception e) + { + s_logger.error("checkDuplicateHostWithTheSameLocalStorage: Exception:"+ e.getMessage()); } - } finally { - txn.commit(); - txn.close(); } } private boolean check21to22PremiumUprage(Connection conn) throws SQLException { - PreparedStatement pstmt = conn.prepareStatement("show tables in cloud_usage"); - ResultSet rs = pstmt.executeQuery(); - int num = 0; - - while (rs.next()) { - String tableName = rs.getString(1); - if (tableName.equalsIgnoreCase("usage_event") || tableName.equalsIgnoreCase("usage_port_forwarding") || tableName.equalsIgnoreCase("usage_network_offering")) { - num++; - s_logger.debug("Checking 21to22PremiumUprage table " + tableName + " found"); - } - if (num == 3) { - return true; + try (PreparedStatement pstmt = conn.prepareStatement("show tables in cloud_usage"); + ResultSet rs = pstmt.executeQuery();) { + int num = 0; + while (rs.next()) { + String tableName = rs.getString(1); + if (tableName.equalsIgnoreCase("usage_event") || tableName.equalsIgnoreCase("usage_port_forwarding") || tableName.equalsIgnoreCase("usage_network_offering")) { + num++; + s_logger.debug("Checking 21to22PremiumUprage table " + tableName + " found"); + } + if (num == 3) { + return true; + } } + return false; } - - return false; } private boolean isColumnExisted(Connection conn, String dbName, String tableName, String column) throws SQLException { - PreparedStatement pstmt = conn.prepareStatement(String.format("describe %1$s.%2$s", dbName, tableName)); - ResultSet rs = pstmt.executeQuery(); - boolean found = false; - while (rs.next()) { - if (column.equalsIgnoreCase(rs.getString(1))) { - s_logger.debug(String.format("Column %1$s.%2$s.%3$s found", dbName, tableName, column)); - found = true; - break; + try (PreparedStatement pstmt = conn.prepareStatement(String.format("describe %1$s.%2$s", dbName, tableName)); + ResultSet rs = pstmt.executeQuery();) { + boolean found = false; + while (rs.next()) { + if (column.equalsIgnoreCase(rs.getString(1))) { + s_logger.debug(String.format("Column %1$s.%2$s.%3$s found", dbName, tableName, column)); + found = true; + break; + } } + return found; } - return found; } private boolean check221to222PremiumUprage(Connection conn) throws SQLException { @@ -174,22 +199,23 @@ private boolean check222to224PremiumUpgrade(Connection conn) throws SQLException private boolean checkMissedPremiumUpgradeFor228() { TransactionLegacy txn = TransactionLegacy.open("Integrity"); - txn.start(); try { - String dbVersion = _dao.getCurrentVersion(); - - if (dbVersion == null) - return false; + txn.start(); + Connection conn = txn.getConnection(); + try ( + PreparedStatement pstmt = conn.prepareStatement("show databases"); + ResultSet rs = pstmt.executeQuery();) { + String dbVersion = _dao.getCurrentVersion(); - if (Version.compare(Version.trimToPatch(dbVersion), Version.trimToPatch("2.2.8")) != 0) { - return true; - } + if (dbVersion == null) { + txn.commit(); + return false; + } - Connection conn; - try { - conn = txn.getConnection(); - PreparedStatement pstmt = conn.prepareStatement("show databases"); - ResultSet rs = pstmt.executeQuery(); + if (Version.compare(Version.trimToPatch(dbVersion), Version.trimToPatch("2.2.8")) != 0) { + txn.commit(); + return true; + } boolean hasUsage = false; while (rs.next()) { String dbName = rs.getString(1); @@ -198,35 +224,46 @@ private boolean checkMissedPremiumUpgradeFor228() { break; } } - if (!hasUsage) { s_logger.debug("No cloud_usage found in database, no need to check missed premium upgrade"); + txn.commit(); return true; } - if (!check21to22PremiumUprage(conn)) { s_logger.error("21to22 premium upgrade missed"); + txn.commit(); return false; } - if (!check221to222PremiumUprage(conn)) { s_logger.error("221to222 premium upgrade missed"); + txn.commit(); return false; } - if (!check222to224PremiumUpgrade(conn)) { s_logger.error("222to224 premium upgrade missed"); + txn.commit(); return false; } - + txn.commit(); return true; - } catch (SQLException e) { - s_logger.error("Unable to check missed premiumg upgrade"); - throw new CloudRuntimeException("Unable to check missed premiumg upgrade"); + } catch (Exception e) { + s_logger.error("checkMissedPremiumUpgradeFor228: Exception:" + e.getMessage()); + throw new CloudRuntimeException("checkMissedPremiumUpgradeFor228: Exception:" + e.getMessage(), e); + } + }catch (Exception e) { + s_logger.error("checkMissedPremiumUpgradeFor228: Exception:"+ e.getMessage()); + throw new CloudRuntimeException("checkMissedPremiumUpgradeFor228: Exception:" + e.getMessage(),e); + } + finally + { + try { + if (txn != null) { + txn.close(); + } + }catch(Exception e) + { + s_logger.error("checkMissedPremiumUpgradeFor228: Exception:"+ e.getMessage()); } - } finally { - txn.commit(); - txn.close(); } } diff --git a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java index 0761c9fe61..8586ed484e 100755 --- a/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java +++ b/engine/schema/src/com/cloud/upgrade/DatabaseUpgradeChecker.java @@ -237,8 +237,8 @@ public DatabaseUpgradeChecker() { } protected void runScript(Connection conn, File file) { - try { - FileReader reader = new FileReader(file); + + try(FileReader reader = new FileReader(file);) { ScriptRunner runner = new ScriptRunner(conn, false, true); runner.runScript(reader); } catch (FileNotFoundException e) { @@ -251,6 +251,7 @@ protected void runScript(Connection conn, File file) { s_logger.error("Unable to execute upgrade script: " + file.getAbsolutePath(), e); throw new CloudRuntimeException("Unable to execute upgrade script: " + file.getAbsolutePath(), e); } + } protected void upgrade(String dbVersion, String currentVersion) { @@ -314,10 +315,9 @@ protected void upgrade(String dbVersion, String currentVersion) { // we don't have VersionDao in 2.1.x upgradeVersion = false; } else if (upgrade.getUpgradedVersion().equals("2.2.4")) { - try { + try(PreparedStatement pstmt = conn.prepareStatement("SELECT * FROM version WHERE version='2.2.4'"); + ResultSet rs = pstmt.executeQuery();) { // specifically for domain vlan update from 2.1.8 to 2.2.4 - PreparedStatement pstmt = conn.prepareStatement("SELECT * FROM version WHERE version='2.2.4'"); - ResultSet rs = pstmt.executeQuery(); if (rs.next()) { upgradeVersion = false; } diff --git a/framework/db/src/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java b/framework/db/src/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java index 58584f93a1..4cee081724 100755 --- a/framework/db/src/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java +++ b/framework/db/src/com/cloud/utils/crypt/EncryptionSecretKeyChanger.java @@ -266,11 +266,10 @@ private String migrateValue(String value) { private void migrateConfigValues(Connection conn) { System.out.println("Begin migrate config values"); - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - pstmt = conn.prepareStatement("select name, value from configuration where category in ('Hidden', 'Secure')"); - rs = pstmt.executeQuery(); + try(PreparedStatement select_pstmt = conn.prepareStatement("select name, value from configuration where category in ('Hidden', 'Secure')"); + ResultSet rs = select_pstmt.executeQuery(); + PreparedStatement update_pstmt = conn.prepareStatement("update configuration set value=? where name=?"); + ) { while (rs.next()) { String name = rs.getString(1); String value = rs.getString(2); @@ -278,37 +277,25 @@ private void migrateConfigValues(Connection conn) { continue; } String encryptedValue = migrateValue(value); - pstmt = conn.prepareStatement("update configuration set value=? where name=?"); - pstmt.setBytes(1, encryptedValue.getBytes("UTF-8")); - pstmt.setString(2, name); - pstmt.executeUpdate(); + update_pstmt.setBytes(1, encryptedValue.getBytes("UTF-8")); + update_pstmt.setString(2, name); + update_pstmt.executeUpdate(); } } catch (SQLException e) { throw new CloudRuntimeException("Unable to update configuration values ", e); } catch (UnsupportedEncodingException e) { throw new CloudRuntimeException("Unable to update configuration values ", e); - } finally { - try { - if (rs != null) { - rs.close(); - } - - if (pstmt != null) { - pstmt.close(); - } - } catch (SQLException e) { - } } System.out.println("End migrate config values"); } private void migrateHostDetails(Connection conn) { System.out.println("Begin migrate host details"); - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - pstmt = conn.prepareStatement("select id, value from host_details where name = 'password'"); - rs = pstmt.executeQuery(); + + try( PreparedStatement sel_pstmt = conn.prepareStatement("select id, value from host_details where name = 'password'"); + ResultSet rs = sel_pstmt.executeQuery(); + PreparedStatement pstmt = conn.prepareStatement("update host_details set value=? where id=?"); + ) { while (rs.next()) { long id = rs.getLong(1); String value = rs.getString(2); @@ -316,7 +303,6 @@ private void migrateHostDetails(Connection conn) { continue; } String encryptedValue = migrateValue(value); - pstmt = conn.prepareStatement("update host_details set value=? where id=?"); pstmt.setBytes(1, encryptedValue.getBytes("UTF-8")); pstmt.setLong(2, id); pstmt.executeUpdate(); @@ -325,28 +311,16 @@ private void migrateHostDetails(Connection conn) { throw new CloudRuntimeException("Unable update host_details values ", e); } catch (UnsupportedEncodingException e) { throw new CloudRuntimeException("Unable update host_details values ", e); - } finally { - try { - if (rs != null) { - rs.close(); - } - - if (pstmt != null) { - pstmt.close(); - } - } catch (SQLException e) { - } } System.out.println("End migrate host details"); } private void migrateVNCPassword(Connection conn) { System.out.println("Begin migrate VNC password"); - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - pstmt = conn.prepareStatement("select id, vnc_password from vm_instance"); - rs = pstmt.executeQuery(); + try(PreparedStatement select_pstmt = conn.prepareStatement("select id, vnc_password from vm_instance"); + ResultSet rs = select_pstmt.executeQuery(); + PreparedStatement pstmt = conn.prepareStatement("update vm_instance set vnc_password=? where id=?"); + ) { while (rs.next()) { long id = rs.getLong(1); String value = rs.getString(2); @@ -354,7 +328,7 @@ private void migrateVNCPassword(Connection conn) { continue; } String encryptedValue = migrateValue(value); - pstmt = conn.prepareStatement("update vm_instance set vnc_password=? where id=?"); + pstmt.setBytes(1, encryptedValue.getBytes("UTF-8")); pstmt.setLong(2, id); pstmt.executeUpdate(); @@ -363,28 +337,16 @@ private void migrateVNCPassword(Connection conn) { throw new CloudRuntimeException("Unable update vm_instance vnc_password ", e); } catch (UnsupportedEncodingException e) { throw new CloudRuntimeException("Unable update vm_instance vnc_password ", e); - } finally { - try { - if (rs != null) { - rs.close(); - } - - if (pstmt != null) { - pstmt.close(); - } - } catch (SQLException e) { - } } System.out.println("End migrate VNC password"); } private void migrateUserCredentials(Connection conn) { System.out.println("Begin migrate user credentials"); - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - pstmt = conn.prepareStatement("select id, secret_key from user"); - rs = pstmt.executeQuery(); + try(PreparedStatement select_pstmt = conn.prepareStatement("select id, secret_key from user"); + ResultSet rs = select_pstmt.executeQuery(); + PreparedStatement pstmt = conn.prepareStatement("update user set secret_key=? where id=?"); + ) { while (rs.next()) { long id = rs.getLong(1); String secretKey = rs.getString(2); @@ -392,7 +354,6 @@ private void migrateUserCredentials(Connection conn) { continue; } String encryptedSecretKey = migrateValue(secretKey); - pstmt = conn.prepareStatement("update user set secret_key=? where id=?"); pstmt.setBytes(1, encryptedSecretKey.getBytes("UTF-8")); pstmt.setLong(2, id); pstmt.executeUpdate(); @@ -401,17 +362,6 @@ private void migrateUserCredentials(Connection conn) { throw new CloudRuntimeException("Unable update user secret key ", e); } catch (UnsupportedEncodingException e) { throw new CloudRuntimeException("Unable update user secret key ", e); - } finally { - try { - if (rs != null) { - rs.close(); - } - - if (pstmt != null) { - pstmt.close(); - } - } catch (SQLException e) { - } } System.out.println("End migrate user credentials"); } diff --git a/framework/db/src/com/cloud/utils/db/Merovingian2.java b/framework/db/src/com/cloud/utils/db/Merovingian2.java index 6eeea9f385..4e2c684a8a 100644 --- a/framework/db/src/com/cloud/utils/db/Merovingian2.java +++ b/framework/db/src/com/cloud/utils/db/Merovingian2.java @@ -444,14 +444,12 @@ public void cleanupThread() { @Override public boolean releaseLockAsLastResortAndIReallyKnowWhatIAmDoing(String key) { s_logger.info("Releasing a lock from JMX lck-" + key); - PreparedStatement pstmt = null; - try { - pstmt = _concierge.conn().prepareStatement(RELEASE_LOCK_SQL); + try(PreparedStatement pstmt = _concierge.conn().prepareStatement(RELEASE_LOCK_SQL);) { pstmt.setString(1, key); int rows = pstmt.executeUpdate(); return rows > 0; - } catch (SQLException e) { - s_logger.error("Unable to release lock " + key, e); + } catch (Exception e) { + s_logger.error("releaseLockAsLastResortAndIReallyKnowWhatIAmDoing : Exception: " + e.getMessage()); return false; } } diff --git a/framework/db/src/com/cloud/utils/db/ScriptRunner.java b/framework/db/src/com/cloud/utils/db/ScriptRunner.java index 66145277bf..932b37baf4 100644 --- a/framework/db/src/com/cloud/utils/db/ScriptRunner.java +++ b/framework/db/src/com/cloud/utils/db/ScriptRunner.java @@ -162,7 +162,7 @@ private void runScript(Connection conn, Reader reader) throws IOException, SQLEx } println(""); while (rs.next()) { - for (int i = 0; i < cols; i++) { + for (int i = 1; i <= cols; i++) { String value = rs.getString(i); print(value + "\t"); } diff --git a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java index ac0ea21d1f..aedf93982b 100755 --- a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java +++ b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java @@ -791,7 +791,7 @@ protected void removeUpTo(String type, Object ref) { it.remove(); try { - if (item.type == type && (ref == null || item.ref == ref)) { + if ( (type == null || type.equals(item.type)) && (ref == null || ref.equals(item.ref))) { break; } diff --git a/server/src/com/cloud/test/IPRangeConfig.java b/server/src/com/cloud/test/IPRangeConfig.java index 1d56471408..29feba6119 100755 --- a/server/src/com/cloud/test/IPRangeConfig.java +++ b/server/src/com/cloud/test/IPRangeConfig.java @@ -318,31 +318,31 @@ private Vector deletePublicIPRange(TransactionLegacy txn, long startIP, String isPublicIPAllocatedSelectSql = "SELECT * FROM `cloud`.`user_ip_address` WHERE public_ip_address = ? AND vlan_id = ?"; Vector problemIPs = new Vector(); - PreparedStatement stmt = null; - PreparedStatement isAllocatedStmt = null; - Connection conn = null; try { conn = txn.getConnection(); - stmt = conn.prepareStatement(deleteSql); - isAllocatedStmt = conn.prepareStatement(isPublicIPAllocatedSelectSql); - } catch (SQLException e) { + } + catch (SQLException e) { + System.out.println("deletePublicIPRange. Exception: " +e.getMessage()); return null; } - - while (startIP <= endIP) { - if (!isPublicIPAllocated(startIP, vlanDbId, isAllocatedStmt)) { - try { - stmt.clearParameters(); - stmt.setLong(1, startIP); - stmt.setLong(2, vlanDbId); - stmt.executeUpdate(); - } catch (Exception ex) { + try(PreparedStatement stmt = conn.prepareStatement(deleteSql); + PreparedStatement isAllocatedStmt = conn.prepareStatement(isPublicIPAllocatedSelectSql);) { + while (startIP <= endIP) { + if (!isPublicIPAllocated(startIP, vlanDbId, isAllocatedStmt)) { + stmt.clearParameters(); + stmt.setLong(1, startIP); + stmt.setLong(2, vlanDbId); + stmt.executeUpdate(); + } + else { + problemIPs.add(NetUtils.long2Ip(startIP)); } - } else { - problemIPs.add(NetUtils.long2Ip(startIP)); + startIP += 1; } - startIP += 1; + }catch (Exception ex) { + System.out.println("deletePublicIPRange. Exception: " +ex.getMessage()); + return null; } return problemIPs; @@ -351,52 +351,46 @@ private Vector deletePublicIPRange(TransactionLegacy txn, long startIP, private Vector deletePrivateIPRange(TransactionLegacy txn, long startIP, long endIP, long podId, long zoneId) { String deleteSql = "DELETE FROM `cloud`.`op_dc_ip_address_alloc` WHERE ip_address = ? AND pod_id = ? AND data_center_id = ?"; String isPrivateIPAllocatedSelectSql = "SELECT * FROM `cloud`.`op_dc_ip_address_alloc` WHERE ip_address = ? AND data_center_id = ? AND pod_id = ?"; - Vector problemIPs = new Vector(); - PreparedStatement stmt = null; - PreparedStatement isAllocatedStmt = null; - - Connection conn = null; try { - conn = txn.getConnection(); - stmt = conn.prepareStatement(deleteSql); - isAllocatedStmt = conn.prepareStatement(isPrivateIPAllocatedSelectSql); - } catch (SQLException e) { - System.out.println("Exception: " + e.getMessage()); - printError("Unable to start DB connection to delete private IPs. Please contact Cloud Support."); - } - - while (startIP <= endIP) { - if (!isPrivateIPAllocated(NetUtils.long2Ip(startIP), podId, zoneId, isAllocatedStmt)) { - try { - stmt.clearParameters(); - stmt.setString(1, NetUtils.long2Ip(startIP)); - stmt.setLong(2, podId); - stmt.setLong(3, zoneId); - stmt.executeUpdate(); - } catch (Exception ex) { + Connection conn = txn.getConnection(); + try (PreparedStatement stmt = conn.prepareStatement(deleteSql); + PreparedStatement isAllocatedStmt = conn.prepareStatement(isPrivateIPAllocatedSelectSql);) { + while (startIP <= endIP) { + if (!isPrivateIPAllocated(NetUtils.long2Ip(startIP), podId, zoneId, isAllocatedStmt)) { + stmt.clearParameters(); + stmt.setString(1, NetUtils.long2Ip(startIP)); + stmt.setLong(2, podId); + stmt.setLong(3, zoneId); + stmt.executeUpdate(); + } else { + problemIPs.add(NetUtils.long2Ip(startIP)); + } + startIP += 1; } - } else { - problemIPs.add(NetUtils.long2Ip(startIP)); + } catch (SQLException e) { + System.out.println("deletePrivateIPRange. Exception: " + e.getMessage()); + printError("deletePrivateIPRange. Exception: " + e.getMessage()); } - startIP += 1; + }catch (SQLException e) { + System.out.println("deletePrivateIPRange. Exception: " + e.getMessage()); + printError("deletePrivateIPRange. Exception: " + e.getMessage()); } - return problemIPs; } private boolean isPublicIPAllocated(long ip, long vlanDbId, PreparedStatement stmt) { - try { + try(ResultSet rs = stmt.executeQuery();) { stmt.clearParameters(); stmt.setLong(1, ip); stmt.setLong(2, vlanDbId); - ResultSet rs = stmt.executeQuery(); if (rs.next()) { return (rs.getString("allocated") != null); } else { return false; } - } catch (SQLException ex) { + } + catch (SQLException ex) { System.out.println(ex.getMessage()); return true; } @@ -408,11 +402,16 @@ private boolean isPrivateIPAllocated(String ip, long podId, long zoneId, Prepare stmt.setString(1, ip); stmt.setLong(2, zoneId); stmt.setLong(3, podId); - ResultSet rs = stmt.executeQuery(); - if (rs.next()) { - return (rs.getString("taken") != null); - } else { - return false; + try(ResultSet rs = stmt.executeQuery();) { + if (rs.next()) { + return (rs.getString("taken") != null); + } else { + return false; + } + } + catch (Exception ex) { + System.out.println(ex.getMessage()); + return true; } } catch (SQLException ex) { System.out.println(ex.getMessage()); @@ -451,7 +450,6 @@ public Vector savePublicIPRange(TransactionLegacy txn, long startIP, lon "INSERT INTO `cloud`.`user_ip_address` (public_ip_address, data_center_id, vlan_db_id, mac_address, source_network_id, physical_network_id, uuid) VALUES (?, ?, ?, (select mac_address from `cloud`.`data_center` where id=?), ?, ?, ?)"; String updateSql = "UPDATE `cloud`.`data_center` set mac_address = mac_address+1 where id=?"; Vector problemIPs = new Vector(); - PreparedStatement stmt = null; Connection conn = null; try { @@ -459,23 +457,20 @@ public Vector savePublicIPRange(TransactionLegacy txn, long startIP, lon } catch (SQLException e) { return null; } - while (startIP <= endIP) { - try { - stmt = conn.prepareStatement(insertSql); - stmt.setString(1, NetUtils.long2Ip(startIP)); - stmt.setLong(2, zoneId); - stmt.setLong(3, vlanDbId); - stmt.setLong(4, zoneId); - stmt.setLong(5, sourceNetworkId); - stmt.setLong(6, physicalNetworkId); - stmt.setString(7, UUID.randomUUID().toString()); - stmt.executeUpdate(); - stmt.close(); - stmt = conn.prepareStatement(updateSql); - stmt.setLong(1, zoneId); - stmt.executeUpdate(); - stmt.close(); + try (PreparedStatement insert_stmt = conn.prepareStatement(insertSql); + PreparedStatement update_stmt = conn.prepareStatement(updateSql); + ){ + insert_stmt.setString(1, NetUtils.long2Ip(startIP)); + insert_stmt.setLong(2, zoneId); + insert_stmt.setLong(3, vlanDbId); + insert_stmt.setLong(4, zoneId); + insert_stmt.setLong(5, sourceNetworkId); + insert_stmt.setLong(6, physicalNetworkId); + insert_stmt.setString(7, UUID.randomUUID().toString()); + insert_stmt.executeUpdate(); + update_stmt.setLong(1, zoneId); + update_stmt.executeUpdate(); } catch (Exception ex) { problemIPs.add(NetUtils.long2Ip(startIP)); } @@ -492,21 +487,19 @@ public List savePrivateIPRange(TransactionLegacy txn, long startIP, long Vector problemIPs = new Vector(); try { - Connection conn = null; - conn = txn.getConnection(); + Connection conn = txn.getConnection(); while (startIP <= endIP) { - try { - PreparedStatement stmt = conn.prepareStatement(insertSql); - stmt.setString(1, NetUtils.long2Ip(startIP)); - stmt.setLong(2, zoneId); - stmt.setLong(3, podId); - stmt.setLong(4, zoneId); - stmt.executeUpdate(); - stmt.close(); - stmt = conn.prepareStatement(updateSql); - stmt.setLong(1, zoneId); - stmt.executeUpdate(); - stmt.close(); + try (PreparedStatement insert_stmt = conn.prepareStatement(insertSql); + PreparedStatement update_stmt = conn.prepareStatement(updateSql); + ) + { + insert_stmt.setString(1, NetUtils.long2Ip(startIP)); + insert_stmt.setLong(2, zoneId); + insert_stmt.setLong(3, podId); + insert_stmt.setLong(4, zoneId); + insert_stmt.executeUpdate(); + update_stmt.setLong(1, zoneId); + update_stmt.executeUpdate(); } catch (Exception e) { problemIPs.add(NetUtils.long2Ip(startIP)); } @@ -531,10 +524,10 @@ private Vector saveLinkLocalPrivateIPRange(TransactionLegacy txn, long s System.out.println("Exception: " + e.getMessage()); printError("Unable to start DB connection to save private IPs. Please contact Cloud Support."); } + long start = startIP; - try { - long start = startIP; - PreparedStatement stmt = conn.prepareStatement(insertSql); + try(PreparedStatement stmt = conn.prepareStatement(insertSql);) + { while (startIP <= endIP) { stmt.setString(1, NetUtils.long2Ip(startIP++)); stmt.setLong(2, zoneId); @@ -547,10 +540,9 @@ private Vector saveLinkLocalPrivateIPRange(TransactionLegacy txn, long s problemIPs.add(NetUtils.long2Ip(start + (i / 2))); } } - stmt.close(); } catch (Exception ex) { + System.out.println("saveLinkLocalPrivateIPRange. Exception: " + ex.getMessage()); } - return problemIPs; } diff --git a/usage/src/com/cloud/usage/UsageSanityChecker.java b/usage/src/com/cloud/usage/UsageSanityChecker.java index 5e6123bc77..1c9e666a79 100644 --- a/usage/src/com/cloud/usage/UsageSanityChecker.java +++ b/usage/src/com/cloud/usage/UsageSanityChecker.java @@ -170,9 +170,7 @@ protected void checkSnapshotUsage() { } protected void readLastCheckId(){ - BufferedReader reader = null; - try { - reader = new BufferedReader(new FileReader(lastCheckFile)); + try(BufferedReader reader = new BufferedReader(new FileReader(lastCheckFile));) { String lastIdText = null; lastId = -1; if ((reader != null) && (lastIdText = reader.readLine()) != null) { @@ -180,42 +178,33 @@ protected void readLastCheckId(){ } } catch (IOException e) { s_logger.error(e); - } finally { - try { - reader.close(); - } catch (IOException e) { - s_logger.error(e); - } } } protected void readMaxId() throws SQLException { - PreparedStatement pstmt = conn.prepareStatement("select max(id) from cloud_usage.cloud_usage"); - ResultSet rs = pstmt.executeQuery(); - maxId = -1; - if (rs.next() && (rs.getInt(1) > 0)) { - maxId = rs.getInt(1); - lastCheckId += " and cu.id <= ?"; + try(PreparedStatement pstmt = conn.prepareStatement("select max(id) from cloud_usage.cloud_usage"); + ResultSet rs = pstmt.executeQuery();) + { + maxId = -1; + if (rs.next() && (rs.getInt(1) > 0)) { + maxId = rs.getInt(1); + lastCheckId += " and cu.id <= ?"; + } + } + catch (Exception e) + { + s_logger.error("readMaxId: Exception :"+ e.getMessage()); } } protected void updateNewMaxId() { - FileWriter fstream = null; - try { - fstream = new FileWriter(lastCheckFile); - BufferedWriter out = new BufferedWriter(fstream); + + try(FileWriter fstream = new FileWriter(lastCheckFile); + BufferedWriter out = new BufferedWriter(fstream); + ) { out.write("" + maxId); - out.close(); } catch (IOException e) { - // Error while writing last check id - } finally { - if (fstream != null) { - try { - fstream.close(); - } catch (IOException e) { - s_logger.error(e); - } - } + s_logger.error("updateMaxId: Exception :"+ e.getMessage()); } } diff --git a/utils/src/com/cloud/utils/crypt/EncryptionSecretKeySender.java b/utils/src/com/cloud/utils/crypt/EncryptionSecretKeySender.java index 086e8a81f9..ed44ac6316 100755 --- a/utils/src/com/cloud/utils/crypt/EncryptionSecretKeySender.java +++ b/utils/src/com/cloud/utils/crypt/EncryptionSecretKeySender.java @@ -19,16 +19,16 @@ package com.cloud.utils.crypt; + import java.io.PrintWriter; import java.net.InetAddress; import java.net.Socket; - import com.cloud.utils.NumbersUtil; + public class EncryptionSecretKeySender { public static void main(String args[]) { try { - // Create a socket to the host String hostname = "localhost"; int port = 8097; @@ -37,25 +37,29 @@ public static void main(String args[]) { hostname = args[0]; port = NumbersUtil.parseInt(args[1], port); } - InetAddress addr = InetAddress.getByName(hostname); - Socket socket = new Socket(addr, port); - PrintWriter out = new PrintWriter(socket.getOutputStream(), true); - java.io.BufferedReader stdin = new java.io.BufferedReader(new java.io.InputStreamReader(System.in)); - String validationWord = "cloudnine"; - String validationInput = ""; - while (!validationWord.equals(validationInput)) { - System.out.print("Enter Validation Word:"); - validationInput = stdin.readLine(); - System.out.println(); - } - System.out.print("Enter Secret Key:"); - String input = stdin.readLine(); - if (input != null) { - out.println(input); + try(Socket socket = new Socket(addr, port); + PrintWriter out = new PrintWriter(socket.getOutputStream(), true);) + { + java.io.BufferedReader stdin = new java.io.BufferedReader(new java.io.InputStreamReader(System.in)); + String validationWord = "cloudnine"; + String validationInput = ""; + while (!validationWord.equals(validationInput)) { + System.out.print("Enter Validation Word:"); + validationInput = stdin.readLine(); + System.out.println(); + } + System.out.print("Enter Secret Key:"); + String input = stdin.readLine(); + if (input != null) { + out.println(input); + } + }catch (Exception e) + { + System.out.println("Exception " + e.getMessage()); } } catch (Exception e) { System.out.print("Exception while sending secret key " + e); } - } + } } From 2d96ad987ee22e5266208e637daaaa26f6a85a22 Mon Sep 17 00:00:00 2001 From: Joris van Lieshout Date: Wed, 21 May 2014 16:58:01 +0200 Subject: [PATCH 588/683] Cosmetic fixed. three in total. 1. Only run hv_kvp_daemon if it exists. 2. add the -f argument to the rm to make is silent if it doesn't exist. 3. by using log_action_msg instead of log_action_begin_msg the screen output looks way better. Signed-off-by: Daan Hoogland (cherry picked from commit 66816827cbef1415dddd3f734e494c8adc41fbae) --- .../patches/debian/config/etc/init.d/cloud-early-config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config b/systemvm/patches/debian/config/etc/init.d/cloud-early-config index ffb23ec7cb..b8c40db4d7 100755 --- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config +++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config @@ -30,13 +30,13 @@ PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" #set -x #exec 3>&0 4>&1 > /var/log/test.log 2>&1 #start hv_kvp daemon -/usr/sbin/hv_kvp_daemon +[ -f /usr/sbin/hv_kvp_daemon ] && /usr/sbin/hv_kvp_daemon # Fix haproxy directory issue mkdir -p /var/lib/haproxy # Clear boot up flag, it would be created by rc.local after boot up done -rm /var/cache/cloud/boot_up_done +rm -f /var/cache/cloud/boot_up_done [ -x /sbin/ifup ] || exit 0 @@ -44,7 +44,7 @@ rm /var/cache/cloud/boot_up_done log_it() { echo "$(date) $@" >> /var/log/cloud.log - log_action_begin_msg "$@" + log_action_msg "$@" } init_interfaces_orderby_macs() { From 43e479d238649e3ab61259b6b57e56152f1ecb29 Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Thu, 12 Jun 2014 16:14:31 -0700 Subject: [PATCH 589/683] CLOUDSTACK-6907: lisVolumes - make a decision whether to set service or disk offering in the response, based on the DiskOfferingVO type entry, not the volume Type --- server/src/com/cloud/api/ApiDBUtils.java | 6 +++++- .../api/query/dao/VolumeJoinDaoImpl.java | 20 +++++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/server/src/com/cloud/api/ApiDBUtils.java b/server/src/com/cloud/api/ApiDBUtils.java index 153d99811e..90a09a0436 100755 --- a/server/src/com/cloud/api/ApiDBUtils.java +++ b/server/src/com/cloud/api/ApiDBUtils.java @@ -900,7 +900,11 @@ public static String findClusterDetails(long clusterId, String name) { } public static DiskOfferingVO findDiskOfferingById(Long diskOfferingId) { - return s_diskOfferingDao.findByIdIncludingRemoved(diskOfferingId); + DiskOfferingVO off = s_diskOfferingDao.findByIdIncludingRemoved(diskOfferingId); + if (off.getType() == DiskOfferingVO.Type.Disk) { + return off; + } + return null; } public static DomainVO findDomainById(Long domainId) { diff --git a/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java index 9e1ee37ceb..24d09220a8 100644 --- a/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/VolumeJoinDaoImpl.java @@ -22,13 +22,12 @@ import javax.ejb.Local; import javax.inject.Inject; -import org.apache.log4j.Logger; -import org.springframework.stereotype.Component; - import org.apache.cloudstack.api.ResponseObject.ResponseView; import org.apache.cloudstack.api.response.VolumeResponse; import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.framework.config.dao.ConfigurationDao; +import org.apache.log4j.Logger; +import org.springframework.stereotype.Component; import com.cloud.api.ApiDBUtils; import com.cloud.api.ApiResponseHelper; @@ -152,19 +151,28 @@ public VolumeResponse newVolumeResponse(ResponseView view, VolumeJoinVO volume) // DiskOfferingVO diskOffering = // ApiDBUtils.findDiskOfferingById(volume.getDiskOfferingId()); if (volume.getDiskOfferingId() > 0) { + boolean isServiceOffering = false; if (volume.getVolumeType().equals(Volume.Type.ROOT)) { - volResponse.setServiceOfferingId(volume.getDiskOfferingUuid()); + isServiceOffering = true; } else { - volResponse.setDiskOfferingId(volume.getDiskOfferingUuid()); + // can't rely on the fact that the volume is the datadisk as it might have been created as a root, and + // then detached later + long offeringId = volume.getDiskOfferingId(); + if (ApiDBUtils.findDiskOfferingById(offeringId) == null) { + isServiceOffering = true; + } } - if (volume.getVolumeType().equals(Volume.Type.ROOT)) { + if (isServiceOffering) { + volResponse.setServiceOfferingId(volume.getDiskOfferingUuid()); volResponse.setServiceOfferingName(volume.getDiskOfferingName()); volResponse.setServiceOfferingDisplayText(volume.getDiskOfferingDisplayText()); } else { + volResponse.setDiskOfferingId(volume.getDiskOfferingUuid()); volResponse.setDiskOfferingName(volume.getDiskOfferingName()); volResponse.setDiskOfferingDisplayText(volume.getDiskOfferingDisplayText()); } + volResponse.setStorageType(volume.isUseLocalStorage() ? ServiceOffering.StorageType.local.toString() : ServiceOffering.StorageType.shared.toString()); volResponse.setBytesReadRate(volume.getBytesReadRate()); volResponse.setBytesWriteRate(volume.getBytesReadRate()); From 49467f295410f1f0e265e7ce5ee6dd849207c3e8 Mon Sep 17 00:00:00 2001 From: Girish Shilamkar Date: Fri, 13 Jun 2014 09:38:16 +0530 Subject: [PATCH 590/683] CLOUDSTACK-6888: Read postable IP configuration from config --- .../integration/component/test_portable_ip.py | 51 ++++++++----------- tools/marvin/marvin/lib/common.py | 37 +++++++++++++- 2 files changed, 58 insertions(+), 30 deletions(-) diff --git a/test/integration/component/test_portable_ip.py b/test/integration/component/test_portable_ip.py index 77a5ab6d8c..538318db43 100644 --- a/test/integration/component/test_portable_ip.py +++ b/test/integration/component/test_portable_ip.py @@ -37,10 +37,11 @@ get_domain, get_region, get_pod, - isIpInDesiredState) + isIpInDesiredState, + getPortableIpRangeServices) from netaddr import IPAddress from marvin.sshClient import SshClient - +from marvin.codes import FAILED from nose.plugins.attrib import attr class Services: @@ -142,15 +143,7 @@ def __init__(self): "publicport": 22, "protocol": 'TCP', }, - "ostype": 'CentOS 5.3 (64-bit)', - "portableIpRange": { - "gateway" : "10.223.252.195", - "netmask" : "255.255.255.192", - "startip" : "10.223.252.196", - "endip" : "10.223.252.197", - "vlan" : "1001" - } - + "ostype": 'CentOS 5.3 (64-bit)' } class TestCreatePortablePublicIpRanges(cloudstackTestCase): @@ -208,8 +201,8 @@ def test_create_portable_ip_range(self): # 1. Create new portable ip range with root admin api # 2. Portable ip range should be created successfully - portable_ip_range_services = self.services["portableIpRange"] - if portable_ip_range_services is None: + portable_ip_range_services = getPortableIpRangeServices(self.config) + if portable_ip_range_services is FAILED: self.skipTest('Failed to read config values related to portable ip range') portable_ip_range_services["regionid"] = self.region.id @@ -231,9 +224,9 @@ def test_create_portable_ip_range_non_root_admin(self): # 1. Create new portable ip range with non root admin api client # 2. Portable ip range should not be created - portable_ip_range_services = self.services["portableIpRange"] + portable_ip_range_services = getPortableIpRangeServices(self.config) - if portable_ip_range_services is None: + if portable_ip_range_services is FAILED: self.skipTest('Failed to read config values related to portable ip range') try: @@ -267,9 +260,9 @@ def test_create_portable_ip_range_invalid_region(self): # 1. Try to create new portable ip range with invalid region id # 2. Portable ip range creation should fail - portable_ip_range_services = self.services["portableIpRange"] + portable_ip_range_services = getPortableIpRangeServices(self.config) - if portable_ip_range_services is None: + if portable_ip_range_services is FAILED: self.skipTest('Failed to read config values related to portable ip range') portable_ip_range_services["regionid"] = -1 @@ -321,9 +314,9 @@ def setUp(self): self.apiclient = self.testClient.getApiClient() self.dbclient = self.testClient.getDbConnection() - portable_ip_range_services = self.services["portableIpRange"] + portable_ip_range_services = getPortableIpRangeServices(self.config) - if portable_ip_range_services is None: + if portable_ip_range_services is FAILED: self.skipTest('Failed to read config values related to portable ip range') portable_ip_range_services["regionid"] = self.region.id @@ -480,9 +473,9 @@ def setUp(self): self.dbclient = self.testClient.getDbConnection() #create new portable ip range - self.portable_ip_range_services = self.services["portableIpRange"] + self.portable_ip_range_services = getPortableIpRangeServices(self.config) - if self.portable_ip_range_services is None: + if self.portable_ip_range_services is FAILED: self.skipTest('Failed to read config values related to portable ip range') self.portable_ip_range_services["regionid"] = self.region.id @@ -643,9 +636,9 @@ def setUp(self): self.cleanup = [] - portable_ip_range_services = self.services["portableIpRange"] + portable_ip_range_services = getPortableIpRangeServices(self.config) - if portable_ip_range_services is None: + if portable_ip_range_services is FAILED: self.skipTest('Failed to read config values related to portable ip range') portable_ip_range_services["regionid"] = self.region.id @@ -978,9 +971,9 @@ def setUp(self): self.dbclient = self.testClient.getDbConnection() self.cleanup = [] - portable_ip_range_services = self.services["portableIpRange"] + portable_ip_range_services = getPortableIpRangeServices(self.config) - if portable_ip_range_services is None: + if portable_ip_range_services is FAILED: self.skipTest('Failed to read config values related to portable ip range') portable_ip_range_services["regionid"] = self.region.id @@ -1172,8 +1165,8 @@ def setUp(self): self.apiclient = self.testClient.getApiClient() self.dbclient = self.testClient.getDbConnection() - portable_ip_range_services = self.services["portableIpRange"] - if portable_ip_range_services is None: + portable_ip_range_services = getPortableIpRangeServices(self.config) + if portable_ip_range_services is FAILED: self.skipTest('Failed to read config values related to portable ip range') self.cleanup = [] @@ -1432,9 +1425,9 @@ def setUp(self): self.dbclient = self.testClient.getDbConnection() #create new portable ip range - self.portable_ip_range_services = self.services["portableIpRange"] + self.portable_ip_range_services = getPortableIpRangeServices(self.config) - if self.portable_ip_range_services is None: + if self.portable_ip_range_services is FAILED: self.skipTest('Failed to read config values related to portable ip range') self.portable_ip_range_services["regionid"] = self.region.id diff --git a/tools/marvin/marvin/lib/common.py b/tools/marvin/marvin/lib/common.py index 91fe0537e7..7753385318 100644 --- a/tools/marvin/marvin/lib/common.py +++ b/tools/marvin/marvin/lib/common.py @@ -61,7 +61,7 @@ from marvin.sshClient import SshClient from marvin.codes import (PASS, ISOLATED_NETWORK, VPC_NETWORK, - BASIC_ZONE, FAIL, NAT_RULE, STATIC_NAT_RULE) + BASIC_ZONE, FAIL, NAT_RULE, STATIC_NAT_RULE, FAILED) import random from marvin.lib.utils import * from marvin.lib.base import * @@ -1187,3 +1187,38 @@ def createNetworkRulesForVM(apiclient, virtualmachine, ruletype, except Exception as e: [FAIL, e] return [PASS, public_ip] + +def getPortableIpRangeServices(config): + """ Reads config values related to portable ip and fills up + services accordingly""" + + services = {} + attributeError = False + + if config.portableIpRange.startip: + services["startip"] = config.portableIpRange.startip + else: + attributeError = True + + if config.portableIpRange.endip: + services["endip"] = config.portableIpRange.endip + else: + attributeError = True + + if config.portableIpRange.netmask: + services["netmask"] = config.portableIpRange.netmask + else: + attributeError = True + + if config.portableIpRange.gateway: + services["gateway"] = config.portableIpRange.gateway + else: + attributeError = True + + if config.portableIpRange.vlan: + services["vlan"] = config.portableIpRange.vlan + + if attributeError: + services = FAILED + + return services From ebff469b46551f8613013e80aa0386203a9c7912 Mon Sep 17 00:00:00 2001 From: Anshul Gangwar Date: Tue, 10 Jun 2014 16:28:32 +0530 Subject: [PATCH 591/683] CLOUDSTACK-6865 , CLOUDSTACK-6868: [hyperv] while attaching the volume we were changing the volume's Image format to hypervisor's default Image format, hence it was failing to find the volume with vhdx format. Now changed the behavior to set Image Format for volume only when it is not set --- .../cloudstack/engine/orchestration/VolumeOrchestrator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index 064ffca6db..5bc788e8d8 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -746,7 +746,9 @@ public VolumeInfo createVolumeOnPrimaryStorage(VirtualMachine vm, Volume rootVol throw new CloudRuntimeException("Volume shouldn't be null " + volume.getId()); } VolumeVO volVO = _volsDao.findById(vol.getId()); - volVO.setFormat(getSupportedImageFormatForCluster(rootDiskHyperType)); + if (volVO.getFormat() == null) { + volVO.setFormat(getSupportedImageFormatForCluster(rootDiskHyperType)); + } _volsDao.update(volVO.getId(), volVO); return volFactory.getVolume(volVO.getId()); } From 2e49ef73bfcb548cf19d1230f00a0510b7d09150 Mon Sep 17 00:00:00 2001 From: Anshul Gangwar Date: Tue, 10 Jun 2014 16:43:40 +0530 Subject: [PATCH 592/683] CLOUDSTACK-6867: Added option to upload the volume in VHDX format --- ui/scripts/storage.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 604f09d5db..0a2d1dc854 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -305,6 +305,10 @@ id: 'VHD', description: 'VHD' }); + items.push({ + id: 'VHDX', + description: 'VHDX' + }); items.push({ id: 'OVA', description: 'OVA' From cef29948a708fbbae1261dbd8b6a13e4da19c703 Mon Sep 17 00:00:00 2001 From: Anshul Gangwar Date: Wed, 11 Jun 2014 11:04:35 +0530 Subject: [PATCH 593/683] CLOUDSTACK-6872: [hyperv] removed the redundant connectToRemote, DisconnectRemote methods which in turn fixes this bug. connectToRemote was used to connect to share, but once the share is domain joined we don't need this method as we already have required permissions --- .../HypervResourceController.cs | 15 --------- .../ServerResource/HypervResource/Utils.cs | 33 ------------------- .../HypervResource/WmiCallsV2.cs | 3 +- 3 files changed, 1 insertion(+), 50 deletions(-) diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs index 0ad95b8704..195a964b75 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/HypervResourceController.cs @@ -236,7 +236,6 @@ public JContainer AttachCommand([FromBody]dynamic cmd) { TemplateObjectTO dataStore = disk.templateObjectTO; NFSTO share = dataStore.nfsDataStoreTO; - Utils.ConnectToRemote(share.UncPath, share.Domain, share.User, share.Password); string diskPath = Utils.NormalizePath(Path.Combine(share.UncPath, dataStore.path)); wmiCallsV2.AttachIso(vmName, diskPath); result = true; @@ -244,11 +243,6 @@ public JContainer AttachCommand([FromBody]dynamic cmd) else if (disk.type.Equals("DATADISK")) { VolumeObjectTO volume = disk.volumeObjectTO; - PrimaryDataStoreTO primary = volume.primaryDataStore; - if (!primary.isLocal) - { - Utils.ConnectToRemote(primary.UncPath, primary.Domain, primary.User, primary.Password); - } string diskPath = Utils.NormalizePath(volume.FullFileName); wmiCallsV2.AttachDisk(vmName, diskPath, disk.diskSequence); result = true; @@ -989,7 +983,6 @@ public JContainer ModifyStoragePoolCommand([FromBody]dynamic cmd) hostPath = Utils.NormalizePath(share.UncPath); // Check access to share. - Utils.ConnectToRemote(share.UncPath, share.Domain, share.User, share.Password); Utils.GetShareDetails(share.UncPath, out capacityBytes, out availableBytes); config.setPrimaryStorage((string)cmd.pool.uuid, hostPath); } @@ -1281,7 +1274,6 @@ public JContainer CreateObjectCommand([FromBody]dynamic cmd) { volumePath = @"\\" + primary.uri.Host + primary.uri.LocalPath + @"\" + volumeName; volumePath = Utils.NormalizePath(volumePath); - Utils.ConnectToRemote(primary.UncPath, primary.Domain, primary.User, primary.Password); } volume.path = volume.uuid; wmiCallsV2.CreateDynamicVirtualHardDisk(volumeSize, volumePath); @@ -1554,17 +1546,10 @@ public JContainer CopyCommand(dynamic cmd) if (destTemplateObjectTO.primaryDataStore != null) { destFile = destTemplateObjectTO.FullFileName; - if (!destTemplateObjectTO.primaryDataStore.isLocal) - { - PrimaryDataStoreTO primary = destTemplateObjectTO.primaryDataStore; - Utils.ConnectToRemote(primary.UncPath, primary.Domain, primary.User, primary.Password); - } } else if (destTemplateObjectTO.nfsDataStoreTO != null) { destFile = destTemplateObjectTO.FullFileName; - NFSTO store = destTemplateObjectTO.nfsDataStoreTO; - Utils.ConnectToRemote(store.UncPath, store.Domain, store.User, store.Password); } } diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs index c8e951edf8..b40cb8f783 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/Utils.cs @@ -128,32 +128,6 @@ public static void DownloadCifsFileToLocalFile(string filePathRelativeToShare, N } } - public static void ConnectToRemote(string remoteUNC, string domain, string username, string password) - { - NETRESOURCE nr = new NETRESOURCE(); - nr.dwType = RESOURCETYPE_DISK; - nr.lpRemoteName = Utils.NormalizePath(remoteUNC); - if (domain != null) - { - username = domain + @"\" + username; - } - - int ret = WNetUseConnection(IntPtr.Zero, nr, password, username, 0, null, null, null); - if (ret != NO_ERROR) - { - throw new ArgumentException("net use of share " + remoteUNC + "failed with "+ getErrorForNumber(ret)); - } - } - - public static void DisconnectRemote(string remoteUNC) - { - int ret = WNetCancelConnection2(remoteUNC, CONNECT_UPDATE_PROFILE, false); - if (ret != NO_ERROR) - { - throw new ArgumentException("net disconnect of share " + remoteUNC + "failed with " + getErrorForNumber(ret)); - } - } - public static void GetShareDetails(string remoteUNC, out long capacity, out long available) { ulong freeBytesAvailable; @@ -228,13 +202,6 @@ public static void ExecuteTask(string command, string args) [DllImport("advapi32.dll", CharSet = CharSet.Auto, SetLastError = true)] public extern static bool DuplicateToken(IntPtr existingTokenHandle, int SECURITY_IMPERSONATION_LEVEL, ref IntPtr duplicateTokenHandle); - [DllImport("Mpr.dll")] - private static extern int WNetUseConnection(IntPtr hwndOwner, NETRESOURCE lpNetResource, string lpPassword, string lpUserID, int dwFlags, - string lpAccessName, string lpBufferSize, string lpResult); - - [DllImport("Mpr.dll")] - private static extern int WNetCancelConnection2(string lpName, int dwFlags, bool fForce); - [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] private static extern bool GetDiskFreeSpaceEx(string lpDirectoryName, out ulong lpFreeBytesAvailable, diff --git a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs index 372f848868..b2a7b454f1 100644 --- a/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs +++ b/plugins/hypervisors/hyperv/DotNet/ServerResource/HypervResource/WmiCallsV2.cs @@ -1,4 +1,4 @@ -// Licensed to the Apache Software Foundation (ASF) under one +// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file @@ -333,7 +333,6 @@ public ComputerSystem DeployVirtualMachine(dynamic jsonObj, string systemVmIso) else if (templateInfo != null && templateInfo.nfsDataStoreTO != null) { NFSTO share = templateInfo.nfsDataStoreTO; - Utils.ConnectToRemote(share.UncPath, share.Domain, share.User, share.Password); // The share is mapped, now attach the iso isoPath = Utils.NormalizePath(Path.Combine(share.UncPath, templateInfo.path)); } From 2dc9e2c530b36efc4c4684e13ae0412103925d05 Mon Sep 17 00:00:00 2001 From: Anshul Gangwar Date: Thu, 12 Jun 2014 13:54:56 +0530 Subject: [PATCH 594/683] CLOUDSTACK-6897: when we try to attach the uploaded/allocated volume to a VM on zwps, then we were passing the podId of VM instead of storage pool to storage allocator. This resulting in use of Clusterscope storage allocator, allocating a storage pool for VM on zwps beacuse of pod id not null. This was resulting in scope conflict later --- .../cloudstack/engine/orchestration/VolumeOrchestrator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java index 5bc788e8d8..358b3bd35b 100644 --- a/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java +++ b/engine/orchestration/src/org/apache/cloudstack/engine/orchestration/VolumeOrchestrator.java @@ -724,8 +724,8 @@ private VolumeInfo copyVolume(StoragePool rootDiskPool, VolumeInfo volume, Virtu public VolumeInfo createVolumeOnPrimaryStorage(VirtualMachine vm, Volume rootVolumeOfVm, VolumeInfo volume, HypervisorType rootDiskHyperType) throws NoTransitionException { VirtualMachineTemplate rootDiskTmplt = _entityMgr.findById(VirtualMachineTemplate.class, vm.getTemplateId()); DataCenter dcVO = _entityMgr.findById(DataCenter.class, vm.getDataCenterId()); - Pod pod = _entityMgr.findById(Pod.class, vm.getPodIdToDeployIn()); StoragePoolVO rootDiskPool = _storagePoolDao.findById(rootVolumeOfVm.getPoolId()); + Pod pod = _entityMgr.findById(Pod.class, rootDiskPool.getPodId()); ServiceOffering svo = _entityMgr.findById(ServiceOffering.class, vm.getServiceOfferingId()); DiskOffering diskVO = _entityMgr.findById(DiskOffering.class, volume.getDiskOfferingId()); Long clusterId = (rootDiskPool == null ? null : rootDiskPool.getClusterId()); From 9dfbdb5ffd2f0981651bc98f1c5d71718a24a29f Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Fri, 13 Jun 2014 15:50:41 +0530 Subject: [PATCH 595/683] CLOUDSTACK-6749: [OVS] xe network-param-get with param-key=is-ovs-vpc-distributed-vr-network alway returns error fixing unnecessary errors in the logs --- .../xenserver/cloudstack_pluginlib.py | 54 +++++++++++++------ .../vm/hypervisor/xenserver/ovs-vif-flows.py | 19 ++----- 2 files changed, 40 insertions(+), 33 deletions(-) diff --git a/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py b/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py index d3d234fdf5..44812b2e51 100644 --- a/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py +++ b/scripts/vm/hypervisor/xenserver/cloudstack_pluginlib.py @@ -420,23 +420,9 @@ def create_tunnel(bridge, remote_ip, gre_key, src_host, dst_host, network_uuid): # find xs network for this bridge, verify is used for ovs tunnel network xs_nw_uuid = do_cmd([XE_PATH, "network-list", "bridge=%s" % bridge, "--minimal"]) - ovs_tunnel_network = False - try: - ovs_tunnel_network = do_cmd([XE_PATH,"network-param-get", - "uuid=%s" % xs_nw_uuid, - "param-name=other-config", - "param-key=is-ovs-tun-network", "--minimal"]) - except: - pass - ovs_vpc_distributed_vr_network = False - try: - ovs_vpc_distributed_vr_network = do_cmd([XE_PATH,"network-param-get", - "uuid=%s" % xs_nw_uuid, - "param-name=other-config", - "param-key=is-ovs-vpc-distributed-vr-network", "--minimal"]) - except: - pass + ovs_tunnel_network = is_regular_tunnel_network(xs_nw_uuid) + ovs_vpc_distributed_vr_network = is_vpc_network_with_distributed_routing(xs_nw_uuid) if ovs_tunnel_network == 'True': # add flow entryies for dropping broadcast coming in from gre tunnel @@ -867,4 +853,38 @@ class tier_ports: error_message = "An unexpected error occurred while updating the flooding rules for the bridge " + \ bridge + " when interface " + " %s" %interface + " is %s" %command logging.debug(error_message + " due to " + str(e)) - raise error_message \ No newline at end of file + raise error_message + + +def is_regular_tunnel_network(xs_nw_uuid): + cmd = [XE_PATH,"network-param-get", "uuid=%s" % xs_nw_uuid, "param-name=other-config", + "param-key=is-ovs-tun-network", "--minimal"] + logging.debug("Executing:%s", cmd) + pipe = subprocess.PIPE + proc = subprocess.Popen(cmd, shell=False, stdin=pipe, stdout=pipe, + stderr=pipe, close_fds=True) + ret_code = proc.wait() + if ret_code: + return False + + output = proc.stdout.read() + if output.endswith('\n'): + output = output[:-1] + return output + + +def is_vpc_network_with_distributed_routing(xs_nw_uuid): + cmd = [XE_PATH,"network-param-get", "uuid=%s" % xs_nw_uuid, "param-name=other-config", + "param-key=is-ovs-vpc-distributed-vr-network", "--minimal"] + logging.debug("Executing:%s", cmd) + pipe = subprocess.PIPE + proc = subprocess.Popen(cmd, shell=False, stdin=pipe, stdout=pipe, + stderr=pipe, close_fds=True) + ret_code = proc.wait() + if ret_code: + return False + + output = proc.stdout.read() + if output.endswith('\n'): + output = output[:-1] + return output \ No newline at end of file diff --git a/scripts/vm/hypervisor/xenserver/ovs-vif-flows.py b/scripts/vm/hypervisor/xenserver/ovs-vif-flows.py index ba5f41a5d5..62601bf187 100644 --- a/scripts/vm/hypervisor/xenserver/ovs-vif-flows.py +++ b/scripts/vm/hypervisor/xenserver/ovs-vif-flows.py @@ -90,24 +90,10 @@ def main(command, vif_raw): # find xs network for this bridge, verify is used for ovs tunnel network xs_nw_uuid = pluginlib.do_cmd([pluginlib.XE_PATH, "network-list", "bridge=%s" % bridge, "--minimal"]) - ovs_tunnel_network = False - try: - ovs_tunnel_network = pluginlib.do_cmd([pluginlib.XE_PATH,"network-param-get", - "uuid=%s" % xs_nw_uuid, - "param-name=other-config", - "param-key=is-ovs-tun-network", "--minimal"]) - except: - pass - ovs_vpc_distributed_vr_network = False - try: - ovs_vpc_distributed_vr_network = pluginlib.do_cmd([pluginlib.XE_PATH,"network-param-get", - "uuid=%s" % xs_nw_uuid, - "param-name=other-config", - "param-key=is-ovs-vpc-distributed-vr-network", "--minimal"]) - except: - pass + ovs_tunnel_network = pluginlib.is_regular_tunnel_network(xs_nw_uuid) + # handle case where network is reguar tunnel network if ovs_tunnel_network == 'True': vlan = pluginlib.do_cmd([pluginlib.VSCTL_PATH, 'br-to-vlan', bridge]) if vlan != '0': @@ -137,6 +123,7 @@ def main(command, vif_raw): # handle case where bridge is setup for VPC which is enabled for distributed routing + ovs_vpc_distributed_vr_network = pluginlib.is_vpc_network_with_distributed_routing(xs_nw_uuid) if ovs_vpc_distributed_vr_network == 'True': vlan = pluginlib.do_cmd([pluginlib.VSCTL_PATH, 'br-to-vlan', bridge]) if vlan != '0': From be937a08213f06a801cf07d19867d48dad35d19f Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Fri, 13 Jun 2014 17:03:28 +0530 Subject: [PATCH 596/683] CLOUDSTACK-6832: [OVS]vnet is not released even the network is deleted fix ensures allocated VNET is released during network shutdown --- .../src/com/cloud/network/guru/OvsGuestNetworkGuru.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java b/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java index de7410889f..3ca25f7b94 100644 --- a/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java +++ b/plugins/network-elements/ovs/src/com/cloud/network/guru/OvsGuestNetworkGuru.java @@ -189,7 +189,12 @@ public void shutdown(NetworkProfile profile, NetworkOffering offering) { return; } - super.shutdown(profile, offering); + if (profile.getBroadcastDomainType() == BroadcastDomainType.Vswitch ) { + s_logger.debug("Releasing vnet for the network id=" + profile.getId()); + _dcDao.releaseVnet(BroadcastDomainType.getValue(profile.getBroadcastUri()), profile.getDataCenterId(), profile.getPhysicalNetworkId(), + profile.getAccountId(), profile.getReservationId()); + } + profile.setBroadcastUri(null); } @Override From b849b7ee3d9b4a141c2eb3fd689d197ed20c4581 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Fri, 13 Jun 2014 00:17:32 -0700 Subject: [PATCH 597/683] CLOUDSTACK-6887: Fixing account cleanup issue across multiple test cases --- .../component/test_add_remove_network.py | 7 +- .../component/test_persistent_networks.py | 214 ++++++++++-------- test/integration/component/test_projects.py | 1 + .../integration/component/test_snapshot_gc.py | 77 +++---- .../component/test_snapshot_limits.py | 2 - test/integration/component/test_usage.py | 7 +- test/integration/component/test_volumes.py | 2 + .../integration/smoke/test_affinity_groups.py | 14 +- 8 files changed, 176 insertions(+), 148 deletions(-) diff --git a/test/integration/component/test_add_remove_network.py b/test/integration/component/test_add_remove_network.py index 20aefe417e..7479cee1de 100644 --- a/test/integration/component/test_add_remove_network.py +++ b/test/integration/component/test_add_remove_network.py @@ -924,22 +924,25 @@ def setUpClass(cls): # Create Accounts & networks cls.services["isolated_network"]["zoneid"] = cls.zone.id cls.services["shared_network"]["zoneid"] = cls.zone.id + cls._cleanup = [] cls.account = Account.create(cls.api_client,cls.services["account"],domainid = cls.domain.id) + cls._cleanup.append(cls.account) cls.service_offering = ServiceOffering.create(cls.api_client,cls.services["service_offering"]) + cls._cleanup.append(cls.service_offering) cls.virtual_machine = VirtualMachine.create(cls.api_client,cls.services["virtual_machine"], accountid=cls.account.name,domainid=cls.account.domainid, serviceofferingid=cls.service_offering.id, mode=cls.zone.networktype) # Create Shared Network Offering - cls.isolated_network_offering = NetworkOffering.create(cls.api_client,cls.services["isolated_network_offering"],) + cls.isolated_network_offering = NetworkOffering.create(cls.api_client,cls.services["isolated_network_offering"]) + cls._cleanup.append(cls.isolated_network_offering) # Enable Isolated Network offering cls.isolated_network_offering.update(cls.api_client, state='Enabled') cls.isolated_network = Network.create(cls.api_client,cls.services["isolated_network"],cls.account.name, cls.account.domainid,networkofferingid=cls.isolated_network_offering.id) - cls._cleanup = [cls.account,cls.service_offering,cls.isolated_network_offering,] return def setUp(self): diff --git a/test/integration/component/test_persistent_networks.py b/test/integration/component/test_persistent_networks.py index ab1e2c2ab4..d848f2a56c 100644 --- a/test/integration/component/test_persistent_networks.py +++ b/test/integration/component/test_persistent_networks.py @@ -1849,59 +1849,88 @@ def test_vpc_force_delete_domain(self): # 3. Restart/delete VPC network # Validations - # 1. In case of Restart operation, restart should be successful and persistent networks should be back in persistent state - # 2. In case of Delete operation, VR servicing the VPC should get destroyed and sourceNAT ip should get released + # 1. In case of Restart operation, restart should be successful + # and persistent networks should be back in persistent state + # 2. In case of Delete operation, VR servicing the VPC should + # get destroyed and sourceNAT ip should get released - child_domain = Domain.create(self.apiclient,services=self.services["domain"], + child_domain = Domain.create(self.apiclient, + services=self.services["domain"], parentdomainid=self.domain.id) - account_1 = Account.create(self.apiclient,self.services["account"],domainid=child_domain.id) - account_2 = Account.create(self.apiclient,self.services["account"],domainid=child_domain.id) + try: + account_1 = Account.create( + self.apiclient,self.services["account"], + domainid=child_domain.id + ) + account_2 = Account.create( + self.apiclient,self.services["account"], + domainid=child_domain.id + ) - self.services["vpc"]["cidr"] = "10.1.1.1/16" - vpc_1 = VPC.create(self.apiclient, self.services["vpc"], + self.services["vpc"]["cidr"] = "10.1.1.1/16" + vpc_1 = VPC.create(self.apiclient, self.services["vpc"], vpcofferingid=self.vpc_off.id, zoneid=self.zone.id, account=account_1.name, domainid=account_1.domainid) - vpcs = VPC.list(self.apiclient, id=vpc_1.id) - self.assertEqual(validateList(vpcs)[0], PASS, "VPC list validation failed, vpc list is %s" % vpcs) + vpcs = VPC.list(self.apiclient, id=vpc_1.id) + self.assertEqual(validateList(vpcs)[0], PASS,\ + "VPC list validation failed, vpc list is %s" % vpcs) - vpc_2 = VPC.create(self.apiclient, self.services["vpc"], + vpc_2 = VPC.create(self.apiclient, self.services["vpc"], vpcofferingid=self.vpc_off.id, zoneid=self.zone.id, account=account_2.name, domainid=account_2.domainid) - vpcs = VPC.list(self.apiclient, id=vpc_2.id) - self.assertEqual(validateList(vpcs)[0], PASS, "VPC list validation failed, vpc list is %s" % vpcs) - - persistent_network_1 = Network.create(self.api_client,self.services["isolated_network"], - networkofferingid=self.persistent_network_offering_NoLB.id, - accountid=account_1.name,domainid=account_1.domainid, - zoneid=self.zone.id, vpcid=vpc_1.id, gateway="10.1.1.1", netmask="255.255.255.0") - response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented") - exceptionOccured = response[0] - isNetworkInDesiredState = response[1] - exceptionMessage = response[2] - - if (exceptionOccured or (not isNetworkInDesiredState)): - self.fail(exceptionMessage) - self.assertIsNotNone(persistent_network_1.vlan, "vlan must not be null for persistent network %s" % persistent_network_1.id) + vpcs = VPC.list(self.apiclient, id=vpc_2.id) + self.assertEqual(validateList(vpcs)[0], PASS,\ + "VPC list validation failed, vpc list is %s" % vpcs) + + persistent_network_1 = Network.create( + self.api_client,self.services["isolated_network"], + networkofferingid=self.persistent_network_offering_NoLB.id, + accountid=account_1.name,domainid=account_1.domainid, + zoneid=self.zone.id, vpcid=vpc_1.id, gateway="10.1.1.1", + netmask="255.255.255.0") + + response = verifyNetworkState(self.apiclient, + persistent_network_1.id, + "implemented" + ) + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] - persistent_network_2 = Network.create(self.api_client,self.services["isolated_network"], - networkofferingid=self.persistent_network_offering_NoLB.id, - accountid=account_2.name,domainid=account_2.domainid, - zoneid=self.zone.id, vpcid=vpc_2.id, gateway="10.1.1.1", netmask="255.255.255.0") - response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented") - exceptionOccured = response[0] - isNetworkInDesiredState = response[1] - exceptionMessage = response[2] + if (exceptionOccured or (not isNetworkInDesiredState)): + raise Exception(exceptionMessage) + self.assertIsNotNone( + persistent_network_1.vlan,\ + "vlan must not be null for persistent network %s" %\ + persistent_network_1.id) + + persistent_network_2 = Network.create( + self.api_client,self.services["isolated_network"], + networkofferingid=self.persistent_network_offering_NoLB.id, + accountid=account_2.name,domainid=account_2.domainid, + zoneid=self.zone.id, vpcid=vpc_2.id, gateway="10.1.1.1", + netmask="255.255.255.0") + response = verifyNetworkState(self.apiclient, persistent_network_2.id, + "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] - if (exceptionOccured or (not isNetworkInDesiredState)): - self.fail(exceptionMessage) - self.assertIsNotNone(persistent_network_2.vlan, "vlan must not be null for persistent network: %s" % persistent_network_2.id) + if (exceptionOccured or (not isNetworkInDesiredState)): + raise Exception(exceptionMessage) + self.assertIsNotNone(persistent_network_2.vlan,\ + "vlan must not be null for persistent network: %s" %\ + persistent_network_2.id) - # Force delete domain - try: + # Force delete domain child_domain.delete(self.apiclient, cleanup=True) + except Exception as e: - self.fail("Failed to delete domain: %s" % e) + self.cleanup.append(account_1) + self.cleanup.append(account_2) + self.cleanup.append(child_domain) + self.fail(e) self.debug("Waiting for account.cleanup.interval" + " to cleanup any remaining resouces") @@ -1909,11 +1938,17 @@ def test_vpc_force_delete_domain(self): wait_for_cleanup(self.apiclient, ["account.cleanup.interval"]*3) self.VerifyDomainCleanup(child_domain.id) - with self.assertRaises(Exception) as e: - Account.list(self.apiclient,name=account_1.name, domainid=account_1.domainid,listall=True) + with self.assertRaises(Exception): + Account.list( + self.apiclient,name=account_1.name, + domainid=account_1.domainid,listall=True + ) - with self.assertRaises(Exception) as e: - Account.list(self.apiclient,name=account_2.name, domainid=account_2.domainid,listall=True) + with self.assertRaises(Exception): + Account.list( + self.apiclient,name=account_2.name, + domainid=account_2.domainid,listall=True + ) self.VerifyVpcCleanup(vpc_1.id) self.VerifyVpcCleanup(vpc_2.id) @@ -1932,46 +1967,46 @@ def test_vpc_delete_account(self): # 1. In case of Restart operation, restart should be successful and persistent networks should be back in persistent state # 2. In case of Delete operation, VR servicing the VPC should get destroyed and sourceNAT ip should get released - # Create Account - account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id) + try: + # Create Account + account = Account.create(self.apiclient,self.services["account"],domainid=self.domain.id) - # Create VPC - self.services["vpc"]["cidr"] = "10.1.1.1/16" - vpc = VPC.create(self.apiclient, self.services["vpc"], + # Create VPC + self.services["vpc"]["cidr"] = "10.1.1.1/16" + vpc = VPC.create(self.apiclient, self.services["vpc"], vpcofferingid=self.vpc_off.id, zoneid=self.zone.id, account=account.name, domainid=account.domainid) - vpcs = VPC.list(self.apiclient, id=vpc.id) - self.assertEqual(validateList(vpcs)[0], PASS, "VPC list validation failed, vpc list is %s" % vpcs) + vpcs = VPC.list(self.apiclient, id=vpc.id) + self.assertEqual(validateList(vpcs)[0], PASS, "VPC list validation failed, vpc list is %s" % vpcs) - # Create Persistent Networks as tiers of VPC - persistent_network_1 = Network.create(self.api_client,self.services["isolated_network"], + # Create Persistent Networks as tiers of VPC + persistent_network_1 = Network.create(self.api_client,self.services["isolated_network"], networkofferingid=self.persistent_network_offering_NoLB.id, accountid=account.name,domainid=account.domainid, zoneid=self.zone.id, vpcid=vpc.id, gateway="10.1.1.1", netmask="255.255.255.0") - response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented") - exceptionOccured = response[0] - isNetworkInDesiredState = response[1] - exceptionMessage = response[2] + response = verifyNetworkState(self.apiclient, persistent_network_1.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] - if (exceptionOccured or (not isNetworkInDesiredState)): - self.fail(exceptionMessage) - self.assertIsNotNone(persistent_network_1.vlan, "vlan must not be null for persistent network %s" % persistent_network_1.id) + if (exceptionOccured or (not isNetworkInDesiredState)): + raise Exception(exceptionMessage) + self.assertIsNotNone(persistent_network_1.vlan, "vlan must not be null for persistent network %s" % persistent_network_1.id) - persistent_network_2 = Network.create(self.api_client,self.services["isolated_network"], + persistent_network_2 = Network.create(self.api_client,self.services["isolated_network"], networkofferingid=self.persistent_network_offering_LB.id, accountid=account.name,domainid=account.domainid, zoneid=self.zone.id, vpcid=vpc.id, gateway="10.1.2.1", netmask="255.255.255.0") - response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented") - exceptionOccured = response[0] - isNetworkInDesiredState = response[1] - exceptionMessage = response[2] + response = verifyNetworkState(self.apiclient, persistent_network_2.id, "implemented") + exceptionOccured = response[0] + isNetworkInDesiredState = response[1] + exceptionMessage = response[2] - if (exceptionOccured or (not isNetworkInDesiredState)): - self.fail(exceptionMessage) - self.assertIsNotNone(persistent_network_2.vlan, "vlan must not be null for persistent network: %s" % persistent_network_2.id) + if (exceptionOccured or (not isNetworkInDesiredState)): + raise Exception(exceptionMessage) + self.assertIsNotNone(persistent_network_2.vlan, "vlan must not be null for persistent network: %s" % persistent_network_2.id) - # Deploy VMs in above networks (VM1, VM2 in network1 and VM3, VM4 in network2) - try: + # Deploy VMs in above networks (VM1, VM2 in network1 and VM3, VM4 in network2) virtual_machine_1 = VirtualMachine.create(self.apiclient,self.services["virtual_machine"], networkids=[persistent_network_1.id],serviceofferingid=self.service_offering.id, accountid=account.name,domainid=self.domain.id) @@ -1987,38 +2022,39 @@ def test_vpc_delete_account(self): virtual_machine_4 = VirtualMachine.create(self.apiclient,self.services["virtual_machine"], networkids=[persistent_network_2.id],serviceofferingid=self.service_offering.id, accountid=account.name,domainid=self.domain.id) - except Exception as e: - self.fail("vm creation failed: %s" % e) - # Associate IP addresses to persistent networks - ipaddress_1 = self.GetAssociatedIpForNetwork(persistent_network_1.id, vpcid=vpc.id, account=account) - ipaddress_2 = self.GetAssociatedIpForNetwork(persistent_network_1.id, vpcid=vpc.id, account=account) - ipaddress_3 = self.GetAssociatedIpForNetwork(persistent_network_2.id, vpcid=vpc.id, account=account) + # Associate IP addresses to persistent networks + ipaddress_1 = self.GetAssociatedIpForNetwork(persistent_network_1.id, vpcid=vpc.id, account=account) + ipaddress_2 = self.GetAssociatedIpForNetwork(persistent_network_1.id, vpcid=vpc.id, account=account) + ipaddress_3 = self.GetAssociatedIpForNetwork(persistent_network_2.id, vpcid=vpc.id, account=account) - # Create NAT rule for VM 1 - NATRule.create(self.api_client, virtual_machine_1, + # Create NAT rule for VM 1 + NATRule.create(self.api_client, virtual_machine_1, self.services["natrule"],ipaddressid=ipaddress_1.ipaddress.id, networkid=persistent_network_1.id) - # Create Static NAT rule for VM 2 - StaticNATRule.enable(self.apiclient, ipaddressid=ipaddress_2.ipaddress.id, + # Create Static NAT rule for VM 2 + StaticNATRule.enable(self.apiclient, ipaddressid=ipaddress_2.ipaddress.id, virtualmachineid=virtual_machine_2.id, networkid=persistent_network_1.id) - # Create load balancer rule for ipaddress3 and assign to VM3 and VM4 - lb_rule = LoadBalancerRule.create(self.apiclient,self.services["lbrule"], + # Create load balancer rule for ipaddress3 and assign to VM3 and VM4 + lb_rule = LoadBalancerRule.create(self.apiclient,self.services["lbrule"], ipaddressid=ipaddress_3.ipaddress.id, accountid=account.name, networkid=persistent_network_2.id, domainid=account.domainid) - lb_rule.assign(self.api_client, [virtual_machine_3, virtual_machine_4]) + lb_rule.assign(self.api_client, [virtual_machine_3, virtual_machine_4]) - # Create network ACL for both ther persistent networks (tiers of VPC) - ingressAclNetwork1, egressAclNetwork1 = self.CreateIngressEgressNetworkACLForNetwork(persistent_network_1.id) - ingressAclNetwork2, egressAclNetwork2 = self.CreateIngressEgressNetworkACLForNetwork(persistent_network_2.id) + # Create network ACL for both ther persistent networks (tiers of VPC) + ingressAclNetwork1, egressAclNetwork1 = self.CreateIngressEgressNetworkACLForNetwork(persistent_network_1.id) + ingressAclNetwork2, egressAclNetwork2 = self.CreateIngressEgressNetworkACLForNetwork(persistent_network_2.id) - self.CheckIngressEgressConnectivityofVM(virtual_machine_1, ipaddress_1.ipaddress.ipaddress) - self.CheckIngressEgressConnectivityofVM(virtual_machine_2, ipaddress_2.ipaddress.ipaddress) - self.CheckIngressEgressConnectivityofVM(virtual_machine_3, ipaddress_3.ipaddress.ipaddress) - self.CheckIngressEgressConnectivityofVM(virtual_machine_4, ipaddress_3.ipaddress.ipaddress) + self.CheckIngressEgressConnectivityofVM(virtual_machine_1, ipaddress_1.ipaddress.ipaddress) + self.CheckIngressEgressConnectivityofVM(virtual_machine_2, ipaddress_2.ipaddress.ipaddress) + self.CheckIngressEgressConnectivityofVM(virtual_machine_3, ipaddress_3.ipaddress.ipaddress) + self.CheckIngressEgressConnectivityofVM(virtual_machine_4, ipaddress_3.ipaddress.ipaddress) + except Exception as e: + self.cleanup.append(account) + self.fail(e) # Delete account account.delete(self.apiclient) diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py index c593fb6d9e..15c4d5e729 100644 --- a/test/integration/component/test_projects.py +++ b/test/integration/component/test_projects.py @@ -1474,6 +1474,7 @@ def setUpClass(cls): cls._cleanup = [ cls.project, cls.account, + cls.user, cls.disk_offering, cls.service_offering ] diff --git a/test/integration/component/test_snapshot_gc.py b/test/integration/component/test_snapshot_gc.py index 42c361cdff..5c475af09c 100644 --- a/test/integration/component/test_snapshot_gc.py +++ b/test/integration/component/test_snapshot_gc.py @@ -16,13 +16,22 @@ # under the License. from nose.plugins.attrib import attr -from marvin.cloudstackTestCase import * -from marvin.cloudstackAPI import * -from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.lib.common import * -from marvin.lib.utils import is_snapshot_on_nfs - +from marvin.cloudstackTestCase import cloudstackTestCase, unittest +#from marvin.cloudstackAPI import * +from marvin.lib.utils import ( + is_snapshot_on_nfs, + cleanup_resources) +from marvin.lib.base import (Account, + Snapshot, + ServiceOffering, + VirtualMachine) +from marvin.lib.common import (get_domain, + get_zone, + get_template, + list_volumes, + list_accounts, + list_snapshots, + wait_for_cleanup) class Services: """Test Snapshots Services @@ -177,7 +186,7 @@ def setUpClass(cls): volume = volumes[0] # Create a snapshot from the ROOTDISK - cls.snapshot = Snapshot.create(cls.api_client, volumes[0].id) + cls.snapshot = Snapshot.create(cls.api_client, volume.id) except Exception, e: cls.tearDownClass() unittest.SkipTest("setupClass fails for %s" % cls.__name__) @@ -223,70 +232,50 @@ def test_02_accountSnapshotClean(self): # b) snapshot image($snapshot_id) should be deleted from the # /secondary/snapshots/$accountid/$volumeid/ - accounts = list_accounts( + try: + accounts = list_accounts( self.apiclient, id=self.account.id ) - self.assertEqual( + self.assertEqual( isinstance(accounts, list), True, "Check list response returns a valid list" ) - self.assertNotEqual( + self.assertNotEqual( len(accounts), 0, "Check list Accounts response" ) - # VM should be in 'Running' state - virtual_machines = list_virtual_machines( - self.apiclient, - id=self.virtual_machine.id - ) - self.assertEqual( - isinstance(virtual_machines, list), - True, - "Check list response returns a valid list" - ) - self.assertNotEqual( - len(virtual_machines), - 0, - "Check list virtual machines response" - ) - for virtual_machine in virtual_machines: - self.debug("VM ID: %s, VM state: %s" % ( - virtual_machine.id, - virtual_machine.state - )) - self.assertEqual( - virtual_machine.state, - 'Running', - "Check list VM response for Running state" - ) - - # Verify the snapshot was created or not - snapshots = list_snapshots( + # Verify the snapshot was created or not + snapshots = list_snapshots( self.apiclient, id=self.snapshot.id ) - self.assertEqual( + self.assertEqual( isinstance(snapshots, list), True, "Check list response returns a valid list" ) - self.assertNotEqual( + self.assertNotEqual( snapshots, None, "No such snapshot %s found" % self.snapshot.id ) - self.assertEqual( + self.assertEqual( snapshots[0].id, self.snapshot.id, "Check snapshot id in list resources call" ) - self.assertTrue(is_snapshot_on_nfs(self.apiclient, self.dbclient, self.config, self.zone.id, self.snapshot.id), - "Snapshot was not found on NFS") + self.assertTrue(is_snapshot_on_nfs(self.apiclient, self.dbclient, self.config, self.zone.id, self.snapshot.id), + "Snapshot was not found on NFS") + + raise Exception("self raised exception") + except Exception as e: + self._cleanup.append(self.account) + self.fail("Exception occured: %s" % e) self.debug("Deleting account: %s" % self.account.name) # Delete account diff --git a/test/integration/component/test_snapshot_limits.py b/test/integration/component/test_snapshot_limits.py index 95c64322e4..a7da0dbc63 100644 --- a/test/integration/component/test_snapshot_limits.py +++ b/test/integration/component/test_snapshot_limits.py @@ -173,8 +173,6 @@ def setUpClass(cls): cls.tearDownClass() unittest.SkipTest("setupClass fails for %s" % cls.__name__) raise e - else: - cls._cleanup.remove(cls.account) return @classmethod diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py index 03823bed91..4413f43342 100644 --- a/test/integration/component/test_usage.py +++ b/test/integration/component/test_usage.py @@ -1462,6 +1462,7 @@ def setUpClass(cls): cls.services["server"]["zoneid"] = cls.zone.id cls.services["template"] = template.id + cls._cleanup = [] # Create Service offerings, VMs etc cls.account = Account.create( @@ -1470,6 +1471,7 @@ def setUpClass(cls): admin=True, domainid=cls.domain.id ) + cls._cleanup.append(cls.account) cls.services["account"] = cls.account.name @@ -1477,6 +1479,7 @@ def setUpClass(cls): cls.api_client, cls.services["service_offering"] ) + cls._cleanup.append(cls.sevice_offering) cls.virtual_machine = VirtualMachine.create( cls.api_client, cls.services["server"], @@ -1492,10 +1495,6 @@ def setUpClass(cls): domainid=cls.virtual_machine.domainid, services=cls.services["server"] ) - cls._cleanup = [ - cls.service_offering, - cls.account, - ] return @classmethod diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py index b5b08e2d5c..22029b1b30 100644 --- a/test/integration/component/test_volumes.py +++ b/test/integration/component/test_volumes.py @@ -1041,6 +1041,7 @@ def test_create_volume_under_domain(self): name="NROOT", parentdomainid=self.domain.id ) + self.cleanup.append(dom) self.assertTrue(dom is not None, msg="Domain creation failed") domuser = Account.create( @@ -1049,6 +1050,7 @@ def test_create_volume_under_domain(self): admin=False, domainid=dom.id ) + self.cleanup.insert(-2, domuser) self.assertTrue(domuser is not None) domapiclient = self.testClient.getUserApiClient(UserName=domuser.name, DomainName=dom.name) diff --git a/test/integration/smoke/test_affinity_groups.py b/test/integration/smoke/test_affinity_groups.py index 4f3f9ec875..bb0a524591 100644 --- a/test/integration/smoke/test_affinity_groups.py +++ b/test/integration/smoke/test_affinity_groups.py @@ -152,10 +152,10 @@ def test_DeployVmAntiAffinityGroup(self): msg="Both VMs of affinity group %s are on the same host" % self.ag.name) - @classmethod - def tearDownClass(cls): - try: - #Clean up, terminate the created templates - cleanup_resources(cls.apiclient, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) + @classmethod + def tearDownClass(cls): + try: + #Clean up, terminate the created templates + cleanup_resources(cls.apiclient, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) From 60e46293234cccea5d2bd31588123e65af3e9bad Mon Sep 17 00:00:00 2001 From: Sheng Yang Date: Fri, 13 Jun 2014 11:05:35 -0700 Subject: [PATCH 598/683] CLOUDSTACK-6908: Enable IPv6 in sysctl when only necessary This new way would only enable IPv6 when VR is created in IPv6 shared network. Otherwise IPv6 sysctl options remain disable. --- .../patches/debian/config/etc/init.d/cloud-early-config | 1 + systemvm/patches/debian/config/etc/sysctl.conf | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/systemvm/patches/debian/config/etc/init.d/cloud-early-config b/systemvm/patches/debian/config/etc/init.d/cloud-early-config index b8c40db4d7..938e6f863e 100755 --- a/systemvm/patches/debian/config/etc/init.d/cloud-early-config +++ b/systemvm/patches/debian/config/etc/init.d/cloud-early-config @@ -387,6 +387,7 @@ setup_interface() { setup_interface_ipv6() { sysctl net.ipv6.conf.all.disable_ipv6=0 + sysctl net.ipv6.conf.all.forwarding=1 sysctl net.ipv6.conf.all.accept_ra=1 local intfnum=$1 diff --git a/systemvm/patches/debian/config/etc/sysctl.conf b/systemvm/patches/debian/config/etc/sysctl.conf index 586d5bdb7c..961d471dfa 100644 --- a/systemvm/patches/debian/config/etc/sysctl.conf +++ b/systemvm/patches/debian/config/etc/sysctl.conf @@ -42,8 +42,8 @@ net.ipv4.tcp_max_tw_buckets=1000000 net.core.somaxconn=1000000 # Disable IPv6 -net.ipv6.conf.all.disable_ipv6 = 0 -net.ipv6.conf.all.forwarding = 1 -net.ipv6.conf.all.accept_ra = 1 +net.ipv6.conf.all.disable_ipv6 = 1 +net.ipv6.conf.all.forwarding = 0 +net.ipv6.conf.all.accept_ra = 0 net.ipv6.conf.all.accept_redirects = 0 net.ipv6.conf.all.autoconf = 0 From 508a966aa1eb2d251cbf2f5374c3f5111e8541cd Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 13 Jun 2014 15:11:05 -0700 Subject: [PATCH 599/683] CLOUDSTACK-6852: UI - modules - remove variable drModuleIncluded. --- ui/scripts/cloudStack.js | 5 +---- ui/scripts/sharedFunctions.js | 4 +--- ui/scripts/storage.js | 4 ++-- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index ad53a4a0a0..2285276272 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -489,9 +489,6 @@ }; } - document.title = _l('label.app.name'); - - // set value to global variable - drModuleIncluded = isModuleIncluded("dr"); + document.title = _l('label.app.name'); }); })(cloudStack, jQuery); diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index 56728202e6..d79c6f58c1 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -49,8 +49,6 @@ var md5HashedLogin = false; var pageSize = 20; //var pageSize = 1; //for testing only -var drModuleIncluded = false; - //async action var pollAsyncJobResult = function(args) { $.ajax({ @@ -1176,7 +1174,7 @@ function listViewDataProvider(args, data, options) { } var addExtraPropertiesIfDrModuleIncluded = function(jsonObj, resourceType) { - if (drModuleIncluded) { + if (isModuleIncluded("dr")) { $.ajax({ url: createURL("listResourceDetails"), data: { diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 0a2d1dc854..197ad71852 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -906,7 +906,7 @@ } var volumeDrEnabled = false; - if (drModuleIncluded) { + if (isModuleIncluded("dr")) { volumeDrEnabled = cloudStack.dr.sharedFunctions.isVolumeDrEnabled(args.context.volumes[0]); } @@ -920,7 +920,7 @@ success: function(json) { var instanceObjs = json.listvirtualmachinesresponse.virtualmachine; $(instanceObjs).each(function() { - if (drModuleIncluded) { + if (isModuleIncluded("dr")) { var vmDrEnabled = cloudStack.dr.sharedFunctions.isVmDrEnabled(this); if (vmDrEnabled == volumeDrEnabled) { items.push({ From 497042508ab682eb4a45f0e71b301f588545ee17 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Fri, 13 Jun 2014 16:35:29 -0700 Subject: [PATCH 600/683] UI - modules - replace addExtraPropertiesIfDrModuleIncluded() with cloudStack.dr.sharedFunctions.addExtraProperties(). --- ui/scripts/instances.js | 7 ++++--- ui/scripts/network.js | 9 +++++---- ui/scripts/sharedFunctions.js | 26 -------------------------- ui/scripts/storage.js | 5 +++-- ui/scripts/system.js | 14 ++++++++------ 5 files changed, 20 insertions(+), 41 deletions(-) diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js index cda531e5c5..93a40fc097 100644 --- a/ui/scripts/instances.js +++ b/ui/scripts/instances.js @@ -1877,9 +1877,10 @@ else jsonObj.xenserverToolsVersion61plus = false; } - - //if DR module is included - addExtraPropertiesIfDrModuleIncluded(jsonObj, "UserVM"); + + if (isModuleIncluded("dr")) { + cloudStack.dr.sharedFunctions.addExtraProperties(jsonObj, "UserVM"); + } args.response.success({ actionFilter: vmActionfilter, diff --git a/ui/scripts/network.js b/ui/scripts/network.js index 4772c34564..2039aa047e 100755 --- a/ui/scripts/network.js +++ b/ui/scripts/network.js @@ -1383,10 +1383,11 @@ success: function(json) { var jsonObj = json.listnetworksresponse.network[0]; addExtraPropertiesToGuestNetworkObject(jsonObj); - - //if DR module is included - addExtraPropertiesIfDrModuleIncluded(jsonObj, "Network"); - + + if (isModuleIncluded("dr")) { + cloudStack.dr.sharedFunctions.addExtraProperties(jsonObj, "Network"); + } + args.response.success({ actionFilter: cloudStack.actionFilter.guestNetwork, data: jsonObj diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js index d79c6f58c1..f58fdd2176 100644 --- a/ui/scripts/sharedFunctions.js +++ b/ui/scripts/sharedFunctions.js @@ -1173,32 +1173,6 @@ function listViewDataProvider(args, data, options) { return data; } -var addExtraPropertiesIfDrModuleIncluded = function(jsonObj, resourceType) { - if (isModuleIncluded("dr")) { - $.ajax({ - url: createURL("listResourceDetails"), - data: { - resourceid: jsonObj.id, - resourcetype: resourceType - }, - async: false, - success: function(json) { - var drFieldNameArray = []; - var resourcedetails = json.listresourcedetailsresponse.resourcedetail; - if (resourcedetails != undefined) { - for (var i = 0; i < resourcedetails.length; i++) { - if (resourcedetails[i].key.indexOf("DR_") > -1) { - drFieldNameArray.push(resourcedetails[i].key); - jsonObj[resourcedetails[i].key] = resourcedetails[i].value; - } - } - } - jsonObj["drFieldNameArray"] = drFieldNameArray; - } - }); - } -} - //used by infrastructure page and network page var addExtraPropertiesToGuestNetworkObject = function(jsonObj) { jsonObj.networkdomaintext = jsonObj.networkdomain; diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js index 197ad71852..260f5212e5 100644 --- a/ui/scripts/storage.js +++ b/ui/scripts/storage.js @@ -1499,8 +1499,9 @@ success: function(json) { var jsonObj = json.listvolumesresponse.volume[0]; - //if DR module is included - addExtraPropertiesIfDrModuleIncluded(jsonObj, "Volume"); + if (isModuleIncluded("dr")) { + cloudStack.dr.sharedFunctions.addExtraProperties(jsonObj, "Volume"); + } args.response.success({ actionFilter: volumeActionfilter, diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 156be7a399..37fe504507 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -1954,9 +1954,10 @@ success: function (json) { selectedGuestNetworkObj = json.listnetworksresponse.network[0]; addExtraPropertiesToGuestNetworkObject(selectedGuestNetworkObj); - - //if DR module is included - addExtraPropertiesIfDrModuleIncluded(selectedGuestNetworkObj, "Network"); + + if (isModuleIncluded("dr")) { + cloudStack.dr.sharedFunctions.addExtraProperties(selectedGuestNetworkObj, "Network"); + } args.response.success({ actionFilter: cloudStack.actionFilter.guestNetwork, @@ -7594,9 +7595,10 @@ } //override default error handling: cloudStack.dialog.notice({ message: parseXMLHttpResponse(XMLHttpResponse)}); }); - - //if DR module is included - addExtraPropertiesIfDrModuleIncluded(selectedZoneObj, "Zone"); + + if (isModuleIncluded("dr")) { + cloudStack.dr.sharedFunctions.addExtraProperties(selectedZoneObj, "Zone"); + } args.response.success({ actionFilter: zoneActionfilter, From 89c35abb4db0f362f9159ea39a6eb70ad4351921 Mon Sep 17 00:00:00 2001 From: VinayV Date: Thu, 12 Jun 2014 14:49:35 +0530 Subject: [PATCH 601/683] CLOUDSTACK-6282: Modified IPAddress tests to fix the failures. Modified Instances, snapshots, templates tests to handle KVM Hypervisor --- .../component/test_escalations_instances.py | 122 +- .../component/test_escalations_ipaddresses.py | 1886 +++++++++-------- .../component/test_escalations_snapshots.py | 60 +- .../component/test_escalations_templates.py | 97 +- tools/marvin/marvin/config/test_data.py | 7 + tools/marvin/marvin/lib/base.py | 2 +- 6 files changed, 1116 insertions(+), 1058 deletions(-) diff --git a/test/integration/component/test_escalations_instances.py b/test/integration/component/test_escalations_instances.py index 9e040db9f7..4900ff625e 100644 --- a/test/integration/component/test_escalations_instances.py +++ b/test/integration/component/test_escalations_instances.py @@ -15,52 +15,30 @@ # specific language governing permissions and limitations # under the License. -#Import Local Modules -from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.cloudstackAPI import (createVolume, - createTemplate) -from marvin.lib.base import (Volume, - Iso, - VirtualMachine, - Template, - Snapshot, - SecurityGroup, - Account, - Zone, - Network, - NetworkOffering, - DiskOffering, - ServiceOffering, - VmSnapshot, - SnapshotPolicy, - SSHKeyPair, - Resources, - Configurations, - VpnCustomerGateway, - Hypervisor, - VpcOffering, - VPC, - NetworkACL) -from marvin.lib.common import (get_zone, - get_domain, - get_template, - list_os_types) -from marvin.lib.utils import (validateList, - cleanup_resources, - random_gen) -from marvin.codes import (PASS, FAIL, EMPTY_LIST) +# Import Local Modules +from marvin.cloudstackTestCase import * +from marvin.cloudstackException import * +from marvin.cloudstackAPI import * +from marvin.sshClient import SshClient +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * +from marvin.lib.utils import checkVolumeSize +from marvin.codes import SUCCESS from nose.plugins.attrib import attr -import time +from time import sleep +from ctypes.wintypes import BOOLEAN class TestListInstances(cloudstackTestCase): @classmethod def setUpClass(cls): try: - cls._cleanup = [] + cls._cleanup = [] cls.testClient = super(TestListInstances, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() cls.services = cls.testClient.getParsedTestDataConfig() + cls.hypervisor = cls.testClient.getHypervisorInfo() # Get Domain, Zone, Template cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) @@ -101,7 +79,7 @@ def setUpClass(cls): cls.user = cls.account.user[0] cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) # Updating resource Limits - for i in range(0,12): + for i in range(0, 12): Resources.updateLimit( cls.api_client, account=cls.account.name, @@ -124,7 +102,7 @@ def setUp(self): self.cleanup = [] def tearDown(self): - #Clean up, terminate the created resources + # Clean up, terminate the created resources cleanup_resources(self.apiClient, self.cleanup) return @@ -194,7 +172,7 @@ def test_01_list_instances_pagination(self): list_instances_before, "Virtual Machine already exists for newly created user" ) - # If number of instances are less than (pagesize + 1), then creating them + # If number of instances are less than (pagesize + 1), then creating them for i in range(0, (self.services["pagesize"] + 1)): vm_created = VirtualMachine.create( self.userapiclient, @@ -216,7 +194,7 @@ def test_01_list_instances_pagination(self): "Newly created VM name and the test data VM name are not matching" ) - # Listing all the instances again after creating VM's + # Listing all the instances again after creating VM's list_instances_after = VirtualMachine.list(self.userapiclient, listall=self.services["listall"]) status = validateList(list_instances_after) self.assertEquals( @@ -301,7 +279,7 @@ def test_01_list_instances_pagination(self): "VM was not deleted" ) return - + @attr(tags=["advanced", "basic", "selfservice"]) def test_02_list_Running_vm(self): """ @@ -363,7 +341,7 @@ def test_02_list_Running_vm(self): ) running_vm = list_running_vms_after[0] - #Creating expected and actual values dictionaries + # Creating expected and actual values dictionaries expected_dict = { "id":vm_created.id, "name":vm_created.name, @@ -456,7 +434,7 @@ def test_03_list_Stopped_vm(self): "Stopped VM list count is not matching" ) stopped_vm = list_stopped_vms_after[0] - #Creating expected and actual values dictionaries + # Creating expected and actual values dictionaries expected_dict = { "id":vm_created.id, "name":vm_created.name, @@ -564,7 +542,7 @@ def test_04_list_Destroyed_vm(self): "Destroyed VM list count is not matching" ) destroyed_vm = list_destroyed_vms_admin[0] - #Creating expected and actual values dictionaries + # Creating expected and actual values dictionaries expected_dict = { "id":vm_created.id, "name":vm_created.name, @@ -666,7 +644,7 @@ def test_05_list_vm_by_id(self): "Listing of VM by Id failed" ) listed_vm = list_vm_byid[0] - #Creating expected and actual values dictionaries + # Creating expected and actual values dictionaries expected_dict = { "id":vm_created.id, "name":vm_created.name, @@ -782,7 +760,7 @@ def test_06_list_vm_by_name(self): "VM list by full name count is not matching" ) # Verifying that the details of the listed VM are same as the VM created above - #Creating expected and actual values dictionaries + # Creating expected and actual values dictionaries expected_dict = { "id":vms[0].id, "name":vms[0].name, @@ -916,7 +894,7 @@ def test_07_list_vm_by_name_state(self): "Count of VM list by name and state is not matching" ) # Verifying that the details of the listed VM are same as the VM created above - #Creating expected and actual values dictionaries + # Creating expected and actual values dictionaries expected_dict = { "id":vm_created.id, "name":vm_created.name, @@ -1068,7 +1046,7 @@ def test_08_list_vm_by_zone(self): ) listed_vm = list_vms_after[0] # Verifying that the details of the Listed VM are same as the VM deployed above - #Creating expected and actual values dictionaries + # Creating expected and actual values dictionaries expected_dict = { "id":vm_created.id, "name":vm_created.name, @@ -1235,7 +1213,7 @@ def test_09_list_vm_by_zone_name(self): ) listed_vm = list_vms[0] # Verifying that the details of the Listed VM are same as the VM deployed above - #Creating expected and actual values dictionaries + # Creating expected and actual values dictionaries expected_dict = { "id":vm_created.id, "name":vm_created.name, @@ -1388,7 +1366,7 @@ def test_10_list_vm_by_zone_name_state(self): ) listed_vm = list_vms[0] # Verifying that the details of the Listed VM are same as the VM deployed above - #Creating expected and actual values dictionaries + # Creating expected and actual values dictionaries expected_dict = { "id":vm_created.id, "name":vm_created.name, @@ -1456,7 +1434,7 @@ def test_10_list_vm_by_zone_name_state(self): ) listed_vm = list_vms[0] # Verifying that the details of the Listed VM are same as the VM deployed above - #Creating expected and actual values dictionaries + # Creating expected and actual values dictionaries expected_dict = { "id":vm_created.id, "name":vm_created.name, @@ -1899,7 +1877,7 @@ def setUpClass(cls): cls.testClient = super(TestInstances, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() cls.services = cls.testClient.getParsedTestDataConfig() - + cls.hypervisor = cls.testClient.getHypervisorInfo() # Get Domain, Zone, Template cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) @@ -1941,7 +1919,7 @@ def setUpClass(cls): cls.user = cls.account.user[0] cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) # Updating resource Limits - for i in range(0,12): + for i in range(0, 12): Resources.updateLimit( cls.api_client, account=cls.account.name, @@ -1963,7 +1941,7 @@ def setUp(self): self.cleanup = [] def tearDown(self): - #Clean up, terminate the created resources + # Clean up, terminate the created resources cleanup_resources(self.apiClient, self.cleanup) return @@ -2024,6 +2002,8 @@ def test_13_attach_detach_iso(self): Step10: Detaching the ISO attached in step8 Step11: Verifying that detached ISO details are not associated with VM """ + if self.hypervisor.lower() == 'kvm': + raise unittest.SkipTest("VM Snapshot is not supported on KVM. Hence, skipping the test") # Listing all the VM's for a User list_vms_before = VirtualMachine.list( self.userapiclient, @@ -2154,6 +2134,8 @@ def test_14_vm_snapshot_pagination(self): Step12: Listing all the VM snapshots in Page 2 with page size Step13: Verifying that size of the list is 0 """ + if self.hypervisor.lower() == 'kvm': + raise unittest.SkipTest("VM Snapshot is not supported on KVM. Hence, skipping the test") # Listing all the VM's for a User list_vms_before = VirtualMachine.list( self.userapiclient, @@ -2309,6 +2291,8 @@ def test_15_revert_vm_to_snapshot(self): Step10: Verifying that only 1 VM snapshot is having current flag set as true. Step11: Verifying that the VM Snapshot with current flag set to true is the reverted snapshot in Step 8 """ + if self.hypervisor.lower() == 'kvm': + raise unittest.SkipTest("VM Snapshot is not supported on KVM. Hence, skipping the test") # Listing all the VM's for a User list_vms_before = VirtualMachine.list( self.userapiclient, @@ -2624,6 +2608,32 @@ def test_16_list_vm_volumes_pagination(self): list_volumes_page2, "Volumes listed in page 2" ) + # Listing all the volumes for a VM again in page 1 + list_volumes_page1 = Volume.list( + self.userapiclient, + listall=self.services["listall"], + virtualmachineid=vm_created.id, + page=1, + pagesize=self.services["pagesize"] + ) + status = validateList(list_volumes_page1) + self.assertEquals( + PASS, + status[0], + "Volumes not listed in page1" + ) + # Verifying that list size is equal to page size + self.assertEquals( + self.services["pagesize"], + len(list_volumes_page1), + "VM's volume count is not matching in page 1" + ) + # Detaching all the volumes attached from VM + for i in range(0, len(list_volumes_page1)): + vm_created.detach_volume( + self.userapiclient, + list_volumes_page1[i] + ) return @attr(tags=["advanced", "basic", "provisioning"]) @@ -2641,6 +2651,8 @@ def test_17_running_vm_scaleup(self): Step5: Perform change service (scale up) the Running VM deployed in step1 Step6: Verifying that VM's service offerings is changed """ + if self.hypervisor.lower() == 'kvm': + raise unittest.SkipTest("ScaleVM is not supported on KVM. Hence, skipping the test") # Checking if Dynamic scaling of VM is supported or not list_config = Configurations.list( self.apiClient, @@ -3445,4 +3457,4 @@ def test_23_deploy_vm_multiple_securitygroups(self): vm_securitygroups_flag, "Security Groups in VM are not same as created" ) - return \ No newline at end of file + return diff --git a/test/integration/component/test_escalations_ipaddresses.py b/test/integration/component/test_escalations_ipaddresses.py index 23dd76b9cf..0b31d2edf8 100644 --- a/test/integration/component/test_escalations_ipaddresses.py +++ b/test/integration/component/test_escalations_ipaddresses.py @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -#Import Local Modules +# Import Local Modules from marvin.cloudstackTestCase import * from marvin.cloudstackException import * from marvin.cloudstackAPI import * @@ -27,6 +27,7 @@ from marvin.codes import SUCCESS from nose.plugins.attrib import attr from time import sleep +from ctypes.wintypes import BOOLEAN class TestIpAddresses(cloudstackTestCase): @@ -37,6 +38,7 @@ def setUpClass(cls): cls.testClient = super(TestIpAddresses, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() cls.services = cls.testClient.getParsedTestDataConfig() + cls.hypervisor = cls.testClient.getHypervisorInfo() # Get Domain, Zone, Template cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) @@ -51,7 +53,7 @@ def setUpClass(cls): else: cls.storagetype = 'shared' cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' - + cls.services['mode'] = cls.zone.networktype cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() cls.services["virtual_machine"]["zoneid"] = cls.zone.id @@ -62,15 +64,7 @@ def setUpClass(cls): ) cls._cleanup.append(cls.service_offering) cls.services['mode'] = cls.zone.networktype - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - cls._cleanup.append(cls.account) + except Exception as e: cls.tearDownClass() raise Exception("Warning: Exception in setup : %s" % e) @@ -80,9 +74,18 @@ def setUp(self): self.apiClient = self.testClient.getApiClient() self.cleanup = [] + self.account = Account.create( + self.apiClient, + self.services["account"], + domainid=self.domain.id + ) + # Getting authentication for user in newly created Account + self.user = self.account.user[0] + self.userapiclient = self.testClient.getUserApiClient(self.user.username, self.domain.name) +# self.cleanup.append(self.account) def tearDown(self): - #Clean up, terminate the created volumes + # Clean up, terminate the created volumes cleanup_resources(self.apiClient, self.cleanup) return @@ -125,7 +128,7 @@ def __verify_values(self, expected_vals, actual_vals): @attr(tags=["advanced", "provisioning"]) def test_01_list_ipaddresses_pagination(self): - """ + """ @summary: Test List IP Addresses pagination @Steps: Step1: Creating a network for the user @@ -209,7 +212,7 @@ def test_01_list_ipaddresses_pagination(self): list_ipaddresses_before, "IP Addresses listed for newly created user" ) - # Associating (pagesize + 1) number of IP Addresses + # Associating (pagesize + 1) number of IP Addresses for i in range(0, (self.services["pagesize"] + 1)): ipaddress = PublicIPAddress.create( self.userapiclient, @@ -220,7 +223,7 @@ def test_01_list_ipaddresses_pagination(self): ipaddress, "Failed to Associate IP Address" ) - + # Listing all the IP Addresses for a user list_ipaddresses_after = PublicIPAddress.list( self.userapiclient, @@ -290,11 +293,12 @@ def test_01_list_ipaddresses_pagination(self): list_ipaddress_page2, "Disassociation of IP Address Failed" ) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_02_list_ipaddresses_byid(self): - """ + """ @summary: Test List IP Addresses details by ID @Steps: Step1: Creating a network for the user @@ -391,7 +395,7 @@ def test_02_list_ipaddresses_byid(self): list_ipaddresses_before, "IP Addresses listed for newly created user" ) - # Associating an IP Addresses to Network created + # Associating an IP Addresses to Network created associated_ipaddress = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -464,11 +468,12 @@ def test_02_list_ipaddresses_byid(self): ipaddress_status, "Listed IP Address details are not as expected" ) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_03_associate_ipaddress_for_vpc(self): - """ + """ @summary: Test to Associate IP Address for VPC @Steps: Step1: Creating a VPC for the user @@ -507,12 +512,12 @@ def test_03_associate_ipaddress_for_vpc(self): "VPC Creation Failed" ) self.cleanup.append(vpc_created) - # Listing the vpc for a user after creating a vpc + # Listing the vpc for a user after creating a vpc list_vpc_after = VPC.list(self.userapiclient) status = validateList(list_vpc_after) self.assertEquals( - PASS, - status[0], + PASS, + status[0], "list VPC not as expected" ) # Verifying the list vpc size is increased by 1 @@ -537,7 +542,7 @@ def test_03_associate_ipaddress_for_vpc(self): len(list_ipaddresses_before), "Failed to List VPC IP Address" ) - # Associating an IP Addresses to VPC created + # Associating an IP Addresses to VPC created associated_ipaddress = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -615,11 +620,12 @@ def test_03_associate_ipaddress_for_vpc(self): ipaddress_status, "Listed IP Address details are not as expected" ) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_04_create_delete_lbrule_fornonvpc(self): - """ + """ @summary: Test to list, create and delete Load Balancer Rule for IP Address associated to Non VPC network @Steps: Step1: Creating a Network for the user @@ -682,7 +688,7 @@ def test_04_create_delete_lbrule_fornonvpc(self): list_ipaddresses_before, "IP Addresses listed for newly created User" ) - # Associating an IP Addresses to Network created + # Associating an IP Addresses to Network created associated_ipaddress = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -785,11 +791,12 @@ def test_04_create_delete_lbrule_fornonvpc(self): list_lbrules_after, "Failed to delete Load Balancer Rule" ) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_05_create_delete_lbrule_forvpc(self): - """ + """ @summary: Test to list, create and delete Load Balancer Rule for IP Address associated to VPC @Steps: Step1: Creating a VPC for the user @@ -829,12 +836,12 @@ def test_05_create_delete_lbrule_forvpc(self): vpc_created, "VPC Creation Failed" ) - # Listing the vpc for a user after creating a vpc + # Listing the vpc for a user after creating a vpc list_vpc_after = VPC.list(self.userapiclient) status = validateList(list_vpc_after) self.assertEquals( - PASS, - status[0], + PASS, + status[0], "list VPC not as expected" ) # Verifying the list vpc size is increased by 1 @@ -843,25 +850,25 @@ def test_05_create_delete_lbrule_forvpc(self): len(list_vpc_after), "list VPC not equal as expected" ) - #List network offering for vpc = true + # List network offering for vpc = true network_offering_vpc_true_list = NetworkOffering.list( self.userapiclient, - forvpc = "true", - zoneid = self.zone.id, - supportedServices = "Lb", - state = "Enabled" + forvpc="true", + zoneid=self.zone.id, + supportedServices="Lb", + state="Enabled" ) status = validateList(network_offering_vpc_true_list) - self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with Lb") - # Creating network under VPC + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with Lb") + # Creating network under VPC network_created = Network.create( self.userapiclient, self.services["ntwk"], - networkofferingid = network_offering_vpc_true_list[0].id, - vpcid = vpc_created.id, + networkofferingid=network_offering_vpc_true_list[0].id, + vpcid=vpc_created.id, zoneid=self.zone.id, - gateway= self.services["ntwk"]["gateway"], - netmask = self.services["ntwk"]["netmask"] + gateway=self.services["ntwk"]["gateway"], + netmask=self.services["ntwk"]["netmask"] ) self.cleanup.append(network_created) self.assertIsNotNone( @@ -876,8 +883,8 @@ def test_05_create_delete_lbrule_forvpc(self): ) status = validateList(list_ipaddresses_before) self.assertEquals( - PASS, - status[0], + PASS, + status[0], "list IP Addresses not as expected" ) # Verifying the list vpc size is increased by 1 @@ -886,7 +893,7 @@ def test_05_create_delete_lbrule_forvpc(self): len(list_ipaddresses_before), "list IP Addresses not equal as expected" ) - # Associating an IP Addresses to VPC created + # Associating an IP Addresses to VPC created associated_ipaddress = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -990,11 +997,12 @@ def test_05_create_delete_lbrule_forvpc(self): list_lbrules_after, "Failed to delete Load Balancer Rule" ) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_06_update_lbrule_name(self): - """ + """ @summary: Test to Update Load Balancer Rule Name for IP Address associated to Non VPC network @Steps: Step1: Creating a Network for the user @@ -1073,7 +1081,7 @@ def test_06_update_lbrule_name(self): list_ipaddresses_before, "IP Addresses listed for newly created User" ) - # Associating an IP Addresses to Network created + # Associating an IP Addresses to Network created associated_ipaddress = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -1186,11 +1194,12 @@ def test_06_update_lbrule_name(self): lbrule_status, "Updated Load Balancer Rule details are not as expected" ) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_07_assign_remove_lbrule_toinstance(self): - """ + """ @summary: Test to Assign and Remove Load Balancer Rule to an Instance @Steps: Step1: Creating a Network for the user @@ -1260,7 +1269,7 @@ def test_07_assign_remove_lbrule_toinstance(self): list_ipaddresses_before, "IP Addresses listed for newly created User" ) - # Associating an IP Addresses to Network created + # Associating an IP Addresses to Network created associated_ipaddress = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -1501,11 +1510,12 @@ def test_07_assign_remove_lbrule_toinstance(self): # Destroying the VM Launched vm_created.delete(self.userapiclient) vm_created.expung(self.apiClient) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_08_list_create_delete_lbsticky_policy(self): - """ + """ @summary: Test to List, Create, Delete Load Balancer Stickyness Policy @Steps: Step1: Creating a Network for the user @@ -1586,7 +1596,7 @@ def test_08_list_create_delete_lbsticky_policy(self): list_ipaddresses_before, "IP Addresses listed for newly created User" ) - # Associating an IP Addresses to Network created + # Associating an IP Addresses to Network created associated_ipaddress = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -1700,7 +1710,7 @@ def test_08_list_create_delete_lbsticky_policy(self): True, lbstickypolicy_status, "Created Load Balancer Sticky Policy details are not as expected" - ) + ) # Listing Load Balancer Stickyness Policies for LB Rule list_lbstickypolicy_after = LoadBalancerRule.listStickyPolicies( self.userapiclient, @@ -1737,11 +1747,12 @@ def test_08_list_create_delete_lbsticky_policy(self): len(list_lbstickypolicy_after[0].stickinesspolicy), "Sticky Policy listed for newly created Load Balancer Rule" ) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_09_create_delete_portforwarding_fornonvpc(self): - """ + """ @summary: Test to list, create and delete Port Forwarding for IP Address associated to Non VPC network @Steps: Step1: Creating a Network for the user @@ -1804,7 +1815,7 @@ def test_09_create_delete_portforwarding_fornonvpc(self): list_ipaddresses_before, "IP Addresses listed for newly created User" ) - # Associating an IP Addresses to Network created + # Associating an IP Addresses to Network created associated_ipaddress = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -1960,11 +1971,12 @@ def test_09_create_delete_portforwarding_fornonvpc(self): # Destroying the VM Launched vm_created.delete(self.userapiclient) vm_created.expung(self.apiClient) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_10_create_delete_portforwarding_forvpc(self): - """ + """ @summary: Test to list, create and delete Port Forwarding Rule for IP Address associated to VPC @Steps: Step1: Creating a VPC for the user @@ -2006,12 +2018,12 @@ def test_10_create_delete_portforwarding_forvpc(self): vpc_created, "VPC Creation Failed" ) - # Listing the vpc for a user after creating a vpc + # Listing the vpc for a user after creating a vpc list_vpc_after = VPC.list(self.userapiclient) status = validateList(list_vpc_after) self.assertEquals( - PASS, - status[0], + PASS, + status[0], "list VPC not as expected" ) # Verifying the list vpc size is increased by 1 @@ -2020,25 +2032,25 @@ def test_10_create_delete_portforwarding_forvpc(self): len(list_vpc_after), "list VPC not equal as expected" ) - #List network offering for vpc = true + # List network offering for vpc = true network_offering_vpc_true_list = NetworkOffering.list( self.userapiclient, - forvpc = "true", - zoneid = self.zone.id, - supportedServices = "SourceNat,PortForwarding", - state = "Enabled" + forvpc="true", + zoneid=self.zone.id, + supportedServices="SourceNat,PortForwarding", + state="Enabled" ) status = validateList(network_offering_vpc_true_list) - self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with PortForwarding") - # Creating network under VPC + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with PortForwarding") + # Creating network under VPC network_created = Network.create( self.userapiclient, self.services["ntwk"], - networkofferingid = network_offering_vpc_true_list[0].id, - vpcid = vpc_created.id, + networkofferingid=network_offering_vpc_true_list[0].id, + vpcid=vpc_created.id, zoneid=self.zone.id, - gateway= self.services["ntwk"]["gateway"], - netmask = self.services["ntwk"]["netmask"] + gateway=self.services["ntwk"]["gateway"], + netmask=self.services["ntwk"]["netmask"] ) self.assertIsNotNone( network_created, @@ -2051,8 +2063,8 @@ def test_10_create_delete_portforwarding_forvpc(self): ) status = validateList(list_ipaddresses_before) self.assertEquals( - PASS, - status[0], + PASS, + status[0], "list IP Addresses not as expected" ) # Verifying the list vpc size is increased by 1 @@ -2061,7 +2073,7 @@ def test_10_create_delete_portforwarding_forvpc(self): len(list_ipaddresses_before), "list IP Addresses not equal as expected" ) - # Associating an IP Addresses to VPC created + # Associating an IP Addresses to VPC created associated_ipaddress = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -2183,11 +2195,12 @@ def test_10_create_delete_portforwarding_forvpc(self): # Destroying the VM Launched vm_created.delete(self.userapiclient) vm_created.expung(self.apiClient) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_11_create_delete_firewallrule(self): - """ + """ @summary: Test to list, create and delete Firewall Rule for IP Address associated to Non VPC network @Steps: Step1: Creating a Network for the user @@ -2250,7 +2263,7 @@ def test_11_create_delete_firewallrule(self): list_ipaddresses_before, "IP Addresses listed for newly created User" ) - # Associating an IP Addresses to Network created + # Associating an IP Addresses to Network created associated_ipaddress = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -2357,11 +2370,12 @@ def test_11_create_delete_firewallrule(self): list_firewalls_after, "Failed to create Firewall Rule" ) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_12_create_delete_remoteaccessvpn(self): - """ + """ @summary: Test to list, create and delete Remote Access VPNs @Steps: Step1: Creating a Network for the user @@ -2424,7 +2438,7 @@ def test_12_create_delete_remoteaccessvpn(self): list_ipaddresses_before, "IP Addresses listed for newly created User" ) - # Associating an IP Addresses to Network created + # Associating an IP Addresses to Network created associated_ipaddress = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -2528,11 +2542,12 @@ def test_12_create_delete_remoteaccessvpn(self): list_vpns_after, "Failed to create Remote Access VPN" ) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_13_add_remove_vpnusers(self): - """ + """ @summary: Test to list, add and remove VPN Users @Steps: Step1: Creating a Network for the user @@ -2597,7 +2612,7 @@ def test_13_add_remove_vpnusers(self): list_ipaddresses_before, "IP Addresses listed for newly created User" ) - # Associating an IP Addresses to Network created + # Associating an IP Addresses to Network created associated_ipaddress = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -2738,11 +2753,12 @@ def test_13_add_remove_vpnusers(self): # Destroying the VM vm_created.delete(self.userapiclient) vm_created.expung(self.apiClient) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_14_enable_disable_staticnat_fornonvpc(self): - """ + """ @summary: Test to Enable and Disable StaticNat for IP Address associated to Non VPC Network @Steps: Step1: Creating a Network for the user @@ -2803,7 +2819,7 @@ def test_14_enable_disable_staticnat_fornonvpc(self): list_ipaddresses_before, "IP Addresses listed for newly created User" ) - # Associating an IP Addresses to Network created + # Associating an IP Addresses to Network created associated_ipaddress1 = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -2813,7 +2829,7 @@ def test_14_enable_disable_staticnat_fornonvpc(self): associated_ipaddress1, "Failed to Associate IP Address" ) - # Associating another IP Addresses to Network created + # Associating another IP Addresses to Network created associated_ipaddress2 = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -2913,11 +2929,12 @@ def test_14_enable_disable_staticnat_fornonvpc(self): # Destroying the VM vm_created.delete(self.userapiclient) vm_created.expung(self.apiClient) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_15_enable_disable_staticnat_forvpc(self): - """ + """ @summary: Test to Enable and Disable StaticNat for IP Address associated to VPC Network @Steps: Step1: Creating a VPC @@ -2955,12 +2972,12 @@ def test_15_enable_disable_staticnat_forvpc(self): vpc_created, "VPC Creation Failed" ) - # Listing the vpc for a user after creating a vpc + # Listing the vpc for a user after creating a vpc list_vpc_after = VPC.list(self.userapiclient) status = validateList(list_vpc_after) self.assertEquals( - PASS, - status[0], + PASS, + status[0], "list VPC not as expected" ) # Verifying the list vpc size is increased by 1 @@ -2969,25 +2986,25 @@ def test_15_enable_disable_staticnat_forvpc(self): len(list_vpc_after), "list VPC not equal as expected" ) - #List network offering for vpc = true + # List network offering for vpc = true network_offering_vpc_true_list = NetworkOffering.list( self.userapiclient, - forvpc = "true", - zoneid = self.zone.id, - supportedServices = "SourceNat,PortForwarding,StaticNat", - state = "Enabled" + forvpc="true", + zoneid=self.zone.id, + supportedServices="SourceNat,PortForwarding,StaticNat", + state="Enabled" ) status = validateList(network_offering_vpc_true_list) - self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with PortForwarding") - # Creating network under VPC + self.assertEquals(PASS, status[0], "Default network offering not present for vpc = true with PortForwarding") + # Creating network under VPC network_created = Network.create( self.userapiclient, self.services["ntwk"], - networkofferingid = network_offering_vpc_true_list[0].id, - vpcid = vpc_created.id, + networkofferingid=network_offering_vpc_true_list[0].id, + vpcid=vpc_created.id, zoneid=self.zone.id, - gateway= self.services["ntwk"]["gateway"], - netmask = self.services["ntwk"]["netmask"] + gateway=self.services["ntwk"]["gateway"], + netmask=self.services["ntwk"]["netmask"] ) self.assertIsNotNone( network_created, @@ -3000,8 +3017,8 @@ def test_15_enable_disable_staticnat_forvpc(self): ) status = validateList(list_ipaddresses_before) self.assertEquals( - PASS, - status[0], + PASS, + status[0], "list IP Addresses not as expected" ) # Verifying the list vpc size is increased by 1 @@ -3010,7 +3027,7 @@ def test_15_enable_disable_staticnat_forvpc(self): len(list_ipaddresses_before), "list IP Addresses not equal as expected" ) - # Associating an IP Addresses to VPC created + # Associating an IP Addresses to VPC created associated_ipaddress = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -3113,11 +3130,12 @@ def test_15_enable_disable_staticnat_forvpc(self): # Destroying the VM vm_created.delete(self.userapiclient) vm_created.expung(self.apiClient) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_16_create_delete_ipforwardingrule(self): - """ + """ @summary: Test to list, create and delete IP Forwarding Rules for IP Address @Steps: Step1: Creating a Network for the user @@ -3183,7 +3201,7 @@ def test_16_create_delete_ipforwardingrule(self): list_ipaddresses_before, "IP Addresses listed for newly created User" ) - # Associating an IP Addresses to Network created + # Associating an IP Addresses to Network created associated_ipaddress1 = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -3193,7 +3211,7 @@ def test_16_create_delete_ipforwardingrule(self): associated_ipaddress1, "Failed to Associate IP Address" ) - # Associating another IP Addresses to Network created + # Associating another IP Addresses to Network created associated_ipaddress2 = PublicIPAddress.create( self.userapiclient, services=self.services["network"], @@ -3320,11 +3338,12 @@ def test_16_create_delete_ipforwardingrule(self): # Destroying the VM vm_created.delete(self.userapiclient) vm_created.expung(self.apiClient) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_17_create_update_autoscalepolicy(self): - """ + """ @summary: Test to list, create and update Autoscale Policy @Steps: Step1: Creating a Network Offering for Supported Service LB with Netscaler @@ -3346,238 +3365,264 @@ def test_17_create_update_autoscalepolicy(self): Step17: Updating Autoscale Policy created in step13 with condition2 Step18: Verifying Autoscale policy is updated with condition2 """ - # Listing Network Offerings - list_nwoff_before = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - # Creating Network Offerign with LB as Netscalar - nwoff_created = NetworkOffering.create( - self.apiClient, - self.services["nw_off_isolated_netscaler"] - ) - self.assertIsNotNone( - nwoff_created, - "Failed to Create Network Offering with LB sercvice for Netscaler" - ) - # Enable Network offering - nwoff_created.update(self.apiClient, state='Enabled') - # Listing Network Offerings again - list_nwoff_after = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - self.assertEquals( - len(list_nwoff_before)+1, - len(list_nwoff_after), - "Failed to create Network Offering" - ) - # Creating a Network Using the Network Offering - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=nwoff_created.id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - self.cleanup.append(nwoff_created) - # Launching a Virtual Machine - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=network.id, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "Failed to launch a VM under network created" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_before) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed while launching a VM" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_before), - "IP Addresses Association Failed while launching a VM" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 2, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing Counters - list_counters = Autoscale.listCounters( + if self.hypervisor.lower() == 'kvm': + raise unittest.SkipTest("ScaleVM is not supported on KVM. Hence, skipping the test") + + list_physical_networks = PhysicalNetwork.list( + self.apiClient, + zoneid=self.zone.id + ) + physical_networks_size = 0 + if list_physical_networks is not None: + physical_networks_size = len(list_physical_networks) + + run_flag = False + for i in range(0, len(list_physical_networks)): + list_network_serviceprovider = NetworkServiceProvider.list( + self.apiClient, + physicalnetworkid=list_physical_networks[i].id + ) + for j in range(0, len(list_network_serviceprovider)): + if((list_network_serviceprovider[j].name == 'Netscaler') and (list_network_serviceprovider[j].state == 'Enabled')): + run_flag = True + break + + if(run_flag == False): + self.debug("Netscaler is not enabled and auto scale VM is applicable only for Netscaler") + else: + # Listing Network Offerings + list_nwoff_before = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + # Creating Network Offerign with LB as Netscalar + nwoff_created = NetworkOffering.create( + self.apiClient, + self.services["nw_off_isolated_netscaler"] + ) + self.assertIsNotNone( + nwoff_created, + "Failed to Create Network Offering with LB sercvice for Netscaler" + ) + # Enable Network offering + nwoff_created.update(self.apiClient, state='Enabled') + # Listing Network Offerings again + list_nwoff_after = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + self.assertEquals( + len(list_nwoff_before) + 1, + len(list_nwoff_after), + "Failed to create Network Offering" + ) + # Creating a Network Using the Network Offering + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=nwoff_created.id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + self.cleanup.append(nwoff_created) + # Launching a Virtual Machine + vm_created = VirtualMachine.create( self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, ) - status = validateList(list_counters) - self.assertEquals( - PASS, - status[0], - "Failed to list counters" - ) - # Listing Conditions - list_conditions_before = Autoscale.listConditions( + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed while launching a VM" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_before), + "IP Addresses Association Failed while launching a VM" + ) + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( self.userapiclient, - listall=self.services["listall"], - account=self.account.name, - domainid=self.domain.id + listall=self.services["listall"] ) - self.assertIsNone( - list_conditions_before, - "Listed Conditions for newly created user" - ) - # Creating first Condition - condition_created1 = Autoscale.createCondition( - self.userapiclient, - counterid=list_counters[0].id, - relationaloperator='GT', - threshold='1000' - ) - self.assertIsNotNone( - condition_created1, - "Failed to create Condition" - ) - # Creating second Condition - condition_created2 = Autoscale.createCondition( - self.userapiclient, - counterid=list_counters[0].id, - relationaloperator='GT', - threshold='1500' - ) - self.assertIsNotNone( - condition_created2, - "Failed to create Condition" - ) - # Listing Conditions again - list_conditions_after = Autoscale.listConditions( - self.userapiclient, - listall=self.services["listall"], - account=self.account.name, - domainid=self.domain.id - ) - status = validateList(list_conditions_after) - self.assertEquals( - PASS, - status[0], - "Failed to list Conditions after creation" - ) - # Listing Autoscale policies - list_autoscalepolicies_before = Autoscale.listAutoscalePolicies( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying no Autoscale policies are listed - self.assertIsNone( - list_autoscalepolicies_before, - "Autoscale policies listed" - ) - # Creating Autoscale Policy - autoscalepolicy_created = Autoscale.createAutoscalePolicy( - self.userapiclient, - action='scaleup', - conditionids=condition_created1.id, - duration='100', - quiettime='100' - ) - self.assertIsNotNone( - autoscalepolicy_created, - "Failed to create Autoscale VM Policy" - ) - # Verifying autoscalepolicy is created using condition1 - self.assertEquals( - condition_created1.id, - autoscalepolicy_created.conditions[0].id, - "Autoscale Policy not created by given condition" - ) - # Listing Autoscale policies - list_autoscalepolicies_after = Autoscale.listAutoscalePolicies( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_autoscalepolicies_after) - self.assertEquals( - PASS, - status[0], - "Failed to list Autoscale Policy after creation" - ) - self.assertEquals( - 1, - len(list_autoscalepolicies_after), - "Autoscale Policies count is not matching" - ) - # Updating Autoscale Policy - autoscalepolicy_updated = Autoscale.updateAutoscalePolicy( - self.userapiclient, - id=autoscalepolicy_created.id, - conditionids=condition_created2.id, - duration='100', - quiettime='100' - ) - self.assertIsNotNone( - autoscalepolicy_updated, - "Failed to update Autoscale Policy" + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 2, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" ) - # Verifying the Autoscale Policy is updated - self.assertEquals( - condition_created2.id, - autoscalepolicy_updated.conditions[0].id, - "Autoscale Policy not updated to given condition" - ) - # Destroying the VM - vm_created.delete(self.userapiclient) - vm_created.expung(self.apiClient) + # Listing Counters + list_counters = Autoscale.listCounters( + self.userapiclient, + ) + status = validateList(list_counters) + self.assertEquals( + PASS, + status[0], + "Failed to list counters" + ) + # Listing Conditions + list_conditions_before = Autoscale.listConditions( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + self.assertIsNone( + list_conditions_before, + "Listed Conditions for newly created user" + ) + # Creating first Condition + condition_created1 = Autoscale.createCondition( + self.userapiclient, + counterid=list_counters[0].id, + relationaloperator='GT', + threshold='1000' + ) + self.assertIsNotNone( + condition_created1, + "Failed to create Condition" + ) + # Creating second Condition + condition_created2 = Autoscale.createCondition( + self.userapiclient, + counterid=list_counters[0].id, + relationaloperator='GT', + threshold='1500' + ) + self.assertIsNotNone( + condition_created2, + "Failed to create Condition" + ) + # Listing Conditions again + list_conditions_after = Autoscale.listConditions( + self.userapiclient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_conditions_after) + self.assertEquals( + PASS, + status[0], + "Failed to list Conditions after creation" + ) + # Listing Autoscale policies + list_autoscalepolicies_before = Autoscale.listAutoscalePolicies( + self.userapiclient, + listall=self.services["listall"] + ) + # Verifying no Autoscale policies are listed + self.assertIsNone( + list_autoscalepolicies_before, + "Autoscale policies listed" + ) + # Creating Autoscale Policy + autoscalepolicy_created = Autoscale.createAutoscalePolicy( + self.userapiclient, + action='scaleup', + conditionids=condition_created1.id, + duration='100', + quiettime='100' + ) + self.assertIsNotNone( + autoscalepolicy_created, + "Failed to create Autoscale VM Policy" + ) + # Verifying autoscalepolicy is created using condition1 + self.assertEquals( + condition_created1.id, + autoscalepolicy_created.conditions[0].id, + "Autoscale Policy not created by given condition" + ) + # Listing Autoscale policies + list_autoscalepolicies_after = Autoscale.listAutoscalePolicies( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_autoscalepolicies_after) + self.assertEquals( + PASS, + status[0], + "Failed to list Autoscale Policy after creation" + ) + self.assertEquals( + 1, + len(list_autoscalepolicies_after), + "Autoscale Policies count is not matching" + ) + # Updating Autoscale Policy + autoscalepolicy_updated = Autoscale.updateAutoscalePolicy( + self.userapiclient, + id=autoscalepolicy_created.id, + conditionids=condition_created2.id, + duration='100', + quiettime='100' + ) + self.assertIsNotNone( + autoscalepolicy_updated, + "Failed to update Autoscale Policy" + ) + # Verifying the Autoscale Policy is updated + self.assertEquals( + condition_created2.id, + autoscalepolicy_updated.conditions[0].id, + "Autoscale Policy not updated to given condition" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + self.cleanup.append(self.account) return - + @attr(tags=["advanced", "provisioning"]) def test_18_create_update_autoscaleprofiles(self): - """ + """ @summary: Test to list, create and update Autoscale VM Profiles @Steps: Step1: Creating a Network Offering for Supported Service LB with Netscaler @@ -3597,277 +3642,303 @@ def test_18_create_update_autoscaleprofiles(self): Step15: Updating Autoscale VM profile with destroy vm grace period Step16: Verifying that Autoscale VM is updated """ - # Listing Network Offerings - list_nwoff_before = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - # Creating Network Offerign with LB as Netscalar - nwoff_created = NetworkOffering.create( - self.apiClient, - self.services["nw_off_isolated_netscaler"] - ) - self.assertIsNotNone( - nwoff_created, - "Failed to Create Network Offering with LB sercvice for Netscaler" - ) - # Enable Network offering - nwoff_created.update(self.apiClient, state='Enabled') - # Listing Network Offerings again - list_nwoff_after = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - self.assertEquals( - len(list_nwoff_before)+1, - len(list_nwoff_after), - "Failed to create Network Offering" - ) - # Creating a Network Using the Network Offering - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=nwoff_created.id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - self.cleanup.append(nwoff_created) - # Launching a Virtual Machine - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=network.id, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "Failed to launch a VM under network created" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_before) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed while launching a VM" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_before), - "IP Addresses Association Failed while launching a VM" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" + if self.hypervisor.lower() == 'kvm': + raise unittest.SkipTest("ScaleVM is not supported on KVM. Hence, skipping the test") + + list_physical_networks = PhysicalNetwork.list( + self.apiClient, + zoneid=self.zone.id + ) + physical_networks_size = 0 + if list_physical_networks is not None: + physical_networks_size = len(list_physical_networks) + + run_flag = False + for i in range(0, len(list_physical_networks)): + list_network_serviceprovider = NetworkServiceProvider.list( + self.apiClient, + physicalnetworkid=list_physical_networks[i].id + ) + for j in range(0, len(list_network_serviceprovider)): + if((list_network_serviceprovider[j].name == 'Netscaler') and (list_network_serviceprovider[j].state == 'Enabled')): + run_flag = True + break + + if(run_flag == False): + self.debug("Netscaler is not enabled and auto scale VM is applicable only for Netscaler") + else: + # Listing Network Offerings + list_nwoff_before = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + # Creating Network Offerign with LB as Netscalar + nwoff_created = NetworkOffering.create( + self.apiClient, + self.services["nw_off_isolated_netscaler"] + ) + self.assertIsNotNone( + nwoff_created, + "Failed to Create Network Offering with LB sercvice for Netscaler" + ) + # Enable Network offering + nwoff_created.update(self.apiClient, state='Enabled') + # Listing Network Offerings again + list_nwoff_after = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + self.assertEquals( + len(list_nwoff_before) + 1, + len(list_nwoff_after), + "Failed to create Network Offering" + ) + # Creating a Network Using the Network Offering + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=nwoff_created.id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + self.cleanup.append(nwoff_created) + # Launching a Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, + ) + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed while launching a VM" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_before), + "IP Addresses Association Failed while launching a VM" ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 2, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing Service Offerings - list_service_offerings = ServiceOffering.list( - self.userapiclient, - listall=self.services["listall"], - issystem='false' - ) - status = validateList(list_service_offerings) - self.assertEquals( - PASS, - status[0], - "Failed to list Service Offerings" - ) - # Listing Users - list_users = User.list( - self.apiClient, - listall=self.services["listall"], - account=self.account.name, - domainid=self.domain.id - ) - status = validateList(list_users) - self.assertEquals( - PASS, - status[0], - "Failed to list Users" - ) - # Listing Featured Templates - list_templates_featured = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter="featured", - zoneid=self.zone.id - ) - status = validateList(list_templates_featured) - self.assertEquals( - PASS, - status[0], - "Failed to list Featured Templates" - ) - # Listing Community Templates - list_templates_community = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter="community", - zoneid=self.zone.id - ) - self.assertIsNone( - list_templates_community, - "Community Templates listed for newly created User" - ) - # Listing selfexecutable Templates - list_templates_selfexecutable = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter="selfexecutable", - zoneid=self.zone.id - ) - self.assertIsNone( - list_templates_selfexecutable, - "Self Executable Templates listed for newly created User" - ) - # Listing Autoscale VM Profiles - list_autoscalevm_profiles_before = Autoscale.listAutoscaleVmPofiles( - self.userapiclient, - listall=self.services["listall"] - ) - self.assertIsNone( - list_autoscalevm_profiles_before, - "Autoscale VM Profiles listed" - ) - # Creating Autoscale VM Profile - counterparam = { "snmpcommunity": "public", "snmpport": "161"} - autoscalevm_profile = Autoscale.createAutoscaleVmProfile( - self.userapiclient, - serviceofferingid=list_service_offerings[0].id, - zoneid=self.zone.id, - templateid=list_templates_featured[0].id, - autoscaleuserid=list_users[0].id, - destroyvmgraceperiod='100', - counterparam=counterparam - ) - self.assertIsNotNone( - autoscalevm_profile, - "Failed to create Autoscale VM Profile" + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 2, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" ) - # Listing Autoscale VM Profiles - list_autoscalevm_profiles_after = Autoscale.listAutoscaleVmPofiles( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_autoscalevm_profiles_after) - self.assertEquals( - PASS, - status[0], - "Failed to list Autoscale VM Profile after creation" - ) - # Verifying only 1 autoscale vm profile is created - self.assertEquals( - 1, - len(list_autoscalevm_profiles_after), - "Count of Autoscale VM profiles listed is not matching" - ) - # Listing the Autoscale VM Profile by id - list_autoscalvmprofile = Autoscale.listAutoscaleVmPofiles( - self.userapiclient, - listall=self.services["listall"], - id=autoscalevm_profile.id - ) - status = validateList(list_autoscalvmprofile) - self.assertEquals( - PASS, - status[0], - "Failed to list Autoscale VM Profile by Id after creation" - ) - # Verifying details of the listed Autoscale VM Profile - # Creating expected and actual values dictionaries - expected_dict = { - "id":autoscalevm_profile.id, - "account":self.account.name, - "domainid":self.domain.id, - "autoscaleuserid":list_users[0].id, - "serviceofferingid":list_service_offerings[0].id, - "zoneid":self.zone.id, - "templateid":list_templates_featured[0].id, - "destroyvmgraceperiod":autoscalevm_profile.destroyvmgraceperiod - } - actual_dict = { - "id":list_autoscalvmprofile[0].id, - "account":list_autoscalvmprofile[0].account, - "domainid":list_autoscalvmprofile[0].domainid, - "autoscaleuserid":list_autoscalvmprofile[0].autoscaleuserid, - "serviceofferingid":list_autoscalvmprofile[0].serviceofferingid, - "zoneid":list_autoscalvmprofile[0].zoneid, - "templateid":list_autoscalvmprofile[0].templateid, - "destroyvmgraceperiod":list_autoscalvmprofile[0].destroyvmgraceperiod - } - autoscalevm_profile_status = self.__verify_values( - expected_dict, - actual_dict + # Listing Service Offerings + list_service_offerings = ServiceOffering.list( + self.userapiclient, + listall=self.services["listall"], + issystem='false' ) - self.assertEqual( - True, - autoscalevm_profile_status, - "Created Autoscale VM Profile details are not as expected" - ) - # Updating destroyvmgrageperiod for created Autoscale VM Profile - autoscalevm_profile_updated = Autoscale.updateAutoscaleVMProfile( - self.userapiclient, - id=autoscalevm_profile.id, - autoscaleuserid=list_users[0].id, - destroyvmgraceperiod='200', - templateid=list_templates_featured[0].id, - ) - self.assertIsNotNone( - autoscalevm_profile_updated, - "Failed to update Autoscale VM Profile" + status = validateList(list_service_offerings) + self.assertEquals( + PASS, + status[0], + "Failed to list Service Offerings" + ) + # Listing Users + list_users = User.list( + self.apiClient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_users) + self.assertEquals( + PASS, + status[0], + "Failed to list Users" + ) + # Listing Featured Templates + list_templates_featured = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter="featured", + zoneid=self.zone.id + ) + status = validateList(list_templates_featured) + self.assertEquals( + PASS, + status[0], + "Failed to list Featured Templates" + ) + # Listing Community Templates + list_templates_community = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter="community", + zoneid=self.zone.id + ) + self.assertIsNone( + list_templates_community, + "Community Templates listed for newly created User" + ) + # Listing selfexecutable Templates + list_templates_selfexecutable = Template.list( + self.userapiclient, + listall=self.services["listall"], + templatefilter="selfexecutable", + zoneid=self.zone.id + ) + self.assertIsNone( + list_templates_selfexecutable, + "Self Executable Templates listed for newly created User" + ) + # Listing Autoscale VM Profiles + list_autoscalevm_profiles_before = Autoscale.listAutoscaleVmPofiles( + self.userapiclient, + listall=self.services["listall"] + ) + self.assertIsNone( + list_autoscalevm_profiles_before, + "Autoscale VM Profiles listed" + ) + # Creating Autoscale VM Profile + counterparam = { "snmpcommunity": "public", "snmpport": "161"} + autoscalevm_profile = Autoscale.createAutoscaleVmProfile( + self.userapiclient, + serviceofferingid=list_service_offerings[0].id, + zoneid=self.zone.id, + templateid=list_templates_featured[0].id, + autoscaleuserid=list_users[0].id, + destroyvmgraceperiod='100', + counterparam=counterparam + ) + self.assertIsNotNone( + autoscalevm_profile, + "Failed to create Autoscale VM Profile" + ) + # Listing Autoscale VM Profiles + list_autoscalevm_profiles_after = Autoscale.listAutoscaleVmPofiles( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_autoscalevm_profiles_after) + self.assertEquals( + PASS, + status[0], + "Failed to list Autoscale VM Profile after creation" + ) + # Verifying only 1 autoscale vm profile is created + self.assertEquals( + 1, + len(list_autoscalevm_profiles_after), + "Count of Autoscale VM profiles listed is not matching" + ) + # Listing the Autoscale VM Profile by id + list_autoscalvmprofile = Autoscale.listAutoscaleVmPofiles( + self.userapiclient, + listall=self.services["listall"], + id=autoscalevm_profile.id + ) + status = validateList(list_autoscalvmprofile) + self.assertEquals( + PASS, + status[0], + "Failed to list Autoscale VM Profile by Id after creation" + ) + # Verifying details of the listed Autoscale VM Profile + # Creating expected and actual values dictionaries + expected_dict = { + "id":autoscalevm_profile.id, + "account":self.account.name, + "domainid":self.domain.id, + "autoscaleuserid":list_users[0].id, + "serviceofferingid":list_service_offerings[0].id, + "zoneid":self.zone.id, + "templateid":list_templates_featured[0].id, + "destroyvmgraceperiod":autoscalevm_profile.destroyvmgraceperiod + } + actual_dict = { + "id":list_autoscalvmprofile[0].id, + "account":list_autoscalvmprofile[0].account, + "domainid":list_autoscalvmprofile[0].domainid, + "autoscaleuserid":list_autoscalvmprofile[0].autoscaleuserid, + "serviceofferingid":list_autoscalvmprofile[0].serviceofferingid, + "zoneid":list_autoscalvmprofile[0].zoneid, + "templateid":list_autoscalvmprofile[0].templateid, + "destroyvmgraceperiod":list_autoscalvmprofile[0].destroyvmgraceperiod + } + autoscalevm_profile_status = self.__verify_values( + expected_dict, + actual_dict + ) + self.assertEqual( + True, + autoscalevm_profile_status, + "Created Autoscale VM Profile details are not as expected" ) - # Verifyign that Destroy VM Graceperiod is updated in autoscale VM Profile - self.assertEquals( - 200, - autoscalevm_profile_updated.destroyvmgraceperiod, - "Failed to update destroy vm grace period" - ) - # Destroying the VM - vm_created.delete(self.userapiclient) - vm_created.expung(self.apiClient) + # Updating destroyvmgrageperiod for created Autoscale VM Profile + autoscalevm_profile_updated = Autoscale.updateAutoscaleVMProfile( + self.userapiclient, + id=autoscalevm_profile.id, + autoscaleuserid=list_users[0].id, + destroyvmgraceperiod='200', + templateid=list_templates_featured[0].id, + ) + self.assertIsNotNone( + autoscalevm_profile_updated, + "Failed to update Autoscale VM Profile" + ) + # Verifyign that Destroy VM Graceperiod is updated in autoscale VM Profile + self.assertEquals( + 200, + autoscalevm_profile_updated.destroyvmgraceperiod, + "Failed to update destroy vm grace period" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + self.cleanup.append(self.account) return @attr(tags=["advanced", "provisioning"]) @@ -3890,303 +3961,328 @@ def test_19_create_update_autoscalevmgroup(self): Step13: Updating Autoscale VM group and verifying it was updated Step14: Enabling Autoscale VM group and verifying it was enabled """ - # Listing Network Offerings - list_nwoff_before = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - # Creating Network Offerign with LB as Netscalar - nwoff_created = NetworkOffering.create( - self.apiClient, - self.services["nw_off_isolated_netscaler"] + if self.hypervisor.lower() == 'kvm': + raise unittest.SkipTest("ScaleVM is not supported on KVM. Hence, skipping the test") + + list_physical_networks = PhysicalNetwork.list( + self.apiClient, + zoneid=self.zone.id + ) + physical_networks_size = 0 + if list_physical_networks is not None: + physical_networks_size = len(list_physical_networks) + + run_flag = False + for i in range(0, len(list_physical_networks)): + list_network_serviceprovider = NetworkServiceProvider.list( + self.apiClient, + physicalnetworkid=list_physical_networks[i].id + ) + for j in range(0, len(list_network_serviceprovider)): + if((list_network_serviceprovider[j].name == 'Netscaler') and (list_network_serviceprovider[j].state == 'Enabled')): + run_flag = True + break + + if(run_flag == False): + self.debug("Netscaler is not enabled and auto scale VM is applicable only for Netscaler") + else: + # Listing Network Offerings + list_nwoff_before = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + # Creating Network Offerign with LB as Netscalar + nwoff_created = NetworkOffering.create( + self.apiClient, + self.services["nw_off_isolated_netscaler"] + ) + self.assertIsNotNone( + nwoff_created, + "Failed to Create Network Offering with LB sercvice for Netscaler" + ) + # Enable Network offering + nwoff_created.update(self.apiClient, state='Enabled') + # Listing Network Offerings again + list_nwoff_after = NetworkOffering.list( + self.apiClient, + forvpc="false", + guestiptype="Isolated", + state="Enabled", + supportedservices="SourceNat,Lb", + zoneid=self.zone.id + ) + self.assertEquals( + len(list_nwoff_before) + 1, + len(list_nwoff_after), + "Failed to create Network Offering" + ) + # Creating a Network Using the Network Offering + network = Network.create( + self.userapiclient, + self.services["network"], + accountid=self.account.name, + domainid=self.domain.id, + networkofferingid=nwoff_created.id, + zoneid=self.zone.id + ) + self.assertIsNotNone( + network, + "Network creation failed" + ) + self.cleanup.append(network) + # self.cleanup.append(nwoff_created) + # Launching a Virtual Machine + vm_created = VirtualMachine.create( + self.userapiclient, + self.services["virtual_machine"], + accountid=self.account.name, + domainid=self.account.domainid, + networkids=network.id, + serviceofferingid=self.service_offering.id, ) - self.assertIsNotNone( - nwoff_created, - "Failed to Create Network Offering with LB sercvice for Netscaler" - ) - # Enable Network offering - nwoff_created.update(self.apiClient, state='Enabled') - # Listing Network Offerings again - list_nwoff_after = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat,Lb", - zoneid=self.zone.id - ) - self.assertEquals( - len(list_nwoff_before)+1, - len(list_nwoff_after), - "Failed to create Network Offering" - ) - # Creating a Network Using the Network Offering - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=nwoff_created.id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - self.cleanup.append(nwoff_created) - # Launching a Virtual Machine - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=network.id, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "Failed to launch a VM under network created" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_before = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_before) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed while launching a VM" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 1, - len(list_ipaddresses_before), - "IP Addresses Association Failed while launching a VM" - ) - # Associating an IP Addresses to Network created - associated_ipaddress = PublicIPAddress.create( - self.userapiclient, - services=self.services["network"], - networkid=network.id - ) - self.assertIsNotNone( - associated_ipaddress, - "Failed to Associate IP Address" - ) - # Listing all the IP Addresses for a user - list_ipaddresses_after = PublicIPAddress.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_ipaddresses_after) - self.assertEquals( - PASS, - status[0], - "IP Addresses Association Failed" - ) - # Verifying the length of the list is 1 - self.assertEqual( - 2, - len(list_ipaddresses_after), - "Number of IP Addresses associated are not matching expected" - ) - # Listing Users - list_users = User.list( - self.apiClient, - listall=self.services["listall"], - account=self.account.name, - domainid=self.domain.id - ) - status = validateList(list_users) - self.assertEquals( - PASS, - status[0], - "Failed to list Users" - ) - # Listing counters - list_counters = Autoscale.listCounters(self.userapiclient) - status = validateList(list_counters) - self.assertEquals( - PASS, - status[0], - "Failed to list Counters" - ) - # Create Condition for scaleup Vm Policy - condition_scaleup = Autoscale.createCondition( - self.userapiclient, - counterid=list_counters[0].id, - relationaloperator='GT', - threshold='40' - ) - self.assertIsNotNone( - condition_scaleup, - "Failed to create Scaleup Condition" - ) - # Creating scaleup Vm Policy - scaleup_policy = Autoscale.createAutoscalePolicy( - self.userapiclient, - action='scaleup', - conditionids=condition_scaleup.id, - duration='40', - quiettime='300' - ) - self.assertIsNotNone( - scaleup_policy, - "Failed to create Scaleup VM Policy" - ) - # Create Condition for scaledown Vm Policy - condition_scaledown = Autoscale.createCondition( - self.userapiclient, - counterid=list_counters[0].id, - relationaloperator='GT', - threshold='10' - ) - self.assertIsNotNone( - condition_scaledown, - "Failed to create Scaledown Condition" - ) - # Creating scaledown Vm Policy - scaledown_policy = Autoscale.createAutoscalePolicy( - self.userapiclient, - action='scaledown', - conditionids=condition_scaledown.id, - duration='40', - quiettime='300' - ) - self.assertIsNotNone( - scaledown_policy, - "Failed to create Scaledown VM Policy" - ) - counterparam = { "snmpcommunity": "public", "snmpport": "161"} - # Create Autoscale VM Profile - vmprofile = Autoscale.createAutoscaleVmProfile( - self.userapiclient, - serviceofferingid=self.service_offering.id, - zoneid=self.zone.id, - templateid=self.template.id, - autoscaleuserid=list_users[0].id, - destroyvmgraceperiod='30', - counterparam=counterparam - ) - self.assertIsNotNone( - vmprofile, - "Failed to create Autoscale Vm Profile" + self.assertIsNotNone( + vm_created, + "Failed to launch a VM under network created" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_before = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_before) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed while launching a VM" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 1, + len(list_ipaddresses_before), + "IP Addresses Association Failed while launching a VM" ) - self.services["lbrule"]["openfirewall"] = False - # Creating Load Balancer Rule - lbrule = LoadBalancerRule.create( - self.userapiclient, - self.services["lbrule"], - ipaddressid=associated_ipaddress.ipaddress.id, - accountid=self.account.name, - networkid=network.id, - domainid=self.domain.id - ) - self.assertIsNotNone( - lbrule, - "Failed to create Load Balancer Rule" + # Associating an IP Addresses to Network created + associated_ipaddress = PublicIPAddress.create( + self.userapiclient, + services=self.services["network"], + networkid=network.id + ) + self.assertIsNotNone( + associated_ipaddress, + "Failed to Associate IP Address" + ) + # Listing all the IP Addresses for a user + list_ipaddresses_after = PublicIPAddress.list( + self.userapiclient, + listall=self.services["listall"] + ) + status = validateList(list_ipaddresses_after) + self.assertEquals( + PASS, + status[0], + "IP Addresses Association Failed" + ) + # Verifying the length of the list is 1 + self.assertEqual( + 2, + len(list_ipaddresses_after), + "Number of IP Addresses associated are not matching expected" ) - # Listing Autoscale VM Groups - list_vmgroup_before = Autoscale.listAutoscaleVmGroup( + # Listing Users + list_users = User.list( + self.apiClient, + listall=self.services["listall"], + account=self.account.name, + domainid=self.domain.id + ) + status = validateList(list_users) + self.assertEquals( + PASS, + status[0], + "Failed to list Users" + ) + # Listing counters + list_counters = Autoscale.listCounters(self.userapiclient) + status = validateList(list_counters) + self.assertEquals( + PASS, + status[0], + "Failed to list Counters" + ) + # Create Condition for scaleup Vm Policy + condition_scaleup = Autoscale.createCondition( + self.userapiclient, + counterid=list_counters[0].id, + relationaloperator='GT', + threshold='40' + ) + self.assertIsNotNone( + condition_scaleup, + "Failed to create Scaleup Condition" + ) + # Creating scaleup Vm Policy + scaleup_policy = Autoscale.createAutoscalePolicy( self.userapiclient, - listall=self.services["listall"], - lbruleid=lbrule.id + action='scaleup', + conditionids=condition_scaleup.id, + duration='40', + quiettime='300' ) - # Verifying No Autoscale VM Groups are listed - self.assertIsNone( - list_vmgroup_before, - "Listed Autoscale VM Groups for newly created LB Rule" - ) - # Creating Autoscale VM Group - vmgroup = Autoscale.createAutoscaleVmGroup( - self.userapiclient, - lbruleid=lbrule.id, - minmembers='3', - maxmembers='10', - scaledownpolicyids=scaledown_policy.id, - scaleuppolicyids=scaleup_policy.id, - vmprofileid=vmprofile.id, - interval='30' - ) - self.assertIsNotNone( - vmgroup, - "Failed to create Autoscale VM Group" - ) - # Listing Autoscale VM Groups - list_vmgroup_after = Autoscale.listAutoscaleVmGroup( + self.assertIsNotNone( + scaleup_policy, + "Failed to create Scaleup VM Policy" + ) + # Create Condition for scaledown Vm Policy + condition_scaledown = Autoscale.createCondition( self.userapiclient, - listall=self.services["listall"], - lbruleid=lbrule.id + counterid=list_counters[0].id, + relationaloperator='GT', + threshold='10' ) - status = validateList(list_vmgroup_after) - self.assertEquals( - PASS, - status[0], - "Failed to list Autoscale VM group after creation" - ) - # Verifying only 1 Autoscale VM group is listed - self.assertEquals( - 1, - len(list_vmgroup_after), - "Autoscale VM group list count is not matching" - ) - # Disabling Autoscale VM group - vmgroup_disabled = Autoscale.disableAutoscaleVmGroup( + self.assertIsNotNone( + condition_scaledown, + "Failed to create Scaledown Condition" + ) + # Creating scaledown Vm Policy + scaledown_policy = Autoscale.createAutoscalePolicy( self.userapiclient, - id=vmgroup.id + action='scaledown', + conditionids=condition_scaledown.id, + duration='40', + quiettime='300' ) - self.assertIsNotNone( - vmgroup_disabled, - "Failed to disable Autoscale VM group" - ) - # Verifyign the state of the VM Group afte renabling - self.assertEquals( - "disabled", - vmgroup_disabled.state, - "Disabled VM Group state is not matching" - ) - # Updating Autoscale VM Group - vmgroup_updated = Autoscale.updateAutoscaleVMGroup( - self.userapiclient, - id=vmgroup.id, - minmembers='3', - maxmembers='10', - scaledownpolicyids=scaledown_policy.id, - scaleuppolicyids=scaleup_policy.id, - interval='40' - ) - self.assertIsNotNone( - vmgroup_updated, - "Failed to update Autoscale VM group" - ) - self.assertEquals( - 40, - vmgroup_updated.interval, - "Updated Autoscale VM group interval value is not matching" - ) - # Enabling Autoscale VM group - vmgroup_enabled = Autoscale.enableAutoscaleVmGroup( + self.assertIsNotNone( + scaledown_policy, + "Failed to create Scaledown VM Policy" + ) + counterparam = { "snmpcommunity": "public", "snmpport": "161"} + # Create Autoscale VM Profile + vmprofile = Autoscale.createAutoscaleVmProfile( self.userapiclient, - id=vmgroup.id + serviceofferingid=self.service_offering.id, + zoneid=self.zone.id, + templateid=self.template.id, + autoscaleuserid=list_users[0].id, + destroyvmgraceperiod='30', + counterparam=counterparam ) - self.assertIsNotNone( - vmgroup_enabled, - "Failed to enable Autoscale VM group" - ) - # Verifyign the state of the VM Group afte renabling - self.assertEquals( - "enabled", - vmgroup_enabled.state, - "Enabled VM Group state is not matching" - ) - # Destroying the VM - vm_created.delete(self.userapiclient) - vm_created.expung(self.apiClient) + self.assertIsNotNone( + vmprofile, + "Failed to create Autoscale Vm Profile" + ) + self.services["lbrule"]["openfirewall"] = False + # Creating Load Balancer Rule + lbrule = LoadBalancerRule.create( + self.userapiclient, + self.services["lbrule"], + ipaddressid=associated_ipaddress.ipaddress.id, + accountid=self.account.name, + networkid=network.id, + domainid=self.domain.id + ) + self.assertIsNotNone( + lbrule, + "Failed to create Load Balancer Rule" + ) + # Listing Autoscale VM Groups + list_vmgroup_before = Autoscale.listAutoscaleVmGroup( + self.userapiclient, + listall=self.services["listall"], + lbruleid=lbrule.id + ) + # Verifying No Autoscale VM Groups are listed + self.assertIsNone( + list_vmgroup_before, + "Listed Autoscale VM Groups for newly created LB Rule" + ) + # Creating Autoscale VM Group + vmgroup = Autoscale.createAutoscaleVmGroup( + self.userapiclient, + lbruleid=lbrule.id, + minmembers='3', + maxmembers='10', + scaledownpolicyids=scaledown_policy.id, + scaleuppolicyids=scaleup_policy.id, + vmprofileid=vmprofile.id, + interval='30' + ) + self.assertIsNotNone( + vmgroup, + "Failed to create Autoscale VM Group" + ) + # Listing Autoscale VM Groups + list_vmgroup_after = Autoscale.listAutoscaleVmGroup( + self.userapiclient, + listall=self.services["listall"], + lbruleid=lbrule.id + ) + status = validateList(list_vmgroup_after) + self.assertEquals( + PASS, + status[0], + "Failed to list Autoscale VM group after creation" + ) + # Verifying only 1 Autoscale VM group is listed + self.assertEquals( + 1, + len(list_vmgroup_after), + "Autoscale VM group list count is not matching" + ) + # Disabling Autoscale VM group + vmgroup_disabled = Autoscale.disableAutoscaleVmGroup( + self.userapiclient, + id=vmgroup.id + ) + self.assertIsNotNone( + vmgroup_disabled, + "Failed to disable Autoscale VM group" + ) + # Verifyign the state of the VM Group afte renabling + self.assertEquals( + "disabled", + vmgroup_disabled.state, + "Disabled VM Group state is not matching" + ) + # Updating Autoscale VM Group + vmgroup_updated = Autoscale.updateAutoscaleVMGroup( + self.userapiclient, + id=vmgroup.id, + minmembers='3', + maxmembers='10', + scaledownpolicyids=scaledown_policy.id, + scaleuppolicyids=scaleup_policy.id, + interval='40' + ) + self.assertIsNotNone( + vmgroup_updated, + "Failed to update Autoscale VM group" + ) + self.assertEquals( + 40, + vmgroup_updated.interval, + "Updated Autoscale VM group interval value is not matching" + ) + # Enabling Autoscale VM group + vmgroup_enabled = Autoscale.enableAutoscaleVmGroup( + self.userapiclient, + id=vmgroup.id + ) + self.assertIsNotNone( + vmgroup_enabled, + "Failed to enable Autoscale VM group" + ) + # Verifyign the state of the VM Group afte renabling + self.assertEquals( + "enabled", + vmgroup_enabled.state, + "Enabled VM Group state is not matching" + ) + # Destroying the VM + vm_created.delete(self.userapiclient) + vm_created.expung(self.apiClient) + self.cleanup.append(self.account) return - \ No newline at end of file diff --git a/test/integration/component/test_escalations_snapshots.py b/test/integration/component/test_escalations_snapshots.py index 2367253b58..0aa36c3cf1 100644 --- a/test/integration/component/test_escalations_snapshots.py +++ b/test/integration/component/test_escalations_snapshots.py @@ -15,42 +15,19 @@ # specific language governing permissions and limitations # under the License. -#Import Local Modules -from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.cloudstackAPI import (createVolume, - createTemplate) -from marvin.lib.base import (Volume, - Iso, - VirtualMachine, - Template, - Snapshot, - SecurityGroup, - Account, - Zone, - Network, - NetworkOffering, - DiskOffering, - ServiceOffering, - VmSnapshot, - SnapshotPolicy, - SSHKeyPair, - Resources, - Configurations, - VpnCustomerGateway, - Hypervisor, - VpcOffering, - VPC, - NetworkACL) -from marvin.lib.common import (get_zone, - get_domain, - get_template, - list_os_types) -from marvin.lib.utils import (validateList, - cleanup_resources, - random_gen) -from marvin.codes import (PASS, FAIL, EMPTY_LIST) +# Import Local Modules +from marvin.cloudstackTestCase import * +from marvin.cloudstackException import * +from marvin.cloudstackAPI import * +from marvin.sshClient import SshClient +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * +from marvin.lib.utils import checkVolumeSize +from marvin.codes import SUCCESS from nose.plugins.attrib import attr -import time +from time import sleep +from ctypes.wintypes import BOOLEAN class TestSnapshots(cloudstackTestCase): @@ -61,6 +38,7 @@ def setUpClass(cls): cls.testClient = super(TestSnapshots, cls).getClsTestClient() cls.api_client = cls.testClient.getApiClient() cls.services = cls.testClient.getParsedTestDataConfig() + cls.hypervisor = cls.testClient.getHypervisorInfo() # Get Domain, Zone, Template cls.domain = get_domain(cls.api_client) cls.zone = get_zone(cls.api_client, cls.testClient.getZoneForTests()) @@ -123,7 +101,7 @@ def setUp(self): self.cleanup = [] def tearDown(self): - #Clean up, terminate the created resources + # Clean up, terminate the created resources cleanup_resources(self.apiClient, self.cleanup) return @@ -387,7 +365,7 @@ def test_02_list_volume_snapshots_byid(self): "Size of the list volume snapshot by Id is not matching" ) # Verifying details of the listed snapshot to be same as snapshot created above - #Creating expected and actual values dictionaries + # Creating expected and actual values dictionaries expected_dict = { "id":snapshot_created.id, "name":snapshot_created.name, @@ -435,6 +413,8 @@ def test_03_list_vm_snapshots_pagination(self): Step11: Listing all the volume snapshots in page2 Step12: Verifying that list size is 0 """ + if self.hypervisor.lower() == 'kvm': + raise unittest.SkipTest("VM Snapshot is not supported on KVM. Hence, skipping the test") # Listing all the VM snapshots for a User list_vm_snaps_before = VmSnapshot.list( self.userapiclient, @@ -529,7 +509,7 @@ def test_03_list_vm_snapshots_pagination(self): "VM snapshot not deleted from page 2" ) # Deleting all the existing VM snapshots - list_vm_snaps = VmSnapshot.list( + list_vm_snaps = VmSnapshot.list( self.userapiclient, listall=self.services["listall"], ) @@ -567,6 +547,8 @@ def test_04_list_vm_snapshots_byid(self): Step7: Verifying that list size is 1 Step8: Verifying details of the listed VM snapshot """ + if self.hypervisor.lower() == 'kvm': + raise unittest.SkipTest("VM Snapshot is not supported on KVM. Hence, skipping the test") # Listing all the VM snapshots for a User list_vm_snaps_before = VmSnapshot.list( self.userapiclient, @@ -622,7 +604,7 @@ def test_04_list_vm_snapshots_byid(self): "Size of the list vm snapshot by Id is not matching" ) # Verifying details of the listed snapshot to be same as snapshot created above - #Creating expected and actual values dictionaries + # Creating expected and actual values dictionaries expected_dict = { "id":snapshot_created.id, "name":snapshot_created.name, diff --git a/test/integration/component/test_escalations_templates.py b/test/integration/component/test_escalations_templates.py index 083ba90e32..06e3d4287f 100644 --- a/test/integration/component/test_escalations_templates.py +++ b/test/integration/component/test_escalations_templates.py @@ -15,42 +15,19 @@ # specific language governing permissions and limitations # under the License. -#Import Local Modules -from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.cloudstackAPI import (createVolume, - createTemplate) -from marvin.lib.base import (Volume, - Iso, - VirtualMachine, - Template, - Snapshot, - SecurityGroup, - Account, - Zone, - Network, - NetworkOffering, - DiskOffering, - ServiceOffering, - VmSnapshot, - SnapshotPolicy, - SSHKeyPair, - Resources, - Configurations, - VpnCustomerGateway, - Hypervisor, - VpcOffering, - VPC, - NetworkACL) -from marvin.lib.common import (get_zone, - get_domain, - get_template, - list_os_types) -from marvin.lib.utils import (validateList, - cleanup_resources, - random_gen) -from marvin.codes import (PASS, FAIL, EMPTY_LIST) +# Import Local Modules +from marvin.cloudstackTestCase import * +from marvin.cloudstackException import * +from marvin.cloudstackAPI import * +from marvin.sshClient import SshClient +from marvin.lib.utils import * +from marvin.lib.base import * +from marvin.lib.common import * +from marvin.lib.utils import checkVolumeSize +from marvin.codes import SUCCESS from nose.plugins.attrib import attr -import time +from time import sleep +from ctypes.wintypes import BOOLEAN class TestTemplates(cloudstackTestCase): @@ -91,7 +68,7 @@ def setUp(self): self.cleanup = [] def tearDown(self): - #Clean up, terminate the created resources + # Clean up, terminate the created resources cleanup_resources(self.apiClient, self.cleanup) return @@ -168,14 +145,12 @@ def test_01_list_templates_pagination(self): list_templates_before, "Templates listed for newly created User" ) - self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" - self.services["template"]["format"] = "VHD" - self.services["template"]["ostype"] = self.services["ostype"] + self.services["templateregister"]["ostype"] = self.services["ostype"] # Creating pagesize + 1 number of Templates for i in range(0, (self.services["pagesize"] + 1)): template_created = Template.register( self.userapiclient, - self.services["template"], + self.services["templateregister"], self.zone.id, hypervisor=self.hypervisor ) @@ -290,9 +265,7 @@ def test_01_list_templates_pagination(self): list_templates_page2, "Templates not deleted from page 2" ) - del self.services["template"]["url"] - del self.services["template"]["format"] - del self.services["template"]["ostype"] + del self.services["templateregister"]["ostype"] return @attr(tags=["advanced", "basic", "provisioning"]) @@ -322,14 +295,12 @@ def test_02_download_template(self): list_templates_before, "Templates listed for newly created User" ) - self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" - self.services["template"]["format"] = "VHD" - self.services["template"]["ostype"] = self.services["ostype"] - self.services["template"]["isextractable"] = True + self.services["templateregister"]["ostype"] = self.services["ostype"] + self.services["templateregister"]["isextractable"] = True # Creating aTemplate template_created = Template.register( self.userapiclient, - self.services["template"], + self.services["templateregister"], self.zone.id, hypervisor=self.hypervisor ) @@ -410,10 +381,8 @@ def test_02_download_template(self): download_template.id, "Download Template details are not same as Template created" ) - del self.services["template"]["url"] - del self.services["template"]["format"] - del self.services["template"]["ostype"] - del self.services["template"]["isextractable"] + del self.services["templateregister"]["ostype"] + del self.services["templateregister"]["isextractable"] return @attr(tags=["advanced", "basic", "provisioning"]) @@ -451,13 +420,11 @@ def test_03_edit_template_details(self): list_templates_before, "Templates listed for newly created User" ) - self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" - self.services["template"]["format"] = "VHD" - self.services["template"]["ostype"] = self.services["ostype"] + self.services["templateregister"]["ostype"] = self.services["ostype"] # Creating aTemplate template_created = Template.register( self.userapiclient, - self.services["template"], + self.services["templateregister"], self.zone.id, hypervisor=self.hypervisor ) @@ -727,9 +694,7 @@ def test_03_edit_template_details(self): edit_template_status, "Edited Template details are not as expected" ) - del self.services["template"]["url"] - del self.services["template"]["format"] - del self.services["template"]["ostype"] + del self.services["templateregister"]["ostype"] return @attr(tags=["advanced", "basic", "provisioning"]) @@ -768,7 +733,7 @@ def test_04_copy_template(self): "Failed to list Zones" ) if not len(zones_list) > 1: - self.fail("Enough zones doesnot exists to copy template") + raise unittest.SkipTest("Enough zones doesnot exists to copy template") else: # Listing all the Templates for a User in Zone 1 list_templates_zone1 = Template.list( @@ -794,10 +759,8 @@ def test_04_copy_template(self): list_templates_zone2, "Templates listed for newly created User in Zone2" ) - self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" - self.services["template"]["format"] = "VHD" - self.services["template"]["ostype"] = self.services["ostype"] - #Listing Hypervisors in Zone 1 + self.services["templateregister"]["ostype"] = self.services["ostype"] + # Listing Hypervisors in Zone 1 hypervisor_list = Hypervisor.list( self.apiClient, zoneid=zones_list[0].id @@ -811,7 +774,7 @@ def test_04_copy_template(self): # Creating aTemplate in Zone 1 template_created = Template.register( self.userapiclient, - self.services["template"], + self.services["templateregister"], zones_list[0].id, hypervisor=hypervisor_list[0].name ) @@ -938,7 +901,5 @@ def test_04_copy_template(self): list_templates_zone2[0].isready, "Failed to copy Template" ) - del self.services["template"]["url"] - del self.services["template"]["format"] - del self.services["template"]["ostype"] + del self.services["templateregister"]["ostype"] return \ No newline at end of file diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py index 44ef8d5fc2..801c549de4 100644 --- a/tools/marvin/marvin/config/test_data.py +++ b/tools/marvin/marvin/config/test_data.py @@ -740,6 +740,13 @@ "name": 'Template', "ostype": "CentOS 5.3 (64-bit)", "templatefilter": 'self', + }, + "templateregister": { + "displaytext": "xs", + "name": "xs", + "passwordenabled": False, + "url": "http://10.147.28.7/templates/ttylinux_pv.vhd", + "format": "VHD" }, "security_group": {"name": "custom_Sec_Grp"}, "ingress_rule": { diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py index 268172490f..8b89087db0 100644 --- a/tools/marvin/marvin/lib/base.py +++ b/tools/marvin/marvin/lib/base.py @@ -1562,7 +1562,7 @@ def enable(cls, apiclient, ipaddressid, virtualmachineid, networkid=None, return @classmethod - def disable(cls, apiclient, ipaddressid, virtualmachineid): + def disable(cls, apiclient, ipaddressid, virtualmachineid=None): """Disables Static NAT rule""" cmd = disableStaticNat.disableStaticNatCmd() From 54e4c075287957821e57368f1baf401761f7bda2 Mon Sep 17 00:00:00 2001 From: Santhosh Edukulla Date: Mon, 16 Jun 2014 16:06:59 +0530 Subject: [PATCH 602/683] CLOUDSTACK-6914: Fixed the Issue Signed-off-by: Abhinandan Prateek --- .../integration/smoke/test_affinity_groups.py | 2 +- .../smoke/test_deploy_vgpu_enabled_vm.py | 129 +++++------------- test/integration/smoke/test_deploy_vm.py | 8 +- .../smoke/test_deploy_vm_root_resize.py | 6 +- .../smoke/test_deploy_vm_with_userdata.py | 4 +- ...ploy_vms_with_varied_deploymentplanners.py | 6 +- test/integration/smoke/test_disk_offerings.py | 6 +- .../integration/smoke/test_global_settings.py | 2 +- .../smoke/test_guest_vlan_range.py | 2 +- test/integration/smoke/test_internal_lb.py | 2 +- test/integration/smoke/test_iso.py | 2 +- test/integration/smoke/test_loadbalance.py | 6 +- .../smoke/test_multipleips_per_nic.py | 2 +- test/integration/smoke/test_network.py | 14 +- test/integration/smoke/test_network_acl.py | 2 +- test/integration/smoke/test_nic.py | 2 +- .../smoke/test_non_contigiousvlan.py | 4 +- .../smoke/test_over_provisioning.py | 2 +- .../smoke/test_portable_publicip.py | 4 +- .../integration/smoke/test_primary_storage.py | 4 +- test/integration/smoke/test_privategw_acl.py | 2 +- .../integration/smoke/test_public_ip_range.py | 2 +- test/integration/smoke/test_pvlan.py | 2 +- test/integration/smoke/test_regions.py | 2 +- .../smoke/test_reset_vm_on_reboot.py | 2 +- .../integration/smoke/test_resource_detail.py | 2 +- test/integration/smoke/test_routers.py | 18 +-- test/integration/smoke/test_scale_vm.py | 2 +- .../smoke/test_secondary_storage.py | 4 +- .../smoke/test_service_offerings.py | 8 +- test/integration/smoke/test_snapshots.py | 3 +- test/integration/smoke/test_ssvm.py | 20 +-- test/integration/smoke/test_templates.py | 16 +-- test/integration/smoke/test_vm_ha.py | 2 +- test/integration/smoke/test_vm_life_cycle.py | 24 ++-- test/integration/smoke/test_vm_snapshots.py | 6 +- test/integration/smoke/test_volumes.py | 18 +-- test/integration/smoke/test_vpc_vpn.py | 4 +- tools/marvin/marvin/config/test_data.py | 68 +++++++++ 39 files changed, 208 insertions(+), 206 deletions(-) diff --git a/test/integration/smoke/test_affinity_groups.py b/test/integration/smoke/test_affinity_groups.py index bb0a524591..c1c5d5b8e3 100644 --- a/test/integration/smoke/test_affinity_groups.py +++ b/test/integration/smoke/test_affinity_groups.py @@ -75,7 +75,7 @@ def setUpClass(cls): ] return - @attr(tags=["simulator", "basic", "advanced", "multihost", "selfservice"]) + @attr(tags=["basic", "advanced", "multihost"], required_hardware="false") def test_DeployVmAntiAffinityGroup(self): """ test DeployVM in anti-affinity groups diff --git a/test/integration/smoke/test_deploy_vgpu_enabled_vm.py b/test/integration/smoke/test_deploy_vgpu_enabled_vm.py index fa33bdcdc7..13c1e5e11f 100644 --- a/test/integration/smoke/test_deploy_vgpu_enabled_vm.py +++ b/test/integration/smoke/test_deploy_vgpu_enabled_vm.py @@ -18,7 +18,7 @@ #Test from the Marvin - Testing in Python wiki #All tests inherit from cloudstackTestCase -from marvin.cloudstackTestCase import cloudstackTestCase +from marvin.cloudstackTestCase import cloudstackTestCase, unittest #Import Integration Libraries @@ -29,121 +29,56 @@ from marvin.lib.utils import cleanup_resources #common - commonly used methods for all tests are listed here -from marvin.lib.common import get_zone, get_domain, get_template +from marvin.lib.common import get_zone, get_domain, get_template, list_hosts -from marvin.codes import FAILED +from marvin.sshClient import SshClient -from nose.plugins.attrib import attr - - -class Services: - """Test VM Life Cycle Services - """ - - def __init__(self): - self.services = { - "disk_offering":{ - "displaytext": "Small", - "name": "Small", - "disksize": 1 - }, - "account": { - "email": "test@test.com", - "firstname": "Test", - "lastname": "User", - "username": "test", - # Random characters are appended in create account to - # ensure unique username generated each time - "password": "password", - }, - "vgpu260q": # Create a virtual machine instance with vgpu type as 260q - { - "displayname": "testserver", - "username": "root", # VM creds for SSH - "password": "password", - "ssh_port": 22, - "hypervisor": 'XenServer', - "privateport": 22, - "publicport": 22, - "protocol": 'TCP', - }, - "vgpu140q": # Create a virtual machine instance with vgpu type as 140q - { - "displayname": "testserver", - "username": "root", - "password": "password", - "ssh_port": 22, - "hypervisor": 'XenServer', - "privateport": 22, - "publicport": 22, - "protocol": 'TCP', - }, - "service_offerings": - { - "vgpu260qwin": - { - "name": "Windows Instance with vGPU260Q", - "displaytext": "Windows Instance with vGPU260Q", - "cpunumber": 2, - "cpuspeed": 1600, # in MHz - "memory": 3072, # In MBs - }, - "vgpu140qwin": - { - # Small service offering ID to for change VM - # service offering from medium to small - "name": "Windows Instance with vGPU140Q", - "displaytext": "Windows Instance with vGPU140Q", - "cpunumber": 2, - "cpuspeed": 1600, - "memory": 3072, - } - }, - "diskdevice": ['/dev/vdc', '/dev/vdb', '/dev/hdb', '/dev/hdc', '/dev/xvdd', '/dev/cdrom', '/dev/sr0', '/dev/cdrom1' ], - # Disk device where ISO is attached to instance - "mount_dir": "/mnt/tmp", - "sleep": 60, - "timeout": 10, - #Migrate VM to hostid - "ostype": 'Windows 7 (32-bit)', - # CentOS 5.3 (64-bit) - } +from marvin.codes import FAILED, XEN_SERVER +from nose.plugins.attrib import attr class TestDeployvGPUenabledVM(cloudstackTestCase): - """Test deploy a vGPU enabled VM into a user account """ + Test deploy a vGPU enabled VM into a user account + """ + @classmethod + def setUpClass(cls): + testClient = super(TestDeployvGPUenabledVM, cls).getClsTestClient() + #Need to add check whether zone containing the xen hypervisor or not as well + hypervisor = testClient.getHypervisorInfo() + if hypervisor.lower() != XEN_SERVER.lower(): + raise unittest.skipTest("GPU feature is supported only on XenServer") + def setUp(self): - self.services = Services().services + self.testdata = self.testClient.getParsedTestDataConfig()["vgpu"] self.apiclient = self.testClient.getApiClient() # Get Zone, Domain and Default Built-in template self.domain = get_domain(self.apiclient) self.zone = get_zone(self.apiclient, self.testClient.getZoneForTests()) - self.services["mode"] = self.zone.networktype + self.testdata["mode"] = self.zone.networktype # Before running this test, register a windows template with ostype as 'Windows 7 (32-bit)' - self.services["ostype"] = 'Windows 7 (32-bit)' - self.template = get_template(self.apiclient, self.zone.id, self.services["ostype"]) + self.template = get_template(self.apiclient, self.zone.id, self.testdata["ostype"]) if self.template == FAILED: - assert False, "get_template() failed to return template with description %s" % self.services["ostype"] + assert False, "get_template() failed to return template with description %s" % self.testdata["ostype"] #create a user account self.account = Account.create( self.apiclient, - self.services["account"], + self.testdata["account"], domainid=self.domain.id ) - self.services["vgpu260q"]["zoneid"] = self.zone.id - self.services["vgpu260q"]["template"] = self.template.id + self.testdata["vgpu260q"]["zoneid"] = self.zone.id + self.testdata["vgpu260q"]["template"] = self.template.id - self.services["vgpu140q"]["zoneid"] = self.zone.id - self.services["vgpu140q"]["template"] = self.template.id + self.testdata["vgpu140q"]["zoneid"] = self.zone.id + self.testdata["vgpu140q"]["template"] = self.template.id #create a service offering self.service_offering = ServiceOffering.create( self.apiclient, - self.services["service_offerings"]["vgpu260qwin"], + self.testdata["service_offerings"]["vgpu260qwin"], serviceofferingdetails={'pciDevice': 'VGPU'} ) #build cleanup list @@ -152,7 +87,7 @@ def setUp(self): self.account ] - @attr(tags = ['advanced', 'simulator', 'basic', 'vgpu', 'provisioning'], BugId="CLOUDSTACK-6876") + @attr(tags = ['advanced', 'basic', 'vgpu'], required_hardware="true", BugId="CLOUDSTACK-6876") def test_deploy_vgpu_enabled_vm(self): """Test Deploy Virtual Machine @@ -163,11 +98,11 @@ def test_deploy_vgpu_enabled_vm(self): """ self.virtual_machine = VirtualMachine.create( self.apiclient, - self.services["vgpu260q"], + self.testdata["vgpu260q"], accountid=self.account.name, domainid=self.account.domainid, serviceofferingid=self.service_offering.id, - mode=self.services['mode'] + mode=self.testdata['mode'] ) list_vms = VirtualMachine.list(self.apiclient, id=self.virtual_machine.id) @@ -204,13 +139,13 @@ def test_deploy_vgpu_enabled_vm(self): "Running", msg="VM is not in Running state" ) - list_hosts = list_hosts( + hosts = list_hosts( self.apiclient, id=vm.hostid ) - hostip = list_hosts[0].ipaddress + hostip = hosts[0].ipaddress try: - sshClient = SshClient(host=hostip, port=22, user='root',passwd=self.services["host_password"]) + sshClient = SshClient(host=hostip, port=22, user='root',passwd=self.testdata["host_password"]) res = sshClient.execute("xe vgpu-list vm-name-label=%s params=type-uuid %s" % ( vm.instancename )) @@ -230,4 +165,4 @@ def tearDown(self): try: cleanup_resources(self.apiclient, self.cleanup) except Exception as e: - self.debug("Warning! Exception in tearDown: %s" % e) \ No newline at end of file + self.debug("Warning! Exception in tearDown: %s" % e) diff --git a/test/integration/smoke/test_deploy_vm.py b/test/integration/smoke/test_deploy_vm.py index 8d0a0eda20..ed5dfaf37e 100644 --- a/test/integration/smoke/test_deploy_vm.py +++ b/test/integration/smoke/test_deploy_vm.py @@ -68,7 +68,7 @@ def setUp(self): self.account ] - @attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'selfservice']) + @attr(tags = ['advanced','basic', 'sg'], required_hardware="false") def test_deploy_vm(self): """Test Deploy Virtual Machine @@ -111,7 +111,7 @@ def test_deploy_vm(self): msg="VM is not in Running state" ) - @attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'selfservice']) + @attr(tags = ['advanced', 'basic', 'sg'], required_hardware="false") def test_deploy_vm_multiple(self): """Test Multiple Deploy Virtual Machine @@ -206,7 +206,7 @@ def setUp(self): self.mock_volume_failure ] - @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6873") + @attr(tags = ['advanced'], BugId="CLOUDSTACK-6873", required_hardware="false") def test_deploy_vm_volume_creation_failure(self): """Test Deploy Virtual Machine - volume creation failure and retry @@ -317,7 +317,7 @@ def setUp(self): self.mock_start_failure ] - @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6873") + @attr(tags = ['advanced'], BugId="CLOUDSTACK-6873", required_hardware="false") def test_deploy_vm_start_failure(self): """Test Deploy Virtual Machine - start operation failure and retry diff --git a/test/integration/smoke/test_deploy_vm_root_resize.py b/test/integration/smoke/test_deploy_vm_root_resize.py index 5d73876db6..0f0ddcc8aa 100644 --- a/test/integration/smoke/test_deploy_vm_root_resize.py +++ b/test/integration/smoke/test_deploy_vm_root_resize.py @@ -103,7 +103,7 @@ def setUp(self): self.account ] - @attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'provisioning']) + @attr(tags = ['advanced', 'basic', 'sg'], required_hardware="true") def test_00_deploy_vm_root_resize(self): """Test deploy virtual machine with root resize @@ -204,7 +204,7 @@ def test_00_deploy_vm_root_resize(self): self.assertEqual(success, True, "Check if unsupported hypervisor %s fails appropriately" % self.hypervisor) - @attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'provisioning']) + @attr(tags = ['advanced', 'basic', 'sg'], required_hardware="true") def test_01_deploy_vm_root_resize(self): """Test proper failure to deploy virtual machine with rootdisksize of 0 """ @@ -233,7 +233,7 @@ def test_01_deploy_vm_root_resize(self): else: self.debug("test 01 does not support hypervisor type " + self.hypervisor); - @attr(tags = ['advanced', 'simulator', 'basic', 'sg', 'provisioning']) + @attr(tags = ['advanced', 'basic', 'sg'], required_hardware="true") def test_02_deploy_vm_root_resize(self): """Test proper failure to deploy virtual machine with rootdisksize less than template size """ diff --git a/test/integration/smoke/test_deploy_vm_with_userdata.py b/test/integration/smoke/test_deploy_vm_with_userdata.py index 7616b82d4b..c98b38aac0 100644 --- a/test/integration/smoke/test_deploy_vm_with_userdata.py +++ b/test/integration/smoke/test_deploy_vm_with_userdata.py @@ -70,7 +70,7 @@ def setUpClass(cls): def setup(self): self.hypervisor = self.testClient.getHypervisorInfo() - @attr(tags=["simulator", "devcloud", "basic", "advanced", "post", "provisioning"]) + @attr(tags=["devcloud", "basic", "advanced", "post"], required_hardware="true") def test_deployvm_userdata_post(self): """Test userdata as POST, size > 2k """ @@ -95,7 +95,7 @@ def test_deployvm_userdata_post(self): self.assert_(vm.id == str(deployVmResponse.id), "Vm deployed is different from the test") self.assert_(vm.state == "Running", "VM is not in Running state") - @attr(tags=["simulator", "devcloud", "basic", "advanced", "provisioning"]) + @attr(tags=["devcloud", "basic", "advanced"], required_hardware="true") def test_deployvm_userdata(self): """Test userdata as GET, size > 2k """ diff --git a/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py b/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py index 420925e378..9fcb6431c1 100644 --- a/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py +++ b/test/integration/smoke/test_deploy_vms_with_varied_deploymentplanners.py @@ -60,7 +60,7 @@ def setUpClass(cls): cls.account ] - @attr(tags=["simulator", "advanced", "basic", "sg", "selfservice"]) + @attr(tags=["advanced", "basic", "sg"], required_hardware="false") def test_deployvm_firstfit(self): """Test to deploy vm with a first fit offering """ @@ -104,7 +104,7 @@ def test_deployvm_firstfit(self): msg="VM is not in Running state" ) - @attr(tags=["simulator", "advanced", "basic", "sg", "selfservice"]) + @attr(tags=["advanced", "basic", "sg"], required_hardware="false") def test_deployvm_userdispersing(self): """Test deploy VMs using user dispersion planner """ @@ -163,7 +163,7 @@ def test_deployvm_userdispersing(self): self.debug("VMs (%s, %s) meant to be dispersed are deployed in the same cluster %s" % ( vm1.id, vm2.id, vm1clusterid)) - @attr(tags=["simulator", "advanced", "basic", "sg", "selfservice"]) + @attr(tags=["advanced", "basic", "sg"], required_hardware="false") def test_deployvm_userconcentrated(self): """Test deploy VMs using user concentrated planner """ diff --git a/test/integration/smoke/test_disk_offerings.py b/test/integration/smoke/test_disk_offerings.py index 45f438fb0c..69a252b8b2 100644 --- a/test/integration/smoke/test_disk_offerings.py +++ b/test/integration/smoke/test_disk_offerings.py @@ -45,7 +45,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke", "selfservice"]) + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false") def test_01_create_disk_offering(self): """Test to create disk offering @@ -132,7 +132,7 @@ def tearDownClass(cls): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke", "selfservice"]) + @attr(tags=["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false") def test_02_edit_disk_offering(self): """Test to update existing disk offering @@ -184,7 +184,7 @@ def test_02_edit_disk_offering(self): ) return - @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "simulator", "smoke", "selfservice"]) + @attr(tags=["advanced", "basic", "eip", "sg", "advancedns", "smoke"], required_hardware="false") def test_03_delete_disk_offering(self): """Test to delete disk offering diff --git a/test/integration/smoke/test_global_settings.py b/test/integration/smoke/test_global_settings.py index ace2db3191..4920421adf 100644 --- a/test/integration/smoke/test_global_settings.py +++ b/test/integration/smoke/test_global_settings.py @@ -32,7 +32,7 @@ class TestUpdateConfigWithScope(cloudstackTestCase): def setUp(self): self.apiClient = self.testClient.getApiClient() - @attr(tags=["simulator", "devcloud", "basic", "advanced", "selfservice"]) + @attr(tags=["devcloud", "basic", "advanced"], required_hardware="false") def test_UpdateConfigParamWithScope(self): """ test update configuration setting at zone level scope diff --git a/test/integration/smoke/test_guest_vlan_range.py b/test/integration/smoke/test_guest_vlan_range.py index f5bcdf4c6e..000d71ef01 100644 --- a/test/integration/smoke/test_guest_vlan_range.py +++ b/test/integration/smoke/test_guest_vlan_range.py @@ -78,7 +78,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags=["simulator", "advanced", "guestvlanrange", "dedicate", "release", "selfservice"],BugId="CLOUDSTACK-6738") + @attr(tags=["advanced", "guestvlanrange", "dedicate", "release"], BugId="CLOUDSTACK-6738", required_hardware="false") def test_dedicateGuestVlanRange(self): """Test guest vlan range dedication """ diff --git a/test/integration/smoke/test_internal_lb.py b/test/integration/smoke/test_internal_lb.py index d6f3477595..d2e6364ad2 100644 --- a/test/integration/smoke/test_internal_lb.py +++ b/test/integration/smoke/test_internal_lb.py @@ -56,7 +56,7 @@ def setUpClass(cls): cls.account.id)) cls.cleanup = [cls.account] - @attr(tags=["smoke", "advanced", "provisioning"]) + @attr(tags=["smoke", "advanced"], required_hardware="true") def test_internallb(self): """Test create, delete, assign, remove of internal loadbalancer """ diff --git a/test/integration/smoke/test_iso.py b/test/integration/smoke/test_iso.py index d394c27419..7c4bf0219e 100644 --- a/test/integration/smoke/test_iso.py +++ b/test/integration/smoke/test_iso.py @@ -75,7 +75,7 @@ def tearDown(self): return - @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke", "selfservice"], BugId="CLOUDSTACK-6769, CLOUDSTACK-6774") + @attr(tags = ["advanced", "basic", "eip", "sg", "advancedns", "smoke"], BugId="CLOUDSTACK-6769, CLOUDSTACK-6774", required_hardware="false") def test_01_create_iso(self): """Test create public & private ISO """ diff --git a/test/integration/smoke/test_loadbalance.py b/test/integration/smoke/test_loadbalance.py index daa5fee3d2..f662974363 100644 --- a/test/integration/smoke/test_loadbalance.py +++ b/test/integration/smoke/test_loadbalance.py @@ -143,7 +143,7 @@ def try_ssh(self, ip_addr, hostnames): time.sleep(10) return - @attr(tags = ["advanced", "advancedns", "smoke", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true") def test_01_create_lb_rule_src_nat(self): """Test to create Load balancing rule with source NAT""" @@ -303,7 +303,7 @@ def test_01_create_lb_rule_src_nat(self): self.try_ssh(src_nat_ip_addr.ipaddress, hostnames) return - @attr(tags = ["advanced", "advancedns", "smoke", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true") def test_02_create_lb_rule_non_nat(self): """Test to create Load balancing rule with non source NAT""" @@ -421,7 +421,7 @@ def test_02_create_lb_rule_non_nat(self): self.try_ssh(self.non_src_nat_ip.ipaddress.ipaddress, hostnames) return - @attr(tags = ["advanced", "advancedns", "smoke", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true") def test_assign_and_removal_lb(self): """Test for assign & removing load balancing rule""" diff --git a/test/integration/smoke/test_multipleips_per_nic.py b/test/integration/smoke/test_multipleips_per_nic.py index ad3a3cf2e0..4093356417 100644 --- a/test/integration/smoke/test_multipleips_per_nic.py +++ b/test/integration/smoke/test_multipleips_per_nic.py @@ -122,7 +122,7 @@ def setUp(self): msg="VM is not in Running state" ) - @attr(tags = ['advanced', 'simulator', 'basic', "provisioning"]) + @attr(tags = ['advanced', 'basic'], required_hardware="false") def test_nic_secondaryip_add_remove(self): #TODO: SIMENH: add verification list_vms = VirtualMachine.list(self.apiclient, id=self.virtual_machine.id) diff --git a/test/integration/smoke/test_network.py b/test/integration/smoke/test_network.py index 410087864e..cfe9c18a0a 100644 --- a/test/integration/smoke/test_network.py +++ b/test/integration/smoke/test_network.py @@ -115,7 +115,7 @@ def tearDownClass(cls): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false") def test_public_ip_admin_account(self): """Test for Associate/Disassociate public IP address for admin account""" @@ -165,7 +165,7 @@ def test_public_ip_admin_account(self): self.fail("list public ip response is not empty") return - @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false") def test_public_ip_user_account(self): """Test for Associate/Disassociate public IP address for user account""" @@ -278,7 +278,7 @@ def tearDown(self): cleanup_resources(self.apiclient, self.cleanup) return - @attr(tags = ["advanced", "advancedns", "smoke", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true") def test_01_port_fwd_on_src_nat(self): """Test for port forwarding on source NAT""" @@ -405,7 +405,7 @@ def test_01_port_fwd_on_src_nat(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true") def test_02_port_fwd_on_non_src_nat(self): """Test for port forwarding on non source NAT""" @@ -617,7 +617,7 @@ def setUp(self): ] return - @attr(tags = ["advanced", "advancedns", "smoke", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true") def test_reboot_router(self): """Test for reboot router""" @@ -773,7 +773,7 @@ def setUp(self): def tearDown(self): cleanup_resources(self.apiclient, self.cleanup) - @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false") def test_releaseIP(self): """Test for release public IP address""" @@ -898,7 +898,7 @@ def setUp(self): self.cleanup = [] return - @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false") def test_delete_account(self): """Test for delete account""" diff --git a/test/integration/smoke/test_network_acl.py b/test/integration/smoke/test_network_acl.py index 68e5067da8..015ebabba9 100644 --- a/test/integration/smoke/test_network_acl.py +++ b/test/integration/smoke/test_network_acl.py @@ -54,7 +54,7 @@ def setUpClass(cls): cls.account.id)) cls.cleanup = [cls.account] - @attr(tags=["advanced", "provisioning"]) + @attr(tags=["advanced"], required_hardware="true") def test_network_acl(self): #TODO: SIMENH: add actual verification Logic for rules. """Test network ACL lists and items in VPC""" diff --git a/test/integration/smoke/test_nic.py b/test/integration/smoke/test_nic.py index 592a8391a0..dd6de96233 100644 --- a/test/integration/smoke/test_nic.py +++ b/test/integration/smoke/test_nic.py @@ -119,7 +119,7 @@ def signal_handler(signal, frame): except Exception as ex: self.debug("Exception during NIC test SETUP!: " + str(ex)) - @attr(tags = ["devcloud", "smoke", "advanced", "advancedns", "provisioning"]) + @attr(tags = ["devcloud", "smoke", "advanced", "advancedns"], required_hardware="true") def test_01_nic(self): #TODO: SIMENH: add validation """Test to add and update added nic to a virtual machine""" diff --git a/test/integration/smoke/test_non_contigiousvlan.py b/test/integration/smoke/test_non_contigiousvlan.py index 50b48d092c..7469829d23 100644 --- a/test/integration/smoke/test_non_contigiousvlan.py +++ b/test/integration/smoke/test_non_contigiousvlan.py @@ -21,7 +21,7 @@ from marvin.lib.common import setNonContiguousVlanIds, get_zone from nose.plugins.attrib import attr -@attr(tags = ["simulator", "advanced", "selfservice"], BugId="CLOUDSTACK-6776") + class TestUpdatePhysicalNetwork(cloudstackTestCase): """ Test to extend physical network vlan range @@ -38,7 +38,7 @@ def setUp(self): raise Exception("Failed to set non contiguous vlan ids to test. Free some ids from \ from existing physical networks at ends") - + @attr(tags = ["advanced"], BugId="CLOUDSTACK-6776", required_hardware="false") def test_extendPhysicalNetworkVlan(self): """ Test to update a physical network and extend its vlan diff --git a/test/integration/smoke/test_over_provisioning.py b/test/integration/smoke/test_over_provisioning.py index 1c5d8a520f..43d558e671 100644 --- a/test/integration/smoke/test_over_provisioning.py +++ b/test/integration/smoke/test_over_provisioning.py @@ -32,7 +32,7 @@ class TestUpdateOverProvision(cloudstackTestCase): def setUp(self): self.apiClient = self.testClient.getApiClient() - @attr(tags=["simulator", "devcloud", "basic", "advanced", "selfservice"]) + @attr(tags=["devcloud", "basic", "advanced"], required_hardware="false") def test_UpdateStorageOverProvisioningFactor(self): """ test update configuration setting at storage scope diff --git a/test/integration/smoke/test_portable_publicip.py b/test/integration/smoke/test_portable_publicip.py index 2d02a7114e..be37773484 100644 --- a/test/integration/smoke/test_portable_publicip.py +++ b/test/integration/smoke/test_portable_publicip.py @@ -75,7 +75,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["simulator", "basic", "advanced", "portablepublicip", "selfservice"]) + @attr(tags = ["basic", "advanced", "portablepublicip"], required_hardware="false") def test_createPortablePublicIPRange(self): """ Test to create a portable public ip range """ @@ -161,7 +161,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["simulator", "advanced", "portablepublicip", "selfservice"]) + @attr(tags = ["advanced", "portablepublicip"], required_hardware="false") def test_createPortablePublicIPAcquire(self): """ Test to acquire a provisioned public ip range """ diff --git a/test/integration/smoke/test_primary_storage.py b/test/integration/smoke/test_primary_storage.py index 3c1aa622d0..f5a666ee35 100644 --- a/test/integration/smoke/test_primary_storage.py +++ b/test/integration/smoke/test_primary_storage.py @@ -51,7 +51,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"], BugId="CLOUDSTACK-6770") + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], BugId="CLOUDSTACK-6770", required_hardware="false") def test_01_primary_storage_nfs(self): """Test primary storage pools - XEN, KVM, VMWare """ @@ -144,7 +144,7 @@ def test_01_primary_storage_nfs(self): return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"], BugId="CLOUDSTACK-6770") + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], BugId="CLOUDSTACK-6770", required_hardware="false") def test_01_primary_storage_iscsi(self): """Test primary storage pools - XEN, KVM, VMWare """ diff --git a/test/integration/smoke/test_privategw_acl.py b/test/integration/smoke/test_privategw_acl.py index c86beb1ecf..cf0f8e338c 100644 --- a/test/integration/smoke/test_privategw_acl.py +++ b/test/integration/smoke/test_privategw_acl.py @@ -39,7 +39,7 @@ def setUp(self): self.privateGwId = None - @attr(tags=["advanced", "selfservice"]) + @attr(tags=["advanced"], required_hardware="false") def test_privategw_acl(self): #TODO: SIMENH: add a new test to verification of ACL rules diff --git a/test/integration/smoke/test_public_ip_range.py b/test/integration/smoke/test_public_ip_range.py index b961dc3477..e09f7b43b5 100644 --- a/test/integration/smoke/test_public_ip_range.py +++ b/test/integration/smoke/test_public_ip_range.py @@ -72,7 +72,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["simulator", "advanced", "publiciprange", "dedicate", "release", "selfservice"]) + @attr(tags = ["advanced", "publiciprange", "dedicate", "release"], required_hardware="false") def test_dedicatePublicIpRange(self): """Test public IP range dedication """ diff --git a/test/integration/smoke/test_pvlan.py b/test/integration/smoke/test_pvlan.py index 9178e624c3..6e187b99dc 100644 --- a/test/integration/smoke/test_pvlan.py +++ b/test/integration/smoke/test_pvlan.py @@ -45,7 +45,7 @@ def setUpClass(cls): cls.zone = get_zone(cls.apiClient, cls.testClient.getZoneForTests()) cls.zoneId = cls.zone.id - @attr(tags = ["advanced", "selfservice"]) + @attr(tags = ["advanced"], required_hardware="false") def test_create_pvlan_network(self): self.debug("Test create pvlan network") createNetworkCmd = createNetwork.createNetworkCmd() diff --git a/test/integration/smoke/test_regions.py b/test/integration/smoke/test_regions.py index 389f878756..7b0dec3c6e 100644 --- a/test/integration/smoke/test_regions.py +++ b/test/integration/smoke/test_regions.py @@ -35,7 +35,7 @@ def setUpClass(cls): cls.domain = get_domain(cls.apiclient) cls.cleanup = [] - @attr(tags=["simulator", "basic", "advanced", "selfservice"]) + @attr(tags=["basic", "advanced"], required_hardware="false") def test_createRegion(self): """ Test for create region """ diff --git a/test/integration/smoke/test_reset_vm_on_reboot.py b/test/integration/smoke/test_reset_vm_on_reboot.py index 4709df4d09..668c77fa7d 100644 --- a/test/integration/smoke/test_reset_vm_on_reboot.py +++ b/test/integration/smoke/test_reset_vm_on_reboot.py @@ -96,7 +96,7 @@ def tearDown(self): return @attr(hypervisor="xenserver") - @attr(tags=["advanced", "basic", "selfservice"]) + @attr(tags=["advanced", "basic"], required_hardware="false") def test_01_reset_vm_on_reboot(self): #TODO: SIMENH: add new test to check volume contents """Test reset virtual machine on reboot diff --git a/test/integration/smoke/test_resource_detail.py b/test/integration/smoke/test_resource_detail.py index 7f4a6e7686..7103c65261 100644 --- a/test/integration/smoke/test_resource_detail.py +++ b/test/integration/smoke/test_resource_detail.py @@ -89,7 +89,7 @@ def tearDown(self): cleanup_resources(self.apiclient, self.cleanup) return - @attr(tags = ["advanced", "xenserver", "selfservice"]) + @attr(tags = ["advanced", "xenserver"], required_hardware="false") def test_01_updatevolumedetail(self): """Test volume detail """ diff --git a/test/integration/smoke/test_routers.py b/test/integration/smoke/test_routers.py index d503af1896..cb878a0fdc 100644 --- a/test/integration/smoke/test_routers.py +++ b/test/integration/smoke/test_routers.py @@ -98,7 +98,7 @@ def setUp(self): self.hypervisor = self.testClient.getHypervisorInfo() return - @attr(tags = ["advanced", "basic", "sg", "smoke", "provisioning"]) + @attr(tags = ["advanced", "basic", "sg", "smoke"], required_hardware="true") def test_01_router_internal_basic(self): """Test router internal basic zone """ @@ -184,7 +184,7 @@ def test_01_router_internal_basic(self): return - @attr(tags = ["advanced", "smoke", "provisioning"]) + @attr(tags = ["advanced", "smoke"], required_hardware="true") def test_02_router_internal_adv(self): """Test router internal advanced zone """ @@ -291,7 +291,7 @@ def test_02_router_internal_adv(self): self.debug("Haproxy process status: %s" % res) return - @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false") def test_03_restart_network_cleanup(self): """Test restart network """ @@ -371,7 +371,7 @@ def test_03_restart_network_cleanup(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true") def test_04_restart_network_wo_cleanup(self): """Test restart network without cleanup """ @@ -487,7 +487,7 @@ def test_04_restart_network_wo_cleanup(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false") def test_05_router_basic(self): """Test router basic setup """ @@ -554,7 +554,7 @@ def test_05_router_basic(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false") def test_06_router_advanced(self): """Test router advanced setup """ @@ -638,7 +638,7 @@ def test_06_router_advanced(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false") def test_07_stop_router(self): """Test stop router """ @@ -683,7 +683,7 @@ def test_07_stop_router(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false") def test_08_start_router(self): """Test start router """ @@ -737,7 +737,7 @@ def verifyRouterResponse(self,router_response,ip): return True return False - @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false") def test_09_reboot_router(self): """Test reboot router """ diff --git a/test/integration/smoke/test_scale_vm.py b/test/integration/smoke/test_scale_vm.py index 261fe93fb2..d77946c545 100644 --- a/test/integration/smoke/test_scale_vm.py +++ b/test/integration/smoke/test_scale_vm.py @@ -103,7 +103,7 @@ def tearDown(self): return @attr(hypervisor="xenserver") - @attr(tags=["advanced", "basic", "provisioning"], BugId="CLOUDSTACK-6768") + @attr(tags=["advanced", "basic"], BugId="CLOUDSTACK-6768", required_hardware="true") def test_01_scale_vm(self): """Test scale virtual machine """ diff --git a/test/integration/smoke/test_secondary_storage.py b/test/integration/smoke/test_secondary_storage.py index ac809562e0..2e20421348 100644 --- a/test/integration/smoke/test_secondary_storage.py +++ b/test/integration/smoke/test_secondary_storage.py @@ -81,7 +81,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"],BugId="CLOUDSTACK-6877") + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false",BugId="CLOUDSTACK-6877") def test_01_sys_vm_start(self): """Test system VM start """ @@ -160,7 +160,7 @@ def test_01_sys_vm_start(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "eip", "sg"], BugId="CLOUDSTACK-6773", required_hardware="false") def test_02_sys_template_ready(self): """Test system templates are ready """ diff --git a/test/integration/smoke/test_service_offerings.py b/test/integration/smoke/test_service_offerings.py index 980e11017b..e390f75572 100644 --- a/test/integration/smoke/test_service_offerings.py +++ b/test/integration/smoke/test_service_offerings.py @@ -54,7 +54,7 @@ def tearDown(self): return - @attr(tags=["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"]) + @attr(tags=["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false") def test_01_create_service_offering(self): """Test to create service offering""" @@ -205,7 +205,7 @@ def tearDownClass(cls): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags=["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"]) + @attr(tags=["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false") def test_02_edit_service_offering(self): """Test to update existing service offering""" @@ -256,7 +256,7 @@ def test_02_edit_service_offering(self): return - @attr(tags=["advanced", "advancedns", "smoke", "basic", "eip", "sg", "selfservice"]) + @attr(tags=["advanced", "advancedns", "smoke", "basic", "eip", "sg"], required_hardware="false") def test_03_delete_service_offering(self): """Test to delete service offering""" @@ -282,7 +282,7 @@ def test_03_delete_service_offering(self): return - @attr(tags=["advanced", "advancedns", "smoke", "provisioning"]) + @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true") def test_04_change_offering_small(self): """Test to change service to a small capacity """ diff --git a/test/integration/smoke/test_snapshots.py b/test/integration/smoke/test_snapshots.py index a9be4e2201..2bb1a89889 100644 --- a/test/integration/smoke/test_snapshots.py +++ b/test/integration/smoke/test_snapshots.py @@ -98,8 +98,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(speed = "slow") - @attr(tags = ["advanced", "advancedns", "smoke", "provisioning"], BugId="CLOUDSTACK-6878") + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="true",BugId="CLOUDSTACK-6878") def test_01_snapshot_root_disk(self): """Test Snapshot Root Disk """ diff --git a/test/integration/smoke/test_ssvm.py b/test/integration/smoke/test_ssvm.py index ffa620b2db..9b8d19d024 100644 --- a/test/integration/smoke/test_ssvm.py +++ b/test/integration/smoke/test_ssvm.py @@ -50,7 +50,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false") def test_01_list_sec_storage_vm(self): """Test List secondary storage VMs """ @@ -168,7 +168,7 @@ def test_01_list_sec_storage_vm(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false") def test_02_list_cpvm_vm(self): """Test List console proxy VMs """ @@ -280,7 +280,7 @@ def test_02_list_cpvm_vm(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true") def test_03_ssvm_internals(self): """Test SSVM Internals""" @@ -393,7 +393,7 @@ def test_03_ssvm_internals(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true") def test_04_cpvm_internals(self): """Test CPVM Internals""" @@ -476,7 +476,7 @@ def test_04_cpvm_internals(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true") def test_05_stop_ssvm(self): """Test stop SSVM """ @@ -552,7 +552,7 @@ def test_05_stop_ssvm(self): self.test_03_ssvm_internals() return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true") def test_06_stop_cpvm(self): """Test stop CPVM """ @@ -625,7 +625,7 @@ def test_06_stop_cpvm(self): self.test_04_cpvm_internals() return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true") def test_07_reboot_ssvm(self): """Test reboot SSVM """ @@ -711,7 +711,7 @@ def test_07_reboot_ssvm(self): self.test_03_ssvm_internals() return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true") def test_08_reboot_cpvm(self): """Test reboot CPVM """ @@ -798,7 +798,7 @@ def test_08_reboot_cpvm(self): self.test_04_cpvm_internals() return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true") def test_09_destroy_ssvm(self): """Test destroy SSVM """ @@ -880,7 +880,7 @@ def test_09_destroy_ssvm(self): self.test_03_ssvm_internals() return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true") def test_10_destroy_cpvm(self): """Test destroy CPVM """ diff --git a/test/integration/smoke/test_templates.py b/test/integration/smoke/test_templates.py index c7594bb85d..a757c2ad1a 100644 --- a/test/integration/smoke/test_templates.py +++ b/test/integration/smoke/test_templates.py @@ -144,7 +144,7 @@ def tearDownClass(cls): return - @attr(tags = ["advanced", "advancedns", "smoke", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke"], required_hardware="false") def test_01_create_template(self): """Test create public & private template """ @@ -340,7 +340,7 @@ def tearDown(self): return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice", "test"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false") def test_02_edit_template(self): """Test Edit template """ @@ -423,7 +423,7 @@ def test_02_edit_template(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false") def test_03_delete_template(self): """Test delete template """ @@ -452,7 +452,7 @@ def test_03_delete_template(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true") def test_04_extract_template(self): "Test for extract template" @@ -503,7 +503,7 @@ def test_04_extract_template(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false") def test_05_template_permissions(self): """Update & Test for template permissions""" @@ -556,7 +556,7 @@ def test_05_template_permissions(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "multizone", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "multizone"], required_hardware="true") def test_06_copy_template(self): """Test for copy template from one zone to another""" @@ -647,7 +647,7 @@ def test_06_copy_template(self): self.apiclient.deleteTemplate(cmd) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false") def test_07_list_public_templates(self): """Test only public templates are visible to normal user""" @@ -679,7 +679,7 @@ def test_07_list_public_templates(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false") def test_08_list_system_templates(self): """Test System templates are not visible to normal user""" diff --git a/test/integration/smoke/test_vm_ha.py b/test/integration/smoke/test_vm_ha.py index 1fc69606a7..1d9021ce9f 100644 --- a/test/integration/smoke/test_vm_ha.py +++ b/test/integration/smoke/test_vm_ha.py @@ -145,7 +145,7 @@ def setUp(self): ] self.cleanup = self.cleanup + self.mock_checkonhost_list - @attr(tags = ['selfservice'],BugId="CLOUDSTACK-6873") + @attr(tags = ['advanced'], required_hardware="false", BugId="CLOUDSTACK-6873") def test_vm_ha(self): """Test VM HA diff --git a/test/integration/smoke/test_vm_life_cycle.py b/test/integration/smoke/test_vm_life_cycle.py index 1e565718a0..ce7cac7676 100644 --- a/test/integration/smoke/test_vm_life_cycle.py +++ b/test/integration/smoke/test_vm_life_cycle.py @@ -115,7 +115,7 @@ def setUp(self): self.dbclient = self.testClient.getDbConnection() - @attr(tags = ["simulator", "devcloud", "advanced", "advancedns", "smoke", "basic", "sg"]) + @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false") def test_deploy_vm(self): """Test Deploy Virtual Machine """ @@ -161,7 +161,7 @@ def test_deploy_vm(self): return - @attr(tags = ["simulator", "advanced"]) + @attr(tags = ["advanced"], required_hardware="false") def test_advZoneVirtualRouter(self): #TODO: SIMENH: duplicate test, remove it """ @@ -183,8 +183,8 @@ def test_advZoneVirtualRouter(self): self.assertIsNotNone(router.publicip, msg="Router has no public ip") self.assertIsNotNone(router.guestipaddress, msg="Router has no guest ip") - @attr(hypervisor = ["simulator"]) - @attr(mode = ["basic"]) + + @attr(mode = ["basic"], required_hardware="false") def test_basicZoneVirtualRouter(self): #TODO: SIMENH: duplicate test, remove it """ @@ -304,7 +304,7 @@ def tearDown(self): return - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false") def test_01_stop_vm(self): """Test Stop Virtual Machine """ @@ -319,7 +319,7 @@ def test_01_stop_vm(self): self.fail("Failed to stop VM: %s" % e) return - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false") def test_02_start_vm(self): """Test Start Virtual Machine """ @@ -357,7 +357,7 @@ def test_02_start_vm(self): ) return - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false") def test_03_reboot_vm(self): """Test Reboot Virtual Machine """ @@ -394,7 +394,7 @@ def test_03_reboot_vm(self): return - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false") def test_06_destroy_vm(self): """Test destroy Virtual Machine """ @@ -430,7 +430,7 @@ def test_06_destroy_vm(self): ) return - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"]) + @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="false") def test_07_restore_vm(self): #TODO: SIMENH: add another test the data on the restored VM. """Test recover Virtual Machine @@ -471,7 +471,7 @@ def test_07_restore_vm(self): return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "multihost", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "multihost"], required_hardware="false") def test_08_migrate_vm(self): """Test migrate VM """ @@ -548,7 +548,7 @@ def test_08_migrate_vm(self): @attr(configuration = "expunge.interval") @attr(configuration = "expunge.delay") - @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg", "selfservice"],BugId="CLOUDSTACK-6738") + @attr(tags = ["devcloud", "advanced", "advancedns", "smoke", "basic", "sg"], BugId="CLOUDSTACK-6738", required_hardware="false") def test_09_expunge_vm(self): """Test destroy(expunge) Virtual Machine """ @@ -593,7 +593,7 @@ def test_09_expunge_vm(self): self.assertEqual(list_vm_response,None,"Check Expunged virtual machine is in listVirtualMachines response") return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic", "sg"], required_hardware="true") def test_10_attachAndDetach_iso(self): """Test for attach and detach ISO to virtual machine""" diff --git a/test/integration/smoke/test_vm_snapshots.py b/test/integration/smoke/test_vm_snapshots.py index e884d42dcf..7b238dcb46 100644 --- a/test/integration/smoke/test_vm_snapshots.py +++ b/test/integration/smoke/test_vm_snapshots.py @@ -100,7 +100,7 @@ def tearDown(self): raise Exception("Warning: Exception during cleanup : %s" % e) return - @attr(tags=["advanced", "advancedns", "smoke", "provisioning"]) + @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true") def test_01_create_vm_snapshots(self): """Test to create VM snapshots """ @@ -144,7 +144,7 @@ def test_01_create_vm_snapshots(self): ) return - @attr(tags=["advanced", "advancedns", "smoke", "provisioning"]) + @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true") def test_02_revert_vm_snapshots(self): """Test to revert VM snapshots """ @@ -231,7 +231,7 @@ def test_02_revert_vm_snapshots(self): "Check the random data is equal with the ramdom file!" ) - @attr(tags=["advanced", "advancedns", "smoke", "provisioning"]) + @attr(tags=["advanced", "advancedns", "smoke"], required_hardware="true") def test_03_delete_vm_snapshots(self): """Test to delete vm snapshots """ diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index 2e41aa7b81..b1a6835ed6 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -109,7 +109,7 @@ def setUp(self): self.dbclient = self.testClient.getDbConnection() self.cleanup = [] - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true") def test_01_create_volume(self): """Test Volume creation for all Disk Offerings (incl. custom) """ @@ -327,7 +327,7 @@ def tearDown(self): cleanup_resources(self.apiClient, self.cleanup) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true") def test_02_attach_volume(self): """Attach a created Volume to a Running VM """ @@ -373,7 +373,7 @@ def test_02_attach_volume(self): (self.virtual_machine.ipaddress, e)) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="false") def test_03_download_attached_volume(self): """Download a Volume attached to a VM """ @@ -395,7 +395,7 @@ def test_03_download_attached_volume(self): with self.assertRaises(Exception): self.apiClient.extractVolume(cmd) - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="false") def test_04_delete_attached_volume(self): """Delete a Volume attached to a VM """ @@ -416,7 +416,7 @@ def test_04_delete_attached_volume(self): with self.assertRaises(Exception): self.apiClient.deleteVolume(cmd) - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "selfservice"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="false") def test_05_detach_volume(self): """Detach a Volume attached to a VM """ @@ -458,7 +458,7 @@ def test_05_detach_volume(self): ) return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true") def test_06_download_detached_volume(self): """Download a Volume unattached to an VM """ @@ -495,7 +495,7 @@ def test_06_download_detached_volume(self): % (extract_vol.url, self.volume.id) ) - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true") def test_07_resize_fail(self): """Test resize (negative) non-existent volume""" # Verify the size is the new size is what we wanted it to be. @@ -609,7 +609,7 @@ def test_07_resize_fail(self): return - @attr(tags = ["advanced", "advancedns", "smoke", "basic", "provisioning"]) + @attr(tags = ["advanced", "advancedns", "smoke", "basic"], required_hardware="true") def test_08_resize_volume(self): """Test resize a volume""" # Verify the size is the new size is what we wanted it to be. @@ -712,7 +712,7 @@ def test_08_resize_volume(self): time.sleep(30) return - @attr(tags = ["advanced", "advancedns", "smoke","basic", "selfservice"], BugId="CLOUDSTACK-6875") + @attr(tags = ["advanced", "advancedns", "smoke","basic"], required_hardware="false", BugId="CLOUDSTACK-6875") def test_09_delete_detached_volume(self): """Delete a Volume unattached to an VM """ diff --git a/test/integration/smoke/test_vpc_vpn.py b/test/integration/smoke/test_vpc_vpn.py index 1b2844781a..f0a2027fe6 100644 --- a/test/integration/smoke/test_vpc_vpn.py +++ b/test/integration/smoke/test_vpc_vpn.py @@ -52,7 +52,7 @@ def setUpClass(cls): cls.cleanup = [cls.account] - @attr(tags=["advanced", "selfservice"]) + @attr(tags=["advanced"], required_hardware="false") def test_vpc_remote_access_vpn(self): """Test VPN in VPC""" @@ -159,7 +159,7 @@ def setUpClass(cls): cls.cleanup = [cls.account] - @attr(tags=["advanced", "selfservice"], BugId="CLOUDSTACK-6879") + @attr(tags=["advanced"], required_hardware="false",BugId="CLOUDSTACK-6879") def test_vpc_site2site_vpn(self): """Test VPN in VPC""" diff --git a/tools/marvin/marvin/config/test_data.py b/tools/marvin/marvin/config/test_data.py index 801c549de4..d870c9876a 100644 --- a/tools/marvin/marvin/config/test_data.py +++ b/tools/marvin/marvin/config/test_data.py @@ -890,4 +890,72 @@ "name": "hostantiaffinity", "type": "host anti-affinity", }, + "vgpu":{ + "disk_offering":{ + "displaytext": "Small", + "name": "Small", + "disksize": 1 + }, + "account": { + "email": "test@test.com", + "firstname": "Test", + "lastname": "User", + "username": "test", + # Random characters are appended in create account to + # ensure unique username generated each time + "password": "password", + }, + "vgpu260q": # Create a virtual machine instance with vgpu type as 260q + { + "displayname": "testserver", + "username": "root", # VM creds for SSH + "password": "password", + "ssh_port": 22, + "hypervisor": 'XenServer', + "privateport": 22, + "publicport": 22, + "protocol": 'TCP', + }, + "vgpu140q": # Create a virtual machine instance with vgpu type as 140q + { + "displayname": "testserver", + "username": "root", + "password": "password", + "ssh_port": 22, + "hypervisor": 'XenServer', + "privateport": 22, + "publicport": 22, + "protocol": 'TCP', + }, + "service_offerings": + { + "vgpu260qwin": + { + "name": "Windows Instance with vGPU260Q", + "displaytext": "Windows Instance with vGPU260Q", + "cpunumber": 2, + "cpuspeed": 1600, # in MHz + "memory": 3072, # In MBs + }, + "vgpu140qwin": + { + # Small service offering ID to for change VM + # service offering from medium to small + "name": "Windows Instance with vGPU140Q", + "displaytext": "Windows Instance with vGPU140Q", + "cpunumber": 2, + "cpuspeed": 1600, + "memory": 3072, + } + }, + "diskdevice": ['/dev/vdc', '/dev/vdb', '/dev/hdb', '/dev/hdc', '/dev/xvdd', '/dev/cdrom', '/dev/sr0', '/dev/cdrom1' ], + # Disk device where ISO is attached to instance + "mount_dir": "/mnt/tmp", + "sleep": 60, + "timeout": 10, + #Migrate VM to hostid + "ostype": 'Windows 7 (32-bit)', + # CentOS 5.3 (64-bit) + } + } From 3c5f64c97ab071451aee7f232d8f2cec6d89044d Mon Sep 17 00:00:00 2001 From: Santhosh Edukulla Date: Fri, 13 Jun 2014 01:25:20 +0530 Subject: [PATCH 603/683] Fixed few resource leak issues Signed-off-by: Daan Hoogland --- .../src/com/cloud/vm/dao/UserVmDaoImpl.java | 164 +++++++++++------- 1 file changed, 106 insertions(+), 58 deletions(-) diff --git a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java index f72690e8a2..8c460b59f4 100755 --- a/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java +++ b/engine/schema/src/com/cloud/vm/dao/UserVmDaoImpl.java @@ -356,91 +356,139 @@ public void saveDetails(UserVmVO vm) { @Override public List listPodIdsHavingVmsforAccount(long zoneId, long accountId) { TransactionLegacy txn = TransactionLegacy.currentTxn(); - PreparedStatement pstmt = null; List result = new ArrayList(); + String sql = LIST_PODS_HAVING_VMS_FOR_ACCOUNT; - try { - String sql = LIST_PODS_HAVING_VMS_FOR_ACCOUNT; - pstmt = txn.prepareAutoCloseStatement(sql); + try(PreparedStatement pstmt = txn.prepareStatement(sql)) { pstmt.setLong(1, zoneId); pstmt.setLong(2, accountId); - - ResultSet rs = pstmt.executeQuery(); - while (rs.next()) { - result.add(rs.getLong(1)); + try(ResultSet rs = pstmt.executeQuery();) + { + while (rs.next()) { + result.add(rs.getLong(1)); + } } + catch (Exception e) { + s_logger.error("listPodIdsHavingVmsforAccount:Exception: " + e.getMessage()); + throw new CloudRuntimeException("listPodIdsHavingVmsforAccount:Exception: " + e.getMessage(), e); + } + txn.commit(); return result; - } catch (SQLException e) { - throw new CloudRuntimeException("DB Exception on: " + LIST_PODS_HAVING_VMS_FOR_ACCOUNT, e); - } catch (Throwable e) { - throw new CloudRuntimeException("Caught: " + LIST_PODS_HAVING_VMS_FOR_ACCOUNT, e); + } catch (Exception e) { + s_logger.error("listPodIdsHavingVmsforAccount:Exception : " + e.getMessage()); + throw new CloudRuntimeException("listPodIdsHavingVmsforAccount:Exception: " + e.getMessage(), e); + } + finally { + try{ + if (txn != null) + { + txn.close(); + } + } + catch (Exception e) + { + s_logger.error("listVmDetails:Exception:" + e.getMessage()); + } } + } @Override public Hashtable listVmDetails(Hashtable userVmDataHash) { TransactionLegacy txn = TransactionLegacy.currentTxn(); - PreparedStatement pstmt = null; - try { int curr_index = 0; - List userVmDataList = new ArrayList(userVmDataHash.values()); - - if (userVmDataList.size() > VM_DETAILS_BATCH_SIZE) { - pstmt = txn.prepareStatement(VM_DETAILS + getQueryBatchAppender(VM_DETAILS_BATCH_SIZE)); - while ((curr_index + VM_DETAILS_BATCH_SIZE) <= userVmDataList.size()) { - // set the vars value - for (int k = 1, j = curr_index; j < curr_index + VM_DETAILS_BATCH_SIZE; j++, k++) { - pstmt.setLong(k, userVmDataList.get(j).getId()); - } - ResultSet rs = pstmt.executeQuery(); - while (rs.next()) { - long vm_id = rs.getLong("vm_instance.id"); - //check if the entry is already there - UserVmData uvm = userVmDataHash.get(vm_id); - if (uvm == null) { - uvm = new UserVmData(); - uvm.setId(vm_id); + if (userVmDataList.size() > VM_DETAILS_BATCH_SIZE) + { + try (PreparedStatement pstmt = txn.prepareStatement(VM_DETAILS + getQueryBatchAppender(VM_DETAILS_BATCH_SIZE));) + { + while ((curr_index + VM_DETAILS_BATCH_SIZE) <= userVmDataList.size()) { + // set the vars value + for (int k = 1, j = curr_index; j < curr_index + VM_DETAILS_BATCH_SIZE; j++, k++) { + pstmt.setLong(k, userVmDataList.get(j).getId()); + } + try(ResultSet rs = pstmt.executeQuery();) + { + while (rs.next()) { + long vm_id = rs.getLong("vm_instance.id"); + //check if the entry is already there + UserVmData uvm = userVmDataHash.get(vm_id); + if (uvm == null) { + uvm = new UserVmData(); + uvm.setId(vm_id); + } + // initialize the data with this row + setUserVmData(uvm, rs); + } } - // initialize the data with this row - setUserVmData(uvm, rs); + catch (Exception e) + { + s_logger.error("listVmDetails:Exception:" + e.getMessage()); + throw new CloudRuntimeException("listVmDetails: Exception:" + e.getMessage(),e); + } + curr_index += VM_DETAILS_BATCH_SIZE; } - rs.close(); - curr_index += VM_DETAILS_BATCH_SIZE; + } + catch (Exception e) + { + s_logger.error("listVmDetails:Exception:" + e.getMessage()); + throw new CloudRuntimeException("listVmDetails: Exception:" + e.getMessage(),e); } } if (curr_index < userVmDataList.size()) { int batch_size = (userVmDataList.size() - curr_index); - pstmt = txn.prepareStatement(VM_DETAILS + getQueryBatchAppender(batch_size)); - // set the vars value - for (int k = 1, j = curr_index; j < curr_index + batch_size; j++, k++) { - pstmt.setLong(k, userVmDataList.get(j).getId()); - } - ResultSet rs = pstmt.executeQuery(); - while (rs.next()) { - long vm_id = rs.getLong("vm_instance.id"); - //check if the entry is already there - UserVmData uvm = userVmDataHash.get(vm_id); - if (uvm == null) { - uvm = new UserVmData(); - uvm.setId(vm_id); + try (PreparedStatement vm_details_pstmt = txn.prepareStatement(VM_DETAILS + getQueryBatchAppender(batch_size))) + { + // set the vars value + for (int k = 1, j = curr_index; j < curr_index + batch_size; j++, k++) { + vm_details_pstmt.setLong(k, userVmDataList.get(j).getId()); + } + try(ResultSet rs = vm_details_pstmt.executeQuery();) { + while (rs.next()) { + long vm_id = rs.getLong("vm_instance.id"); + //check if the entry is already there + UserVmData uvm = userVmDataHash.get(vm_id); + if (uvm == null) { + uvm = new UserVmData(); + uvm.setId(vm_id); + } + // initialize the data with this row + setUserVmData(uvm, rs); + } + } + catch (Exception e) + { + s_logger.error("listVmDetails: Exception:" + e.getMessage()); + throw new CloudRuntimeException("listVmDetails: Exception:" + e.getMessage(),e); } - // initialize the data with this row - setUserVmData(uvm, rs); } - rs.close(); + catch (Exception e) + { + s_logger.error("listVmDetails:Exception:" + e.getMessage()); + throw new CloudRuntimeException("listVmDetails: Exception:" + e.getMessage(),e); + } } - - if (pstmt != null) - pstmt.close(); + txn.commit(); return userVmDataHash; - } catch (SQLException e) { - throw new CloudRuntimeException("DB Exception on: " + VM_DETAILS, e); - } catch (Throwable e) { - throw new CloudRuntimeException("Caught: " + VM_DETAILS, e); + } catch (Exception e) { + s_logger.error("listVmDetails:Exception:" + e.getMessage()); + throw new CloudRuntimeException("listVmDetails:Exception : ", e); } + finally { + try{ + if (txn != null) + { + txn.close(); + } + } + catch (Exception e) + { + s_logger.error("listVmDetails:Exception:" + e.getMessage()); + } + } + } public static UserVmData setUserVmData(UserVmData userVmData, ResultSet rs) throws SQLException { From dbfce8b11e25855a8cb21ec2bbbfe20940bb788d Mon Sep 17 00:00:00 2001 From: Santhosh Edukulla Date: Sat, 14 Jun 2014 22:20:14 +0530 Subject: [PATCH 604/683] June14: Fixed few coverity issues reported Signed-off-by: Daan Hoogland --- .../cloud/upgrade/dao/Upgrade421to430.java | 272 +++++++++--------- .../schema/src/com/cloud/vm/VMInstanceVO.java | 10 +- .../kvm/storage/LibvirtStorageAdaptor.java | 3 +- .../VirtualNetworkApplianceManagerImpl.java | 11 +- utils/src/com/cloud/utils/net/NetUtils.java | 17 +- 5 files changed, 166 insertions(+), 147 deletions(-) diff --git a/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java b/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java index 889cad457a..50822a35a4 100644 --- a/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java +++ b/engine/schema/src/com/cloud/upgrade/dao/Upgrade421to430.java @@ -116,8 +116,6 @@ private void upgradeMemoryOfSsvmOffering(Connection conn) { } private void encryptLdapConfigParams(Connection conn) { - PreparedStatement pstmt = null; - String[][] ldapParams = { {"ldap.user.object", "inetOrgPerson", "Sets the object type of users within LDAP"}, {"ldap.username.attribute", "uid", "Sets the username attribute used within LDAP"}, {"ldap.email.attribute", "mail", "Sets the email attribute used within LDAP"}, {"ldap.firstname.attribute", "givenname", "Sets the firstname attribute used within LDAP"}, @@ -129,83 +127,82 @@ private void encryptLdapConfigParams(Connection conn) { + "?) ON DUPLICATE KEY UPDATE category='Secure';"; try { - - pstmt = conn.prepareStatement(insertSql); - for (String[] ldapParam : ldapParams) { - String name = ldapParam[0]; - String value = ldapParam[1]; - String desc = ldapParam[2]; - String encryptedValue = DBEncryptionUtil.encrypt(value); - pstmt.setString(1, name); - pstmt.setBytes(2, encryptedValue.getBytes("UTF-8")); - pstmt.setString(3, desc); - pstmt.executeUpdate(); + String port; + int portNumber = 0; + String hostname = null; + try ( PreparedStatement pstmt = conn.prepareStatement(insertSql);) { + for (String[] ldapParam : ldapParams) { + String name = ldapParam[0]; + String value = ldapParam[1]; + String desc = ldapParam[2]; + String encryptedValue = DBEncryptionUtil.encrypt(value); + pstmt.setString(1, name); + pstmt.setBytes(2, encryptedValue.getBytes("UTF-8")); + pstmt.setString(3, desc); + pstmt.executeUpdate(); + } + }catch (Exception e) { + s_logger.error("encryptLdapConfigParams:Exception:"+e.getMessage()); + throw new CloudRuntimeException("encryptLdapConfigParams:Exception:"+e.getMessage(), e); } - - pstmt.close(); - /** * if encrypted, decrypt the ldap hostname and port and then update as they are not encrypted now. */ - pstmt = conn.prepareStatement("SELECT conf.value FROM `cloud`.`configuration` conf WHERE conf.name='ldap.hostname'"); - ResultSet resultSet = pstmt.executeQuery(); - String hostname = null; - String port; - int portNumber = 0; - if (resultSet.next()) { - hostname = DBEncryptionUtil.decrypt(resultSet.getString(1)); - } - - pstmt.close(); - - pstmt = conn.prepareStatement("SELECT conf.value FROM `cloud`.`configuration` conf WHERE conf.name='ldap.port'"); - resultSet = pstmt.executeQuery(); - if (resultSet.next()) { - port = DBEncryptionUtil.decrypt(resultSet.getString(1)); - if (StringUtils.isNotBlank(port)) { - portNumber = Integer.valueOf(port); + try(PreparedStatement sel_ldap_hostname_pstmt = conn.prepareStatement("SELECT conf.value FROM `cloud`.`configuration` conf WHERE conf.name='ldap.hostname'"); + ResultSet resultSet = sel_ldap_hostname_pstmt.executeQuery();) { + if (resultSet.next()) { + hostname = DBEncryptionUtil.decrypt(resultSet.getString(1)); } + }catch (Exception e) { + s_logger.error("encryptLdapConfigParams:Exception:"+e.getMessage()); + throw new CloudRuntimeException("encryptLdapConfigParams:Exception:"+e.getMessage(), e); } - pstmt.close(); - if (StringUtils.isNotBlank(hostname)) { - pstmt = conn.prepareStatement("INSERT INTO `cloud`.`ldap_configuration`(hostname, port) VALUES(?,?)"); - pstmt.setString(1, hostname); - if (portNumber != 0) { - pstmt.setInt(2, portNumber); - } else { - pstmt.setNull(2, Types.INTEGER); + try( PreparedStatement sel_ldap_port_pstmt = conn.prepareStatement("SELECT conf.value FROM `cloud`.`configuration` conf WHERE conf.name='ldap.port'"); + ResultSet resultSet = sel_ldap_port_pstmt.executeQuery();) + { + if (resultSet.next()) { + port = DBEncryptionUtil.decrypt(resultSet.getString(1)); + if (StringUtils.isNotBlank(port)) { + portNumber = Integer.valueOf(port); + } } - pstmt.executeUpdate(); - pstmt.close(); + }catch (Exception e) { + s_logger.error("encryptLdapConfigParams:Exception:"+e.getMessage()); + throw new CloudRuntimeException("encryptLdapConfigParams:Exception:"+e.getMessage(), e); } - } catch (SQLException e) { - throw new CloudRuntimeException("Unable to insert ldap configuration values ", e); - } catch (UnsupportedEncodingException e) { - throw new CloudRuntimeException("Unable to insert ldap configuration values ", e); - } finally { - try { - if (pstmt != null) { - pstmt.close(); + if (StringUtils.isNotBlank(hostname)) { + try(PreparedStatement insert_pstmt = conn.prepareStatement("INSERT INTO `cloud`.`ldap_configuration`(hostname, port) VALUES(?,?)");) + { + insert_pstmt.setString(1, hostname); + if (portNumber != 0) { + insert_pstmt.setInt(2, portNumber); + } else { + insert_pstmt.setNull(2, Types.INTEGER); + } + insert_pstmt.executeUpdate(); + }catch (Exception e) { + s_logger.error("encryptLdapConfigParams:Exception:"+e.getMessage()); + throw new CloudRuntimeException("encryptLdapConfigParams:Exception:"+e.getMessage(), e); } - } catch (SQLException e) { } + } catch (Exception e) { + s_logger.error("encryptLdapConfigParams:Exception:"+e.getMessage()); + throw new CloudRuntimeException("encryptLdapConfigParams:Exception:"+e.getMessage(), e); } s_logger.debug("Done encrypting ldap Config values"); } private void updateSystemVmTemplates(Connection conn) { - PreparedStatement pstmt = null; - ResultSet rs = null; s_logger.debug("Updating System Vm template IDs"); try{ //Get all hypervisors in use Set hypervisorsListInUse = new HashSet(); - try { - pstmt = conn.prepareStatement("select distinct(hypervisor_type) from `cloud`.`cluster` where removed is null"); - rs = pstmt.executeQuery(); + try(PreparedStatement pstmt = conn.prepareStatement("select distinct(hypervisor_type) from `cloud`.`cluster` where removed is null"); + ResultSet rs = pstmt.executeQuery(); + ) { while(rs.next()){ switch (Hypervisor.HypervisorType.getType(rs.getString(1))) { case XenServer: hypervisorsListInUse.add(Hypervisor.HypervisorType.XenServer); @@ -220,8 +217,9 @@ private void updateSystemVmTemplates(Connection conn) { break; } } - } catch (SQLException e) { - throw new CloudRuntimeException("Error while listing hypervisors in use", e); + } catch (Exception e) { + s_logger.error("updateSystemVmTemplates:Exception:"+e.getMessage()); + throw new CloudRuntimeException("updateSystemVmTemplates:Exception:"+e.getMessage(), e); } Map NewTemplateNameList = new HashMap(){ @@ -262,77 +260,98 @@ private void updateSystemVmTemplates(Connection conn) { for (Map.Entry hypervisorAndTemplateName : NewTemplateNameList.entrySet()){ s_logger.debug("Updating " + hypervisorAndTemplateName.getKey() + " System Vms"); - try { - //Get 4.3.0 system Vm template Id for corresponding hypervisor - pstmt = conn.prepareStatement("select id from `cloud`.`vm_template` where name = ? and removed is null order by id desc limit 1"); - pstmt.setString(1, hypervisorAndTemplateName.getValue()); - rs = pstmt.executeQuery(); - if(rs.next()){ - long templateId = rs.getLong(1); - rs.close(); - pstmt.close(); -// // Mark the old system templates as removed + try (PreparedStatement pstmt = conn.prepareStatement("select id from `cloud`.`vm_template` where name = ? and removed is null order by id desc limit 1");) + { + //Get 4.3.0 system Vm template Id for corresponding hypervisor + long templateId = -1; + pstmt.setString(1, hypervisorAndTemplateName.getValue()); + try(ResultSet rs = pstmt.executeQuery();) + { + if(rs.next()) { + templateId = rs.getLong(1); + } + }catch (Exception e) + { + s_logger.error("updateSystemVmTemplates:Exception:"+e.getMessage()); + throw new CloudRuntimeException("updateSystemVmTemplates:Exception:"+e.getMessage(), e); + } +// // Mark the old system templates as removed // pstmt = conn.prepareStatement("UPDATE `cloud`.`vm_template` SET removed = now() WHERE hypervisor_type = ? AND type = 'SYSTEM' AND removed is null"); // pstmt.setString(1, hypervisorAndTemplateName.getKey().toString()); // pstmt.executeUpdate(); // pstmt.close(); // change template type to SYSTEM - pstmt = conn.prepareStatement("update `cloud`.`vm_template` set type='SYSTEM' where id = ?"); - pstmt.setLong(1, templateId); - pstmt.executeUpdate(); - pstmt.close(); - // update templete ID of system Vms - pstmt = conn.prepareStatement("update `cloud`.`vm_instance` set vm_template_id = ? where type <> 'User' and hypervisor_type = ?"); - pstmt.setLong(1, templateId); - pstmt.setString(2, hypervisorAndTemplateName.getKey().toString()); - pstmt.executeUpdate(); - pstmt.close(); - // Change value of global configuration parameter router.template.* for the corresponding hypervisor - pstmt = conn.prepareStatement("UPDATE `cloud`.`configuration` SET value = ? WHERE name = ?"); - pstmt.setString(1, hypervisorAndTemplateName.getValue()); - pstmt.setString(2, routerTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey())); - pstmt.executeUpdate(); - pstmt.close(); - } else { - if (hypervisorsListInUse.contains(hypervisorAndTemplateName.getKey())){ - throw new CloudRuntimeException("4.3.0 " + hypervisorAndTemplateName.getKey() + " SystemVm template not found. Cannot upgrade system Vms"); + if (templateId != -1) + { + try(PreparedStatement templ_type_pstmt = conn.prepareStatement("update `cloud`.`vm_template` set type='SYSTEM' where id = ?");) + { + templ_type_pstmt.setLong(1, templateId); + templ_type_pstmt.executeUpdate(); + } + catch (Exception e) + { + s_logger.error("updateSystemVmTemplates:Exception:"+e.getMessage()); + throw new CloudRuntimeException("updateSystemVmTemplates:Exception:"+e.getMessage(), e); + } + // update templete ID of system Vms + try(PreparedStatement update_templ_id_pstmt = conn.prepareStatement("update `cloud`.`vm_instance` set vm_template_id = ? where type <> 'User' and hypervisor_type = ?");) + { + update_templ_id_pstmt.setLong(1, templateId); + update_templ_id_pstmt.setString(2, hypervisorAndTemplateName.getKey().toString()); + update_templ_id_pstmt.executeUpdate(); + }catch (Exception e) + { + s_logger.error("updateSystemVmTemplates:Exception:"+e.getMessage()); + throw new CloudRuntimeException("updateSystemVmTemplates:Exception:"+e.getMessage(), e); + } + + // Change value of global configuration parameter router.template.* for the corresponding hypervisor + try(PreparedStatement update_pstmt = conn.prepareStatement("UPDATE `cloud`.`configuration` SET value = ? WHERE name = ?");) { + update_pstmt.setString(1, hypervisorAndTemplateName.getValue()); + update_pstmt.setString(2, routerTemplateConfigurationNames.get(hypervisorAndTemplateName.getKey())); + update_pstmt.executeUpdate(); + }catch (Exception e) + { + s_logger.error("updateSystemVmTemplates:Exception:"+e.getMessage()); + throw new CloudRuntimeException("updateSystemVmTemplates:Exception:"+e.getMessage(), e); + } + } else { - s_logger.warn("4.3.0 " + hypervisorAndTemplateName.getKey() + " SystemVm template not found. " + hypervisorAndTemplateName.getKey() + " hypervisor is not used, so not failing upgrade"); - // Update the latest template URLs for corresponding hypervisor - pstmt = conn.prepareStatement("UPDATE `cloud`.`vm_template` SET url = ? , checksum = ? WHERE hypervisor_type = ? AND type = 'SYSTEM' AND removed is null order by id desc limit 1"); - pstmt.setString(1, newTemplateUrl.get(hypervisorAndTemplateName.getKey())); - pstmt.setString(2, newTemplateChecksum.get(hypervisorAndTemplateName.getKey())); - pstmt.setString(3, hypervisorAndTemplateName.getKey().toString()); - pstmt.executeUpdate(); - pstmt.close(); + if (hypervisorsListInUse.contains(hypervisorAndTemplateName.getKey())){ + throw new CloudRuntimeException("4.3.0 " + hypervisorAndTemplateName.getKey() + " SystemVm template not found. Cannot upgrade system Vms"); + } else { + s_logger.warn("4.3.0 " + hypervisorAndTemplateName.getKey() + " SystemVm template not found. " + hypervisorAndTemplateName.getKey() + " hypervisor is not used, so not failing upgrade"); + // Update the latest template URLs for corresponding hypervisor + try(PreparedStatement update_templ_url_pstmt = conn.prepareStatement("UPDATE `cloud`.`vm_template` SET url = ? , checksum = ? WHERE hypervisor_type = ? AND type = 'SYSTEM' AND removed is null order by id desc limit 1");) { + update_templ_url_pstmt.setString(1, newTemplateUrl.get(hypervisorAndTemplateName.getKey())); + update_templ_url_pstmt.setString(2, newTemplateChecksum.get(hypervisorAndTemplateName.getKey())); + update_templ_url_pstmt.setString(3, hypervisorAndTemplateName.getKey().toString()); + update_templ_url_pstmt.executeUpdate(); + }catch (Exception e) + { + s_logger.error("updateSystemVmTemplates:Exception:"+e.getMessage()); + throw new CloudRuntimeException("updateSystemVmTemplates:Exception:"+e.getMessage(), e); + } + } } - } } catch (SQLException e) { + s_logger.error("updateSystemVmTemplates:Exception:"+e.getMessage()); throw new CloudRuntimeException("Error while updating "+ hypervisorAndTemplateName.getKey() +" systemVm template", e); } } s_logger.debug("Updating System Vm Template IDs Complete"); - } finally { - try { - if (rs != null) { - rs.close(); - } - - if (pstmt != null) { - pstmt.close(); - } - } catch (SQLException e) { - } + } + catch (Exception e) { + s_logger.error("updateSystemVmTemplates:Exception:"+e.getMessage()); + throw new CloudRuntimeException("updateSystemVmTemplates:Exception:"+e.getMessage(), e); } } private void encryptImageStoreDetails(Connection conn) { s_logger.debug("Encrypting image store details"); - PreparedStatement pstmt = null; - ResultSet rs = null; - try { - pstmt = conn.prepareStatement("select id, value from `cloud`.`image_store_details` where name = 'key' or name = 'secretkey'"); - rs = pstmt.executeQuery(); + try (PreparedStatement sel_image_store_det_pstmt = conn.prepareStatement("select id, value from `cloud`.`image_store_details` where name = 'key' or name = 'secretkey'"); + ResultSet rs = sel_image_store_det_pstmt.executeQuery();) + { while (rs.next()) { long id = rs.getLong(1); String value = rs.getString(2); @@ -340,26 +359,21 @@ private void encryptImageStoreDetails(Connection conn) { continue; } String encryptedValue = DBEncryptionUtil.encrypt(value); - pstmt = conn.prepareStatement("update `cloud`.`image_store_details` set value=? where id=?"); - pstmt.setBytes(1, encryptedValue.getBytes("UTF-8")); - pstmt.setLong(2, id); - pstmt.executeUpdate(); + try( PreparedStatement update_image_store_det_pstmt = conn.prepareStatement("update `cloud`.`image_store_details` set value=? where id=?");) { + update_image_store_det_pstmt.setBytes(1, encryptedValue.getBytes("UTF-8")); + update_image_store_det_pstmt.setLong(2, id); + update_image_store_det_pstmt.executeUpdate(); + }catch (UnsupportedEncodingException e) { + s_logger.error("encryptImageStoreDetails:Exception:" + e.getMessage()); + throw new CloudRuntimeException("encryptImageStoreDetails:Exception:" + e.getMessage(),e); + } } } catch (SQLException e) { + s_logger.error("encryptImageStoreDetails:Exception:"+e.getMessage()); throw new CloudRuntimeException("Unable encrypt image_store_details values ", e); - } catch (UnsupportedEncodingException e) { + } catch (Exception e) { + s_logger.error("encryptImageStoreDetails:Exception:"+e.getMessage()); throw new CloudRuntimeException("Unable encrypt image_store_details values ", e); - } finally { - try { - if (rs != null) { - rs.close(); - } - - if (pstmt != null) { - pstmt.close(); - } - } catch (SQLException e) { - } } s_logger.debug("Done encrypting image_store_details"); } diff --git a/engine/schema/src/com/cloud/vm/VMInstanceVO.java b/engine/schema/src/com/cloud/vm/VMInstanceVO.java index 849e042081..90d13b2d2b 100644 --- a/engine/schema/src/com/cloud/vm/VMInstanceVO.java +++ b/engine/schema/src/com/cloud/vm/VMInstanceVO.java @@ -183,7 +183,7 @@ public class VMInstanceVO implements VirtualMachine, FiniteStateObject info = qemu.info(srcFile); - String backingFile = info.get(new String("backing_file")); + String backing_file_str = "backing_file"; + String backingFile = info.get(backing_file_str); // qcow2 templates can just be copied into place if (sourceFormat.equals(destFormat) && backingFile == null && sourcePath.endsWith(".qcow2")) { String result = Script.runSimpleBashScript("cp -f " + sourcePath + " " + destPath, timeout); diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index 05fbad359e..bf0a6cc7af 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -609,7 +609,7 @@ public VirtualRouter stopRouter(final long routerId, final boolean forced) throw if (router.isStopPending()) { s_logger.info("Clear the stop pending flag of router " + router.getHostName() + " after stop router successfully"); router.setStopPending(false); - router = _routerDao.persist(router); + _routerDao.persist(router); virtualRouter.setStopPending(false); } return virtualRouter; @@ -658,7 +658,7 @@ public VirtualRouter rebootRouter(final long routerId, final boolean reprogramNe _accountMgr.checkAccess(caller, null, true, router); // Can reboot domain router only in Running state - if (router == null || router.getState() != State.Running) { + if (router.getState() != State.Running) { s_logger.warn("Unable to reboot, virtual router is not in the right state " + router.getState()); throw new ResourceUnavailableException("Unable to reboot domR, it is not in right state " + router.getState(), DataCenter.class, router.getDataCenterId()); } @@ -1113,7 +1113,7 @@ protected void updateSite2SiteVpnConnectionState(final List rout for (final Site2SiteVpnConnectionVO conn : conns) { final Site2SiteVpnConnectionVO lock = _s2sVpnConnectionDao.acquireInLockTable(conn.getId()); if (lock == null) { - throw new CloudRuntimeException("Unable to acquire lock on " + lock); + throw new CloudRuntimeException("updateSite2SiteVpnConnectionState: Unable to acquire lock"); } try { if (conn.getState() != Site2SiteVpnConnection.State.Connected && conn.getState() != Site2SiteVpnConnection.State.Disconnected) { @@ -1415,7 +1415,8 @@ protected void getRouterAlerts() { GetRouterAlertsCommand command = null; if (opRouterMonitorServiceVO == null) { - command = new GetRouterAlertsCommand(new String("1970-01-01 00:00:00")); // To avoid sending null value + String date_str = "1970-01-01 00:00:00"; + command = new GetRouterAlertsCommand(date_str); // To avoid sending null value } else { command = new GetRouterAlertsCommand(opRouterMonitorServiceVO.getLastAlertTimestamp()); } @@ -2846,7 +2847,7 @@ public boolean finalizeStart(final VirtualMachineProfile profile, final long hos GetDomRVersionAnswer versionAnswer = (GetDomRVersionAnswer)cmds.getAnswer("getDomRVersion"); router.setTemplateVersion(versionAnswer.getTemplateVersion()); router.setScriptsVersion(versionAnswer.getScriptsVersion()); - router = _routerDao.persist(router, guestNetworks); + _routerDao.persist(router, guestNetworks); } return result; diff --git a/utils/src/com/cloud/utils/net/NetUtils.java b/utils/src/com/cloud/utils/net/NetUtils.java index 6350986a89..8e3e916a2a 100755 --- a/utils/src/com/cloud/utils/net/NetUtils.java +++ b/utils/src/com/cloud/utils/net/NetUtils.java @@ -162,15 +162,18 @@ public static String getDefaultHostIp() { Pattern pattern = Pattern.compile("\\s*0.0.0.0\\s*0.0.0.0\\s*(\\S*)\\s*(\\S*)\\s*"); try { Process result = Runtime.getRuntime().exec("route print -4"); - BufferedReader output = new BufferedReader(new InputStreamReader(result.getInputStream())); + try(BufferedReader output = new BufferedReader(new InputStreamReader(result.getInputStream()));) { - String line = output.readLine(); - while (line != null) { - Matcher matcher = pattern.matcher(line); - if (matcher.find()) { - return matcher.group(2); + String line = output.readLine(); + while (line != null) { + Matcher matcher = pattern.matcher(line); + if (matcher.find()) { + return matcher.group(2); + } + line = output.readLine(); } - line = output.readLine(); + }catch (Exception e) { + s_logger.error("getDefaultHostIp:Exception:"+e.getMessage()); } } catch (Exception e) { } From de04881da177b28d7cb3efc09adb2d8069f0fdd3 Mon Sep 17 00:00:00 2001 From: amoghvk Date: Mon, 16 Jun 2014 14:29:14 -0700 Subject: [PATCH 605/683] CLOUDSTACK-6915: Include searching deleted OS entries --- .../vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java | 2 +- .../hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java | 2 +- server/src/com/cloud/hypervisor/KVMGuru.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java index 08d12f2eb7..f82c2c1934 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/guru/VMwareGuru.java @@ -310,7 +310,7 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) { } } // Determine the VM's OS description - GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId()); + GuestOSVO guestOS = _guestOsDao.findByIdIncludingRemoved(vm.getVirtualMachine().getGuestOSId()); to.setOs(guestOS.getDisplayName()); to.setHostName(vm.getHostName()); HostVO host = _hostDao.findById(vm.getVirtualMachine().getHostId()); diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java index c10f4a0ba1..3f950d6ef8 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/XenServerGuru.java @@ -89,7 +89,7 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) { to.setBootloader(bt); // Determine the VM's OS description - GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId()); + GuestOSVO guestOS = _guestOsDao.findByIdIncludingRemoved(vm.getVirtualMachine().getGuestOSId()); to.setOs(guestOS.getDisplayName()); HostVO host = hostDao.findById(vm.getVirtualMachine().getHostId()); GuestOSHypervisorVO guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), getHypervisorType().toString(), host.getHypervisorVersion()); diff --git a/server/src/com/cloud/hypervisor/KVMGuru.java b/server/src/com/cloud/hypervisor/KVMGuru.java index 287b0d2f1e..954ada856c 100644 --- a/server/src/com/cloud/hypervisor/KVMGuru.java +++ b/server/src/com/cloud/hypervisor/KVMGuru.java @@ -57,7 +57,7 @@ public VirtualMachineTO implement(VirtualMachineProfile vm) { VirtualMachineTO to = toVirtualMachineTO(vm); // Determine the VM's OS description - GuestOSVO guestOS = _guestOsDao.findById(vm.getVirtualMachine().getGuestOSId()); + GuestOSVO guestOS = _guestOsDao.findByIdIncludingRemoved(vm.getVirtualMachine().getGuestOSId()); to.setOs(guestOS.getDisplayName()); HostVO host = _hostDao.findById(vm.getVirtualMachine().getHostId()); GuestOSHypervisorVO guestOsMapping = _guestOsHypervisorDao.findByOsIdAndHypervisor(guestOS.getId(), getHypervisorType().toString(), host.getHypervisorVersion()); From 146867eb071bae6334bb7b902a4c9319c33b5a1f Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Mon, 16 Jun 2014 14:57:02 -0700 Subject: [PATCH 606/683] CLOUDSTACK-6919: don't attempt to restart user vms having no Root volume attached --- .../storage/StoragePoolAutomationImpl.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/server/src/com/cloud/storage/StoragePoolAutomationImpl.java b/server/src/com/cloud/storage/StoragePoolAutomationImpl.java index 8becd75ef2..8ff759df10 100644 --- a/server/src/com/cloud/storage/StoragePoolAutomationImpl.java +++ b/server/src/com/cloud/storage/StoragePoolAutomationImpl.java @@ -23,15 +23,14 @@ import javax.inject.Inject; -import org.apache.log4j.Logger; -import org.springframework.stereotype.Component; - import org.apache.cloudstack.context.CallContext; import org.apache.cloudstack.engine.subsystem.api.storage.DataStore; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreManager; import org.apache.cloudstack.engine.subsystem.api.storage.DataStoreProviderManager; import org.apache.cloudstack.storage.datastore.db.PrimaryDataStoreDao; import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; +import org.apache.log4j.Logger; +import org.springframework.stereotype.Component; import com.cloud.agent.AgentManager; import com.cloud.agent.api.Answer; @@ -362,10 +361,16 @@ public boolean cancelMaintain(DataStore store) { // if the instance is of type user vm, call the user vm manager if (vmInstance.getType().equals(VirtualMachine.Type.User)) { UserVmVO userVm = userVmDao.findById(vmInstance.getId()); - - vmMgr.advanceStart(userVm.getUuid(), null, null); // update work queue - work.setStartedAfterMaintenance(true); - _storagePoolWorkDao.update(work.getId(), work); + // check if the vm has a root volume. If not, remove the item from the queue, the vm should be + // started only when it has at least one root volume attached to it + // don't allow to start vm that doesn't have a root volume + if (volumeDao.findByInstanceAndType(work.getId(), Volume.Type.ROOT).isEmpty()) { + _storagePoolWorkDao.remove(work.getId()); + } else { + vmMgr.advanceStart(userVm.getUuid(), null, null); + work.setStartedAfterMaintenance(true); + _storagePoolWorkDao.update(work.getId(), work); + } } return true; } catch (Exception e) { From 2214bd2502a34ee8e671eb6b4efe8cd26e29ac5a Mon Sep 17 00:00:00 2001 From: Jayapal Date: Tue, 17 Jun 2014 12:06:03 +0530 Subject: [PATCH 607/683] CLOUDSTACK-6922: Updated events for firewall ingress and egress --- api/src/com/cloud/event/EventTypes.java | 8 +++++ .../network/firewall/FirewallService.java | 8 +++-- .../firewall/CreateEgressFirewallRuleCmd.java | 4 +-- .../user/firewall/CreateFirewallRuleCmd.java | 4 +-- .../firewall/DeleteEgressFirewallRuleCmd.java | 4 +-- .../user/firewall/DeleteFirewallRuleCmd.java | 2 +- .../firewall/UpdateEgressFirewallRuleCmd.java | 4 +-- .../user/firewall/UpdateFirewallRuleCmd.java | 2 +- .../network/firewall/FirewallManagerImpl.java | 36 ++++++++++++++++--- .../network/MockFirewallManagerImpl.java | 35 +++++++++++++----- 10 files changed, 83 insertions(+), 24 deletions(-) diff --git a/api/src/com/cloud/event/EventTypes.java b/api/src/com/cloud/event/EventTypes.java index 471b3f652f..0fa3cd5fd7 100755 --- a/api/src/com/cloud/event/EventTypes.java +++ b/api/src/com/cloud/event/EventTypes.java @@ -128,6 +128,10 @@ public class EventTypes { public static final String EVENT_FIREWALL_CLOSE = "FIREWALL.CLOSE"; public static final String EVENT_FIREWALL_UPDATE = "FIREWALL.UPDATE"; + public static final String EVENT_FIREWALL_EGRESS_OPEN = "FIREWALL.EGRESS.OPEN"; + public static final String EVENT_FIREWALL_EGRESS_CLOSE = "FIREWALL.EGRESS.CLOSE"; + public static final String EVENT_FIREWALL_EGRESS_UPDATE = "FIREWALL.EGRESS.UPDATE"; + //NIC Events public static final String EVENT_NIC_CREATE = "NIC.CREATE"; public static final String EVENT_NIC_DELETE = "NIC.DELETE"; @@ -556,6 +560,10 @@ public class EventTypes { entityEventDetails.put(EVENT_NET_RULE_MODIFY, FirewallRule.class); entityEventDetails.put(EVENT_FIREWALL_OPEN, FirewallRule.class); entityEventDetails.put(EVENT_FIREWALL_CLOSE, FirewallRule.class); + entityEventDetails.put(EVENT_FIREWALL_EGRESS_OPEN, FirewallRule.class); + entityEventDetails.put(EVENT_FIREWALL_EGRESS_CLOSE, FirewallRule.class); + entityEventDetails.put(EVENT_FIREWALL_EGRESS_UPDATE, FirewallRule.class); + // Load Balancers entityEventDetails.put(EVENT_ASSIGN_TO_LOAD_BALANCER_RULE, FirewallRule.class); diff --git a/api/src/com/cloud/network/firewall/FirewallService.java b/api/src/com/cloud/network/firewall/FirewallService.java index 5ab789121a..41b170da5b 100644 --- a/api/src/com/cloud/network/firewall/FirewallService.java +++ b/api/src/com/cloud/network/firewall/FirewallService.java @@ -40,7 +40,8 @@ public interface FirewallService { * the id of the rule to revoke. * @return */ - boolean revokeFirewallRule(long ruleId, boolean apply); + boolean revokeIngressFirewallRule(long ruleId, boolean apply); + boolean revokeEgressFirewallRule(long ruleId, boolean apply); boolean applyEgressFirewallRules(FirewallRule rule, Account caller) throws ResourceUnavailableException; @@ -50,6 +51,9 @@ public interface FirewallService { boolean revokeRelatedFirewallRule(long ruleId, boolean apply); - FirewallRule updateFirewallRule(long ruleId, String customId, Boolean forDisplay); + FirewallRule updateIngressFirewallRule(long ruleId, String customId, Boolean forDisplay); + FirewallRule updateEgressFirewallRule(long ruleId, String customId, Boolean forDisplay); + boolean applyIngressFwRules(long ipId, Account caller) throws ResourceUnavailableException; + boolean revokeIngressFwRule(long ruleId, boolean apply); } diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java index 579cccbfb2..90aed5e507 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateEgressFirewallRuleCmd.java @@ -154,7 +154,7 @@ public void execute() throws ResourceUnavailableException { fwResponse.setResponseName(getCommandName()); } finally { if (!success || rule == null) { - _firewallService.revokeFirewallRule(getEntityId(), true); + _firewallService.revokeEgressFirewallRule(getEntityId(), true); throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create firewall rule"); } } @@ -270,7 +270,7 @@ public void create() { @Override public String getEventType() { - return EventTypes.EVENT_FIREWALL_OPEN; + return EventTypes.EVENT_FIREWALL_EGRESS_OPEN; } @Override diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java index b09d3a73a7..06669359e8 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/CreateFirewallRuleCmd.java @@ -134,7 +134,7 @@ public void execute() throws ResourceUnavailableException { FirewallRule rule = _entityMgr.findById(FirewallRule.class, getEntityId()); try { CallContext.current().setEventDetails("Rule Id: " + getEntityId()); - success = _firewallService.applyIngressFirewallRules(rule.getSourceIpAddressId(), callerContext.getCallingAccount()); + success = _firewallService.applyIngressFwRules(rule.getSourceIpAddressId(), callerContext.getCallingAccount()); // State is different after the rule is applied, so get new object here rule = _entityMgr.findById(FirewallRule.class, getEntityId()); @@ -146,7 +146,7 @@ public void execute() throws ResourceUnavailableException { fwResponse.setResponseName(getCommandName()); } finally { if (!success || rule == null) { - _firewallService.revokeFirewallRule(getEntityId(), true); + _firewallService.revokeIngressFwRule(getEntityId(), true); throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create firewall rule"); } } diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java index 4d227722f8..17968fce58 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteEgressFirewallRuleCmd.java @@ -74,7 +74,7 @@ public String getCommandName() { @Override public String getEventType() { - return EventTypes.EVENT_FIREWALL_CLOSE; + return EventTypes.EVENT_FIREWALL_EGRESS_CLOSE; } @Override @@ -98,7 +98,7 @@ public long getEntityOwnerId() { @Override public void execute() throws ResourceUnavailableException { CallContext.current().setEventDetails("Rule Id: " + id); - boolean result = _firewallService.revokeFirewallRule(id, true); + boolean result = _firewallService.revokeEgressFirewallRule(id, true); if (result) { SuccessResponse response = new SuccessResponse(getCommandName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java index 66dcc039c3..f8d1c18329 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/DeleteFirewallRuleCmd.java @@ -96,7 +96,7 @@ public long getEntityOwnerId() { @Override public void execute() throws ResourceUnavailableException { CallContext.current().setEventDetails("Rule Id: " + id); - boolean result = _firewallService.revokeFirewallRule(id, true); + boolean result = _firewallService.revokeIngressFwRule(id, true); if (result) { SuccessResponse response = new SuccessResponse(getCommandName()); diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateEgressFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateEgressFirewallRuleCmd.java index 079539624c..b597a891ba 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateEgressFirewallRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateEgressFirewallRuleCmd.java @@ -78,7 +78,7 @@ public String getCommandName() { @Override public void execute() throws ResourceUnavailableException { CallContext.current().setEventDetails("Rule Id: " + id); - FirewallRule rule = _firewallService.updateFirewallRule(id, this.getCustomId(), getDisplay()); + FirewallRule rule = _firewallService.updateEgressFirewallRule(id, this.getCustomId(), getDisplay()); FirewallResponse fwResponse = new FirewallResponse(); if (rule != null) { @@ -97,7 +97,7 @@ public void checkUuid() { @Override public String getEventType() { - return EventTypes.EVENT_FIREWALL_UPDATE; + return EventTypes.EVENT_FIREWALL_EGRESS_UPDATE; } diff --git a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateFirewallRuleCmd.java b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateFirewallRuleCmd.java index f68437192b..e9c87d0163 100644 --- a/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateFirewallRuleCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/firewall/UpdateFirewallRuleCmd.java @@ -79,7 +79,7 @@ public String getCommandName() { @Override public void execute() throws ResourceUnavailableException { CallContext.current().setEventDetails("Rule Id: " + id); - FirewallRule rule = _firewallService.updateFirewallRule(id, this.getCustomId(), getDisplay()); + FirewallRule rule = _firewallService.updateIngressFirewallRule(id, this.getCustomId(), getDisplay()); FirewallResponse fwResponse = new FirewallResponse(); if (rule != null) { diff --git a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java index 4f853b332a..dd928d8d6f 100644 --- a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java +++ b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java @@ -161,7 +161,7 @@ public boolean start() { } @Override - @ActionEvent(eventType = EventTypes.EVENT_FIREWALL_OPEN, eventDescription = "creating firewall rule", create = true) + @ActionEvent(eventType = EventTypes.EVENT_FIREWALL_EGRESS_OPEN, eventDescription = "creating egress firewall rule for network", create = true) public FirewallRule createEgressFirewallRule(FirewallRule rule) throws NetworkRuleConflictException { Account caller = CallContext.current().getCallingAccount(); @@ -612,6 +612,12 @@ public void removeRule(FirewallRule rule) { _firewallDao.remove(rule.getId()); } + @Override + @ActionEvent(eventType = EventTypes.EVENT_FIREWALL_OPEN, eventDescription = "creating firewall rule", async = true) + public boolean applyIngressFwRules(long ipId, Account caller) throws ResourceUnavailableException { + return applyIngressFirewallRules(ipId, caller); + } + @Override public boolean applyIngressFirewallRules(long ipId, Account caller) throws ResourceUnavailableException { List rules = _firewallDao.listByIpAndPurpose(ipId, Purpose.Firewall); @@ -619,6 +625,7 @@ public boolean applyIngressFirewallRules(long ipId, Account caller) throws Resou } @Override + @ActionEvent(eventType = EventTypes.EVENT_FIREWALL_EGRESS_OPEN, eventDescription = "creating egress firewall rule", async = true) public boolean applyEgressFirewallRules(FirewallRule rule, Account caller) throws ResourceUnavailableException { List rules = _firewallDao.listByNetworkPurposeTrafficType(rule.getNetworkId(), Purpose.Firewall, FirewallRule.TrafficType.Egress); return applyFirewallRules(rules, false, caller); @@ -719,7 +726,21 @@ protected boolean revokeFirewallRule(long ruleId, boolean apply, Account caller, @Override @ActionEvent(eventType = EventTypes.EVENT_FIREWALL_CLOSE, eventDescription = "revoking firewall rule", async = true) - public boolean revokeFirewallRule(long ruleId, boolean apply) { + public boolean revokeIngressFwRule(long ruleId, boolean apply) { + return revokeIngressFirewallRule(ruleId, apply); + } + + + @Override + public boolean revokeIngressFirewallRule(long ruleId, boolean apply) { + Account caller = CallContext.current().getCallingAccount(); + long userId = CallContext.current().getCallingUserId(); + return revokeFirewallRule(ruleId, apply, caller, userId); + } + + @Override + @ActionEvent(eventType = EventTypes.EVENT_FIREWALL_EGRESS_CLOSE, eventDescription = "revoking egress firewall rule", async = true) + public boolean revokeEgressFirewallRule(long ruleId, boolean apply) { Account caller = CallContext.current().getCallingAccount(); long userId = CallContext.current().getCallingUserId(); return revokeFirewallRule(ruleId, apply, caller, userId); @@ -727,7 +748,14 @@ public boolean revokeFirewallRule(long ruleId, boolean apply) { @Override @ActionEvent(eventType = EventTypes.EVENT_FIREWALL_UPDATE, eventDescription = "updating firewall rule", async = true) - public FirewallRule updateFirewallRule(long ruleId, String customId, Boolean forDisplay) { + public FirewallRule updateIngressFirewallRule(long ruleId, String customId, Boolean forDisplay) { + Account caller = CallContext.current().getCallingAccount(); + return updateFirewallRule(ruleId, customId, caller, forDisplay); + } + + @Override + @ActionEvent(eventType = EventTypes.EVENT_FIREWALL_EGRESS_UPDATE, eventDescription = "updating egress firewall rule", async = true) + public FirewallRule updateEgressFirewallRule(long ruleId, String customId, Boolean forDisplay) { Account caller = CallContext.current().getCallingAccount(); return updateFirewallRule(ruleId, customId, caller, forDisplay); } @@ -881,7 +909,7 @@ public boolean revokeRelatedFirewallRule(long ruleId, boolean apply) { } s_logger.debug("Revoking Firewall rule id=" + fwRule.getId() + " as a part of rule delete id=" + ruleId + " with apply=" + apply); - return revokeFirewallRule(fwRule.getId(), apply); + return revokeIngressFirewallRule(fwRule.getId(), apply); } diff --git a/server/test/com/cloud/network/MockFirewallManagerImpl.java b/server/test/com/cloud/network/MockFirewallManagerImpl.java index 3c026135da..e484e61b9b 100644 --- a/server/test/com/cloud/network/MockFirewallManagerImpl.java +++ b/server/test/com/cloud/network/MockFirewallManagerImpl.java @@ -70,9 +70,13 @@ public Pair, Integer> listFirewallRules(ListFirewal } @Override - public boolean revokeFirewallRule(long ruleId, boolean apply) { - // TODO Auto-generated method stub - return false; + public boolean revokeIngressFirewallRule(long ruleId, boolean apply) { + return false; //To change body of implemented methods use File | Settings | File Templates. + } + + @Override + public boolean revokeEgressFirewallRule(long ruleId, boolean apply) { + return false; //To change body of implemented methods use File | Settings | File Templates. } @Override @@ -87,6 +91,26 @@ public boolean revokeRelatedFirewallRule(long ruleId, boolean apply) { return false; } + @Override + public FirewallRule updateIngressFirewallRule(long ruleId, String customId, Boolean forDisplay) { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + @Override + public FirewallRule updateEgressFirewallRule(long ruleId, String customId, Boolean forDisplay) { + return null; //To change body of implemented methods use File | Settings | File Templates. + } + + @Override + public boolean applyIngressFwRules(long ipId, Account caller) throws ResourceUnavailableException { + return false; //To change body of implemented methods use File | Settings | File Templates. + } + + @Override + public boolean revokeIngressFwRule(long ruleId, boolean apply) { + return false; //To change body of implemented methods use File | Settings | File Templates. + } + @Override public void detectRulesConflict(FirewallRule newRule) throws NetworkRuleConflictException { // TODO Auto-generated method stub @@ -184,10 +208,5 @@ public FirewallRule createIngressFirewallRule(FirewallRule rule) throws NetworkR return null; } - @Override - public FirewallRule updateFirewallRule(long ruleId, String customId, Boolean forDisplay) { - // TODO Auto-generated method stub - return null; - } } From a5415d93eb791bac52c40b9ede6a433a0d7f1dca Mon Sep 17 00:00:00 2001 From: Girish Shilamkar Date: Tue, 17 Jun 2014 15:37:25 +0530 Subject: [PATCH 608/683] CLOUDSTACK-6861: Fixing nfs mount path --- tools/marvin/marvin/lib/utils.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tools/marvin/marvin/lib/utils.py b/tools/marvin/marvin/lib/utils.py index 60a15ea9a9..c94afd5d06 100644 --- a/tools/marvin/marvin/lib/utils.py +++ b/tools/marvin/marvin/lib/utils.py @@ -348,7 +348,7 @@ def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid): nfsurl = secondaryStore.url from urllib2 import urlparse parse_url = urlparse.urlsplit(nfsurl, scheme='nfs') - host, path = parse_url.netloc, parse_url.path + host, path = str(parse_url.netloc), str(parse_url.path) if not config.mgtSvr: raise Exception( @@ -364,11 +364,17 @@ def is_snapshot_on_nfs(apiclient, dbconn, config, zoneid, snapshotid): user, passwd ) + + pathSeparator = "" #used to form host:dir format + if not host.endswith(':'): + pathSeparator= ":" + cmds = [ "mkdir -p %s /mnt/tmp", - "mount -t %s %s:%s /mnt/tmp" % ( + "mount -t %s %s%s%s /mnt/tmp" % ( 'nfs', host, + pathSeparator, path, ), "test -f %s && echo 'snapshot exists'" % ( From b0d726a872e2859a56ee677c15079cc3a59ab894 Mon Sep 17 00:00:00 2001 From: Jayapal Date: Tue, 17 Jun 2014 16:14:33 +0530 Subject: [PATCH 609/683] CLOUDSTACK-6923: updated listLBStickinessPolicies API to list using stickinesspolicy id --- .../network/lb/LoadBalancingRulesService.java | 2 ++ .../ListLBStickinessPoliciesCmd.java | 35 +++++++++++++++++-- .../lb/LoadBalancingRulesManagerImpl.java | 22 ++++++++++-- 3 files changed, 55 insertions(+), 4 deletions(-) diff --git a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java index c4976338f0..3e1101453c 100644 --- a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java +++ b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java @@ -159,4 +159,6 @@ LoadBalancer createPublicLoadBalancerRule(String xId, String name, String descri StickinessPolicy updateLBStickinessPolicy(long id, String customId, Boolean forDisplay); HealthCheckPolicy updateLBHealthCheckPolicy(long id, String customId, Boolean forDisplay); + + LoadBalancer findLbByStickinessId(long stickinessPolicyId); } diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java index 9905c0b1ac..80ae3ebed0 100644 --- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBStickinessPoliciesCmd.java @@ -19,6 +19,7 @@ import java.util.ArrayList; import java.util.List; +import com.cloud.exception.InvalidParameterValueException; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.api.APICommand; import org.apache.cloudstack.api.ApiConstants; @@ -47,10 +48,16 @@ public class ListLBStickinessPoliciesCmd extends BaseListCmd { @Parameter(name = ApiConstants.LBID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, - required = true, description = "the ID of the load balancer rule") private Long lbRuleId; + @Parameter(name = ApiConstants.ID, + type = CommandType.UUID, + entityType = LBStickinessResponse.class, + description = "the ID of the load balancer stickiness policy") + private Long id; + + @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "list resources by display flag; only ROOT admin is eligible to pass this parameter", since = "4.4", authorized = {RoleType.Admin}) private Boolean display; @@ -61,6 +68,10 @@ public Long getLbRuleId() { return lbRuleId; } + public Long getId() { + return id; + } + public boolean getDisplay() { if (display != null) { return display; @@ -79,8 +90,28 @@ public String getCommandName() { @Override public void execute() { + + LoadBalancer lb = null; + if (lbRuleId == null && id == null) { + throw new InvalidParameterValueException("LB rule id and stickiness policy id can't be null"); + } + + if (id != null) { + lb = _lbService.findLbByStickinessId(id); + if (lb == null) { + throw new InvalidParameterValueException("stickiness policy id doesn't exist"); + } + + if ((lbRuleId != null) && (lbRuleId != lb.getId())) { + throw new InvalidParameterValueException("stickiness policy id doesn't belong to lbId" + lbRuleId); + } + } + + if (lbRuleId != null && lb != null) { + lb = _lbService.findById(getLbRuleId()); + } + List spResponses = new ArrayList(); - LoadBalancer lb = _lbService.findById(getLbRuleId()); ListResponse response = new ListResponse(); if (lb != null) { diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java index 8225243db4..6358252bdc 100755 --- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java +++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java @@ -2213,16 +2213,24 @@ public List getStickinessMethods(long networkid) { public List searchForLBStickinessPolicies(ListLBStickinessPoliciesCmd cmd) throws PermissionDeniedException { Account caller = CallContext.current().getCallingAccount(); Long loadBalancerId = cmd.getLbRuleId(); + Long stickinessId = cmd.getId(); + boolean forDisplay = cmd.getDisplay(); + LoadBalancerVO loadBalancer = null; + + if (loadBalancerId == null) { + loadBalancer = findLbByStickinessId(stickinessId); + } else { + loadBalancer = _lbDao.findById(loadBalancerId); + } - LoadBalancerVO loadBalancer = _lbDao.findById(loadBalancerId); if (loadBalancer == null) { return null; } _accountMgr.checkAccess(caller, null, true, loadBalancer); - List sDbpolicies = _lb2stickinesspoliciesDao.listByLoadBalancerIdAndDisplayFlag(cmd.getLbRuleId(), forDisplay); + List sDbpolicies = _lb2stickinesspoliciesDao.listByLoadBalancerIdAndDisplayFlag(loadBalancer.getId(), forDisplay); return sDbpolicies; } @@ -2362,6 +2370,16 @@ public LoadBalancerVO findById(long lbId) { return _lbDao.findById(lbId); } + @Override + public LoadBalancerVO findLbByStickinessId(long stickinessPolicyId) { + LBStickinessPolicyVO stickinessPolicy = _lb2stickinesspoliciesDao.findById(stickinessPolicyId); + + if (stickinessPolicy == null) { + return null; + } + return _lbDao.findById(stickinessPolicy.getLoadBalancerId()); + } + @Override public void removeLBRule(LoadBalancer rule) { // remove the rule From 883d8f11196e9ca55324bcf075880e077a2d3df3 Mon Sep 17 00:00:00 2001 From: Girish chaudhari Date: Mon, 19 May 2014 06:16:20 +0000 Subject: [PATCH 610/683] CLOUDSTACK-5150 - set the template size from source Signed-off-by: Daan Hoogland --- .../src/com/cloud/resource/SimulatorStorageProcessor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java index 8a78b87e28..bdb3277342 100644 --- a/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java +++ b/plugins/hypervisors/simulator/src/com/cloud/resource/SimulatorStorageProcessor.java @@ -95,9 +95,11 @@ public Answer copyVolumeFromPrimaryToSecondary(CopyCommand cmd) { @Override public Answer createTemplateFromVolume(CopyCommand cmd) { DataTO destData = cmd.getDestTO(); + VolumeObjectTO srcData = (VolumeObjectTO)cmd.getSrcTO(); TemplateObjectTO template = new TemplateObjectTO(); template.setPath(template.getName()); template.setFormat(Storage.ImageFormat.RAW); + template.setSize(srcData.getSize()); DataStoreTO imageStore = destData.getDataStore(); if (!(imageStore instanceof NfsTO)) { return new CopyCmdAnswer("unsupported protocol"); From 8ca8a7217ec155a37b24e3d9cfc3d5fc67adef2d Mon Sep 17 00:00:00 2001 From: Murali Reddy Date: Tue, 17 Jun 2014 17:31:40 +0530 Subject: [PATCH 611/683] CLOUDSTACK-6925: [OVS] get rid custom logic to create bridges on hosts in the XenServer pool for GRE tunnel networks Fix uses XenServer recommended way Network.other_config:assume_network_is_shared=true which ensures bridge is created automatically on hosts in the pool for GRE tunnel networks. Fix also gets rid of error prone custom logic that ensures bridge is created by plugging a VIF into the dom0 and connected to GRE tunnel network. --- .../xen/resource/CitrixResourceBase.java | 82 +------------------ 1 file changed, 4 insertions(+), 78 deletions(-) diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java index 1a24f19c8f..7fcb5611ab 100644 --- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java +++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java @@ -897,76 +897,6 @@ protected XsLocalNetwork getNativeNetworkForTraffic(Connection conn, TrafficType throw new CloudRuntimeException("Unsupported network type: " + type); } - /** - * This is a tricky to create network in xenserver. - * if you create a network then create bridge by brctl or openvswitch yourself, - * then you will get an expection that is "REQUIRED_NETWROK" when you start a - * vm with this network. The soultion is, create a vif of dom0 and plug it in - * network, xenserver will create the bridge on behalf of you. But we can not keep the dom0 vif for the entire - * existence of network, as we will seen reach max VIF (8) that can be conencted to a domain. So as soon as we have - * one more VIF for any of the VM, delete dom0 VIF so that we can scale beyond 8 networks on a host. - * @throws XmlRpcException - * @throws XenAPIException - */ - private void enableXenServerNetwork(Connection conn, Network nw, String vifNameLabel, String networkDesc) throws XenAPIException, XmlRpcException { - /* Make sure there is a physical bridge on this network */ - VIF dom0vif = null; - Pair vm = getControlDomain(conn); - VM dom0 = vm.first(); - // Create a VIF unless there's not already another VIF - Set dom0Vifs = dom0.getVIFs(conn); - for (VIF vif : dom0Vifs) { - vif.getRecord(conn); - if (vif.getNetwork(conn).getUuid(conn).equals(nw.getUuid(conn))) { - dom0vif = vif; - s_logger.debug("A VIF for dom0 has already been found - No need to create one"); - } - } - - int domuVifCount=0; - Set domUVifs = nw.getVIFs(conn); - Host host = Host.getByUuid(conn, _host.uuid); - for (VIF vif : domUVifs) { - vif.getRecord(conn); - if (vif.getVM(conn).getResidentOn(conn).equals(host)) { - domuVifCount++; - } - } - - if (dom0vif == null && domuVifCount == 0) { - s_logger.debug("Create a vif on dom0 for " + networkDesc); - VIF.Record vifr = new VIF.Record(); - vifr.VM = dom0; - vifr.device = getLowestAvailableVIFDeviceNum(conn, dom0); - if (vifr.device == null) { - s_logger.debug("Failed to create " + networkDesc + ", no vif available"); - return; - } - Map config = new HashMap(); - config.put("nameLabel", vifNameLabel); - vifr.otherConfig = config; - vifr.MAC = "FE:FF:FF:FF:FF:FF"; - vifr.network = nw; - - vifr.lockingMode = Types.VifLockingMode.NETWORK_DEFAULT; - dom0vif = VIF.create(conn, vifr); - synchronized (_tmpDom0Vif) { - _tmpDom0Vif.add(dom0vif); - } - try { - dom0vif.plug(conn); - } catch (Exception e) { - // though an exception is thrown here, VIF actually gets plugged-in to dom0, so just ignore the exception - } - dom0vif.unplug(conn); - } - - if (dom0vif != null && domuVifCount > 1) { - // now that there is at least one more VIF (other than dom0 vif) destroy dom0 VIF - dom0vif.destroy(conn); - } - } - private synchronized Network setupvSwitchNetwork(Connection conn) { try { if (_host.vswitchNetwork == null) { @@ -982,8 +912,6 @@ private synchronized Network setupvSwitchNetwork(Connection conn) { } else { vswitchNw = networks.iterator().next(); } - if (!is_xcp()) - enableXenServerNetwork(conn, vswitchNw, "vswitch", "vswitch network"); _host.vswitchNetwork = vswitchNw; } return _host.vswitchNetwork; @@ -1007,21 +935,20 @@ private synchronized Network findOrCreateTunnelNetwork(Connection conn, String n Network.Record rec = new Network.Record(); Set networks = Network.getByNameLabel(conn, nwName); - if (networks.size() == 0) { rec.nameDescription = "tunnel network id# " + nwName; rec.nameLabel = nwName; //Initialize the ovs-host-setup to avoid error when doing get-param in plugin Map otherConfig = new HashMap(); otherConfig.put("ovs-host-setup", ""); + // Mark 'internal network' as shared so bridge gets automatically created on each host in the cluster + // when VM with vif connected to this internal network is started + otherConfig.put("assume_network_is_shared", "true"); rec.otherConfig = otherConfig; nw = Network.create(conn, rec); - // Plug dom0 vif only when creating network - enableXenServerNetwork(conn, nw, nwName, "tunnel network for account " + nwName); s_logger.debug("### Xen Server network for tunnels created:" + nwName); } else { nw = networks.iterator().next(); - enableXenServerNetwork(conn, nw, nwName, "tunnel network for account " + nwName); s_logger.debug("Xen Server network for tunnels found:" + nwName); } return nw; @@ -1052,9 +979,8 @@ private synchronized Network configureTunnelNetwork(Connection conn, Long networ } } } + if (!configured) { - // Plug dom0 vif only if not done before for network and host - enableXenServerNetwork(conn, nw, nwName, "tunnel network for account " + bridgeName); String result; if (bridgeName.startsWith("OVS-DR-VPC-Bridge")) { result = callHostPlugin(conn, "ovstunnel", "setup_ovs_bridge_for_distributed_routing", "bridge", bridge, From 6fca4eb0f1193b4612d1057784d24d7db1d7b048 Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Tue, 17 Jun 2014 16:59:30 -0700 Subject: [PATCH 612/683] CLOUDSTACK-6929: HAPlanner (SkipHeuresticsPlanner) gets added into the list of regular planners currently, add it in the exclude list. Also create allocator order list --- .../cloudstack/core/spring-core-registry-core-context.xml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml b/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml index d54823a33e..819fb830d5 100644 --- a/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml +++ b/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml @@ -75,6 +75,7 @@ +
+ + From a0f19d4bd5d7bec6613aa8130b3da9ecffc71d0b Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Tue, 17 Jun 2014 20:32:12 -0700 Subject: [PATCH 613/683] CLOUDSTACK-1466: Automation - Priamary Storage Limits --- .../component/test_ps_domain_limits.py | 690 ++++++++++++++++++ test/integration/component/test_ps_limits.py | 588 +++++++++++++++ .../component/test_ps_max_limits.py | 300 ++++++++ .../component/test_ps_project_limits.py | 238 ++++++ .../component/test_ps_resize_volume.py | 339 +++++++++ tools/marvin/marvin/codes.py | 24 + tools/marvin/marvin/lib/base.py | 36 +- tools/marvin/marvin/lib/common.py | 135 +++- 8 files changed, 2343 insertions(+), 7 deletions(-) create mode 100644 test/integration/component/test_ps_domain_limits.py create mode 100644 test/integration/component/test_ps_limits.py create mode 100644 test/integration/component/test_ps_max_limits.py create mode 100644 test/integration/component/test_ps_project_limits.py create mode 100644 test/integration/component/test_ps_resize_volume.py diff --git a/test/integration/component/test_ps_domain_limits.py b/test/integration/component/test_ps_domain_limits.py new file mode 100644 index 0000000000..afb0955704 --- /dev/null +++ b/test/integration/component/test_ps_domain_limits.py @@ -0,0 +1,690 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +""" P1 tests for primary storage domain limits + + Test Plan: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Limit+Resources+to+domain+or+accounts + + Issue Link: https://issues.apache.org/jira/browse/CLOUDSTACK-1466 + + Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Limit+Resources+to+domains+and+accounts +""" +# Import Local Modules +from nose.plugins.attrib import attr +from marvin.cloudstackTestCase import cloudstackTestCase, unittest +from marvin.lib.base import (Account, + ServiceOffering, + VirtualMachine, + Resources, + Domain, + Volume, + DiskOffering, + Snapshot) +from marvin.lib.common import (get_domain, + get_zone, + get_template, + createSnapshotFromVirtualMachineVolume, + isVmExpunged, + isDomainResourceCountEqualToExpectedCount) +from marvin.lib.utils import (cleanup_resources) +from marvin.codes import (PASS, + FAIL, + FAILED, + RESOURCE_PRIMARY_STORAGE) + +class TestMultipleChildDomain(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + cloudstackTestClient = super(TestMultipleChildDomain, + cls).getClsTestClient() + cls.api_client = cloudstackTestClient.getApiClient() + # Fill services from the external config file + cls.services = cloudstackTestClient.getParsedTestDataConfig() + # Get Zone, Domain and templates + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cloudstackTestClient.getZoneForTests()) + cls.services["mode"] = cls.zone.networktype + + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.services["volume"]["zoneid"] = cls.zone.id + + cls._cleanup = [] + try: + cls.service_offering = ServiceOffering.create(cls.api_client, + cls.services["service_offering"]) + cls._cleanup.append(cls.service_offering) + except Exception as e: + cls.tearDownClass() + raise unittest.SkipTest("Exception in setUpClass: %s" % e) + return + + @classmethod + def tearDownClass(cls): + try: + # Cleanup resources used + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + def setUp(self): + self.apiclient = self.testClient.getApiClient() + self.dbclient = self.testClient.getDbConnection() + self.cleanup = [] + self.services["disk_offering"]["disksize"] = 5 + try: + self.disk_offering = DiskOffering.create( + self.apiclient, + self.services["disk_offering"] + ) + self.assertNotEqual(self.disk_offering, None, \ + "Disk offering is None") + self.cleanup.append(self.disk_offering) + except Exception as e: + self.tearDown() + self.skipTest("Failure while creating disk offering: %s" % e) + return + + def tearDown(self): + try: + # Clean up, terminate the created instance, volumes and snapshots + cleanup_resources(self.apiclient, self.cleanup) + pass + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + def updateDomainResourceLimits(self, parentdomainlimit, subdomainlimit): + """Update primary storage limits of the parent domain and its + child domains""" + + try: + #Update resource limit for domain + Resources.updateLimit(self.apiclient, resourcetype=10, + max=parentdomainlimit, + domainid=self.parent_domain.id) + + # Update Resource limit for sub-domains + Resources.updateLimit(self.apiclient, resourcetype=10, + max=subdomainlimit, + domainid=self.cadmin_1.domainid) + + Resources.updateLimit(self.apiclient, resourcetype=10, + max=subdomainlimit, + domainid=self.cadmin_2.domainid) + except Exception as e: + return [FAIL, e] + return [PASS, None] + + def setupAccounts(self): + try: + self.parent_domain = Domain.create(self.apiclient, + services=self.services["domain"], + parentdomainid=self.domain.id) + self.parentd_admin = Account.create(self.apiclient, self.services["account"], + admin=True, domainid=self.parent_domain.id) + + # Create sub-domains and their admin accounts + self.cdomain_1 = Domain.create(self.apiclient, + services=self.services["domain"], + parentdomainid=self.parent_domain.id) + self.cdomain_2 = Domain.create(self.apiclient, + services=self.services["domain"], + parentdomainid=self.parent_domain.id) + + self.cadmin_1 = Account.create(self.apiclient, self.services["account"], + admin=True, domainid=self.cdomain_1.id) + + self.cadmin_2 = Account.create(self.apiclient, self.services["account"], + admin=True, domainid=self.cdomain_2.id) + + # Cleanup the resources created at end of test + self.cleanup.append(self.cadmin_1) + self.cleanup.append(self.cadmin_2) + self.cleanup.append(self.cdomain_1) + self.cleanup.append(self.cdomain_2) + self.cleanup.append(self.parentd_admin) + self.cleanup.append(self.parent_domain) + + users = { + self.cdomain_1: self.cadmin_1, + self.cdomain_2: self.cadmin_2 + } + except Exception as e: + return [FAIL, e, None] + return [PASS, None, users] + + @attr(tags=["advanced","selfservice"]) + def test_01_multiple_domains_primary_storage_limits(self): + """Test primary storage limit of domain and its sub-domains + + # Steps + 1. Create a parent domain and two sub-domains in it (also admin accounts + of each domain) + 2. Update primary storage limits of the parent domain and child domains + 3. Deploy VM in child domain 1 so that total primary storage + is less than the limit of child domain + 4. Repeat step 3 for child domain 2 + 5. Try to deploy VM in parent domain now so that the total primary storage in + parent domain (including that in sub-domains is more than the primary + storage limit of the parent domain + 6. Delete the admin account of child domain 1 and check resource count + of the parent domain + 7. Delete VM deployed in account 2 and check primary storage count + of parent domain + + # Validations: + 1. Step 3 and 4 should succeed + 2. Step 5 should fail as the resource limit exceeds in parent domain + 3. After step 6, resource count in parent domain should decrease by equivalent + quantity + 4. After step 7, resource count in parent domain should be 0""" + + # Setting up account and domain hierarchy + result = self.setupAccounts() + self.assertEqual(result[0], PASS,\ + "Failure while setting up accounts and domains: %s" % result[1]) + + templatesize = (self.template.size / (1024**3)) + disksize = 10 + subdomainlimit = (templatesize + disksize) + + result = self.updateDomainResourceLimits(((subdomainlimit*3)- 1), subdomainlimit) + self.assertEqual(result[0], PASS,\ + "Failure while updating resource limits: %s" % result[1]) + + try: + self.services["disk_offering"]["disksize"] = disksize + disk_offering_custom = DiskOffering.create(self.apiclient, + services=self.services["disk_offering"]) + self.cleanup.append(disk_offering_custom) + except Exception as e: + self.fail("Failed to create disk offering") + + # Get API clients of parent and child domain admin accounts + api_client_admin = self.testClient.getUserApiClient( + UserName=self.parentd_admin.name, + DomainName=self.parentd_admin.domain) + self.assertNotEqual(api_client_admin, FAILED,\ + "Failed to create api client for account: %s" % self.parentd_admin.name) + + api_client_cadmin_1 = self.testClient.getUserApiClient( + UserName=self.cadmin_1.name, + DomainName=self.cadmin_1.domain) + self.assertNotEqual(api_client_cadmin_1, FAILED,\ + "Failed to create api client for account: %s" % self.cadmin_1.name) + + api_client_cadmin_2 = self.testClient.getUserApiClient( + UserName=self.cadmin_2.name, + DomainName=self.cadmin_2.domain) + self.assertNotEqual(api_client_cadmin_2, FAILED,\ + "Failed to create api client for account: %s" % self.cadmin_2.name) + + VirtualMachine.create( + api_client_cadmin_1, self.services["virtual_machine"], + accountid=self.cadmin_1.name, domainid=self.cadmin_1.domainid, + diskofferingid=disk_offering_custom.id, serviceofferingid=self.service_offering.id + ) + + self.initialResourceCount = (templatesize + disksize) + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.parent_domain.id, + self.initialResourceCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + # Create VM in second child domain + vm_2 = VirtualMachine.create( + api_client_cadmin_2, self.services["virtual_machine"], + accountid=self.cadmin_2.name, domainid=self.cadmin_2.domainid, + diskofferingid=disk_offering_custom.id, serviceofferingid=self.service_offering.id + ) + + # Now the VMs in two child domains have exhausted the primary storage limit + # of parent domain, hence VM creation in parent domain with custom disk offering + # should fail + with self.assertRaises(Exception): + VirtualMachine.create( + api_client_admin, self.services["virtual_machine"], + accountid=self.parentd_admin.name, domainid=self.parentd_admin.domainid, + diskofferingid=disk_offering_custom.id, serviceofferingid=self.service_offering.id + ) + + # Deleting user account + self.cadmin_1.delete(self.apiclient) + self.cleanup.remove(self.cadmin_1) + + expectedCount = self.initialResourceCount + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.parent_domain.id, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + try: + vm_2.delete(self.apiclient) + except Exception as e: + self.fail("Failed to delete instance: %s" % e) + + self.assertTrue(isVmExpunged(self.apiclient, vm_2.id), "VM not expunged \ + in allotted time") + + expectedCount = 0 + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.parent_domain.id, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + return + + @attr(tags=["advanced", "selfservice"]) + def test_02_multiple_domains_primary_storage_limits(self): + """Test primary storage counts in multiple child domains + # Steps + 1. Create a parent domain and two sub-domains in it (also admin accounts + of each domain) + Repeat following steps for both the child domains + 2. Deploy VM in child domain + 3. Check if the resource count for domain is updated correctly + 4. Create a volume and attach it to the VM + 5. Check if the primary storage resource count is updated correctly + + """ + + # Setting up account and domain hierarchy + result = self.setupAccounts() + self.assertEqual(result[0], PASS,\ + "Failure while setting up accounts and domains: %s" % result[1]) + users = result[2] + + templatesize = (self.template.size / (1024**3)) + + for domain, admin in users.items(): + self.account = admin + self.domain = domain + + apiclient = self.testClient.getUserApiClient( + UserName=self.account.name, + DomainName=self.account.domain) + self.assertNotEqual(apiclient, FAILED,\ + "Failed to create api client for account: %s" % self.account.name) + try: + vm = VirtualMachine.create( + apiclient, self.services["virtual_machine"], + accountid=self.account.name, domainid=self.account.domainid, + diskofferingid=self.disk_offering.id, serviceofferingid=self.service_offering.id + ) + + expectedCount = templatesize + self.disk_offering.disksize + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.domain.id, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + # Creating service offering with 10 GB volume + self.services["disk_offering"]["disksize"] = 10 + disk_offering_10_GB = DiskOffering.create(self.apiclient, + services=self.services["disk_offering"]) + + self.cleanup.append(disk_offering_10_GB) + + volume = Volume.create( + apiclient, self.services["volume"], + zoneid=self.zone.id, account=self.account.name, + domainid=self.account.domainid, diskofferingid=disk_offering_10_GB.id + ) + + volumeSize = (volume.size / (1024**3)) + expectedCount += volumeSize + + vm.attach_volume(apiclient, volume=volume) + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.domain.id, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + expectedCount -= volumeSize + vm.detach_volume(apiclient, volume=volume) + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.domain.id, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + except Exception as e: + self.fail("Failure: %s" % e) + return + + @attr(tags=["advanced", "selfservice"]) + def test_03_multiple_domains_multiple_volumes(self): + """Test primary storage counts in multiple child domains + # Steps + 1. Create a parent domain and two sub-domains in it (also admin accounts + of each domain) + Repeat following steps for both the child domains + 2. Deploy VM in child domain + 3. Check if the resource count for domain is updated correctly + 4. Create multiple volumes and attach it to the VM + 5. Check if the primary storage resource count is updated correctly + 6. Delete one of the volumes and check if the primary storage resource count + reduced by equivalent number + 7. Detach other volume and check primary storage resource count remains the same + + """ + # Setting up account and domain hierarchy + result = self.setupAccounts() + if result[0] == FAIL: + self.fail("Failure while setting up accounts and domains: %s" % result[1]) + else: + users = result[2] + + templatesize = (self.template.size / (1024**3)) + + for domain, admin in users.items(): + self.account = admin + self.domain = domain + + apiclient = self.testClient.getUserApiClient( + UserName=self.account.name, + DomainName=self.account.domain) + self.assertNotEqual(apiclient, FAILED,\ + "Failed to create api client for account: %s" % self.account.name) + + try: + vm = VirtualMachine.create( + apiclient, self.services["virtual_machine"], + accountid=self.account.name, domainid=self.account.domainid, + diskofferingid=self.disk_offering.id, serviceofferingid=self.service_offering.id + ) + + expectedCount = templatesize + self.disk_offering.disksize + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.domain.id, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + volume1size = self.services["disk_offering"]["disksize"] = 15 + disk_offering_15_GB = DiskOffering.create(self.apiclient, + services=self.services["disk_offering"]) + + self.cleanup.append(disk_offering_15_GB) + + volume2size = self.services["disk_offering"]["disksize"] = 20 + disk_offering_20_GB = DiskOffering.create(self.apiclient, + services=self.services["disk_offering"]) + + self.cleanup.append(disk_offering_20_GB) + + volume_1 = Volume.create( + apiclient, self.services["volume"], + zoneid=self.zone.id, account=self.account.name, + domainid=self.account.domainid, diskofferingid=disk_offering_15_GB.id + ) + + volume_2 = Volume.create( + apiclient, self.services["volume"], + zoneid=self.zone.id, account=self.account.name, + domainid=self.account.domainid, diskofferingid=disk_offering_20_GB.id + ) + + vm.attach_volume(apiclient, volume=volume_1) + vm.attach_volume(apiclient, volume=volume_2) + + expectedCount += volume1size + volume2size + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.domain.id, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + vm.detach_volume(apiclient, volume=volume_1) + volume_1.delete(apiclient) + + expectedCount -= volume1size + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.domain.id, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + expectedCount -= volume2size + vm.detach_volume(apiclient, volume=volume_2) + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.domain.id, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + except Exception as e: + self.fail("Failure: %s" % e) + return + + @attr(tags=["advanced", "selfservice"]) + def test_04_create_template_snapshot(self): + """Test create snapshot and templates from volume + + # Validate the following + 1. Create parent domain with two child sub-domains (and their admin accounts) + Follow these steps for both the domains + # 1. Create template from snapshot and verify secondary storage resource count + # 2. Create Volume from Snapshot and verify primary storage resource count + # 3. Attach volume to instance which was created from snapshot and + # verify primary storage resource count + # 4. Detach volume from instance which was created from snapshot and + # verify the primary storage resource count + # 5. Delete volume which was created from snapshot and verify primary storage + resource count""" + + result = self.setupAccounts() + if result[0] == FAIL: + self.fail("Failure while setting up accounts and domains: %s" % result[1]) + users = result[2] + + for domain, admin in users.items(): + self.account = admin + self.domain = domain + + try: + apiclient = self.testClient.getUserApiClient( + UserName=self.account.name, + DomainName=self.account.domain) + self.assertNotEqual(apiclient, FAILED,\ + "Failed to create api client for account: %s" % self.account.name) + + vm = VirtualMachine.create( + apiclient, self.services["virtual_machine"], + accountid=self.account.name, domainid=self.account.domainid, + diskofferingid=self.disk_offering.id, serviceofferingid=self.service_offering.id + ) + + templatesize = (self.template.size / (1024**3)) + + initialResourceCount = expectedCount = templatesize + self.disk_offering.disksize + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.domain.id, + initialResourceCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + vm.stop(self.apiclient) + + response = createSnapshotFromVirtualMachineVolume(apiclient, self.account, vm.id) + self.assertEqual(response[0], PASS, response[1]) + snapshot = response[1] + + response = snapshot.validateState(apiclient, Snapshot.BACKED_UP) + self.assertEqual(response[0], PASS, response[1]) + + self.services["volume"]["size"] = self.services["disk_offering"]["disksize"] + volume = Volume.create_from_snapshot(apiclient, + snapshot_id=snapshot.id, + services=self.services["volume"], + account=self.account.name, + domainid=self.account.domainid) + volumeSize = (volume.size / (1024**3)) + vm.attach_volume(apiclient, volume) + expectedCount = initialResourceCount + (volumeSize) + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.domain.id, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + expectedCount -= volumeSize + vm.detach_volume(apiclient, volume) + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.domain.id, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + volume.delete(apiclient) + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.domain.id, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + except Exception as e: + self.fail("Failed with exception : %s" % e) + return + + @attr(tags=["advanced", "selfservice"]) + def test_05_assign_virtual_machine_different_domain(self): + """Test assign virtual machine to account belonging to different domain + + # Steps + 1. Create a parent domain and two sub-domains in it (also admin accounts + of each domain) + 2. Deploy VM in child domain 1 + 3. Check if the resource count for domain 1 is updated correctly + 4. Assign this virtual machine to account 2 in domain 2 + 5. Verify that primaru storage resource count of domain 1 is now 0 and + primary storage resource count of domain 2 is increased by equivalent number + """ + + # Setting up account and domain hierarchy + result = self.setupAccounts() + self.assertEqual(result[0], PASS, result[1]) + + apiclient = self.testClient.getUserApiClient( + UserName=self.cadmin_1.name, + DomainName=self.cadmin_1.domain) + self.assertNotEqual(apiclient, FAILED,\ + "Failed to create api client for account: %s" % self.cadmin_1.name) + + try: + vm_1 = VirtualMachine.create( + apiclient, self.services["virtual_machine"], + accountid=self.cadmin_1.name, domainid=self.cadmin_1.domainid, + diskofferingid=self.disk_offering.id, serviceofferingid=self.service_offering.id + ) + + templatesize = (self.template.size / (1024**3)) + + expectedCount = templatesize + self.disk_offering.disksize + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.cadmin_1.domainid, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + vm_1.stop(apiclient) + vm_1.assign_virtual_machine(self.apiclient, account=self.cadmin_2.name, + domainid=self.cadmin_2.domainid) + + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.cadmin_2.domainid, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + expectedCount = 0 + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.cadmin_1.domainid, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + except Exception as e: + self.fail("Failed with exception: %s" % e) + return + + @attr(tags=["advanced", "selfservice"]) + def test_06_destroy_recover_vm(self): + """Test primary storage counts while destroying and recovering VM + # Steps + 1. Create a parent domain and two sub-domains in it (also admin accounts + of each domain) + Repeat following steps for both the child domains + 2. Deploy VM in child domain + 3. Check if the resource count for domain is updated correctly + 4. Destroy the VM + 5. Verify that the primary storage resource count remains the same + 6. Recover the VM + 7. Verify that the primary storage resource count remains the same + """ + + # Setting up account and domain hierarchy + result = self.setupAccounts() + self.assertEqual(result[0], PASS, result[1]) + users = result[2] + + for domain, admin in users.items(): + self.account = admin + self.domain = domain + try: + vm_1 = VirtualMachine.create( + self.apiclient, self.services["virtual_machine"], + accountid=self.account.name, domainid=self.account.domainid, + diskofferingid=self.disk_offering.id, serviceofferingid=self.service_offering.id + ) + + templatesize = (self.template.size / (1024**3)) + + expectedCount = templatesize + self.disk_offering.disksize + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.account.domainid, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + vm_1.delete(self.apiclient) + + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.account.domainid, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + + vm_1.recover(self.apiclient) + + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.account.domainid, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + except Exception as e: + self.fail("Failed with exception: %s" % e) + return diff --git a/test/integration/component/test_ps_limits.py b/test/integration/component/test_ps_limits.py new file mode 100644 index 0000000000..1993e934b3 --- /dev/null +++ b/test/integration/component/test_ps_limits.py @@ -0,0 +1,588 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +""" P1 tests for primary storage limits + + Test Plan: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Limit+Resources+to+domain+or+accounts + + Issue Link: https://issues.apache.org/jira/browse/CLOUDSTACK-1466 + + Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Limit+Resources+to+domains+and+accounts +""" +# Import Local Modules +from nose.plugins.attrib import attr +from marvin.cloudstackTestCase import cloudstackTestCase, unittest +from marvin.lib.base import ( + Account, + ServiceOffering, + VirtualMachine, + Domain, + Volume, + DiskOffering) +from marvin.lib.common import (get_domain, + get_zone, + get_template, + matchResourceCount, + createSnapshotFromVirtualMachineVolume, + isVmExpunged) +from marvin.lib.utils import (cleanup_resources, + validateList) +from marvin.codes import (PASS, + FAIL, + RESOURCE_PRIMARY_STORAGE, + CHILD_DOMAIN_ADMIN, + ROOT_DOMAIN_ADMIN) +from ddt import ddt, data + +@ddt +class TestVolumeLimits(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + cloudstackTestClient = super(TestVolumeLimits, + cls).getClsTestClient() + cls.api_client = cloudstackTestClient.getApiClient() + # Fill services from the external config file + cls.services = cloudstackTestClient.getParsedTestDataConfig() + # Get Zone, Domain and templates + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cloudstackTestClient.getZoneForTests()) + cls.services["mode"] = cls.zone.networktype + + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.services["volume"]["zoneid"] = cls.zone.id + cls._cleanup = [] + try: + cls.service_offering = ServiceOffering.create(cls.api_client, cls.services["service_offering"]) + cls._cleanup.append(cls.service_offering) + except Exception as e: + cls.tearDownClass() + raise unittest.SkipTest("Exception in setUpClass: %s" % e) + return + + @classmethod + def tearDownClass(cls): + try: + # Cleanup resources used + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + def setUp(self): + self.apiclient = self.testClient.getApiClient() + self.dbclient = self.testClient.getDbConnection() + self.cleanup = [] + try: + self.services["disk_offering"]["disksize"] = 2 + self.disk_offering = DiskOffering.create(self.apiclient, self.services["disk_offering"]) + self.assertNotEqual(self.disk_offering, None,\ + "Disk offering is None") + self.cleanup.append(self.disk_offering) + except Exception as e: + self.tearDown() + self.skipTest("Failure in setup: %s" % e) + return + + def tearDown(self): + try: + # Clean up, terminate the created instance, volumes and snapshots + cleanup_resources(self.apiclient, self.cleanup) + pass + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + def setupAccount(self, accountType): + """Setup the account required for the test""" + + try: + if accountType == CHILD_DOMAIN_ADMIN: + self.domain = Domain.create(self.apiclient, + services=self.services["domain"], + parentdomainid=self.domain.id) + + self.account = Account.create(self.apiclient, self.services["account"], + domainid=self.domain.id, admin=True) + self.cleanup.append(self.account) + if accountType == CHILD_DOMAIN_ADMIN: + self.cleanup.append(self.domain) + + self.virtualMachine = VirtualMachine.create(self.api_client, self.services["virtual_machine"], + accountid=self.account.name, domainid=self.account.domainid, + diskofferingid=self.disk_offering.id, + serviceofferingid=self.service_offering.id) + + accounts = Account.list(self.apiclient, id=self.account.id) + + self.assertEqual(validateList(accounts)[0], PASS, + "accounts list validation failed") + + self.initialResourceCount = int(accounts[0].primarystoragetotal) + except Exception as e: + return [FAIL, e] + return [PASS, None] + + @data(ROOT_DOMAIN_ADMIN, CHILD_DOMAIN_ADMIN) + @attr(tags=["advanced", "selfservice"]) + def test_stop_start_vm(self, value): + """Test Deploy VM with 5 GB volume & verify the usage + + # Validate the following + # 1. Create a VM with custom disk offering and check the primary storage count + # 2. Stop VM and verify the resource count remains same + # 3. Start VM and verify resource count remains same""" + + response = self.setupAccount(value) + self.assertEqual(response[0], PASS, response[1]) + + expectedCount = self.initialResourceCount + # Stopping instance + try: + self.virtualMachine.stop(self.apiclient) + except Exception as e: + self.fail("Failed to stop instance: %s" % e) + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + + # Starting instance + try: + self.virtualMachine.start(self.apiclient) + except Exception as e: + self.fail("Failed to start instance: %s" % e) + + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + return + + @unittest.skip("skip") + @data(ROOT_DOMAIN_ADMIN, CHILD_DOMAIN_ADMIN) + @attr(tags=["advanced", "selfservice"]) + def test_destroy_recover_vm(self, value): + """Test delete and recover instance + + # Validate the following + # 1. Create a VM with custom disk offering and check the primary storage count + # 2. Destroy VM and verify the resource count remains same + # 3. Recover VM and verify resource count remains same""" + + response = self.setupAccount(value) + self.assertEqual(response[0], PASS, response[1]) + + expectedCount = self.initialResourceCount + # Stopping instance + try: + self.virtualMachine.delete(self.apiclient) + except Exception as e: + self.fail("Failed to destroy instance: %s" % e) + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + + # Recovering instance + try: + self.virtualMachine.recover(self.apiclient) + except Exception as e: + self.fail("Failed to start instance: %s" % e) + + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + return + + @data(ROOT_DOMAIN_ADMIN, CHILD_DOMAIN_ADMIN) + @attr(tags=["advanced", "selfservice"]) + def test_attach_detach_volume(self, value): + """Stop attach and detach volume from VM + + # Validate the following + # 1. Create a VM with custom disk offering and check the primary storage count + # of account + # 2. Create custom volume in account + # 3. Verify that primary storage count increases by same amount + # 4. Attach volume to VM and verify resource count remains the same + # 5. Detach volume and verify resource count remains the same""" + + response = self.setupAccount(value) + self.assertEqual(response[0], PASS, response[1]) + + apiclient = self.apiclient + if value == CHILD_DOMAIN_ADMIN: + apiclient = self.testClient.getUserApiClient( + UserName=self.account.name, + DomainName=self.account.domain + ) + self.assertNotEqual(apiclient, FAIL, "Failure while getting\ + api client of account: %s" % self.account.name) + + try: + self.services["disk_offering"]["disksize"] = 4 + expectedCount = self.initialResourceCount + int(self.services["disk_offering"]["disksize"]) + disk_offering = DiskOffering.create(self.apiclient, + services=self.services["disk_offering"]) + + self.cleanup.append(disk_offering) + + volume = Volume.create( + apiclient,self.services["volume"],zoneid=self.zone.id, + account=self.account.name,domainid=self.account.domainid, + diskofferingid=disk_offering.id) + except Exception as e: + self.fail("Failure: %s" % e) + + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + + try: + self.virtualMachine.attach_volume(apiclient, volume=volume) + except Exception as e: + self.fail("Failed while attaching volume to VM: %s" % e) + + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + + try: + self.virtualMachine.detach_volume(apiclient, volume=volume) + except Exception as e: + self.fail("Failure while detaching volume: %s" % e) + + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + return + + @data(ROOT_DOMAIN_ADMIN, CHILD_DOMAIN_ADMIN) + @attr(tags=["advanced", "selfservice"]) + def test_create_multiple_volumes(self, value): + """Test create multiple volumes + + # Validate the following + # 1. Create a VM with custom disk offering and check the primary storage count + # of account + # 2. Create multiple volumes in account + # 3. Verify that primary storage count increases by same amount + # 4. Attach volumes to VM and verify resource count remains the same + # 5. Detach and delete both volumes one by one and verify resource count decreases + # proportionately""" + + # Creating service offering with 10 GB volume + + response = self.setupAccount(value) + self.assertEqual(response[0], PASS, response[1]) + + apiclient = self.apiclient + if value == CHILD_DOMAIN_ADMIN: + apiclient = self.testClient.getUserApiClient( + UserName=self.account.name, + DomainName=self.account.domain + ) + self.assertNotEqual(apiclient, FAIL, "Failure while getting\ + api client of account %s" % self.account.name) + + try: + self.services["disk_offering"]["disksize"] = 5 + disk_offering_5_GB = DiskOffering.create(self.apiclient, + services=self.services["disk_offering"]) + self.cleanup.append(disk_offering_5_GB) + + self.services["disk_offering"]["disksize"] = 10 + disk_offering_10_GB = DiskOffering.create(self.apiclient, + services=self.services["disk_offering"]) + + self.cleanup.append(disk_offering_10_GB) + + volume_1 = Volume.create( + apiclient,self.services["volume"],zoneid=self.zone.id, + account=self.account.name,domainid=self.account.domainid, + diskofferingid=disk_offering_5_GB.id) + + volume_2 = Volume.create( + apiclient,self.services["volume"],zoneid=self.zone.id, + account=self.account.name,domainid=self.account.domainid, + diskofferingid=disk_offering_10_GB.id) + + self.debug("Attaching volume %s to vm %s" % (volume_1.name, self.virtualMachine.name)) + self.virtualMachine.attach_volume(apiclient, volume=volume_1) + + self.debug("Attaching volume %s to vm %s" % (volume_2.name, self.virtualMachine.name)) + self.virtualMachine.attach_volume(apiclient, volume=volume_2) + except Exception as e: + self.fail("Failure: %s" % e) + + expectedCount = self.initialResourceCount + 15 # (5 + 10) + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + + try: + # Detaching and deleting volume 1 + self.virtualMachine.detach_volume(apiclient, volume=volume_1) + volume_1.delete(apiclient) + except Exception as e: + self.fail("Failure while volume operation: %s" % e) + + expectedCount -= 5 #After deleting first volume + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + + try: + # Detaching and deleting volume 2 + self.virtualMachine.detach_volume(apiclient, volume=volume_2) + volume_2.delete(apiclient) + except Exception as e: + self.fail("Failure while volume operation: %s" % e) + + expectedCount -= 10 + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + return + + @data(ROOT_DOMAIN_ADMIN, CHILD_DOMAIN_ADMIN) + @attr(tags=["advanced", "selfservice"]) + def test_deploy_multiple_vm(self, value): + """Test Deploy multiple VMs with & verify the usage + # Validate the following + # 1. Deploy multiple VMs with this service offering + # 2. Update Resource count for the root admin Primary Storage usage + # 3. Primary Storage usage should list properly + # 4. Destroy one VM among multiple VM's and verify that primary storage count + # decreases by equivalent amount + """ + + response = self.setupAccount(value) + self.assertEqual(response[0], PASS, response[1]) + + self.virtualMachine_2 = VirtualMachine.create(self.api_client, self.services["virtual_machine"], + accountid=self.account.name, domainid=self.account.domainid, + diskofferingid=self.disk_offering.id, + serviceofferingid=self.service_offering.id) + + expectedCount = (self.initialResourceCount * 2) #Total 2 vms + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + + self.virtualMachine_3 = VirtualMachine.create(self.api_client, self.services["virtual_machine"], + accountid=self.account.name, domainid=self.account.domainid, + diskofferingid=self.disk_offering.id, + serviceofferingid=self.service_offering.id) + + expectedCount = (self.initialResourceCount * 3) #Total 3 vms + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + + self.debug("Destroying instance: %s" % self.virtualMachine_2.name) + try: + self.virtualMachine_2.delete(self.apiclient) + except Exception as e: + self.fail("Failed to delete instance: %s" % e) + + self.assertTrue(isVmExpunged(self.apiclient, self.virtualMachine_2.id), "VM not expunged \ + in allotted time") + + expectedCount = (self.initialResourceCount * 2) #Total 2 vms + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + return + + @data(ROOT_DOMAIN_ADMIN, CHILD_DOMAIN_ADMIN) + @attr(tags=["advanced","selfservice"]) + def test_assign_vm_different_account(self, value): + """Test assign Vm to different account + # Validate the following + # 1. Deploy VM in account and check the primary storage resource count + # 2. Assign VM to another account + # 3. Resource count for first account should now equal to 0 + # 4. Resource count for the account to which VM is assigned should + # increase to that of initial resource count of first account + """ + + response = self.setupAccount(value) + self.assertEqual(response[0], PASS, response[1]) + + try: + account_2 = Account.create(self.apiclient, self.services["account"], + domainid=self.domain.id, admin=True) + self.cleanup.insert(0, account_2) + except Exception as e: + self.fail("Failed to create account: %s" % e) + + expectedCount = self.initialResourceCount + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + + try: + self.virtualMachine.stop(self.apiclient) + self.virtualMachine.assign_virtual_machine(self.apiclient, + account_2.name ,account_2.domainid) + except Exception as e: + self.fail("Failed to assign virtual machine to account %s: %s" % + (account_2.name,e)) + + # Checking resource count for account 2 + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=account_2.id) + self.assertEqual(response[0], PASS, response[1]) + + expectedCount = 0 + # Checking resource count for original account + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + return + + @data(ROOT_DOMAIN_ADMIN, CHILD_DOMAIN_ADMIN) + @attr(tags=["advanced", "selfservice"]) + def test_create_template_snapshot(self, value): + """Test create snapshot and templates from volume + + # Validate the following + # 1. Deploy VM with custoom disk offering and check the + # primary storage resource count + # 2. Stop the VM and create Snapshot from VM's volume + # 3. Create volume againt from this snapshto and attach to VM + # 4. Verify that primary storage count increases by the volume size + # 5. Detach and delete volume, verify primary storage count decreaes by volume size""" + + response = self.setupAccount(value) + self.debug(response[0]) + self.debug(response[1]) + self.assertEqual(response[0], PASS, response[1]) + + apiclient = self.apiclient + if value == CHILD_DOMAIN_ADMIN: + apiclient = self.testClient.getUserApiClient( + UserName=self.account.name, + DomainName=self.account.domain + ) + self.assertNotEqual(apiclient, FAIL, "Failure while getting api\ + client of account: %s" % self.account.name) + + try: + self.virtualMachine.stop(apiclient) + except Exception as e: + self.fail("Failed to stop instance: %s" % e) + expectedCount = self.initialResourceCount + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + + self.debug("Creating snapshot from ROOT volume: %s" % self.virtualMachine.name) + snapshot = None + response = createSnapshotFromVirtualMachineVolume(apiclient, self.account, self.virtualMachine.id) + self.assertEqual(response[0], PASS, response[1]) + snapshot = response[1] + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + + try: + self.services["volume"]["size"] = self.services["disk_offering"]["disksize"] + volume = Volume.create_from_snapshot(apiclient, + snapshot_id=snapshot.id, + services=self.services["volume"], + account=self.account.name, + domainid=self.account.domainid) + + self.debug("Attaching the volume to vm: %s" % self.virtualMachine.name) + self.virtualMachine.attach_volume(apiclient, volume) + except Exception as e: + self.fail("Failure in volume operation: %s" % e) + + expectedCount += int(self.services["volume"]["size"]) + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + + try: + self.virtualMachine.detach_volume(apiclient, volume) + except Exception as e: + self.fail("Failure in detach volume operation: %s" % e) + + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + + try: + self.debug("deleting the volume: %s" % volume.name) + volume.delete(apiclient) + except Exception as e: + self.fail("Failure while deleting volume: %s" % e) + + expectedCount -= int(self.services["volume"]["size"]) + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.account.id) + self.assertEqual(response[0], PASS, response[1]) + return diff --git a/test/integration/component/test_ps_max_limits.py b/test/integration/component/test_ps_max_limits.py new file mode 100644 index 0000000000..8d047ef992 --- /dev/null +++ b/test/integration/component/test_ps_max_limits.py @@ -0,0 +1,300 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +""" Tests for praimary storage - Maximum Limits + + Test Plan: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Limit+Resources+to+domain+or+accounts + + Issue Link: https://issues.apache.org/jira/browse/CLOUDSTACK-1466 + + Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Limit+Resources+to+domains+and+accounts +""" +# Import Local Modules +from nose.plugins.attrib import attr +from marvin.cloudstackTestCase import cloudstackTestCase, unittest +from marvin.lib.base import (Account, + ServiceOffering, + VirtualMachine, + Resources, + Domain, + Project, + Volume, + DiskOffering) +from marvin.lib.common import (get_domain, + get_zone, + get_template) +from marvin.lib.utils import (cleanup_resources, + validateList) +from marvin.codes import PASS, FAIL + +class TestMaxPrimaryStorageLimits(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + cloudstackTestClient = super(TestMaxPrimaryStorageLimits, + cls).getClsTestClient() + cls.api_client = cloudstackTestClient.getApiClient() + # Fill services from the external config file + cls.services = cloudstackTestClient.getParsedTestDataConfig() + # Get Zone, Domain and templates + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cloudstackTestClient.getZoneForTests()) + cls.services["mode"] = cls.zone.networktype + + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.services["volume"]["zoneid"] = cls.zone.id + cls._cleanup = [] + try: + cls.service_offering = ServiceOffering.create(cls.api_client, cls.services["service_offering"]) + cls._cleanup.append(cls.service_offering) + except Exception as e: + cls.tearDownClass() + raise unittest.SkipTest("Exception in setUpClass: %s" % e) + return + + @classmethod + def tearDownClass(cls): + try: + # Cleanup resources used + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + def setUp(self): + self.apiclient = self.testClient.getApiClient() + self.dbclient = self.testClient.getDbConnection() + self.cleanup = [] + try: + response = self.setupAccounts() + if response[0] == FAIL: + self.skipTest("Failure while setting up accounts: %s" % response[1]) + self.services["disk_offering"]["disksize"] = 2 + self.disk_offering = DiskOffering.create(self.apiclient, self.services["disk_offering"]) + self.cleanup.append(self.disk_offering) + except Exception as e: + self.tearDown() + self.skipTest("Failure in setup: %s" % e) + return + + def tearDown(self): + try: + # Clean up, terminate the created instance, volumes and snapshots + cleanup_resources(self.apiclient, self.cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + def setupAccounts(self): + + try: + self.child_domain = Domain.create(self.apiclient,services=self.services["domain"], + parentdomainid=self.domain.id) + + self.child_do_admin = Account.create(self.apiclient, self.services["account"], admin=True, + domainid=self.child_domain.id) + + # Create project as a domain admin + self.project = Project.create(self.apiclient, self.services["project"], + account=self.child_do_admin.name, + domainid=self.child_do_admin.domainid) + + # Cleanup created project at end of test + self.cleanup.append(self.project) + + # Cleanup accounts created + self.cleanup.append(self.child_do_admin) + self.cleanup.append(self.child_domain) + except Exception as e: + return [FAIL, e] + return [PASS, None] + + def updatePrimaryStorageLimits(self, accountLimit=None, domainLimit=None, + projectLimit=None): + + try: + # Update resource limits for account + if accountLimit: + Resources.updateLimit(self.apiclient, resourcetype=10, + max=accountLimit, account=self.child_do_admin.name, + domainid=self.child_do_admin.domainid) + + if projectLimit: + Resources.updateLimit(self.apiclient, resourcetype=10, + max=projectLimit, projectid=self.project.id) + + if domainLimit: + Resources.updateLimit(self.apiclient, resourcetype=10, + max=domainLimit, domainid=self.child_domain.id) + except Exception as e: + return [FAIL, e] + return [PASS, None] + + @attr(tags=["advanced","selfservice"]) + def test_01_deploy_vm_domain_limit_reached(self): + """Test Try to deploy VM with admin account where account has not used + the resources but @ domain they are not available + + # Validate the following + # 1. Try to deploy VM with admin account where account has not used the + # resources but @ domain they are not available + # 2. Deploy VM should error out saying ResourceAllocationException + # with "resource limit exceeds""" + + self.virtualMachine = VirtualMachine.create(self.api_client, self.services["virtual_machine"], + accountid=self.child_do_admin.name, domainid=self.child_do_admin.domainid, + serviceofferingid=self.service_offering.id) + + accounts = Account.list(self.apiclient, id=self.child_do_admin.id) + self.assertEqual(validateList(accounts)[0], PASS, + "accounts list validation failed") + + self.initialResourceCount = int(accounts[0].primarystoragetotal) + domainLimit = self.initialResourceCount + 3 + + self.debug("Setting up account and domain hierarchy") + response = self.updatePrimaryStorageLimits(domainLimit=domainLimit) + self.assertEqual(response[0], PASS, response[1]) + + self.services["volume"]["size"] = self.services["disk_offering"]["disksize"] = 2 + + try: + disk_offering = DiskOffering.create(self.apiclient, + services=self.services["disk_offering"]) + self.cleanup.append(disk_offering) + Volume.create(self.apiclient, + self.services["volume"], + zoneid=self.zone.id, + account=self.child_do_admin.name, + domainid=self.child_do_admin.domainid, + diskofferingid=disk_offering.id) + except Exception as e: + self.fail("Exception occured: %s" % e) + + with self.assertRaises(Exception): + Volume.create(self.apiclient, + self.services["volume"], + zoneid=self.zone.id, + account=self.child_do_admin.name, + domainid=self.child_do_admin.domainid, + diskofferingid=disk_offering.id) + return + + @attr(tags=["advanced","selfservice"]) + def test_02_deploy_vm_account_limit_reached(self): + """Test Try to deploy VM with admin account where account has used + the resources but @ domain they are available""" + + self.virtualMachine = VirtualMachine.create(self.api_client, self.services["virtual_machine"], + accountid=self.child_do_admin.name, domainid=self.child_do_admin.domainid, + diskofferingid=self.disk_offering.id, + serviceofferingid=self.service_offering.id) + + accounts = Account.list(self.apiclient, id=self.child_do_admin.id) + self.assertEqual(validateList(accounts)[0], PASS, + "accounts list validation failed") + + self.initialResourceCount = int(accounts[0].primarystoragetotal) + accountLimit = self.initialResourceCount + 3 + + self.debug("Setting up account and domain hierarchy") + response = self.updatePrimaryStorageLimits(accountLimit=accountLimit) + self.assertEqual(response[0], PASS, response[1]) + + self.services["volume"]["size"] = self.services["disk_offering"]["disksize"] = 2 + + try: + disk_offering = DiskOffering.create(self.apiclient, + services=self.services["disk_offering"]) + self.cleanup.append(disk_offering) + Volume.create(self.apiclient, + self.services["volume"], + zoneid=self.zone.id, + account=self.child_do_admin.name, + domainid=self.child_do_admin.domainid, + diskofferingid=disk_offering.id) + except Exception as e: + self.fail("failed to create volume: %s" % e) + + with self.assertRaises(Exception): + Volume.create(self.apiclient, + self.services["volume"], + zoneid=self.zone.id, + account=self.child_do_admin.name, + domainid=self.child_do_admin.domainid, + diskofferingid=disk_offering.id) + return + + @attr(tags=["advanced","selfservice"]) + def test_03_deploy_vm_project_limit_reached(self): + """Test TTry to deploy VM with admin account where account has not used + the resources but @ project they are not available + + # Validate the following + # 1. Try to deploy VM with admin account where account has not used the + # resources but @ project they are not available + # 2. Deploy VM should error out saying ResourceAllocationException + # with "resource limit exceeds""" + + self.virtualMachine = VirtualMachine.create(self.api_client, self.services["virtual_machine"], + projectid=self.project.id, + diskofferingid=self.disk_offering.id, + serviceofferingid=self.service_offering.id) + + try: + projects = Project.list(self.apiclient, id=self.project.id, listall=True) + except Exception as e: + self.fail("failed to get projects list: %s" % e) + + self.assertEqual(validateList(projects)[0], PASS, + "projects list validation failed") + self.initialResourceCount = int(projects[0].primarystoragetotal) + + projectLimit = self.initialResourceCount + 3 + + self.debug("Setting up account and domain hierarchy") + response = self.updatePrimaryStorageLimits(projectLimit=projectLimit) + self.assertEqual(response[0], PASS, response[1]) + + self.services["volume"]["size"] = self.services["disk_offering"]["disksize"] = 2 + + try: + disk_offering = DiskOffering.create(self.apiclient, + services=self.services["disk_offering"]) + self.cleanup.append(disk_offering) + Volume.create(self.apiclient, + self.services["volume"], + zoneid=self.zone.id, + projectid=self.project.id, + diskofferingid=disk_offering.id) + except Exception as e: + self.fail("Exception occured: %s" % e) + + with self.assertRaises(Exception): + Volume.create(self.apiclient, + self.services["volume"], + zoneid=self.zone.id, + projectid=self.project.id, + diskofferingid=disk_offering.id) + return diff --git a/test/integration/component/test_ps_project_limits.py b/test/integration/component/test_ps_project_limits.py new file mode 100644 index 0000000000..471b4a187a --- /dev/null +++ b/test/integration/component/test_ps_project_limits.py @@ -0,0 +1,238 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +""" P1 tests for primary storage Project limits + + Test Plan: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Limit+Resources+to+domain+or+accounts + + Issue Link: https://issues.apache.org/jira/browse/CLOUDSTACK-1466 + + Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Limit+Resources+to+domains+and+accounts +""" +# Import Local Modules +from nose.plugins.attrib import attr +from marvin.cloudstackTestCase import cloudstackTestCase, unittest +from marvin.lib.base import (Account, + ServiceOffering, + VirtualMachine, + Host, + Domain, + Project, + Volume) +from marvin.lib.common import (get_domain, + get_zone, + get_template, + matchResourceCount, + isVmExpunged) +from marvin.lib.utils import (cleanup_resources, + validateList) +from marvin.codes import (PASS, + FAIL, + RESOURCE_PRIMARY_STORAGE) +import time + +class TestProjectsVolumeLimits(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + cloudstackTestClient = super(TestProjectsVolumeLimits, + cls).getClsTestClient() + cls.api_client = cloudstackTestClient.getApiClient() + # Fill services from the external config file + cls.services = cloudstackTestClient.getParsedTestDataConfig() + # Get Zone, Domain and templates + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cloudstackTestClient.getZoneForTests()) + cls.services["mode"] = cls.zone.networktype + + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["volume"]["zoneid"] = cls.zone.id + cls._cleanup = [] + try: + cls.service_offering = ServiceOffering.create(cls.api_client, cls.services["service_offering"]) + cls._cleanup.append(cls.service_offering) + except Exception as e: + cls.tearDownClass() + raise unittest.SkipTest("Exception in setUpClass: %s" % e) + return + + @classmethod + def tearDownClass(cls): + try: + # Cleanup resources used + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + def setUp(self): + self.apiclient = self.testClient.getApiClient() + self.dbclient = self.testClient.getDbConnection() + + self.cleanup = [] + response = self.setupProjectAccounts() + self.assertEqual(response[0], PASS, response[1]) + + try: + self.vm = VirtualMachine.create( + self.apiclient,self.services["virtual_machine"], + templateid=self.template.id,projectid=self.project.id, + serviceofferingid=self.service_offering.id) + projects = Project.list(self.apiclient,id=self.project.id, listall=True) + self.assertEqual(validateList(projects)[0], PASS,\ + "projects list validation failed") + self.initialResourceCount = projects[0].primarystoragetotal + except Exception as e: + self.tearDown() + self.skipTest("Exception occured in setup: %s" % e) + return + + def tearDown(self): + try: + # Clean up, terminate the created instance, volumes and snapshots + cleanup_resources(self.apiclient, self.cleanup) + pass + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + def setupProjectAccounts(self): + + try: + self.domain = Domain.create(self.apiclient, + services=self.services["domain"], + parentdomainid=self.domain.id) + self.admin = Account.create( + self.apiclient, self.services["account"], + admin=True, domainid=self.domain.id) + + # Create project as a domain admin + self.project = Project.create( + self.apiclient,self.services["project"], + account=self.admin.name,domainid=self.admin.domainid) + # Cleanup created project at end of test + self.cleanup.append(self.project) + self.cleanup.append(self.admin) + self.cleanup.append(self.domain) + except Exception as e: + return [FAIL, e] + return [PASS, None] + + @attr(tags=["advanced", "selfservice"]) + def test_01_VM_start_stop(self): + """Test project primary storage count with VM stop/start operation + + # Validate the following + # 1. Create VM with custom disk offering in a project and check + # initial primary storage count + # 2. Stop the VM and verify primary storage count remains the same + # 3. Start the VM and verify priamay storage count remains the same + """ + + try: + self.vm.stop(self.apiclient) + except Exception as e: + self.fail("Faield to stop VM: %s" % e) + + expectedCount = self.initialResourceCount + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + projectid=self.project.id) + self.assertEqual(response[0], PASS, response[1]) + + try: + self.vm.start(self.apiclient) + except Exception as e: + self.fail("Failed to start VM: %s" % e) + + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + projectid=self.project.id) + self.assertEqual(response[0], PASS, response[1]) + return + + @attr(tags=["advanced", "selfservice"]) + def test_02_migrate_vm(self): + """Test migrate VM in project + + # Validate the following + # 1. Create VM with custom disk offering in a project and check + # initial primary storage count + # 2. List the hosts suitable for migrating the VM + # 3. Migrate the VM and verify that primary storage count of project remains same""" + + try: + hosts = Host.list(self.apiclient,virtualmachineid=self.vm.id, + listall=True) + self.assertEqual(validateList(hosts)[0], PASS, "hosts list validation failed") + host = hosts[0] + self.vm.migrate(self.apiclient, host.id) + except Exception as e: + self.fail("Exception occured" % e) + + expectedCount = self.initialResourceCount + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + projectid=self.project.id) + self.assertEqual(response[0], PASS, response[1]) + return + + @attr(tags=["advanced", "selfservice"]) + def test_03_delete_vm(self): + """Test delete VM belonging to project + + # Validate the following + # 1. Create VM with custom disk offering in a project and check + # initial primary storage count + # 2. Delete VM and verify that it's expunged + # 3. Verify that primary storage count of project equals 0""" + + try: + self.vm.delete(self.apiclient) + except Exception as e: + self.fail("Failed to detroy VM: %s" % e) + + self.assertTrue(isVmExpunged(self.apiclient, self.vm.id, self.project.id),\ + "VM not expunged") + + totalallottedtime = timeout = 600 + while timeout >= 0: + volumes = Volume.list(self.apiclient, projectid=self.project.id, listall=True) + if volumes is None: + break + if timeout == 0: + self.fail("Volume attached to VM not cleaned up even\ + after %s seconds" % totalallottedtime) + timeout -= 60 + time.sleep(60) + + expectedCount = 0 + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + projectid=self.project.id) + self.assertEqual(response[0], PASS, response[1]) + return diff --git a/test/integration/component/test_ps_resize_volume.py b/test/integration/component/test_ps_resize_volume.py new file mode 100644 index 0000000000..737f910331 --- /dev/null +++ b/test/integration/component/test_ps_resize_volume.py @@ -0,0 +1,339 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +""" P1 tests for testing resize volume functionality with primary storage limit constraints on + account/domain + + Test Plan: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Limit+Resources+to+domain+or+accounts + + Issue Link: https://issues.apache.org/jira/browse/CLOUDSTACK-1466 + + Feature Specifications: https://cwiki.apache.org/confluence/display/CLOUDSTACK/Limit+Resources+to+domains+and+accounts +""" +# Import Local Modules +from nose.plugins.attrib import attr +from marvin.cloudstackTestCase import cloudstackTestCase, unittest +from marvin.lib.base import (Account, + ServiceOffering, + VirtualMachine, + Resources, + Domain, + DiskOffering, + Volume) +from marvin.lib.common import (get_domain, + get_zone, + get_template, + matchResourceCount, + isDomainResourceCountEqualToExpectedCount) +from marvin.lib.utils import (cleanup_resources, + get_hypervisor_type) +from marvin.codes import (PASS, + FAIL, + FAILED, + RESOURCE_PRIMARY_STORAGE, + RESOURCE_SECONDARY_STORAGE, + XEN_SERVER) + +class TestResizeVolume(cloudstackTestCase): + + @classmethod + def setUpClass(cls): + cloudstackTestClient = super(TestResizeVolume, + cls).getClsTestClient() + cls.api_client = cloudstackTestClient.getApiClient() + # Fill services from the external config file + cls.services = cloudstackTestClient.getParsedTestDataConfig() + # Get Zone, Domain and templates + cls.domain = get_domain(cls.api_client) + cls.zone = get_zone(cls.api_client, cloudstackTestClient.getZoneForTests()) + cls.services["mode"] = cls.zone.networktype + cls.resourcetypemapping = {RESOURCE_PRIMARY_STORAGE: 10, + RESOURCE_SECONDARY_STORAGE: 11} + + cls.template = get_template( + cls.api_client, + cls.zone.id, + cls.services["ostype"] + ) + + cls.services["virtual_machine"]["zoneid"] = cls.zone.id + cls.services["virtual_machine"]["template"] = cls.template.id + cls.services["volume"]["zoneid"] = cls.zone.id + + cls._cleanup = [] + try: + cls.hypervisor = str(get_hypervisor_type(cls.api_client)).lower() + + # Creating service offering with normal config + cls.service_offering = ServiceOffering.create(cls.api_client, + cls.services["service_offering"]) + cls._cleanup.append(cls.service_offering) + + cls.services["disk_offering"]["disksize"] = 5 + cls.disk_offering_5_GB = DiskOffering.create( + cls.api_client, + cls.services["disk_offering"] + ) + cls._cleanup.append(cls.disk_offering_5_GB) + + cls.services["disk_offering"]["disksize"] = 20 + cls.disk_offering_20_GB = DiskOffering.create( + cls.api_client, + cls.services["disk_offering"] + ) + cls._cleanup.append(cls.disk_offering_20_GB) + except Exception as e: + cls.tearDownClass() + raise unittest.SkipTest("Failure while creating disk offering: %s" % e) + return + + @classmethod + def tearDownClass(cls): + try: + # Cleanup resources used + cleanup_resources(cls.api_client, cls._cleanup) + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + def setUp(self): + self.apiclient = self.testClient.getApiClient() + self.dbclient = self.testClient.getDbConnection() + self.cleanup = [] + return + + def tearDown(self): + try: + # Clean up, terminate the created instance, volumes and snapshots + cleanup_resources(self.apiclient, self.cleanup) + pass + except Exception as e: + raise Exception("Warning: Exception during cleanup : %s" % e) + return + + def updateResourceLimits(self, accountLimit=None, domainLimit=None): + """Update primary storage limits of the parent domain and its + child domains""" + + try: + if domainLimit: + #Update resource limit for domain + Resources.updateLimit(self.apiclient, resourcetype=10, + max=domainLimit, + domainid=self.parent_domain.id) + if accountLimit: + #Update resource limit for domain + Resources.updateLimit(self.apiclient, resourcetype=10, + max=accountLimit, account=self.parentd_admin.name, + domainid=self.parent_domain.id) + except Exception as e: + return [FAIL, e] + return [PASS, None] + + def setupAccounts(self): + try: + self.parent_domain = Domain.create(self.apiclient, + services=self.services["domain"], + parentdomainid=self.domain.id) + self.parentd_admin = Account.create(self.apiclient, self.services["account"], + admin=True, domainid=self.parent_domain.id) + + # Cleanup the resources created at end of test + self.cleanup.append(self.parentd_admin) + self.cleanup.append(self.parent_domain) + except Exception as e: + return [FAIL, e] + return [PASS, None] + + @attr(tags=["advanced", "selfservice"]) + def test_01_increase_volume_size_within_account_limit(self): + """Test increasing volume size within the account limit and verify primary storage usage + + # Validate the following + # 1. Create a domain and its admin account + # 2. Set account primary storage limit well beyond (20 GB volume + template size of VM) + # 3. Deploy a VM without any disk offering (only root disk) + # 4. Create a volume of 5 GB in the account and attach it to the VM + # 5. Increase (resize) the volume to 20 GB + # 6. Resize opearation should be successful and primary storage counnt for + # account should be updated successfully""" + + # Setting up account and domain hierarchy + result = self.setupAccounts() + self.assertEqual(result[0], PASS, result[1]) + + apiclient = self.testClient.getUserApiClient( + UserName=self.parentd_admin.name, + DomainName=self.parentd_admin.domain) + self.assertNotEqual(apiclient, FAILED, "Failed to get api client\ + of account: %s" % self.parentd_admin.name) + + templateSize = (self.template.size / (1024**3)) + accountLimit = (templateSize + self.disk_offering_20_GB.disksize) + response = self.updateResourceLimits(accountLimit=accountLimit) + self.assertEqual(response[0], PASS, response[1]) + try: + virtualMachine = VirtualMachine.create( + apiclient, self.services["virtual_machine"], + accountid=self.parentd_admin.name, domainid=self.parent_domain.id, + serviceofferingid=self.service_offering.id + ) + + volume = Volume.create( + apiclient,self.services["volume"],zoneid=self.zone.id, + account=self.parentd_admin.name,domainid=self.parent_domain.id, + diskofferingid=self.disk_offering_5_GB.id) + + virtualMachine.attach_volume(apiclient, volume=volume) + + expectedCount = (templateSize + self.disk_offering_5_GB.disksize) + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.parentd_admin.id) + if response[0] == FAIL: + raise Exception(response[1]) + + if self.hypervisor == str(XEN_SERVER).lower(): + virtualMachine.stop(self.apiclient) + volume.resize(apiclient, diskofferingid=self.disk_offering_20_GB.id) + + expectedCount = (templateSize + self.disk_offering_20_GB.disksize) + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.parentd_admin.id) + if response[0] == FAIL: + raise Exception(response[1]) + except Exception as e: + self.fail("Failed with exception: %s" % e) + return + + @attr(tags=["advanced", "selfservice"]) + def test_02_increase_volume_size_above_account_limit(self): + """Test increasing volume size above the account limit + + # Validate the following + # 1. Create a domain and its admin account + # 2. Set account primary storage limit more than (5 GB volume + template size of VM) + # and less than (20 GB volume+ template size of VM) + # 3. Deploy a VM without any disk offering (only root disk) + # 4. Create a volume of 5 GB in the account and attach it to the VM + # 5. Try to (resize) the volume to 20 GB + # 6. Resize opearation should fail""" + + # Setting up account and domain hierarchy + result = self.setupAccounts() + self.assertEqual(result[0], PASS, result[1]) + + templateSize = (self.template.size / (1024**3)) + accountLimit = ((templateSize + self.disk_offering_20_GB.disksize) - 1) + response = self.updateResourceLimits(accountLimit=accountLimit) + self.assertEqual(response[0], PASS, response[1]) + + apiclient = self.testClient.getUserApiClient( + UserName=self.parentd_admin.name, + DomainName=self.parentd_admin.domain) + self.assertNotEqual(apiclient, FAILED, "Failed to get api client\ + of account: %s" % self.parentd_admin.name) + + try: + virtualMachine = VirtualMachine.create( + apiclient, self.services["virtual_machine"], + accountid=self.parentd_admin.name, domainid=self.parent_domain.id, + serviceofferingid=self.service_offering.id + ) + + volume = Volume.create( + apiclient,self.services["volume"],zoneid=self.zone.id, + account=self.parentd_admin.name,domainid=self.parent_domain.id, + diskofferingid=self.disk_offering_5_GB.id) + + virtualMachine.attach_volume(apiclient, volume=volume) + + expectedCount = (templateSize + self.disk_offering_5_GB.disksize) + response = matchResourceCount( + self.apiclient, expectedCount, + RESOURCE_PRIMARY_STORAGE, + accountid=self.parentd_admin.id) + if response[0] == FAIL: + raise Exception(response[1]) + except Exception as e: + self.fail("Failed with exception: %s" % e) + + if self.hypervisor == str(XEN_SERVER).lower(): + virtualMachine.stop(self.apiclient) + with self.assertRaises(Exception): + volume.resize(apiclient, diskofferingid=self.disk_offering_20_GB.id) + return + + @attr(tags=["advanced", "selfservice"]) + def test_03_increase_volume_size_above_domain_limit(self): + """Test increasing volume size above the domain limit + + # Validate the following + # 1. Create a domain and its admin account + # 2. Set domain primary storage limit more than (5 GB volume + template size of VM) + # and less than (20 GB volume+ template size of VM) + # 3. Deploy a VM without any disk offering (only root disk) + # 4. Create a volume of 5 GB in the account and attach it to the VM + # 5. Try to (resize) the volume to 20 GB + # 6. Resize opearation should fail""" + + # Setting up account and domain hierarchy + result = self.setupAccounts() + self.assertEqual(result[0], PASS, result[1]) + + templateSize = (self.template.size / (1024**3)) + domainLimit = ((templateSize + self.disk_offering_20_GB.disksize) - 1) + response = self.updateResourceLimits(domainLimit=domainLimit) + self.assertEqual(response[0], PASS, response[1]) + + apiclient = self.testClient.getUserApiClient( + UserName=self.parentd_admin.name, + DomainName=self.parentd_admin.domain) + self.assertNotEqual(apiclient, FAILED, "Failed to get api client\ + of account: %s" % self.parentd_admin.name) + + try: + virtualMachine = VirtualMachine.create( + apiclient, self.services["virtual_machine"], + accountid=self.parentd_admin.name, domainid=self.parent_domain.id, + serviceofferingid=self.service_offering.id + ) + + volume = Volume.create( + apiclient,self.services["volume"],zoneid=self.zone.id, + account=self.parentd_admin.name,domainid=self.parent_domain.id, + diskofferingid=self.disk_offering_5_GB.id) + + virtualMachine.attach_volume(apiclient, volume=volume) + + expectedCount = (templateSize + self.disk_offering_5_GB.disksize) + result = isDomainResourceCountEqualToExpectedCount( + self.apiclient, self.parent_domain.id, + expectedCount, RESOURCE_PRIMARY_STORAGE) + self.assertFalse(result[0], result[1]) + self.assertTrue(result[2], "Resource count does not match") + except Exception as e: + self.fail("Failed with exception: %s" % e) + + if self.hypervisor == str(XEN_SERVER).lower(): + virtualMachine.stop(self.apiclient) + with self.assertRaises(Exception): + volume.resize(apiclient, diskofferingid=self.disk_offering_20_GB.id) + return diff --git a/tools/marvin/marvin/codes.py b/tools/marvin/marvin/codes.py index ef49c0c3c8..a1e708599d 100644 --- a/tools/marvin/marvin/codes.py +++ b/tools/marvin/marvin/codes.py @@ -30,12 +30,28 @@ @DateAdded: 20th October 2013 """ +''' +VM STATES - START +''' RUNNING = "Running" STOPPED = "Stopped" STOPPING = "Stopping" STARTING = "Starting" DESTROYED = "Destroyed" EXPUNGING = "Expunging" +''' +VM STATES - END +''' + +''' +Snapshot States - START +''' +BACKED_UP = "backedup" +BACKING_UP = "backingup" +''' +Snapshot States - END +''' + RECURRING = "RECURRING" ENABLED = "Enabled" NETWORK_OFFERING = "network_offering" @@ -81,3 +97,11 @@ XEN_SERVER = "XenServer" ADMIN_ACCOUNT = 'ADMIN_ACCOUNT' USER_ACCOUNT = 'USER_ACCOUNT' +RESOURCE_CPU = 8 +RESOURCE_MEMORY = 9 +RESOURCE_PRIMARY_STORAGE = 10 +RESOURCE_SECONDARY_STORAGE = 11 +KVM = "kvm" +VMWARE = "vmware" +ROOT_DOMAIN_ADMIN="root domain admin" +CHILD_DOMAIN_ADMIN="child domain admin" diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py index 8b89087db0..c3d98c9549 100644 --- a/tools/marvin/marvin/lib/base.py +++ b/tools/marvin/marvin/lib/base.py @@ -20,11 +20,10 @@ """ import marvin -from utils import is_server_ssh_ready, random_gen from marvin.cloudstackAPI import * from marvin.codes import (FAILED, FAIL, PASS, RUNNING, STOPPED, STARTING, DESTROYED, EXPUNGING, - STOPPING) + STOPPING, BACKED_UP, BACKING_UP) from marvin.cloudstackException import GetDetailExceptionInfo from marvin.lib.utils import validateList, is_server_ssh_ready, random_gen # Import System modules @@ -957,6 +956,12 @@ class Snapshot: """Manage Snapshot Lifecycle """ + '''Class level variables''' + # Variables denoting possible Snapshot states - start + BACKED_UP = BACKED_UP + BACKING_UP = BACKING_UP + # Variables denoting possible Snapshot states - end + def __init__(self, items): self.__dict__.update(items) @@ -990,6 +995,33 @@ def list(cls, apiclient, **kwargs): cmd.listall=True return(apiclient.listSnapshots(cmd)) + def validateState(self, apiclient, snapshotstate, timeout=600): + """Check if snapshot is in required state + returnValue: List[Result, Reason] + @Result: PASS if snapshot is in required state, + else FAIL + @Reason: Reason for failure in case Result is FAIL + """ + isSnapshotInRequiredState = False + try: + while timeout >= 0: + snapshots = Snapshot.list(apiclient, id=self.id) + assert validateList(snapshots)[0] == PASS, "snapshots list\ + validation failed" + if str(snapshots[0].state).lower() == snapshotstate: + isSnapshotInRequiredState = True + break + timeout -= 60 + time.sleep(60) + #end while + if isSnapshotInRequiredState: + return[PASS, None] + else: + raise Exception("Snapshot not in required state") + except Exception as e: + return [FAIL, e] + + class Template: diff --git a/tools/marvin/marvin/lib/common.py b/tools/marvin/marvin/lib/common.py index 7753385318..42ffc51520 100644 --- a/tools/marvin/marvin/lib/common.py +++ b/tools/marvin/marvin/lib/common.py @@ -60,12 +60,29 @@ from marvin.sshClient import SshClient -from marvin.codes import (PASS, ISOLATED_NETWORK, VPC_NETWORK, - BASIC_ZONE, FAIL, NAT_RULE, STATIC_NAT_RULE, FAILED) +from marvin.codes import (PASS, FAILED, ISOLATED_NETWORK, VPC_NETWORK, + BASIC_ZONE, FAIL, NAT_RULE, STATIC_NAT_RULE, + RESOURCE_PRIMARY_STORAGE, RESOURCE_SECONDARY_STORAGE, + RESOURCE_CPU, RESOURCE_MEMORY) +from marvin.lib.utils import (validateList, xsplit, get_process_status) +from marvin.lib.base import (PhysicalNetwork, + PublicIPAddress, + NetworkOffering, + NATRule, + StaticNATRule, + Volume, + Account, + Project, + Snapshot, + NetScaler, + VirtualMachine, + FireWallRule, + Template, + Network, + Host, + Resources, + Configurations) import random -from marvin.lib.utils import * -from marvin.lib.base import * -from marvin.codes import PASS # Import System modules @@ -1222,3 +1239,111 @@ def getPortableIpRangeServices(config): services = FAILED return services + + +def uploadVolume(apiclient, zoneid, account, services): + try: + # Upload the volume + volume = Volume.upload(apiclient, services["volume"], + zoneid=zoneid, account=account.name, + domainid=account.domainid, url=services["url"]) + + volume.wait_for_upload(apiclient) + + # Check List Volume response for newly created volume + volumes = Volume.list(apiclient, id=volume.id, + zoneid=zoneid, listall=True) + validationresult = validateList(volumes) + assert validationresult[0] == PASS,\ + "volumes list validation failed: %s" % validationresult[2] + assert str(volumes[0].state).lower() == "uploaded",\ + "Volume state should be 'uploaded' but it is %s" % volumes[0].state + except Exception as e: + return [FAIL, e] + return [PASS, volume] + +def matchResourceCount(apiclient, expectedCount, resourceType, + accountid=None, projectid=None): + """Match the resource count of account/project with the expected + resource count""" + try: + resourceholderlist = None + if accountid: + resourceholderlist = Account.list(apiclient, id=accountid) + elif projectid: + resourceholderlist = Project.list(apiclient, id=projectid, listall=True) + validationresult = validateList(resourceholderlist) + assert validationresult[0] == PASS,\ + "accounts list validation failed" + if resourceType == RESOURCE_PRIMARY_STORAGE: + resourceCount = resourceholderlist[0].primarystoragetotal + elif resourceType == RESOURCE_SECONDARY_STORAGE: + resourceCount = resourceholderlist[0].secondarystoragetotal + elif resourceType == RESOURCE_CPU: + resourceCount = resourceholderlist[0].cputotal + elif resourceType == RESOURCE_MEMORY: + resourceCount = resourceholderlist[0].memorytotal + assert str(resourceCount) == str(expectedCount),\ + "Resource count %s should match with the expected resource count %s" %\ + (resourceCount, expectedCount) + except Exception as e: + return [FAIL, e] + return [PASS, None] + +def createSnapshotFromVirtualMachineVolume(apiclient, account, vmid): + """Create snapshot from volume""" + + try: + volumes = Volume.list(apiclient, account=account.name, + domainid=account.domainid, virtualmachineid=vmid) + validationresult = validateList(volumes) + assert validateList(volumes)[0] == PASS,\ + "List volumes should return a valid response" + snapshot = Snapshot.create(apiclient, volume_id=volumes[0].id, + account=account.name, domainid=account.domainid) + snapshots = Snapshot.list(apiclient, id=snapshot.id, + listall=True) + validationresult = validateList(snapshots) + assert validationresult[0] == PASS,\ + "List snapshot should return a valid list" + except Exception as e: + return[FAIL, e] + return [PASS, snapshot] + +def isVmExpunged(apiclient, vmid, projectid=None, timeout=600): + """Verify if VM is expunged or not""" + vmExpunged= False + while timeout>=0: + try: + vms = VirtualMachine.list(apiclient, id=vmid, projectid=projectid) + if vms is None: + vmExpunged = True + break + timeout -= 60 + time.sleep(60) + except Exception: + vmExpunged = True + break + #end while + return vmExpunged + +def isDomainResourceCountEqualToExpectedCount(apiclient, domainid, expectedcount, + resourcetype): + """Get the resource count of specific domain and match + it with the expected count + Return list [isExceptionOccured, reasonForException, isResourceCountEqual]""" + isResourceCountEqual = False + isExceptionOccured = False + reasonForException = None + try: + response = Resources.updateCount(apiclient, domainid=domainid, + resourcetype=resourcetype) + except Exception as e: + reasonForException = "Failed while updating resource count: %s" % e + isExceptionOccured = True + return [isExceptionOccured, reasonForException, isResourceCountEqual] + + resourcecount = (response[0].resourcecount / (1024**3)) + if resourcecount == expectedcount: + isResourceCountEqual = True + return [isExceptionOccured, reasonForException, isResourceCountEqual] From 8aea23a4e36559e8113d7bc0427aa950ae8082eb Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Wed, 18 Jun 2014 13:04:35 +0530 Subject: [PATCH 614/683] CLOUDSTACK-6906: Fixed volume resize BVT failure --- test/integration/smoke/test_volumes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/smoke/test_volumes.py b/test/integration/smoke/test_volumes.py index b1a6835ed6..e60b0fa875 100644 --- a/test/integration/smoke/test_volumes.py +++ b/test/integration/smoke/test_volumes.py @@ -504,7 +504,7 @@ def test_07_resize_fail(self): # first, an invalid id cmd = resizeVolume.resizeVolumeCmd() cmd.id = "invalid id" - cmd.diskofferingid = self.services['resizeddiskofferingid'] + cmd.diskofferingid = self.services['customresizeddiskofferingid'] success = False try: self.apiClient.resizeVolume(cmd) @@ -636,7 +636,7 @@ def test_08_resize_volume(self): cmd = resizeVolume.resizeVolumeCmd() cmd.id = self.volume.id - cmd.diskofferingid = self.services['resizeddiskofferingid'] + cmd.diskofferingid = self.services['customresizeddiskofferingid'] self.apiClient.resizeVolume(cmd) From 588e3e37afdd5740816d1225d449164ed2024c03 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Wed, 18 Jun 2014 13:06:55 +0530 Subject: [PATCH 615/683] CLOUDSTACK-6887: Code enhancement to ensure better cleanup --- test/integration/component/test_accounts.py | 83 ++++++++++--------- .../component/test_add_remove_network.py | 68 +++++++++------ .../component/test_affinity_groups.py | 64 ++++++-------- .../integration/component/test_portable_ip.py | 22 ++--- .../integration/component/test_vpc_network.py | 10 +-- 5 files changed, 125 insertions(+), 122 deletions(-) diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index f71dea523d..a60a5beba8 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -272,8 +272,8 @@ def setUpClass(cls): cls.services["account"] ) - cls._cleanup = [ - cls.service_offering, + cls._cleanup = [cls.account, + cls.service_offering, ] return @@ -774,6 +774,13 @@ def setUpClass(cls): domainid=cls.domain_2.id ) + cls._cleanup = [ + cls.account_2, + cls.domain_2, + cls.account_1, + cls.domain_1, + ] + builtin_info = get_builtin_template_info(cls.api_client, cls.zone.id) cls.services["template"]["url"] = builtin_info[0] cls.services["template"]["hypervisor"] = builtin_info[1] @@ -794,14 +801,6 @@ def setUpClass(cls): # Wait for template status to be changed across time.sleep(60) - - cls._cleanup = [ - cls.account_2, - cls.domain_2, - cls.template, - cls.account_1, - cls.domain_1, - ] return @classmethod @@ -927,6 +926,13 @@ def setUpClass(cls): cls.services["service_offering"], domainid=cls.domain.id ) + + cls._cleanup = [ + cls.account_2, + cls.account_1, + cls.sub_domain, + cls.service_offering + ] cls.template = get_template( cls.api_client, cls.zone.id, @@ -950,12 +956,6 @@ def setUpClass(cls): domainid=cls.account_2.domainid, serviceofferingid=cls.service_offering.id ) - cls._cleanup = [ - cls.account_2, - cls.account_1, - cls.sub_domain, - cls.service_offering - ] return @classmethod @@ -1574,16 +1574,17 @@ def test_forceDeleteDomain(self): domainid=domain.id ) - self.debug("Creating a tiny service offering for VM deployment") - self.service_offering = ServiceOffering.create( + try: + self.debug("Creating a tiny service offering for VM deployment") + self.service_offering = ServiceOffering.create( self.apiclient, self.services["service_offering"], domainid=self.domain.id ) - self.debug("Deploying virtual machine in account 1: %s" % + self.debug("Deploying virtual machine in account 1: %s" % self.account_1.name) - vm_1 = VirtualMachine.create( + vm_1 = VirtualMachine.create( self.apiclient, self.services["virtual_machine"], templateid=self.template.id, @@ -1592,9 +1593,9 @@ def test_forceDeleteDomain(self): serviceofferingid=self.service_offering.id ) - self.debug("Deploying virtual machine in account 2: %s" % + self.debug("Deploying virtual machine in account 2: %s" % self.account_2.name) - vm_2 = VirtualMachine.create( + VirtualMachine.create( self.apiclient, self.services["virtual_machine"], templateid=self.template.id, @@ -1603,22 +1604,22 @@ def test_forceDeleteDomain(self): serviceofferingid=self.service_offering.id ) - networks = Network.list( + networks = Network.list( self.apiclient, account=self.account_1.name, domainid=self.account_1.domainid, listall=True ) - self.assertEqual( + self.assertEqual( isinstance(networks, list), True, "List networks should return a valid response" ) - network_1 = networks[0] - self.debug("Default network in account 1: %s is %s" % ( + network_1 = networks[0] + self.debug("Default network in account 1: %s is %s" % ( self.account_1.name, network_1.name)) - src_nat_list = PublicIPAddress.list( + src_nat_list = PublicIPAddress.list( self.apiclient, associatednetworkid=network_1.id, account=self.account_1.name, @@ -1626,44 +1627,48 @@ def test_forceDeleteDomain(self): listall=True, issourcenat=True, ) - self.assertEqual( + self.assertEqual( isinstance(src_nat_list, list), True, "List Public IP should return a valid source NAT" ) - self.assertNotEqual( + self.assertNotEqual( len(src_nat_list), 0, "Length of response from listPublicIp should not be 0" ) - src_nat = src_nat_list[0] + src_nat = src_nat_list[0] - self.debug( - "Trying to create a port forwarding rule in source NAT: %s" % + self.debug( + "Trying to create a port forwarding rule in source NAT: %s" % src_nat.ipaddress) - #Create NAT rule - nat_rule = NATRule.create( + #Create NAT rule + nat_rule = NATRule.create( self.apiclient, vm_1, self.services["natrule"], ipaddressid=src_nat.id ) - self.debug("Created PF rule on source NAT: %s" % src_nat.ipaddress) + self.debug("Created PF rule on source NAT: %s" % src_nat.ipaddress) - nat_rules = NATRule.list(self.apiclient, id=nat_rule.id) + nat_rules = NATRule.list(self.apiclient, id=nat_rule.id) - self.assertEqual( + self.assertEqual( isinstance(nat_rules, list), True, "List NAT should return a valid port forwarding rules" ) - self.assertNotEqual( + self.assertNotEqual( len(nat_rules), 0, "Length of response from listLbRules should not be 0" ) + except Exception as e: + self.clenaup.append(self.account_1) + self.cleanup.append(self.account_2) + self.fail(e) self.debug("Deleting domain with force option") try: @@ -1760,7 +1765,7 @@ def test_DeleteDomain(self): self.debug("Deploying virtual machine in account 2: %s" % self.account_2.name) - vm_2 = VirtualMachine.create( + VirtualMachine.create( self.apiclient, self.services["virtual_machine"], templateid=self.template.id, diff --git a/test/integration/component/test_add_remove_network.py b/test/integration/component/test_add_remove_network.py index 7479cee1de..4222f7afec 100644 --- a/test/integration/component/test_add_remove_network.py +++ b/test/integration/component/test_add_remove_network.py @@ -196,10 +196,13 @@ def setUpClass(cls): # Create Accounts & networks cls.services["isolated_network"]["zoneid"] = cls.zone.id cls.services["shared_network"]["zoneid"] = cls.zone.id + cls._cleanup = [] cls.account = Account.create(cls.api_client, cls.services["account"], domainid = cls.domain.id) + cls._cleanup.append(cls.account) cls.service_offering = ServiceOffering.create(cls.api_client,cls.services["service_offering"]) + cls._cleanup.append(cls.service_offering) cls.virtual_machine = VirtualMachine.create(cls.api_client, cls.services["virtual_machine"],accountid=cls.account.name, domainid=cls.account.domainid, serviceofferingid=cls.service_offering.id, @@ -207,6 +210,7 @@ def setUpClass(cls): # Create Shared Network Offering cls.isolated_network_offering = NetworkOffering.create(cls.api_client, cls.services["isolated_network_offering"]) + cls._cleanup.append(cls.isolated_network_offering) # Enable Isolated Network offering cls.isolated_network_offering.update(cls.api_client, state='Enabled') @@ -230,9 +234,8 @@ def setUpClass(cls): cls.shared_network = Network.create(cls.api_client,cls.services["shared_network"],cls.account.name, cls.account.domainid,networkofferingid=cls.shared_network_offering.id) - - cls._cleanup = [cls.account,cls.service_offering,cls.shared_network,cls.isolated_network_offering, - cls.shared_network_offering] + cls._cleanup.append(cls.shared_network) + cls._cleanup.append(cls.shared_network_offering) return def setUp(self): @@ -600,37 +603,40 @@ def test_24_add_nw_different_domain(self): network = None #The network which we are adding to the vm - self.child_domain_1 = Domain.create(self.apiclient, + try: + tempCleanupList = [] + self.child_domain_1 = Domain.create(self.apiclient, services=self.services["domain"], parentdomainid=self.domain.id) + tempCleanupList.append(self.child_domain_1) - self.child_do_admin_1 = Account.create( + self.child_do_admin_1 = Account.create( self.apiclient, self.services["account"], admin=True, domainid=self.child_domain_1.id ) + tempCleanupList.append(self.child_do_admin_1) - self.debug("Creating a domain under: %s" % self.domain.name) - - self.child_domain_2 = Domain.create(self.apiclient, + self.child_domain_2 = Domain.create(self.apiclient, services=self.services["domain"], parentdomainid=self.domain.id) + tempCleanupList.append(self.child_domain_2) - self.child_do_admin_2 = Account.create( + self.child_do_admin_2 = Account.create( self.apiclient, self.services["account"], admin=True, domainid=self.child_domain_2.id) + tempCleanupList.append(self.child_do_admin_2) + except Exception as e: + tempCleanupList.reverse() + self.cleanup += tempCleanupList + self.fail(e) network = Network.create(self.api_client,self.services["isolated_network"],self.child_do_admin_1.name, self.child_do_admin_1.domainid,networkofferingid=self.isolated_network_offering.id) - self.cleanup.append(self.child_do_admin_1) - self.cleanup.append(self.child_domain_1) - self.cleanup.append(self.child_do_admin_2) - self.cleanup.append(self.child_domain_2) - virtual_machine = VirtualMachine.create(self.apiclient, self.services["virtual_machine"],accountid=self.child_do_admin_2.name, domainid=self.child_do_admin_2.domainid, serviceofferingid=self.service_offering.id, mode=self.zone.networktype) @@ -661,12 +667,9 @@ def test_25_add_nw_above_account_limit(self): self.services["account"], domainid=self.domain.id ) - self.debug("create account %s" % account_1.name) - self.cleanup.append(account_1) self.debug("setting network limit of account: %s as 1" % account_1.name) - update_resource_limit( self.apiclient, 6, # Network @@ -742,22 +745,25 @@ def setUpClass(cls): # Create Accounts & networks cls.services["isolated_network"]["zoneid"] = cls.zone.id cls.services["shared_network"]["zoneid"] = cls.zone.id + cls._cleanup = [] cls.account = Account.create(cls.api_client,cls.services["account"],domainid = cls.domain.id) + cls._cleanup.append(cls.account) cls.service_offering = ServiceOffering.create(cls.api_client,cls.services["service_offering"]) + cls._cleanup.append(cls.service_offering) cls.virtual_machine = VirtualMachine.create(cls.api_client,cls.services["virtual_machine"],accountid=cls.account.name, domainid=cls.account.domainid,serviceofferingid=cls.service_offering.id, mode=cls.zone.networktype) # Create Shared Network Offering cls.isolated_network_offering = NetworkOffering.create(cls.api_client,cls.services["isolated_network_offering"]) + cls._cleanup.append(cls.isolated_network_offering) + # Enable Isolated Network offering cls.isolated_network_offering.update(cls.api_client, state='Enabled') cls.isolated_network = Network.create(cls.api_client,cls.services["isolated_network"],cls.account.name, cls.account.domainid,networkofferingid=cls.isolated_network_offering.id) - - cls._cleanup = [cls.account,cls.service_offering,cls.isolated_network_offering,] return def setUp(self): @@ -1139,21 +1145,25 @@ def setUpClass(cls): cls.services["virtual_machine"]["template"] = template.id # Create Accounts & networks cls.services["isolated_network"]["zoneid"] = cls.zone.id + cls._cleanup = [] cls.account = Account.create(cls.api_client,cls.services["account"],domainid = cls.domain.id) + cls._cleanup.append(cls.account) + cls.service_offering = ServiceOffering.create(cls.api_client,cls.services["service_offering"]) + cls._cleanup.append(cls.service_offering) cls.virtual_machine = VirtualMachine.create(cls.api_client,cls.services["virtual_machine"], accountid=cls.account.name,domainid=cls.account.domainid, serviceofferingid=cls.service_offering.id,mode=cls.zone.networktype) # Create Shared Network Offering cls.isolated_network_offering = NetworkOffering.create(cls.api_client,cls.services["isolated_network_offering"],) + cls._cleanup.append(cls.isolated_network_offering) + # Enable Isolated Network offering cls.isolated_network_offering.update(cls.api_client, state='Enabled') cls.isolated_network = Network.create(cls.api_client,cls.services["isolated_network"],cls.account.name, cls.account.domainid,networkofferingid=cls.isolated_network_offering.id) - - cls._cleanup = [cls.account,cls.service_offering,cls.isolated_network_offering,] return def setUp(self): @@ -1376,9 +1386,14 @@ def setUpClass(cls): # Create Accounts & networks cls.services["isolated_network"]["zoneid"] = cls.zone.id cls.services["shared_network"]["zoneid"] = cls.zone.id + cls._cleanup = [] cls.account = Account.create(cls.api_client,cls.services["account"],domainid = cls.domain.id) + cls.append(cls.account) + cls.service_offering = ServiceOffering.create(cls.api_client,cls.services["service_offering"]) + cls._cleanup.append(cls.service_offering) + cls.virtual_machine = VirtualMachine.create(cls.api_client,cls.services["virtual_machine"], accountid=cls.account.name,domainid=cls.account.domainid, serviceofferingid=cls.service_offering.id, @@ -1386,6 +1401,7 @@ def setUpClass(cls): # Create Shared Network Offering cls.isolated_network_offering = NetworkOffering.create(cls.api_client, cls.services["isolated_network_offering"],) + cls._cleanup.append(cls.isolated_network_offering) # Enable Isolated Network offering cls.isolated_network_offering.update(cls.api_client, state='Enabled') cls.isolated_network = Network.create(cls.api_client,cls.services["isolated_network"],cls.account.name, @@ -1393,8 +1409,6 @@ def setUpClass(cls): # Add network to VM cls.virtual_machine.add_nic(cls.api_client, cls.isolated_network.id) - - cls._cleanup = [cls.account,cls.service_offering,cls.isolated_network_offering,] return def setUp(self): @@ -1556,10 +1570,13 @@ def setUpClass(cls): # Create Accounts & networks cls.services["isolated_network"]["zoneid"] = cls.zone.id cls.services["shared_network"]["zoneid"] = cls.zone.id + cls._cleanup = [] cls.account = Account.create(cls.api_client, cls.services["account"], domainid = cls.domain.id) + cls._cleanup.append(cls.account) cls.service_offering = ServiceOffering.create(cls.api_client, cls.services["service_offering"]) + cls._cleanup.append(cls.service_offering) cls.virtual_machine = VirtualMachine.create(cls.api_client,cls.services["virtual_machine"], accountid=cls.account.name,domainid=cls.account.domainid, @@ -1569,6 +1586,7 @@ def setUpClass(cls): # Create Shared Network Offering cls.isolated_network_offering = NetworkOffering.create(cls.api_client, cls.services["isolated_network_offering"],) + cls._cleanup.append(cls.isolated_network_offering) # Enable Isolated Network offering cls.isolated_network_offering.update(cls.api_client, state='Enabled') @@ -1576,8 +1594,6 @@ def setUpClass(cls): cls.account.name,cls.account.domainid, networkofferingid=cls.isolated_network_offering.id) cls.virtual_machine.add_nic(cls.api_client, cls.isolated_network.id) - cls._cleanup = [cls.account,cls.service_offering, - cls.isolated_network_offering,] return def setUp(self): @@ -1711,8 +1727,6 @@ def test_23_update_nic_incorrect_vm_state(self): self.debug("Creating new account") account = Account.create(self.apiclient,self.services["account"],domainid = self.domain.id) - self.debug("Created account %s" % account.name) - self.cleanup.append(account) self.debug("Creating virtual machine in the account %s" % account.name) diff --git a/test/integration/component/test_affinity_groups.py b/test/integration/component/test_affinity_groups.py index d0fa2f7a3d..de5f007dbb 100644 --- a/test/integration/component/test_affinity_groups.py +++ b/test/integration/component/test_affinity_groups.py @@ -113,11 +113,14 @@ def setUpClass(cls): cls.services["template"] = cls.template.id cls.services["zoneid"] = cls.zone.id + cls._cleanup = [] + cls.account = Account.create( cls.api_client, cls.services["account"], domainid=cls.domain.id ) + cls._cleanup.append(cls.account) cls.services["account"] = cls.account.name cls.services["domainid"] = cls.domain.id @@ -126,11 +129,7 @@ def setUpClass(cls): cls.api_client, cls.services["service_offering"] ) - - cls._cleanup = [ - cls.service_offering, - cls.account, - ] + cls._cleanup.append(cls.service_offering) return def setUp(self): @@ -221,10 +220,9 @@ def test_03_user_create_aff_grp(self): self.user = Account.create(self.api_client, self.services["new_account"], domainid=self.domain.id) + self.cleanup.append(self.user) userapiclient = self.testClient.getUserApiClient(self.user.name, self.domain.name) - - self.cleanup.append(self.user) aff_grp = self.create_aff_grp(api_client=userapiclient, aff_grp=self.services["host_anti_affinity"], acc=self.user.name, domainid=self.domain.id) aff_grp.delete(userapiclient) @@ -309,11 +307,14 @@ def setUpClass(cls): cls.services["template"] = cls.template.id cls.services["zoneid"] = cls.zone.id + cls._cleanup = [] + cls.account = Account.create( cls.api_client, cls.services["account"], domainid=cls.domain.id ) + cls._cleanup.append(cls.account) cls.services["account"] = cls.account.name cls.services["domainid"] = cls.domain.id @@ -322,12 +323,7 @@ def setUpClass(cls): cls.api_client, cls.services["service_offering"] ) - - cls.__cleanup = [ - cls.service_offering, - cls.account, - ] - + cls._cleanup.append(cls.service_offering) # Create multiple Affinity Groups return @@ -558,11 +554,14 @@ def setUpClass(cls): cls.services["template"] = cls.template.id cls.services["zoneid"] = cls.zone.id + cls._cleanup = [] + cls.account = Account.create( cls.api_client, cls.services["account"], domainid=cls.domain.id ) + cls._cleanup.append(cls.account) cls.services["account"] = cls.account.name cls.services["domainid"] = cls.domain.id @@ -571,12 +570,7 @@ def setUpClass(cls): cls.api_client, cls.services["service_offering"] ) - - cls.__cleanup = [ - cls.service_offering, - cls.account, - ] - + cls._cleanup.append(cls.service_offering) # Create multiple Affinity Groups return @@ -831,11 +825,14 @@ def setUpClass(cls): cls.services["template"] = cls.template.id cls.services["zoneid"] = cls.zone.id + cls._cleanup = [] + cls.account = Account.create( cls.api_client, cls.services["account"], domainid=cls.domain.id ) + cls._cleanup.append(cls.account) cls.services["account"] = cls.account.name cls.services["domainid"] = cls.domain.id @@ -844,12 +841,7 @@ def setUpClass(cls): cls.api_client, cls.services["service_offering"] ) - - cls.__cleanup = [ - cls.service_offering, - cls.account, - ] - + cls._cleanup.append(cls.service_offering) # Create multiple Affinity Groups return @@ -1118,11 +1110,14 @@ def setUpClass(cls): cls.services["template"] = cls.template.id cls.services["zoneid"] = cls.zone.id + cls._cleanup = [] + cls.account = Account.create( cls.api_client, cls.services["account"], domainid=cls.domain.id ) + cls._cleanup.append(cls.account) cls.services["account"] = cls.account.name cls.services["domainid"] = cls.domain.id @@ -1131,13 +1126,7 @@ def setUpClass(cls): cls.api_client, cls.services["service_offering"] ) - - cls.__cleanup = [ - cls.service_offering, - cls.account, - ] - - # Create multiple Affinity Groups + cls._cleanup.append(cls.service_offering) return def setUp(self): @@ -1468,11 +1457,14 @@ def setUpClass(cls): cls.services["template"] = cls.template.id cls.services["zoneid"] = cls.zone.id + cls._cleanup = [] + cls.account = Account.create( cls.api_client, cls.services["account"], domainid=cls.domain.id ) + cls._cleanup.append(cls.account) cls.services["account"] = cls.account.name cls.services["domainid"] = cls.domain.id @@ -1481,13 +1473,7 @@ def setUpClass(cls): cls.api_client, cls.services["service_offering"] ) - - cls.__cleanup = [ - cls.service_offering, - cls.account, - ] - - # Create multiple Affinity Groups + cls._cleanup.append(cls.service_offering) return def setUp(self): diff --git a/test/integration/component/test_portable_ip.py b/test/integration/component/test_portable_ip.py index 538318db43..b9c9059d2b 100644 --- a/test/integration/component/test_portable_ip.py +++ b/test/integration/component/test_portable_ip.py @@ -235,6 +235,7 @@ def test_create_portable_ip_range_non_root_admin(self): self.services["account"], domainid=self.domain.id ) + self.cleanup.append(self.account) self.api_client_user = self.testClient.getUserApiClient( UserName=self.account.name, @@ -597,6 +598,7 @@ def setUpClass(cls): domainid=cls.domain.id, admin=True ) + cls._cleanup = [cls.account, ] cls.network_offering = NetworkOffering.create( cls.api_client, @@ -615,8 +617,6 @@ def setUpClass(cls): networkofferingid=cls.network_offering.id, zoneid=cls.zone.id ) - - cls._cleanup = [cls.account] return @classmethod @@ -907,6 +907,7 @@ def setUpClass(cls): # Set Zones and disk offerings cls.services["small"]["zoneid"] = cls.zone.id cls.services["small"]["template"] = template.id + cls._cleanup = [] cls.account = Account.create( cls.api_client, @@ -914,11 +915,13 @@ def setUpClass(cls): domainid=cls.domain.id, admin=True ) + cls._cleanup.append(cls.account) cls.service_offering = ServiceOffering.create( cls.api_client, cls.services["service_offering"] ) + cls._cleanup.append(cls.service_offering) cls.network_offering = NetworkOffering.create( cls.api_client, @@ -928,6 +931,7 @@ def setUpClass(cls): # Enable Network offering cls.network_offering.update(cls.api_client, state='Enabled') + cls._cleanup.append(cls.network_offering) cls.network = Network.create( cls.api_client, @@ -947,12 +951,6 @@ def setUpClass(cls): networkids = [cls.network.id], mode=cls.services['mode'] ) - - cls._cleanup = [ - cls.account, - cls.service_offering, - cls.network_offering - ] return @classmethod @@ -1177,6 +1175,7 @@ def setUp(self): domainid=self.domain.id, admin=True ) + self.cleanup.append(self.account) portable_ip_range_services["regionid"] = self.region.id #create new portable ip range new_portable_ip_range = PortablePublicIpRange.create(self.apiclient, @@ -1200,7 +1199,6 @@ def setUp(self): ) self.cleanup.append(self.network_offering) except Exception as e: - self.cleanup.append(self.account) self.fail("Exception in setupClass: %s" % e) return @@ -1353,6 +1351,8 @@ def setUpClass(cls): cls.services["vm2"]["zoneid"] = cls.zone.id cls.services["vm2"]["template"] = template.id + cls._cleanup = [] + # Set Zones and Network offerings cls.account = Account.create( cls.api_client, @@ -1360,12 +1360,14 @@ def setUpClass(cls): domainid=cls.domain.id, admin=True ) + cls._cleanup.append(cls.account) cls.network_offering = NetworkOffering.create( cls.api_client, cls.services["network_offering"], conservemode=False ) + cls._cleanup.append(cls.network_offering) # Enable Network offering cls.network_offering.update(cls.api_client, state='Enabled') @@ -1407,8 +1409,6 @@ def setUpClass(cls): serviceofferingid=cls.service_offering.id, networkids = [cls.network2.id], ) - cls._cleanup = [cls.account, cls.network_offering] - return @classmethod diff --git a/test/integration/component/test_vpc_network.py b/test/integration/component/test_vpc_network.py index a449948c91..c5d9da6f25 100644 --- a/test/integration/component/test_vpc_network.py +++ b/test/integration/component/test_vpc_network.py @@ -294,8 +294,7 @@ def setUp(self): admin=True, domainid=self.domain.id ) - self.cleanup = [] - self.cleanup.insert(0, self.account) + self.cleanup = [self.account, ] return def tearDown(self): @@ -1056,8 +1055,7 @@ def setUp(self): admin=True, domainid=self.domain.id ) - self.cleanup = [] - self.cleanup.insert(0, self.account) + self.cleanup = [self.account, ] return def tearDown(self): @@ -1516,6 +1514,7 @@ def test_05_create_network_diff_account(self, value): admin=True, domainid=self.domain.id ) + self.cleanup.append(account) # Creating network using the network offering created self.debug("Creating network from diff account than VPC") @@ -1584,8 +1583,7 @@ def setUp(self): admin=True, domainid=self.domain.id ) - self.cleanup = [] - self.cleanup.insert(0, self.account) + self.cleanup = [self.account, ] return def tearDown(self): From 095be48314c96b74ed18280a95d710071482d2d6 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Wed, 18 Jun 2014 13:18:04 +0530 Subject: [PATCH 616/683] Fixing indetation issue --- tools/marvin/marvin/lib/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/marvin/marvin/lib/common.py b/tools/marvin/marvin/lib/common.py index 42ffc51520..7b0c7ad445 100644 --- a/tools/marvin/marvin/lib/common.py +++ b/tools/marvin/marvin/lib/common.py @@ -1322,7 +1322,7 @@ def isVmExpunged(apiclient, vmid, projectid=None, timeout=600): timeout -= 60 time.sleep(60) except Exception: - vmExpunged = True + vmExpunged = True break #end while return vmExpunged From 21e452ff4f0459422f0612f2ddf7033a963b0a19 Mon Sep 17 00:00:00 2001 From: Rajesh Battala Date: Wed, 18 Jun 2014 15:42:23 +0530 Subject: [PATCH 617/683] CLOUDSTACK-6920 Support listing of LBHealthcheck policy with LBHealthcheck policy ID --- .../network/lb/LoadBalancingRulesService.java | 2 ++ .../ListLBHealthCheckPoliciesCmd.java | 21 +++++++++++++++++-- .../lb/LoadBalancingRulesManagerImpl.java | 16 ++++++++++++-- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java index 3e1101453c..50b39d2f33 100644 --- a/api/src/com/cloud/network/lb/LoadBalancingRulesService.java +++ b/api/src/com/cloud/network/lb/LoadBalancingRulesService.java @@ -161,4 +161,6 @@ LoadBalancer createPublicLoadBalancerRule(String xId, String name, String descri HealthCheckPolicy updateLBHealthCheckPolicy(long id, String customId, Boolean forDisplay); LoadBalancer findLbByStickinessId(long stickinessPolicyId); + + Long findLBIdByHealtCheckPolicyId(long lbHealthCheckPolicy); } diff --git a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java index 7f78da6409..3f2082af5c 100644 --- a/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java +++ b/api/src/org/apache/cloudstack/api/command/user/loadbalancer/ListLBHealthCheckPoliciesCmd.java @@ -29,6 +29,8 @@ import org.apache.cloudstack.api.response.ListResponse; import org.apache.log4j.Logger; + +import com.cloud.exception.InvalidParameterValueException; import com.cloud.network.rules.HealthCheckPolicy; import com.cloud.network.rules.LoadBalancer; @@ -45,13 +47,15 @@ public class ListLBHealthCheckPoliciesCmd extends BaseListCmd { @Parameter(name = ApiConstants.LBID, type = CommandType.UUID, entityType = FirewallRuleResponse.class, - required = true, description = "the ID of the load balancer rule") private Long lbRuleId; @Parameter(name = ApiConstants.FOR_DISPLAY, type = CommandType.BOOLEAN, description = "list resources by display flag; only ROOT admin is eligible to pass this parameter", since = "4.4", authorized = {RoleType.Admin}) private Boolean display; + @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = LBHealthCheckResponse.class, description = "the ID of the healthcheck policy", since = "4.4") + private Long id; + // /////////////////////////////////////////////////// // ///////////////// Accessors /////////////////////// // /////////////////////////////////////////////////// @@ -59,6 +63,10 @@ public Long getLbRuleId() { return lbRuleId; } + public Long getId() { + return id; + } + public boolean getDisplay() { if (display != null) { return display; @@ -78,9 +86,18 @@ public String getCommandName() { @Override public void execute() { List hcpResponses = new ArrayList(); - LoadBalancer lb = _lbService.findById(getLbRuleId()); ListResponse response = new ListResponse(); + Long lbRuleId = getLbRuleId(); + Long hId = getId(); + if(lbRuleId == null) { + if(hId != null) { + lbRuleId = _lbService.findLBIdByHealtCheckPolicyId(hId); + } else { + throw new InvalidParameterValueException("Either LB Ruleid or HealthCheckpolicy Id should be specified"); + } + } + LoadBalancer lb = _lbService.findById(lbRuleId); if (lb != null) { List healthCheckPolicies = _lbService.searchForLBHealthCheckPolicies(this); LBHealthCheckResponse spResponse = _responseGenerator.createLBHealthCheckPolicyResponse(healthCheckPolicies, lb); diff --git a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java index 6358252bdc..e29d8c39e7 100755 --- a/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java +++ b/server/src/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java @@ -2239,15 +2239,18 @@ public List searchForLBStickinessPolicies(ListLBStickiness public List searchForLBHealthCheckPolicies(ListLBHealthCheckPoliciesCmd cmd) throws PermissionDeniedException { Account caller = CallContext.current().getCallingAccount(); Long loadBalancerId = cmd.getLbRuleId(); + Long policyId = cmd.getId(); boolean forDisplay = cmd.getDisplay(); - + if(loadBalancerId == null) { + loadBalancerId = findLBIdByHealtCheckPolicyId(policyId); + } LoadBalancerVO loadBalancer = _lbDao.findById(loadBalancerId); if (loadBalancer == null) { return null; } _accountMgr.checkAccess(caller, null, true, loadBalancer); - List hcDbpolicies = _lb2healthcheckDao.listByLoadBalancerIdAndDisplayFlag(cmd.getLbRuleId(), forDisplay); + List hcDbpolicies = _lb2healthcheckDao.listByLoadBalancerIdAndDisplayFlag(loadBalancerId, forDisplay); return hcDbpolicies; } @@ -2545,4 +2548,13 @@ public HealthCheckPolicy updateLBHealthCheckPolicy(long id, String customId, Boo return _lb2healthcheckDao.findById(id); } + @Override + public Long findLBIdByHealtCheckPolicyId(long lbHealthCheckPolicy) { + LBHealthCheckPolicyVO policy= _lb2healthcheckDao.findById(lbHealthCheckPolicy); + if(policy != null) { + return policy.getLoadBalancerId(); + } + return null; + } + } From 7e4303821570d58ad962c85a1a3bd6dbf32f8d73 Mon Sep 17 00:00:00 2001 From: Gaurav Aradhye Date: Wed, 18 Jun 2014 16:26:13 +0530 Subject: [PATCH 618/683] CLOUDSTACK-6932: Removing redundant file test_escalations.py --- .../integration/component/test_escalations.py | 8202 ----------------- 1 file changed, 8202 deletions(-) delete mode 100644 test/integration/component/test_escalations.py diff --git a/test/integration/component/test_escalations.py b/test/integration/component/test_escalations.py deleted file mode 100644 index 1b596a72b6..0000000000 --- a/test/integration/component/test_escalations.py +++ /dev/null @@ -1,8202 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -#Import Local Modules -from marvin.cloudstackTestCase import cloudstackTestCase -from marvin.cloudstackAPI import (createVolume, - createTemplate) -from marvin.lib.base import (Volume, - Iso, - VirtualMachine, - Template, - Snapshot, - SecurityGroup, - Account, - Zone, - Network, - NetworkOffering, - DiskOffering, - ServiceOffering, - VmSnapshot, - SnapshotPolicy, - SSHKeyPair, - Resources, - Configurations, - VpnCustomerGateway, - Hypervisor) -from marvin.lib.common import (get_zone, - get_domain, - get_template, - list_os_types) -from marvin.lib.utils import (validateList, - cleanup_resources, - random_gen) -from marvin.codes import (PASS, EMPTY_LIST) -from nose.plugins.attrib import attr -import time - -class TestVolumes(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - - cls.testClient = super(TestVolumes, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - if cls.zone.localstorageenabled: - cls.storagetype = 'local' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' - cls.services["disk_offering"]["storagetype"] = 'local' - else: - cls.storagetype = 'shared' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' - cls.services["disk_offering"]["storagetype"] = 'shared' - - cls.services['mode'] = cls.zone.networktype - cls.services["virtual_machine"]["hypervisor"] = 'XenServer' - cls.services["virtual_machine"]["zoneid"] = cls.zone.id - cls.services["virtual_machine"]["template"] = cls.template.id - cls.services["custom_volume"]["zoneid"] = cls.zone.id - - # Creating Disk offering, Service Offering and Account - cls.disk_offering = DiskOffering.create( - cls.api_client, - cls.services["disk_offering"] - ) - cls.service_offering = ServiceOffering.create( - cls.api_client, - cls.services["service_offerings"]["tiny"] - ) - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - - # Creating Virtual Machine - cls.virtual_machine = VirtualMachine.create( - cls.userapiclient, - cls.services["virtual_machine"], - accountid=cls.account.name, - domainid=cls.account.domainid, - serviceofferingid=cls.service_offering.id, - ) - cls._cleanup = [ - cls.virtual_machine, - cls.disk_offering, - cls.service_offering, - cls.account - ] - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created volumes - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cls.apiclient = super(TestVolumes, cls).getClsTestClient().getApiClient() - cleanup_resources(cls.apiclient, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - - def __verify_values(self, expected_vals, actual_vals): - """ - @summary: Function to verify expected and actual values - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_01_list_volumes_pagination(self): - """ - @summary: Test List Volumes pagination - - Step1: Listing all the volumes for a user - Step2: Verifying listed volumes for account created at class level - Step3: If number of volumes is less than (page size + 1), then creating them - Step4: Listing all the volumes again after creation of volumes - Step5: Verifying the length of the volumes is (page size + 1) - Step6: Listing all the volumes in page1 - Step7: Verifying that the length of the volumes in page 1 is (page size) - Step8: Listing all the volumes in page2 - Step9: Verifying that the length of the volumes in page 2 is 1 - Step10: Deleting the volume present in page 2 - Step11: Listing for the volumes on page 2 - Step12: Verifying that there are no volumes present in page 2 - """ - # Listing all the volumes for a user - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - # Verifying listed volumes for account created at class level - self.assertIsNotNone( - list_volumes_before, - "create volume from VM failed at class setup method" - ) - self.assertEqual( - len(list_volumes_before), - 1, - "more than 1 volume created from VM at class level" - ) - - # If number of volumes is less than (pagesize + 1), then creating them - for i in range(0, (self.services["pagesize"])): - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - self.assertIsNotNone( - volume_created, - "Volume is not created" - ) - if(i < (self.services["pagesize"] - 1)): - self.cleanup.append(volume_created) - - self.assertEqual( - self.services["volume"]["diskname"], - volume_created.name, - "Newly created volume name and the test data volume name are not matching" - ) - - # Listing all the volumes again after creation of volumes - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - # Verifying the length of the volumes is (page size + 1) - self.assertEqual( - len(list_volumes_after), - (self.services["pagesize"] + 1), - "Number of volumes created is not matching expected" - ) - - # Listing all the volumes in page1 - list_volumes_page1 = Volume.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"] - ) - self.assertIsNotNone( - list_volumes_page1, - "No volumes found in Page 1" - ) - # Verifying that the length of the volumes in page 1 is (page size) - self.assertEqual( - len(list_volumes_page1), - self.services["pagesize"], - "List Volume response is not matching with the page size length for page 1" - ) - - # Listing all the volumes in page2 - list_volumes_page2 = Volume.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - self.assertIsNotNone( - list_volumes_page2, - "No volumes found in Page 2" - ) - # Verifying that the length of the volumes in page 2 is 1 - self.assertEqual( - len(list_volumes_page2), - 1, - "List Volume response is not matching with the page size length for page 2" - ) - volume_page2 = list_volumes_page2[0] - - # Verifying that the volume on page 2 is not present in page1 - for i in range(0, len(list_volumes_page1)): - volume_page1 = list_volumes_page1[i] - self.assertNotEquals( - volume_page2.id, - volume_page1.id, - "Volume listed in page 2 is also listed in page 1" - ) - - # Deleting a single volume - Volume.delete(volume_created, self.userapiclient) - - # Listing the volumes in page 2 - list_volume_response = Volume.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - # verifying that volume does not exists on page 2 - self.assertEqual( - list_volume_response, - None, - "Volume was not deleted" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_02_list_volume_byid(self): - """ - @summary: Test List Volumes with Id - - Step1: Listing all the volumes for a user before creating a data volume - Step2: Verifying the length of the list as 1 - Step3: Creating a data volume - Step4: Listing all the volumes for a user after creating a data volume - Step5: Verifying the list volume size is increased by 1 - Step6: List the volumes by specifying root volume Id - Step7: Verifying the details of the root volume - Step8: List the volumes by specifying data volume Id - Step9: Verifying the details of the data volume - """ - # Listing all the volumes for a user before creating a data volume - list_volumes_before = Volume.list( - self.userapiclient, - listall=self.services["listall"] - ) - self.assertIsNotNone( - list_volumes_before, - "create volume from VM failed at class setup method") - # Verifying the length of the list as 1 - self.assertEqual( - len(list_volumes_before), - 1, - "more than 1 volume created at class level" - ) - root_volume = list_volumes_before[0] - - # Creating a data volume - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - self.assertIsNotNone( - volume_created, - "Volume is not created" - ) - self.cleanup.append(volume_created) - - self.assertEqual( - self.services["volume"]["diskname"], - volume_created.name, - "Newly created volume name and the test data volume name are not matching" - ) - # Listing all the volumes for a user after creating a data volume - list_volumes_after = Volume.list( - self.userapiclient, - listall=self.services["listall"] - ) - self.assertIsNotNone( - list_volumes_after, - "Volume creation failed" - ) - # Verifying the list volume size is increased by 1 - self.assertEqual( - len(list_volumes_before) + 1, - len(list_volumes_after), - "list volume is not matching with Number of volumes created" - ) - - # Listing a Root Volume by Id and verifying the volume details - list_volumes_by_id = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=root_volume.id - ) - self.assertIsNotNone( - list_volumes_by_id, - "Root volume is not listed" - ) - self.assertEqual( - 1, - len(list_volumes_by_id), - "list volume is not matching with Number of volumes created" - ) - obtained_volume = list_volumes_by_id[0] - - #Creating expected and actual values dictionaries - expected_dict = { - "id":root_volume.id, - "name":root_volume.name, - "vmname":self.virtual_machine.name, - "state":"Ready", - "type":"ROOT", - "zoneid":self.zone.id, - "account":self.account.name, - "storagetype":self.storagetype, - "size":self.template.size - } - actual_dict = { - "id":obtained_volume.id, - "name":obtained_volume.name, - "vmname":obtained_volume.vmname, - "state":obtained_volume.state, - "type":obtained_volume.type, - "zoneid":obtained_volume.zoneid, - "account":obtained_volume.account, - "storagetype":obtained_volume.storagetype, - "size":obtained_volume.size, - } - root_volume_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - root_volume_status, - "Listed Root Volume details are not as expected" - ) - # Listing a Data Volume by Id and verifying the volume details - list_volumes_by_id = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - self.assertIsNotNone( - list_volumes_by_id, - "Data volume is not listed" - ) - self.assertEqual( - len(list_volumes_by_id), - 1, - "list volume is not matching with Number of volumes created" - ) - obtained_volume = list_volumes_by_id[0] - - #Creating expected and actual values dictionaries - expected_dict = { - "id":volume_created.id, - "name":volume_created.name, - "state":"Allocated", - "type":"DATADISK", - "zoneid":self.zone.id, - "account":self.account.name, - "storagetype":self.storagetype, - "size":self.disk_offering.disksize - } - actual_dict = { - "id":obtained_volume.id, - "name":obtained_volume.name, - "state":obtained_volume.state, - "type":obtained_volume.type, - "zoneid":obtained_volume.zoneid, - "account":obtained_volume.account, - "storagetype":obtained_volume.storagetype, - "size":obtained_volume.size/(1024*1024*1024), - } - root_volume_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - root_volume_status, - "Listed Data Volume details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_03_data_volume_resize(self): - """ - @summary: Test to verify creation and resize of data volume - - Step1: Listing the volumes for a user before creating data volume - Step2: Creating a data volume - Step3: Listing the volumes for a user after creating data volume - Step4: Attaching and Detaching data volume created to Virtual Machine - Step5: Verifying if there exists a disk offering with higher size - If not present creating it - Step6: Resizing data volume - """ - # Listing volumes for a user before creating a volume - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - # Creating a data volume - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - self.assertIsNotNone(volume_created, "Data volume creation failed") - - self.cleanup.append(volume_created) - - # Listing volumes for a user after creating data volume - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Data volume creation failed" - ) - - # Attaching data volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - - # Detaching data volume from Virtual Machine - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - - # Verifying if there exists a disk offering with higher size. If not present creating it - list_disk_offerings = DiskOffering.list(self.apiClient) - - large_disk_offering_exists = False - # Converting disk_size in bytes to GB - current_disk_size = volume_created.size/(1024*1024*1024) - - for disk_offering in list_disk_offerings: - if ((disk_offering.disksize > current_disk_size) and (not disk_offering.iscustomized) and disk_offering.storagetype == self.storagetype): - new_disk_offering = disk_offering - large_disk_offering_exists = True - break - - if large_disk_offering_exists == False: - new_size = (volume_created.size/(1024*1024*1024)) + 1 - self.services["disk_offering"]["disksize"] = new_size - new_disk_offering = DiskOffering.create( - self.apiClient, - self.services["disk_offering"] - ) - if new_disk_offering is not None: - self.cleanup.append(new_disk_offering) - else: - new_size = new_disk_offering.disksize - - # Resizing data volume - resized_volume = volume_created.resize( - self.userapiclient, - diskofferingid=new_disk_offering.id, - shrinkok='false', - ) - self.assertIsNotNone(resized_volume, "Resize Volume failed") - # Verifying data volume size is increased - self.assertEquals( - new_size, - (resized_volume.size/(1024*1024*1024)), - "volume not resized to expected value" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_04_custom_volume_resize(self): - """ - @summary: Test to verify creation and resize of custom volume - - Step1: Checking if Custom disk offering already exists. - If not present then creating custom Disk Offering - Step2: Listing the volumes for a user before creating custom volume - Step3: Creating a custom volume - Step4: Listing the volumes for a user after creating custom volume - Step5: Attaching and Detaching custom volume created to Virtual Machine - Step6: Resizing custom volume - """ - # Listing all the disk offerings - list_disk_offerings = DiskOffering.list(self.apiClient) - - custom_disk_offering_exists = False - - # Verifying if a custom disk offering already exists - if list_disk_offerings is not None: - for disk_offering in list_disk_offerings: - if (disk_offering.iscustomized and disk_offering.storagetype == self.storagetype): - custom_disk_offering = disk_offering - custom_disk_offering_exists = True - break - - # If a custom disk offering does not exists, then creating a custom disk offering - if custom_disk_offering_exists == False: - custom_disk_offering = DiskOffering.create( - self.apiClient, - self.services["disk_offering"], - custom=True - ) - if custom_disk_offering is not None: - self.cleanup.append(custom_disk_offering) - - # Listing the volumes for a user before creating custom volume - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - # Creating a custom volume - volume_created = Volume.create_custom_disk( - self.userapiclient, - self.services["custom_volume"], - account=self.account.name, - domainid=self.account.domainid, - diskofferingid=custom_disk_offering.id - ) - self.assertIsNotNone( - volume_created, - "Custom volume did not get created" - ) - - self.cleanup.append(volume_created) - - # Listing the volumes for a user after creating custom volume - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - # Verifyign that volume list is increased by 1 after creation of custion volume - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Custom volume did not get created" - ) - - # Attaching custom volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - - # Detaching custom volume from Virtual Machine - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - - # Resizing custom volume - # Increasing custom disk size by 1 - new_size = self.services["custom_volume"]["customdisksize"] + 1 - resized_volume = volume_created.resize( - self.userapiclient, - diskofferingid=custom_disk_offering.id, - shrinkok='false', - size=new_size) - self.assertIsNotNone(resized_volume, "Resize Volume failed") - # Verifying that custom disk size is increased - self.assertEquals( - new_size, - (resized_volume.size/(1024*1024*1024)), - "volume not resized to expected value" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_05_volume_snapshot(self): - """ - @summary: Test to verify creation of snapshot from volume and creation of template, volume from snapshot - - Step1: Creating a volume - Step2: Attaching and Detaching custom volume created to Virtual Machine - Step3: Creating Snapshot from volume - Step4: Creating Volume from snapshot - Step5: Creating Template from Snapshot - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - - self.assertIsNotNone(volume_created, "Volume not created") - - if volume_created is not None: - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - # Attaching and Detaching custom volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - # Creating Snapshot from volume - snapshot_created = Snapshot.create( - self.userapiclient, - volume_created.id, - ) - - self.assertIsNotNone(snapshot_created, "Snapshot not created") - - self.cleanup.append(snapshot_created) - - #Creating expected and actual values dictionaries - expected_dict = { - "id":volume_created.id, - "intervaltype":"MANUAL", - "snapshottype":"MANUAL", - "volumetype":volume_created.type, - "domain":self.domain.id - } - actual_dict = { - "id":snapshot_created.volumeid, - "intervaltype":snapshot_created.intervaltype, - "snapshottype":snapshot_created.snapshottype, - "volumetype":snapshot_created.volumetype, - "domain":snapshot_created.domainid, - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Snapshot created from Volume details are not as expected" - ) - # Creating Volume from snapshot - cmd = createVolume.createVolumeCmd() - cmd.name = "-".join([self.services["volume"]["diskname"], random_gen()]) - cmd.snapshotid = snapshot_created.id - - volume_from_snapshot = Volume(self.userapiclient.createVolume(cmd).__dict__) - - self.assertIsNotNone( - volume_from_snapshot, - "Volume creation failed from snapshot" - ) - self.cleanup.append(volume_from_snapshot) - - #Creating expected and actual values dictionaries - expected_dict = { - "snapshotid":snapshot_created.id, - "volumetype":snapshot_created.volumetype, - "size":self.disk_offering.disksize, - "accounr":self.account.name, - "domain":self.domain.id, - "storagetype":self.storagetype, - "zone":self.zone.id - } - actual_dict = { - "snapshotid":volume_from_snapshot.snapshotid, - "volumetype":volume_from_snapshot.type, - "size":volume_from_snapshot.size/(1024*1024*1024), - "accounr":volume_from_snapshot.account, - "domain":volume_from_snapshot.domainid, - "storagetype":volume_from_snapshot.storagetype, - "zone":volume_from_snapshot.zoneid, - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Volume created from Snapshot details are not as expected" - ) - # Creating Template from Snapshot - list_templates_before = Template.list(self.userapiclient, templatefilter='self') - - if list_templates_before is None: - templates_before_size = 0 - else: - templates_before_size = len(list_templates_before) - - cmd = createTemplate.createTemplateCmd() - cmd.name = self.services["ostype"] - cmd.displaytext = self.services["ostype"] - cmd.ostypeid = self.template.ostypeid - cmd.snapshotid = snapshot_created.id - cmd.ispublic = False - cmd.passwordenabled = False - - template_from_snapshot = Template(self.userapiclient.createTemplate(cmd).__dict__) - - self.assertIsNotNone( - template_from_snapshot, - "Template creation failed from snapshot" - ) - - self.cleanup.append(template_from_snapshot) - - #Creating expected and actual values dictionaries - expected_dict = { - "name":self.services["ostype"], - "ostypeid":self.template.ostypeid, - "type":"USER", - "zone":self.zone.id, - "domain":self.domain.id, - "account":self.account.name, - "passwordenabled":False, - "ispublic":False, - "size":self.disk_offering.disksize - } - actual_dict = { - "name":template_from_snapshot.name, - "ostypeid":template_from_snapshot.ostypeid, - "type":template_from_snapshot.templatetype, - "zone":template_from_snapshot.zoneid, - "domain":template_from_snapshot.domainid, - "account":template_from_snapshot.account, - "passwordenabled":template_from_snapshot.passwordenabled, - "ispublic":template_from_snapshot.ispublic, - "size":template_from_snapshot.size/(1024*1024*1024) - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Template created from Snapshot details are not as expected" - ) - - list_templates_after = Template.list(self.userapiclient, templatefilter='self') - - self.assertEquals( - templates_before_size + 1, - len(list_templates_after), - "Template creation failed from snapshot" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_06_volume_snapshot_policy_hourly(self): - """ - @summary: Test to verify creation of Hourly Snapshot policies from volume - - Step1: Creating a Volume. - Step2: Attaching volume created in Step2 to virtual machine - Step3: Detaching the volume created in step2 from virtual machine - Step4: Listing snapshot policies for a volume created in step1 - Step5: Creating Hourly snapshot policy - Step6: Listing snapshot policies for a volume created in step1 again - Step7: Verifyign that the list snapshot policy length is increased by 1 - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - - self.assertIsNotNone(volume_created, "Volume not created") - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - - # Attaching volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - # Detaching volume created from Virtual Machine - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - # Creating Hourly Snapshot Policy from volume - self.services["recurring_snapshot"]["intervaltype"] = 'hourly' - self.services["recurring_snapshot"]["schedule"] = '1' - - list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - snapshot_policy_before_size = 0 - - if list_snapshot_policy_before is not None: - snapshot_policy_before_size = len(list_snapshot_policy_before) - - snapshot_policy_hourly = SnapshotPolicy.create( - self.userapiclient, - volume_created.id, - self.services["recurring_snapshot"] - ) - self.assertIsNotNone( - snapshot_policy_hourly, - "Hourly Snapshot policy creation failed" - ) - #Creating expected and actual values dictionaries - expected_dict = { - "schedule":self.services["recurring_snapshot"]["schedule"], - "intervaltype":0, - "volumeid":volume_created.id - } - actual_dict = { - "schedule":snapshot_policy_hourly.schedule, - "intervaltype":snapshot_policy_hourly.intervaltype, - "volumeid":snapshot_policy_hourly.volumeid - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Hourly Snapshot Policy details are not as expected" - ) - - list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - self.assertIsNotNone( - list_snapshot_policy_after, - "Hourly Snapshot policy creation failed" - ) - self.assertEquals( - snapshot_policy_before_size + 1, - len(list_snapshot_policy_after), - "Hourly Snapshot policy creation failed" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_07_volume_snapshot_policy_daily(self): - """ - @summary: Test to verify creation of Daily Snapshot policies from volume - - Step1: Creating a Volume. - Step2: Attaching volume created in Step2 to virtual machine - Step3: Detaching the volume created in step2 from virtual machine - Step4: Listing snapshot policies for a volume created in step1 - Step5: Creating Daily snapshot policy - Step6: Listing snapshot policies for a volume created in step1 again - Step7: Verifyign that the list snapshot policy length is increased by 1 - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - - self.assertIsNotNone(volume_created, "Volume not created") - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - # Attaching volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - # Detaching volume created from Virtual Machine - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - # Creating Daily Snapshot Policy from volume - self.services["recurring_snapshot"]["intervaltype"] = 'daily' - self.services["recurring_snapshot"]["schedule"] = '00:00' - - list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - snapshot_policy_before_size = 0 - - if list_snapshot_policy_before is not None: - snapshot_policy_before_size = len(list_snapshot_policy_before) - - snapshot_policy_daily = SnapshotPolicy.create( - self.userapiclient, - volume_created.id, - self.services["recurring_snapshot"] - ) - self.assertIsNotNone( - snapshot_policy_daily, - "Daily Snapshot policy creation failed" - ) - #Creating expected and actual values dictionaries - expected_dict = { - "schedule":self.services["recurring_snapshot"]["schedule"], - "intervaltype":1, - "volumeid":volume_created.id - } - actual_dict = { - "schedule":snapshot_policy_daily.schedule, - "intervaltype":snapshot_policy_daily.intervaltype, - "volumeid":snapshot_policy_daily.volumeid - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Daily Snapshot Policy details are not as expected" - ) - - list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - self.assertIsNotNone( - list_snapshot_policy_after, - "Daily Snapshot policy creation failed" - ) - self.assertEquals( - snapshot_policy_before_size + 1, - len(list_snapshot_policy_after), - "Daily Snapshot policy creation failed" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_08_volume_snapshot_policy_weekly(self): - """ - @summary: Test to verify creation of Weekly Snapshot policies from volume - - Step1: Creating a Volume. - Step2: Attaching volume created in Step2 to virtual machine - Step3: Detaching the volume created in step2 from virtual machine - Step4: Listing snapshot policies for a volume created in step1 - Step5: Creating Weekly snapshot policy - Step6: Listing snapshot policies for a volume created in step1 again - Step7: Verifyign that the list snapshot policy length is increased by 1 - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - - self.assertIsNotNone(volume_created, "Volume not created") - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - - # Attaching volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - # Detaching volume created to Virtual Machine - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - # Creating Weekly Snapshot Policy from volume - self.services["recurring_snapshot"]["intervaltype"] = 'weekly' - self.services["recurring_snapshot"]["schedule"] = '00:00:1' - - list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - snapshot_policy_before_size = 0 - - if list_snapshot_policy_before is not None: - snapshot_policy_before_size = len(list_snapshot_policy_before) - - snapshot_policy_weekly = SnapshotPolicy.create( - self.userapiclient, - volume_created.id, - self.services["recurring_snapshot"] - ) - self.assertIsNotNone( - snapshot_policy_weekly, - "Weekly Snapshot policy creation failed" - ) - #Creating expected and actual values dictionaries - expected_dict = { - "schedule":self.services["recurring_snapshot"]["schedule"], - "intervaltype":2, - "volumeid":volume_created.id - } - actual_dict = { - "schedule":snapshot_policy_weekly.schedule, - "intervaltype":snapshot_policy_weekly.intervaltype, - "volumeid":snapshot_policy_weekly.volumeid - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Weekly Snapshot Policy details are not as expected" - ) - - list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - self.assertIsNotNone( - list_snapshot_policy_after, - "Weekly Snapshot policy creation failed" - ) - self.assertEquals( - snapshot_policy_before_size + 1, - len(list_snapshot_policy_after), - "Weekly Snapshot policy creation failed" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_09_volume_snapshot_policy_monthly(self): - """ - @summary: Test to verify creation of Monthly Snapshot policies from volume - - Step1: Creating a Volume. - Step2: Attaching volume created in Step2 to virtual machine - Step3: Detaching the volume created in step2 from virtual machine - Step4: Listing snapshot policies for a volume created in step1 - Step5: Creating Monthly snapshot policy - Step6: Listing snapshot policies for a volume created in step1 again - Step7: Verifyign that the list snapshot policy length is increased by 1 - Step8: Deleting monthly snapshot policy created in step5 - Step9: List snapshot policies for a volume again - Step10: Verifying that the list snapshot policy length is decreased by 1 - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - self.assertIsNotNone(volume_created, "Volume not created") - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - # Attaching and Detaching custom volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - # Creating Monthly Snapshot Policy from volume - self.services["recurring_snapshot"]["intervaltype"] = 'monthly' - self.services["recurring_snapshot"]["schedule"] = '00:00:1' - - list_snapshot_policy_before = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - snapshot_policy_before_size = 0 - - if list_snapshot_policy_before is not None: - snapshot_policy_before_size = len(list_snapshot_policy_before) - - snapshot_policy_monthly = SnapshotPolicy.create( - self.userapiclient, - volume_created.id, - self.services["recurring_snapshot"]) - self.assertIsNotNone( - snapshot_policy_monthly, - "Monthly Snapshot policy creation failed" - ) - #Creating expected and actual values dictionaries - expected_dict = { - "schedule":self.services["recurring_snapshot"]["schedule"], - "intervaltype":3, - "volumeid":volume_created.id - } - actual_dict = { - "schedule":snapshot_policy_monthly.schedule, - "intervaltype":snapshot_policy_monthly.intervaltype, - "volumeid":snapshot_policy_monthly.volumeid - } - status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - status, - "Monthly Snapshot Policy details are not as expected" - ) - - list_snapshot_policy_after = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - self.assertIsNotNone( - list_snapshot_policy_after, - "Monthly Snapshot policy creation failed" - ) - self.assertEquals( - snapshot_policy_before_size + 1, - len(list_snapshot_policy_after), - "Monthly Snapshot policy creation failed" - ) - # Deleting monthly snapshot policy - SnapshotPolicy.delete(snapshot_policy_monthly, self.userapiclient) - - list_snapshot_policies = SnapshotPolicy.list(self.userapiclient, volumeid=volume_created.id) - - self.assertIsNone( - list_snapshot_policies, - "Deletion of Monthly Snapshot policy failed" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_10_volume_snapshots_pagination(self): - """ - @summary: Test to verify pagination of snapshots for Volume - - Step1: Creating a Volume. - Step2: Attaching volume created in Step2 to virtual machine - Step3: Detaching the volume created in step2 from virtual machine - Step4: Listing all the snapshots for a volume - Step5: Creating Pagesize + 1 number of snapshots for a volume - Step6: Listing all the snapshots for a volume - Step7: Verifying that there are pagesize + 1 number of snapshots listsed - Step8: Listing all the snapshots in page 1 - Step9: Listing all the snapshots in page 2 - Step10: Deleting the snapshot present in page 2 - Step11: Listign the snapshots from page 2 again and verifyign that list returns none - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - # Creating a Volume - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - self.assertIsNotNone(volume_created, "Volume not created") - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - #Attaching volume to virtual machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - #Detaching volume from virtual machine - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - - #Creating 3 Snapshots from volume - list_snapshot_before = Snapshot.list( - self.userapiclient, - volumeid=volume_created.id, - listall=self.services["listall"] - ) - self.assertIsNone( - list_snapshot_before, - "Newly created volume is already having snapshots" - ) - - list_snapshot_before_size = 0 - for i in range(0, 3): - snapshot_created = Snapshot.create( - self.userapiclient, - volume_created.id, - ) - self.assertIsNotNone(snapshot_created, "Snapshot not created") - self.cleanup.append(snapshot_created) - - self.assertEquals( - volume_created.id, - snapshot_created.volumeid, - "Snapshot not created for given volume" - ) - - list_snapshot_after = Snapshot.list( - self.userapiclient, - volumeid=volume_created.id, - listall=self.services["listall"] - ) - self.assertEqual( - list_snapshot_before_size+3, - len(list_snapshot_after), - "Number of snapshots created is not matching expected" - ) - #Listing all the snapshots in page1 - list_snapshots_page1 = Snapshot.list( - self.userapiclient, - volumeid=volume_created.id, - listall=self.services["listall"], - page=1, - pagesize=2 - ) - self.assertEqual( - 2, - len(list_snapshots_page1), - "List snapshots response is not matching with the page size length for page 1" - ) - - #Listing all the snapshots in page2 and ensuring only 1 snapshot is present - list_snapshots_page2 = Snapshot.list( - self.userapiclient, - volumeid=volume_created.id, - listall=self.services["listall"], - page=2, - pagesize=2 - ) - self.assertEqual( - len(list_snapshots_page2), - 1, - "List snapshots response is not matching with the page size length for page 2" - ) - snapshot_page2 = list_snapshots_page2[0] - - # Verifying that the snapshot on page 2 is not present in page1 - for i in range(0, len(list_snapshots_page1)): - snapshot_page1 = list_snapshots_page1[i] - self.assertNotEquals( - snapshot_page2.id, - snapshot_page1.id, - "Snapshot listed in page 2 is also listed in page 1" - ) - # Deleting a single snapshot and verifying that snapshot does not exists on page 2 - Snapshot.delete(snapshot_created, self.userapiclient) - - list_snapshot_page2 = Snapshot.list( - self.userapiclient, - volumeid=volume_created.id, - listall=self.services["listall"], - page=2, - pagesize=2 - ) - self.assertEqual( - None, - list_snapshot_page2, - "Snapshot was not deleted" - ) - list_snapshot_page1 = Snapshot.list( - self.userapiclient, - volumeid=volume_created.id, - listall=self.services["listall"], - page=1, - pagesize=2 - ) - self.assertEqual( - 2, - len(list_snapshot_page1), - "Snapshots on page 1 are not matching" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_11_volume_extract(self): - """ - @summary: Test to verify extract/download a Volume - - Step1: Listing Volumes before creating a Volume - Step2: Creating a Volume. - Step3: Verifying that created volume is not none and adding to clean up - Step4: Listing the volumes after creation - Step5: Verifying that the list volume size is increased by 1 - Step6: Attaching volume created in Step2 to virtual machine - Step7: Detaching the volume created in step2 from virtual machine - Step8: Extracting/Downloadign the volume - Step9: Verifyign that a download URL is created for volume download - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertIsNotNone( - list_volumes_before, - "volume not created for the vm launched at class level" - ) - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - - self.assertIsNotNone(volume_created, "Volume not created") - self.cleanup.append(volume_created) - - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertIsNotNone( - list_volumes_after, - "volume creation failed" - ) - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "Volume not created" - ) - #Attaching and Detaching volume created to Virtual Machine - self.virtual_machine.attach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - attached_volume = list_volumes[0] - - self.assertIsNotNone( - attached_volume.vmname, - "VM is not attached to Volume" - ) - self.assertEquals( - self.virtual_machine.name, - attached_volume.vmname, - "VM Name is not matching with attached vm" - ) - self.virtual_machine.detach_volume( - self.userapiclient, - volume_created - ) - list_volumes = Volume.list( - self.userapiclient, - listall=self.services["listall"], - id=volume_created.id - ) - detached_volume = list_volumes[0] - self.assertIsNone( - detached_volume.vmname, - "VM is not detached from volume" - ) - #Extract/Download the volume - self.services["mode"] = "HTTP_DOWNLOAD" - - extract_volume_response = Volume.extract( - self.userapiclient, - volume_created.id, - self.zone.id, - self.services["mode"] - ) - self.assertIsNotNone(extract_volume_response, "Extract/Download volume failed") - - self.assertEquals( - "DOWNLOAD_URL_CREATED", - extract_volume_response.state, - "Failed to create Download URL" - ) - self.assertIsNotNone( - extract_volume_response.url, - "Extract/Download volume URL is NULL" - ) - self.assertTrue( - (extract_volume_response.url.find("https://")!=-1), - "Extract/Download volume URL doesnot contain https://" - ) - self.assertEquals( - volume_created.id, - extract_volume_response.id, - "Extracted/Downloaded volume is not matching with original volume" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_12_volume_upload(self): - """ - @summary: Test to verify upload volume - - Step1: Listing the volumes for a user before uploading volume - Step2: Uploading a volume - Step3: Listing the volumes for a user after uploading data volume - Step4: Verifying that the list volume length after upload is increased by 1 - """ - list_volumes_before = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertIsNotNone( - list_volumes_before, - "volume not created for the vm launched at class level" - ) - #Uploading a Volume - volume_uploaded = Volume.upload( - self.userapiclient, - self.services["upload_volume"], - self.zone.id - ) - self.assertIsNotNone(volume_uploaded, "volume uploading failed") - - self.assertEquals( - self.services["upload_volume"]["diskname"], - volume_uploaded.name, - "Uploaded volume name is not matching with name provided while uploading") - - #Listing the volumes for a user after uploading data volume - list_volumes_after = Volume.list(self.userapiclient, listall=self.services["listall"]) - - self.assertIsNotNone( - list_volumes_after, - "volume not created for the vm launched at class level" - ) - #Asserting that the list volume length after upload is increased by 1 - self.assertEquals( - len(list_volumes_before) + 1, - len(list_volumes_after), - "upload volume failed" - ) - return - -class TestListInstances(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestListInstances, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - if cls.zone.localstorageenabled: - cls.storagetype = 'local' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' - cls.services["disk_offering"]["storagetype"] = 'local' - else: - cls.storagetype = 'shared' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' - cls.services["disk_offering"]["storagetype"] = 'shared' - - cls.services['mode'] = cls.zone.networktype - cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() - cls.services["virtual_machine"]["zoneid"] = cls.zone.id - cls.services["virtual_machine"]["template"] = cls.template.id - cls.services["custom_volume"]["zoneid"] = cls.zone.id - - # Creating Disk offering, Service Offering and Account - cls.disk_offering = DiskOffering.create( - cls.api_client, - cls.services["disk_offering"] - ) - cls._cleanup.append(cls.disk_offering) - cls.service_offering = ServiceOffering.create( - cls.api_client, - cls.services["service_offerings"]["tiny"] - ) - cls._cleanup.append(cls.service_offering) - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - # Updating resource Limits - for i in range(0,12): - Resources.updateLimit( - cls.api_client, - account=cls.account.name, - domainid=cls.domain.id, - max=-1, - resourcetype=i - ) - - cls._cleanup.append(cls.account) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_01_list_instances_pagination(self): - """ - @Desc: Test List Instances pagination - @Steps: - Step1: Listing all the Instances for a user - Step2: Verifying listed Instances for account created at class level - Step3: If number of volumes is less than (page size + 1), then creating them - Step4: Listing all the volumes again after creation of volumes - Step5: Verifying the length of the volumes is (page size + 1) - Step6: Listing all the volumes in page1 - Step7: Verifying that the length of the volumes in page 1 is (page size) - Step8: Listing all the volumes in page2 - Step9: Verifying that the length of the volumes in page 2 is 1 - Step10: Deleting the volume present in page 2 - Step11: Listing for the volumes on page 2 - Step12: Verifying that there are no volumes present in page 2 - """ - # Listing all the instances for a user - list_instances_before = VirtualMachine.list(self.userapiclient, listall=self.services["listall"]) - - # Verifying listed instances for account created at class level - self.assertIsNone( - list_instances_before, - "Virtual Machine already exists for newly created user" - ) - # If number of instances are less than (pagesize + 1), then creating them - for i in range(0, (self.services["pagesize"] + 1)): - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - if(i < (self.services["pagesize"])): - self.cleanup.append(vm_created) - - self.assertEqual( - self.services["virtual_machine"]["displayname"], - vm_created.displayname, - "Newly created VM name and the test data VM name are not matching" - ) - - # Listing all the instances again after creating VM's - list_instances_after = VirtualMachine.list(self.userapiclient, listall=self.services["listall"]) - status = validateList(list_instances_after) - self.assertEquals( - PASS, - status[0], - "Listing of instances after creation failed" - ) - # Verifying the length of the instances is (page size + 1) - self.assertEqual( - len(list_instances_after), - (self.services["pagesize"] + 1), - "Number of instances created is not matching as expected" - ) - - # Listing all the volumes in page1 - list_instances_page1 = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid - ) - status = validateList(list_instances_page1) - self.assertEquals( - PASS, - status[0], - "Listing of instances in page1 failed" - ) - # Verifying that the length of the instances in page 1 is (page size) - self.assertEqual( - self.services["pagesize"], - len(list_instances_page1), - "List VM response is not matching with the page size length for page 1" - ) - - # Listing all the VM's in page2 - list_instances_page2 = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"], - domainid=self.account.domainid - ) - status = validateList(list_instances_page2) - self.assertEquals( - PASS, - status[0], - "Listing of instances in page2 failed" - ) - # Verifying that the length of the VM's in page 2 is 1 - self.assertEqual( - 1, - len(list_instances_page2), - "List VM response is not matching with the page size length for page 2" - ) - instance_page2 = list_instances_page2[0] - - # Verifying that the VM on page 2 is not present in page1 - for i in range(0, len(list_instances_page1)): - instance_page1 = list_instances_page1[i] - self.assertNotEquals( - instance_page2.id, - instance_page1.id, - "VM listed in page 2 is also listed in page 1" - ) - - # Deleting a single VM - VirtualMachine.delete(vm_created, self.userapiclient) - - # Listing the VM's in page 2 - list_instance_response = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"], - domainid=self.account.domainid - ) - # verifying that VM does not exists on page 2 - self.assertEqual( - list_instance_response, - None, - "VM was not deleted" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_02_list_Running_vm(self): - """ - @Desc: Test List Running VM's - @Steps: - Step1: Listing all the Running VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Listing all the Running VMs for a user again - Step5: Verifying that the size of the list is increased by 1 - Step6: Verifying that the details of the Running VM listed are same as the VM deployed in Step3 - """ - # Listing all the Running VM's for a User - list_running_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Running" - ) - self.assertIsNone( - list_running_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the Running VM's for a User - list_running_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Running" - ) - status = validateList(list_running_vms_after) - self.assertEquals( - PASS, - status[0], - "Newly created VM is not in Running state" - ) - # Verifying list size is 1 - self.assertEquals( - 1, - len(list_running_vms_after), - "Running VM list count is not matching" - ) - running_vm = list_running_vms_after[0] - - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":"Running", - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":running_vm.id, - "name":running_vm.name, - "displayname":running_vm.displayname, - "state":running_vm.state, - "zoneid":running_vm.zoneid, - "account":running_vm.account, - "template":running_vm.templateid - } - running_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - running_vm_status, - "Listed Running VM details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_03_list_Stopped_vm(self): - """ - @Desc: Test List Stopped VM's - @Steps: - Step1: Listing all the Stopped VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Stopping the VM deployed in step3 - Step5: Listing all the Stopped VMs for a user again - Step6: Verifying that the size of the list is increased by 1 - Step7: Verifying that the details of the Stopped VM listed are same as the VM stopped in Step4 - """ - # Listing all the Stopped VM's for a User - list_stopped_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Stopped" - ) - self.assertIsNone( - list_stopped_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Stopping the VM - VirtualMachine.stop(vm_created, self.userapiclient) - # Listing all the Stopped VM's for a User - list_stopped_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Stopped" - ) - status = validateList(list_stopped_vms_after) - self.assertEquals( - PASS, - status[0], - "Stopped VM is not in Stopped state" - ) - # Verifying list size is 1 - self.assertEquals( - 1, - len(list_stopped_vms_after), - "Stopped VM list count is not matching" - ) - stopped_vm = list_stopped_vms_after[0] - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":"Stopped", - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":stopped_vm.id, - "name":stopped_vm.name, - "displayname":stopped_vm.displayname, - "state":stopped_vm.state, - "zoneid":stopped_vm.zoneid, - "account":stopped_vm.account, - "template":stopped_vm.templateid - } - stopped_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - stopped_vm_status, - "Listed Stopped VM details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_04_list_Destroyed_vm(self): - """ - @Desc: Test List Destroyed VM's - @Steps: - Step1: Listing all the Destroyed VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Destroyed the VM deployed in step3 - Step5: Listing all the Destroyed VMs for a user again - Step6: Verifying that destroyed VM is not listed for User - Step7: Listing all the destroyed VMs as admin - Step8: Verifying that the size of the list is 1 - Step9: Verifying that the details of the Destroyed VM listed are same as the VM destroyed in Step4 - """ - # Listing all the Destroyed VM's for a User - list_destroyed_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Destroyed" - ) - self.assertIsNone( - list_destroyed_vms_before, - "Virtual Machine in Destroyed state already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - # Destroying the VM - VirtualMachine.delete(vm_created, self.userapiclient) - # Listing all the Destroyed VM's for a User - list_destroyed_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Destroyed" - ) - self.assertIsNone( - list_destroyed_vms_after, - "Destroyed VM is not in destroyed state" - ) - # Listing destroyed VMs as admin user - list_destroyed_vms_admin = VirtualMachine.list( - self.apiClient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - state="Destroyed", - id=vm_created.id - ) - status = validateList(list_destroyed_vms_admin) - self.assertEquals( - PASS, - status[0], - "Destroyed VM is not in Destroyed state" - ) - # Verifying that the length of the destroyed VMs list should be 1 - self.assertEquals( - 1, - len(list_destroyed_vms_admin), - "Destroyed VM list count is not matching" - ) - destroyed_vm = list_destroyed_vms_admin[0] - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":"Destroyed", - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":destroyed_vm.id, - "name":destroyed_vm.name, - "displayname":destroyed_vm.displayname, - "state":destroyed_vm.state, - "zoneid":destroyed_vm.zoneid, - "account":destroyed_vm.account, - "template":destroyed_vm.templateid - } - destroyed_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - destroyed_vm_status, - "Listed Destroyed VM details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_05_list_vm_by_id(self): - """ - @Desc: Test List VM by Id - @Steps: - Step1: Listing all the VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Listing all the VMs for a user again - Step5: Verifying that the size of the list is increased by 1 - Step6: List a VM by specifying the Id if the VM deployed in Step3 - Step7: Verifying that the details of the Listed VM are same as the VM deployed in Step3 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - account=self.account.name - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VM's for a User - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - account=self.account.name - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "Listing of VM after creation failed" - ) - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing a VM by Id - list_vm_byid = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - id=vm_created.id - ) - status = validateList(list_vm_byid) - self.assertEquals( - PASS, - status[0], - "Listing of VM by Id failed" - ) - listed_vm = list_vm_byid[0] - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":vm_created.state, - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":listed_vm.id, - "name":listed_vm.name, - "displayname":listed_vm.displayname, - "state":listed_vm.state, - "zoneid":listed_vm.zoneid, - "account":listed_vm.account, - "template":listed_vm.templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM by Id details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_06_list_vm_by_name(self): - """ - @Desc: Test List VM's by Name - @Steps: - Step1: Listing all the VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a 2 VM's - Step4: Listing all the VMs for a user again - Step5: Verifying that list size is increased by 2 - Step6: Listing the VM by specifying complete name of VM-1 created in step3 - Step7: Verifying that the size of the list is 1 - Step8: Verifying that the details of the listed VM are same as the VM-1 created in step3 - Step9: Listing the VM by specifying the partial name of VM - Step10: Verifying that the size of the list is 2 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - vms = {} - for i in range(0, 2): - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - vms.update({i: vm_created}) - - # Listing all the VM's for a User - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM's creation failed" - ) - self.assertEquals( - 2, - len(list_vms_after), - "VM's list count is not matching" - ) - # Listing the VM by complete name - list_vm_byfullname = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - name=vms[0].name - ) - status = validateList(list_vm_byfullname) - self.assertEquals( - PASS, - status[0], - "Failed to list VM by Name" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vm_byfullname), - "VM list by full name count is not matching" - ) - # Verifying that the details of the listed VM are same as the VM created above - #Creating expected and actual values dictionaries - expected_dict = { - "id":vms[0].id, - "name":vms[0].name, - "displayname":vms[0].displayname, - "state":vms[0].state, - "zoneid":vms[0].zoneid, - "account":vms[0].account, - "template":vms[0].templateid - } - actual_dict = { - "id":list_vm_byfullname[0].id, - "name":list_vm_byfullname[0].name, - "displayname":list_vm_byfullname[0].displayname, - "state":list_vm_byfullname[0].state, - "zoneid":list_vm_byfullname[0].zoneid, - "account":list_vm_byfullname[0].account, - "template":list_vm_byfullname[0].templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM details are not as expected" - ) - # Listing the VM by partial name - list_vm_bypartialname = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - domainid=self.account.domainid, - name=vms[0].name[:1] - ) - status = validateList(list_vm_bypartialname) - self.assertEquals( - PASS, - status[0], - "Failed to list VM by Name" - ) - # Verifying that the size of the list is 2 - self.assertEquals( - 2, - len(list_vm_bypartialname), - "VM list by full name count is not matching" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_07_list_vm_by_name_state(self): - """ - @Desc: Test List VM's by Name and State - @Steps: - Step1: Listing all the VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Listing all the VMs for a user again - Step5: Verifying that list size is increased by 1 - Step6: Listing the VM by specifying name of VM created in step3 and state as Running (matching name and state) - Step7: Verifying that the size of the list is 1 - Step8: Verifying that the details of the listed VM are same as the VM created in step3 - Step9: Listing the VM by specifying name of VM created in step3 and state as Stopped (non matching state) - Step10: Verifying that the size of the list is 0 - Step11: Listing the VM by specifying non matching name and state as Running (non matching name) - Step12: Verifying that the size of the list is 0 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VM's for a User - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM's creation failed" - ) - self.assertEquals( - 1, - len(list_vms_after), - "VM's list count is not matching" - ) - # Listing the VM by matching Name and State - list_running_vm = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - name=vm_created.name, - state="Running" - ) - status = validateList(list_running_vm) - self.assertEquals( - PASS, - status[0], - "List VM by name and state failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_running_vm), - "Count of VM list by name and state is not matching" - ) - # Verifying that the details of the listed VM are same as the VM created above - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":"Running", - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":list_running_vm[0].id, - "name":list_running_vm[0].name, - "displayname":list_running_vm[0].displayname, - "state":list_running_vm[0].state, - "zoneid":list_running_vm[0].zoneid, - "account":list_running_vm[0].account, - "template":list_running_vm[0].templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM details are not as expected" - ) - # Listing the VM by matching name and non matching state - list_running_vm = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - name=vm_created.name, - state="Stopped" - ) - self.assertIsNone( - list_running_vm, - "Listed VM with non matching state" - ) - # Listing the VM by non matching name and matching state - list_running_vm = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - name="name", - state="Running" - ) - self.assertIsNone( - list_running_vm, - "Listed VM with non matching name" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_08_list_vm_by_zone(self): - """ - @Desc: Test List VM by Zone. - This test case is applicable for a setup having multiple zones. - @Steps: - Step1: Listing all the zones - Step2: Checking if there are multiple zones in the setup. - Continuing below steps only if there are multiple zones - Step3: Listing template for zone - Step4: Listing all the VMs for a user - Step5: Verifying that the size of the list is 0 - Step6: Deploying a VM - Step7: Listing all the VMs for a user again for matching zone - Step8: Verifying that the size of the list is 1 - Step9: Verifying that the details of the Listed VM are same as the VM deployed in Step6 - Step10: Listing all the VMs for a user again for non-matching zone - Step11: Verifying that the size of the list is 0 - """ - # Listing all the zones available - zones_list = Zone.list(self.apiClient) - status = validateList(zones_list) - self.assertEquals( - PASS, - status[0], - "zones not available in the given setup" - ) - current_zone = self.services["virtual_machine"]["zoneid"] - current_template = self.services["virtual_machine"]["template"] - # Checking if there are multiple zones in the setup. - if not len(zones_list) > 1: - self.debug("Setup is not having multiple zones") - else: - # Getting the template available under the zone - template = get_template( - self.apiClient, - zones_list[0].id, - self.services["ostype"] - ) - self.assertIsNotNone( - template, - "Template not found for zone" - ) - self.services["virtual_machine"]["zoneid"] = zones_list[0].id - self.services["virtual_machine"]["template"] = template.id - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[0].id - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again for matching zone - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[0].id - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - listed_vm = list_vms_after[0] - # Verifying that the details of the Listed VM are same as the VM deployed above - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":vm_created.state, - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":listed_vm.id, - "name":listed_vm.name, - "displayname":listed_vm.displayname, - "state":listed_vm.state, - "zoneid":listed_vm.zoneid, - "account":listed_vm.account, - "template":listed_vm.templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM by Id details are not as expected" - ) - # Listing all the VMs for a user again for non-matching zone - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[1].id - ) - self.assertIsNone( - list_vms, - "VM's listed for non matching zone" - ) - self.services["virtual_machine"]["zoneid"] = current_zone - self.services["virtual_machine"]["template"] = current_template - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_09_list_vm_by_zone_name(self): - """ - @Desc: Test List VM by Zone. - This test case is applicable for a setup having multiple zones. - @Steps: - Step1: Listing all the zones - Step2: Checking if there are multiple zones in the setup. - Continuing below steps only if there are multiple zones - Step3: Listing template for zone - Step4: Listing all the VMs for a user - Step5: Verifying that the size of the list is 0 - Step6: Deploying a VM - Step7: Listing all the VMs for a user again - Step8: Verifying that list size is increased by 1 - Step9: Listing the VM by specifying name of VM created in step6 and matching zone (matching name and zone) - Step10: Verifying that the size of the list is 1 - Step11: Verifying that the details of the listed VM are same as the VM created in step3 - Step12: Listing the VM by specifying name of VM created in step6 and non matching zone (non matching zone) - Step13: Verifying that the size of the list is 0 - Step14: Listing the VM by specifying non matching name and matching zone (non matching name) - Step15: Verifying that the size of the list is 0 - """ - # Listing all the zones available - zones_list = Zone.list(self.apiClient) - status = validateList(zones_list) - self.assertEquals( - PASS, - status[0], - "zones not available in the given setup" - ) - current_zone = self.services["virtual_machine"]["zoneid"] - current_template = self.services["virtual_machine"]["template"] - # Checking if there are multiple zones in the setup. - if not len(zones_list) > 1: - self.debug("Setup is not having multiple Zones") - else: - # Getting the template available under the zone - template = get_template( - self.apiClient, - zones_list[0].id, - self.services["ostype"] - ) - self.assertIsNotNone( - template, - "Template not found for zone" - ) - self.services["virtual_machine"]["zoneid"] = zones_list[0].id - self.services["virtual_machine"]["template"] = template.id - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[0].id, - account=self.account.name - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again for matching zone - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[0].id, - account=self.account.name - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing the VM by specifying name of VM created in above and matching zone - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[0].id, - name=vm_created.name - ) - status = validateList(list_vms) - self.assertEquals( - PASS, - status[0], - "Listing VM's by name and zone failed" - ) - # Verifying Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms), - "Count of listed VM's by name and zone is not as expected" - ) - listed_vm = list_vms[0] - # Verifying that the details of the Listed VM are same as the VM deployed above - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":vm_created.state, - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":listed_vm.id, - "name":listed_vm.name, - "displayname":listed_vm.displayname, - "state":listed_vm.state, - "zoneid":listed_vm.zoneid, - "account":listed_vm.account, - "template":listed_vm.templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM by Id details are not as expected" - ) - # Listing the VM by specifying name of VM created in step3 and non matching zone - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[1].id, - name=vm_created.name - ) - self.assertIsNone( - list_vms, - "VM's listed for non matching zone" - ) - # Listing the VM by specifying non matching name of VM and matching zone - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=zones_list[0].id, - name="name" - ) - self.assertIsNone( - list_vms, - "VM's listed for non matching zone" - ) - self.services["virtual_machine"]["zoneid"] = current_zone - self.services["virtual_machine"]["template"] = current_template - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_10_list_vm_by_zone_name_state(self): - """ - @Desc: Test List VM by Zone. - @Steps: - Step1: Listing all the VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Listing all the VMs for a user again - Step5: Verifying that list size is increased by 1 - Step6: Listing the VM by specifying name of VM created in step3 and matching zone and state as Running - Step7: Verifying that the size of the list is 1 - Step8: Verifying that the details of the listed VM are same as the VM created in step3 - Step9: Listing the VM by specifying name of VM created in step3 and matching zone and state as Stopped - Step10: Verifying that the size of the list is 0 - Step11: Listing the VM by name, Zone and account - Step12: Verifying that the size of the list is 1 - Step13: Verifying that the details of the listed VM are same as the VM created in step3 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - account=self.account.name - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again for matching zone - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - account=self.account.name - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing the VM by specifying name of VM created in step3 and matching zone and state as Running - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - name=vm_created.name, - state="Running" - ) - status = validateList(list_vms) - self.assertEquals( - PASS, - status[0], - "Listing VM's by name and zone failed" - ) - # Verifying Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms), - "Count of listed VM's by name, zone and state is not as expected" - ) - listed_vm = list_vms[0] - # Verifying that the details of the Listed VM are same as the VM deployed above - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":vm_created.state, - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":listed_vm.id, - "name":listed_vm.name, - "displayname":listed_vm.displayname, - "state":listed_vm.state, - "zoneid":listed_vm.zoneid, - "account":listed_vm.account, - "template":listed_vm.templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM by Id details are not as expected" - ) - # Listing the VM by specifying name of VM created in step3, zone and State as Stopped - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - name=vm_created.name, - state="Stopped" - ) - self.assertIsNone( - list_vms, - "VM's listed for non matching zone" - ) - # Listing the VM by name, zone and account - list_vms = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - name=vm_created.name, - account=self.account.name - ) - status = validateList(list_vms) - self.assertEquals( - PASS, - status[0], - "Listing VM's by name, account and zone failed" - ) - # Verifying Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms), - "Count of listed VM's by name, zone and account is not as expected" - ) - listed_vm = list_vms[0] - # Verifying that the details of the Listed VM are same as the VM deployed above - #Creating expected and actual values dictionaries - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":vm_created.state, - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":listed_vm.id, - "name":listed_vm.name, - "displayname":listed_vm.displayname, - "state":listed_vm.state, - "zoneid":listed_vm.zoneid, - "account":listed_vm.account, - "template":listed_vm.templateid - } - list_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - list_vm_status, - "Listed VM by Id details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_11_register_reset_vm_sshkey(self): - """ - @Desc: Test to verify registering and reset of SSH Key for VM - @Steps: - Step1: Deploying a VM - Step2: Stopping the VM deployed in step1 - Step3: Listing all the SSH Key pairs - Step4: Registering a SSH Key pair - Step5: Listing all the SSh Key pairs again - Step6: Verifying that the key pairs list is increased by 1 - Step7: Resetting the VM SSH Key to the key pair registered in step4 - Step8: Verifying that the registered SSH Key pair is set to the VM - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Stopping the VM deployed above - vm_created.stop( - self.userapiclient, - forced=True - ) - # Listing all the SSH Key pairs - list_keypairs_before = SSHKeyPair.list( - self.userapiclient - ) - list_keypairs_before_size = 0 - if list_keypairs_before is not None: - list_keypairs_before_size = len(list_keypairs_before) - - # Registering new Key pair - new_keypair = SSHKeyPair.register( - self.userapiclient, - name="keypair1", - publickey="ssh-rsa: e6:9a:1e:b5:98:75:88:5d:56:bc:92:7b:43:48:05:b2" - ) - self.assertIsNotNone( - new_keypair, - "New Key pair generation failed" - ) - self.assertEquals( - "keypair1", - new_keypair.name, - "Key Pair not created with given name" - ) - # Listing all the SSH Key pairs again - list_keypairs_after = SSHKeyPair.list( - self.userapiclient - ) - status = validateList(list_keypairs_after) - self.assertEquals( - PASS, - status[0], - "Listing of Key pairs failed" - ) - # Verifying that list size is increased by 1 - self.assertEquals( - list_keypairs_before_size + 1, - len(list_keypairs_after), - "List count is not matching" - ) - # Resetting the VM SSH key to the Key pair created above - vm_created.resetSshKey( - self.userapiclient, - keypair=new_keypair.name - ) - # Listing VM details again - list_vm = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vm) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - self.assertEquals( - 1, - len(list_vm), - "VMs list is not as expected" - ) - # Verifying that VM's SSH keypair is set to newly created keypair - self.assertEquals( - new_keypair.name, - list_vm[0].keypair, - "VM is not set to newly created SSH Key pair" - ) - return - - @attr(tags=["advanced", "provisioning"]) - def test_12_vm_nics(self): - """ - @Desc: Test to verify Nics for a VM - @Steps: - Step1: Deploying a VM - Step2: Listing all the Networks - Step3: Verifying that the list size is 1 - Step4: Creating 1 network - Step5: Listing all the networks again - Step6: Verifying that the list size is 2 - Step7: Verifying that VM deployed in step1 has only 1 nic - and it is same as network listed in step3 - Step8: Adding the networks created in step4 to VM deployed in step1 - Step9: Verifying that VM deployed in step1 has 2 nics - Step10: Verifying that isdefault is set to true for only 1 nic - Step11: Verifying that isdefault is set to true for the Network created when deployed a VM - Step12: Making the nic created in step4 as default nic - Step13: Verifying that isdefault is set to true for only 1 nic - Step14: Verifying that the isdefault is set to true for the nic created in step4 - Step15: Removing the non-default nic from VM - Step16: Verifying that VM deployed in step1 has only 1 nic - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing all the networks before - list_network_before = Network.list( - self.userapiclient, - isdefault="true", - zoneid=self.zone.id, - account=self.account.name, - domainid=self.domain.id - ) - status = validateList(list_network_before) - self.assertEquals( - PASS, - status[0], - "Default Network not created when deploying a VM" - ) - # Verifying that only 1 network is created while deploying a VM - self.assertEquals( - 1, - len(list_network_before), - "More than 1 default network exists" - ) - network1 = list_network_before[0] - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat", - zoneid=self.zone.id - ) - self.assertIsNotNone( - network_offerings_list, - "Isolated Network Offerings with sourceNat enabled are not found" - ) - # Creating one more network - network2 = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network2, - "Network creation failed" - ) - self.cleanup.append(network2) - # Listing all the networks again - list_network_after = Network.list( - self.userapiclient, - zoneid=self.zone.id, - account=self.account.name, - domainid=self.domain.id - ) - status = validateList(list_network_after) - self.assertEquals( - PASS, - status[0], - "List of Networks failed" - ) - # Verifying that list size is 2 - self.assertEquals( - 2, - len(list_network_after), - "More than 1 default network exists" - ) - # Verifying that VM created is having only 1 nic - vm_nics_before = vm_created.nic - self.assertIsNotNone( - vm_nics_before, - "Nic not found for the VM deployed" - ) - self.assertEquals( - 1, - len(vm_nics_before), - "VM Nic count is not matching" - ) - # Verifying that the nic is same as the default network listed above - self.assertEquals( - network1.id, - vm_nics_before[0].networkid, - "Default NIC for VM is not as expected" - ) - # Adding network2 created above to VM - VirtualMachine.add_nic( - vm_created, - self.userapiclient, - network2.id - ) - # Listing the Vm details again - list_vms_after = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - vm = list_vms_after[0] - # Verifying that VM nics size is 2 now - vm_nics_after = vm.nic - self.assertIsNotNone( - vm_nics_after, - "Nic not found for the deployed VM" - ) - self.assertEquals( - 2, - len(vm_nics_after), - "VM NIC's count is not matching" - ) - # Verifying that isdefault is set to true for only 1 nic - default_count = 0 - for i in range(0, len(vm_nics_after)): - if vm_nics_after[i].isdefault is True: - default_count = default_count + 1 - default_nic = vm_nics_after[i] - else: - non_default_nic = vm_nics_after[i] - self.assertEquals( - 1, - default_count, - "Default NIC count is not matching" - ) - # Verifying that default NIC is same the network created when VM is deployed - self.assertEquals( - network1.id, - default_nic.networkid, - "Default NIC is not matching for VM" - ) - # Updating network 2 as default NIC - vm_created.update_default_nic( - self.userapiclient, - non_default_nic.id - ) - # Listing the Vm details again - list_vms_after = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - vm = list_vms_after[0] - # Verifying that VM nics size is 2 now - vm_nics_after = vm.nic - self.assertIsNotNone( - vm_nics_after, - "Nic not found for the deployed VM" - ) - self.assertEquals( - 2, - len(vm_nics_after), - "VM NIC's count is not matching" - ) - # Verifying that isdefault is set to true for only 1 nic - default_count = 0 - for i in range(0, len(vm_nics_after)): - if vm_nics_after[i].isdefault is True: - default_count = default_count + 1 - default_nic = vm_nics_after[i] - else: - non_default_nic = vm_nics_after[i] - - self.assertEquals( - 1, - default_count, - "Default NIC count is not matching" - ) - # Verifying that default NIC is same the newly updated network (network 2) - self.assertEquals( - network2.id, - default_nic.networkid, - "Default NIC is not matching for VM" - ) - # Deleting non default NIC - vm_created.remove_nic( - self.userapiclient, - non_default_nic.id - ) - # Listing the Vm details again - list_vms_after = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - vm = list_vms_after[0] - # Verifying that VM nics size is 1 now - vm_nics_after = vm.nic - self.assertIsNotNone( - vm_nics_after, - "Nic not found for the deployed VM" - ) - self.assertEquals( - 1, - len(vm_nics_after), - "VM NIC's count is not matching" - ) - # Verifying the nic network is same as the default nic network - self.assertEquals( - network2.id, - vm_nics_after[0].networkid, - "VM NIC is not same as expected" - ) - return - -class TestInstances(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestInstances, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - if cls.zone.localstorageenabled: - cls.storagetype = 'local' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' - cls.services["disk_offering"]["storagetype"] = 'local' - else: - cls.storagetype = 'shared' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' - cls.services["disk_offering"]["storagetype"] = 'shared' - - cls.services['mode'] = cls.zone.networktype - cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() - cls.services["virtual_machine"]["zoneid"] = cls.zone.id - cls.services["virtual_machine"]["template"] = cls.template.id - cls.services["custom_volume"]["zoneid"] = cls.zone.id - - # Creating Disk offering, Service Offering and Account - cls.disk_offering = DiskOffering.create( - cls.api_client, - cls.services["disk_offering"] - ) - cls._cleanup.append(cls.disk_offering) - cls.service_offering = ServiceOffering.create( - cls.api_client, - cls.services["service_offerings"]["tiny"] - ) - cls._cleanup.append(cls.service_offering) - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - # Updating resource Limits - for i in range(0,12): - Resources.updateLimit( - cls.api_client, - account=cls.account.name, - domainid=cls.domain.id, - max=-1, - resourcetype=i - ) - cls._cleanup.append(cls.account) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_13_attach_detach_iso(self): - """ - @Desc: Test Attach ISO to VM and Detach ISO from VM. - @Steps: - Step1: Listing all the VMs for a user - Step2: Verifying that the size of the list is 0 - Step3: Deploying a VM - Step4: Listing all the VMs for a user again - Step5: Verifying that list size is increased by 1 - Step6: Listing all the ready ISO's - Step7: If size of the list is >= 1 continuing to next steps - Step8: Attaching the ISO listed to VM deployed in Step3 - Step9: Verifying that the attached ISO details are associated with VM - Step10: Detaching the ISO attached in step8 - Step11: Verifying that detached ISO details are not associated with VM - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - account=self.account.name - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again for matching zone - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"], - domainid=self.account.domainid, - zoneid=self.zone.id, - account=self.account.name - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing the ISO's in ready state - isos_list = Iso.list( - self.userapiclient, - isready="true", - isofilter="executable", - zoneid=self.zone.id - ) - # Verifying if size of the list is >= 1 - if isos_list is not None: - iso_toattach = isos_list[0] - # Attaching ISO listed to VM deployed - VirtualMachine.attach_iso( - vm_created, - self.userapiclient, - iso_toattach - ) - list_vm = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vm) - self.assertEquals( - PASS, - status[0], - "VM listing by Id failed" - ) - # Verifying that attached ISO details are present in VM - self.assertEquals( - iso_toattach.name, - list_vm[0].isoname, - "Attached ISO name is not matching" - ) - self.assertEquals( - iso_toattach.displaytext, - list_vm[0].isodisplaytext, - "Attached ISO display is not matching" - ) - # Detaching ISO from VM - VirtualMachine.detach_iso( - vm_created, - self.userapiclient - ) - list_vm = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vm) - self.assertEquals( - PASS, - status[0], - "VM listing by Id failed" - ) - # Verifying that ISO details are NOT present in VM - self.assertIsNone( - list_vm[0].isoname, - "ISO not detached from VM" - ) - else: - self.fail("Executable ISO in Ready is not found in the given setup") - - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_14_vm_snapshot_pagination(self): - """ - @Desc: Test VM Snapshots pagination. - @Steps: - Step1: Deploying a VM - Step2: Listing all the Snapshots of the VM deployed in Step 1 - Step3: Verifying that the list size is 0 - Step4: Creating (pagesize + 1) number of Snapshots for the VM - Step5: Listing all the Snapshots of the VM deployed in Step 1 - Step6: Verifying that the list size is (pagesize + 1) - Step7: Listing all the VM snapshots in Page 1 with page size - Step8: Verifying that size of the list is same as page size - Step9: Listing all the VM snapshots in Page 2 with page size - Step10: Verifying that size of the list is 1 - Step11: Deleting VM snapshot in page 2 - Step12: Listing all the VM snapshots in Page 2 with page size - Step13: Verifying that size of the list is 0 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing all the VM snapshots for VM deployed above - list_snapshots_before = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - # Verifying that the VM snapshot list is None - self.assertIsNone( - list_snapshots_before, - "Snapshots already exists for newly created VM" - ) - # Creating pagesize + 1 number of VM snapshots - for i in range(0, (self.services["pagesize"] + 1)): - snapshot_created = VmSnapshot.create( - self.userapiclient, - vm_created.id, - ) - self.assertIsNotNone( - snapshot_created, - "Snapshot creation failed" - ) - - # Listing all the VM snapshots for VM again - list_snapshots_after = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - status = validateList(list_snapshots_after) - self.assertEquals( - PASS, - status[0], - "VM Snapshots creation failed" - ) - self.assertEquals( - self.services["pagesize"] + 1, - len(list_snapshots_after), - "Count of VM Snapshots is not matching" - ) - # Listing all the VM snapshots in Page 1 with page size - list_snapshots_page1 = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id, - page=1, - pagesize=self.services["pagesize"], - ) - status = validateList(list_snapshots_page1) - self.assertEquals( - PASS, - status[0], - "Listing of VM Snapshots failed in page 1" - ) - # Verifying the list size is equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_snapshots_page1), - "List VM Snapshot count is not matching in page 1" - ) - # Listing all the VM Snapshots in page 2 - list_snapshots_page2 = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id, - page=2, - pagesize=self.services["pagesize"], - ) - status = validateList(list_snapshots_page2) - self.assertEquals( - PASS, - status[0], - "Listing of VM Snapshots failed in page 2" - ) - # Verifying the list size is equal to 1 - self.assertEquals( - 1, - len(list_snapshots_page2), - "List VM Snapshot count is not matching in page 2" - ) - # Deleting VM Snapshot in page 2 - VmSnapshot.deleteVMSnapshot( - self.userapiclient, - snapshot_created.id - ) - # Listing all the VM Snapshots in page 2 again - list_snapshots_page2 = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id, - page=2, - pagesize=self.services["pagesize"], - ) - # Verifying the list size is equal to 0 - self.assertIsNone( - list_snapshots_page2, - "VM Snapshots exists in page 2" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_15_revert_vm_to_snapshot(self): - """ - @Desc: Test Revert VM to Snapshot functionality. - @Steps: - Step1: Deploying a VM - Step2: Listing all the Snapshots of the VM deployed in Step 1 - Step3: Verifying that the list size is 0 - Step4: Creating 2 Snapshots for the VM - Step5: Listing all the Snapshots of the VM deployed in Step 1 - Step6: Verifying that the list size is 2 - Step7: Verifying that only 1 snapshot is have current flag set to True - Step8: Verifying that the VM snapshot with current flag set as true is the latest snapshot created - Step9: Reverting VM to snapshot having current flag as false (non current snapshot) - Step10: Verifying that only 1 VM snapshot is having current flag set as true. - Step11: Verifying that the VM Snapshot with current flag set to true is the reverted snapshot in Step 8 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing all the VM snapshots for VM deployed above - list_snapshots_before = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - # Verifying that the VM snapshot list is None - self.assertIsNone( - list_snapshots_before, - "Snapshots already exists for newly created VM" - ) - # Creating 2 of VM snapshots - snapshot1 = VmSnapshot.create( - self.userapiclient, - vm_created.id, - ) - self.assertIsNotNone( - snapshot1, - "Snapshot creation failed" - ) - snapshot2 = VmSnapshot.create( - self.userapiclient, - vm_created.id, - ) - self.assertIsNotNone( - snapshot2, - "Snapshot creation failed" - ) - # Listing all the VM snapshots for VM again - list_snapshots_after = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - status = validateList(list_snapshots_after) - self.assertEquals( - PASS, - status[0], - "VM Snapshots creation failed" - ) - self.assertEquals( - 2, - len(list_snapshots_after), - "Count of VM Snapshots is not matching" - ) - # Verifying that only 1 snapshot is having current flag set to true - # and that snapshot is the latest snapshot created (snapshot2) - current_count = 0 - for i in range(0, len(list_snapshots_after)): - if(list_snapshots_after[i].current is True): - current_count = current_count + 1 - current_snapshot = list_snapshots_after[i] - - self.assertEquals( - 1, - current_count, - "count of VM Snapshot with current flag as true is not matching" - ) - self.assertEquals( - snapshot2.id, - current_snapshot.id, - "Latest snapshot taken is not marked as current" - ) - # Reverting the VM to Snapshot 1 - VmSnapshot.revertToSnapshot( - self.userapiclient, - snapshot1.id - ) - # Listing the VM snapshots again - list_snapshots_after = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - status = validateList(list_snapshots_after) - self.assertEquals( - PASS, - status[0], - "VM Snapshots creation failed" - ) - self.assertEquals( - 2, - len(list_snapshots_after), - "Count of VM Snapshots is not matching" - ) - # Verifying that only 1 snapshot is having current flag set to true - # and that snapshot is snapshot1 - current_count = 0 - for i in range(0, len(list_snapshots_after)): - if(list_snapshots_after[i].current is True): - current_count = current_count + 1 - current_snapshot = list_snapshots_after[i] - self.assertEquals( - 1, - current_count, - "count of VM Snapshot with current flag as true is not matching" - ) - self.assertEquals( - snapshot1.id, - current_snapshot.id, - "Current flag was set properly after reverting the VM to snapshot" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_16_list_vm_volumes_pagination(self): - """ - @Desc: Test to verify pagination of Volumes for a VM - @Steps: - Step1: Deploying a VM - Step2: Listing all the Volumes of the VM deployed in Step 1 - Step3: Verifying that the list size is 1 - Step4: Creating page size number of volumes - Step5: Attaching all the volumes created in step4 to VM deployed in Step1 - Step6: Listing all the Volumes for the VM in step1 - Step7: Verifying that the list size is equal to page size + 1 - Step8: Listing all the volumes of VM in page 1 - Step9: Verifying that the list size is equal to page size - Step10: Listing all the Volumes in Page 2 - Step11: Verifying that the list size is 1 - Step12: Detaching the volume from the VM - Step13: Listing all the Volumes in Page 2 - Step14: Verifying that list size is 0 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing all the Volumes for the VM deployed - list_volumes_before = Volume.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - status = validateList(list_volumes_before) - self.assertEquals( - PASS, - status[0], - "Root volume is not created for VM deployed" - ) - # Verifying the size of the list is 1 - self.assertEquals( - 1, - len(list_volumes_before), - "Volumes count is not matching" - ) - # Creating Page size number of volumes - for i in range(0, self.services["pagesize"]): - volume_created = Volume.create( - self.userapiclient, - self.services["volume"], - zoneid=self.zone.id, - diskofferingid=self.disk_offering.id - ) - self.assertIsNotNone( - volume_created, - "Volume is not created" - ) - self.cleanup.append(volume_created) - # Attaching all the volumes created to VM - vm_created.attach_volume( - self.userapiclient, - volume_created - ) - - # List all the volumes for the VM again - list_volumes_after = Volume.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id - ) - status = validateList(list_volumes_after) - self.assertEquals( - PASS, - status[0], - "Volumes are not listed" - ) - # Verifying that size of the list is equal to page size + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_volumes_after), - "VM's volume count is not matching" - ) - # Listing all the volumes for a VM in page 1 - list_volumes_page1 = Volume.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id, - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_volumes_page1) - self.assertEquals( - PASS, - status[0], - "Volumes not listed in page1" - ) - # Verifying that list size is equal to page size - self.assertEquals( - self.services["pagesize"], - len(list_volumes_page1), - "VM's volume count is not matching in page 1" - ) - # Listing all the volumes for a VM in page 2 - list_volumes_page2 = Volume.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id, - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_volumes_page2) - self.assertEquals( - PASS, - status[0], - "Volumes not listed in page2" - ) - # Verifying that list size is equal to 1 - self.assertEquals( - 1, - len(list_volumes_page2), - "VM's volume count is not matching in page 1" - ) - # Detaching 1 volume from VM - vm_created.detach_volume( - self.userapiclient, - volume_created - ) - # Listing all the volumes for a VM in page 2 again - list_volumes_page2 = Volume.list( - self.userapiclient, - listall=self.services["listall"], - virtualmachineid=vm_created.id, - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that there are no volumes present in page 2 - self.assertIsNone( - list_volumes_page2, - "Volumes listed in page 2" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_17_running_vm_scaleup(self): - """ - @Desc: Test to verify change service for Running VM - @Steps: - Step1: Checking if dynamic scaling of virtual machines is enabled in zone and template. - If yes then continuing. - If not then printing message that scale up is not possible for Running VM - Step2: Deploying a VM - Step3: Listing all the existing service offerings - Step4: If there is a matching Service Offering for scale-up of running VM - use that service offering. If not create one service offering for scale up. - Step5: Perform change service (scale up) the Running VM deployed in step1 - Step6: Verifying that VM's service offerings is changed - """ - # Checking if Dynamic scaling of VM is supported or not - list_config = Configurations.list( - self.apiClient, - zoneid=self.zone.id, - name="enable.dynamic.scale.vm" - ) - status = validateList(list_config) - self.assertEquals( - PASS, - status[0], - "Listing of configuration failed" - ) - # Checking if dynamic scaling is allowed in Zone and Template - if not ((list_config[0].value is True) and (self.template.isdynamicallyscalable)): - self.debug("Scale up of Running VM is not possible as Zone/Template does not support") - else: - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing details of current Service Offering - vm_so_list = ServiceOffering.list( - self.userapiclient, - id=vm_created.serviceofferingid - ) - status = validateList(vm_so_list) - self.assertEquals( - PASS, - status[0], - "Listing of VM Service offering failed" - ) - current_so = vm_so_list[0] - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Listing all the existing service offerings - service_offerings_list = ServiceOffering.list( - self.userapiclient, - virtualmachineid=vm_created.id - ) - # Verifying if any Service offering available for scale up of VM - so_exists = False - if service_offerings_list is not None: - for i in range(0, len(service_offerings_list)): - if not ((current_so.cpunumber > service_offerings_list[i].cpunumber or\ - current_so.cpuspeed > service_offerings_list[i].cpuspeed or\ - current_so.memory > service_offerings_list[i].memory) or\ - (current_so.cpunumber == service_offerings_list[i].cpunumber and\ - current_so.cpuspeed == service_offerings_list[i].cpuspeed and\ - current_so.memory == service_offerings_list[i].memory)): - if(current_so.storagetype == service_offerings_list[i].storagetype): - so_exists = True - new_so = service_offerings_list[i] - break - # If service offering does not exists, then creating one service offering for scale up - if not so_exists: - self.services["service_offerings"]["small"]["storagetype"] = current_so.storagetype - new_so = ServiceOffering.create( - self.apiClient, - self.services["service_offerings"]["small"] - ) - self.cleanup.append(new_so) - # Scaling up the VM - vm_created.scale_virtualmachine( - self.userapiclient, - new_so.id - ) - # Listing VM details again - list_vms_after = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - self.assertEquals( - 1, - len(list_vms_after), - "VMs list is not as expected" - ) - # Verifying that VM's service offerings is changed - self.assertEquals( - new_so.id, - list_vms_after[0].serviceofferingid, - "VM is not containing New Service Offering" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_18_stopped_vm_change_service(self): - """ - @Desc: Test to verify change service for Stopped VM - @Steps: - Step1: Deploying a VM - Step2: Stopping the VM deployed in step1 - Step3: Listing all the existing service offerings - Step4: If there is a matching Service Offering for change service of stopped VM - use that service offering. If not create one service offering for change service. - Step5: Perform change service for the Stopped VM - Step6: Verifying that VM's service offerings is changed - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing details of current Service Offering - vm_so_list = ServiceOffering.list( - self.userapiclient, - id=vm_created.serviceofferingid - ) - status = validateList(vm_so_list) - self.assertEquals( - PASS, - status[0], - "Listing of VM Service offering failed" - ) - current_so = vm_so_list[0] - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Stopping the VM deployed above - vm_created.stop( - self.userapiclient, - forced=True - ) - # Listing all the service offerings - service_offerings_list = ServiceOffering.list( - self.userapiclient, - virtualmachineid=vm_created.id - ) - # Verifying if any Service offering available for change service of VM - so_exists = False - if service_offerings_list is not None: - for i in range(0, len(service_offerings_list)): - if ((current_so.id != service_offerings_list[i].id) and\ - (current_so.storagetype == service_offerings_list[i].storagetype)): - so_exists = True - new_so = service_offerings_list[i] - break - # If service offering does not exists, then creating one service offering for scale up - if not so_exists: - self.services["service_offerings"]["small"]["storagetype"] = current_so.storagetype - new_so = ServiceOffering.create( - self.apiClient, - self.services["service_offerings"]["small"] - ) - self.cleanup.append(new_so) - # Changing service for the VM - vm_created.scale_virtualmachine( - self.userapiclient, - new_so.id - ) - # Listing VM details again - list_vm = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vm) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - self.assertEquals( - 1, - len(list_vm), - "VMs list is not as expected" - ) - # Verifying that VM's service offerings is changed - self.assertEquals( - new_so.id, - list_vm[0].serviceofferingid, - "VM is not containing New Service Offering" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_19_create_reset_vm_sshkey(self): - """ - @Desc: Test to verify creation and reset of SSH Key for VM - @Steps: - Step1: Deploying a VM - Step2: Stopping the VM deployed in step1 - Step3: Listing all the SSH Key pairs - Step4: Creating a new SSH Key pair - Step5: Listing all the SSh Key pairs again - Step6: Verifying that the key pairs list is increased by 1 - Step7: Resetting the VM SSH Key to the key pair created in step4 - Step8: Verifying that the new SSH Key pair is set to the VM - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Stopping the VM deployed above - vm_created.stop( - self.userapiclient, - forced=True - ) - # Listing all the SSH Key pairs - list_keypairs_before = SSHKeyPair.list( - self.userapiclient - ) - list_keypairs_before_size = 0 - if list_keypairs_before is not None: - list_keypairs_before_size = len(list_keypairs_before) - - # Creating a new Key pair - new_keypair = SSHKeyPair.create( - self.userapiclient, - name="keypair1", - account=self.account.name, - domainid=self.domain.id - ) - self.assertIsNotNone( - new_keypair, - "New Key pair generation failed" - ) - self.assertEquals( - "keypair1", - new_keypair.name, - "Key Pair not created with given name" - ) - # Listing all the SSH Key pairs again - list_keypairs_after = SSHKeyPair.list( - self.userapiclient - ) - status = validateList(list_keypairs_after) - self.assertEquals( - PASS, - status[0], - "Listing of Key pairs failed" - ) - # Verifying that list size is increased by 1 - self.assertEquals( - list_keypairs_before_size + 1, - len(list_keypairs_after), - "List count is not matching" - ) - # Resetting the VM SSH key to the Key pair created above - vm_created.resetSshKey( - self.userapiclient, - keypair=new_keypair.name - ) - # Listing VM details again - list_vm = VirtualMachine.list( - self.userapiclient, - id=vm_created.id - ) - status = validateList(list_vm) - self.assertEquals( - PASS, - status[0], - "Listing of VM failed" - ) - self.assertEquals( - 1, - len(list_vm), - "VMs list is not as expected" - ) - # Verifying that VM's SSH keypair is set to newly created keypair - self.assertEquals( - new_keypair.name, - list_vm[0].keypair, - "VM is not set to newly created SSH Key pair" - ) - return - - @attr(tags=["advanced", "basic", "selfservice"]) - def test_20_update_vm_displayname_group(self): - """ - @Desc: Test to verify Update VM details - @Steps: - Step1: List all the VM's for a user - Step2: Deploy a VM with all parameters - Step3: Listing all the VM's again for the user - Step4: Verifying that list size is increased by 1 - Step5: Updating VM details - displayname, group - Step6: Listing the VM deployed in step 2 by ID - Step7: Verifying that displayname, group details of the VM are updated - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - self.services["virtual_machine"]["keyboard"] = "us" - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - group="groupName" - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Verifying the displayname and group details for deployed VM - self.assertEquals( - self.services["virtual_machine"]["displayname"], - vm_created.displayname, - "Display name of VM is not as expected" - ) - self.assertEquals( - "groupName", - vm_created.group, - "Group of VM is not as expected" - ) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Updating the VM details - displayname and group - vm_created.update( - self.userapiclient, - displayname="DisplayName", - group="Group", - haenable=False - ) - # Listing VM details again - list_vm = VirtualMachine.list( - self.userapiclient, - id=vm_created.id, - ) - status = validateList(list_vm) - self.assertEquals( - PASS, - status[0], - "Listing of VM by Id failed" - ) - self.assertEquals( - 1, - len(list_vm), - "Count of List VM by Id is not matching" - ) - # Verifying that displayname and group details are updated - self.assertEquals( - "DisplayName", - list_vm[0].displayname, - "Displayname of VM is not updated" - ) - self.assertEquals( - "Group", - list_vm[0].group, - "Group of VM is not updated" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_21_restore_vm(self): - """ - @Desc: Test to verify Restore VM - @Steps: - Step1: List all the VM's for a user - Step2: Deploy a VM with all parameters - Step3: Listing all the VM's again for the user - Step4: Verifying that list size is increased by 1 - Step5: Restoring the VM deployed in step2 - Step6: Verifying that restored VM details are same as the VM deployed in step2 - """ - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Restoring the VM - restored_vm = vm_created.restore(self.userapiclient) - self.assertIsNotNone( - restored_vm, - "VM restore failed" - ) - # Verifying the restored VM details - expected_dict = { - "id":vm_created.id, - "name":vm_created.name, - "displayname":vm_created.displayname, - "state":vm_created.state, - "zoneid":vm_created.zoneid, - "account":vm_created.account, - "template":vm_created.templateid - } - actual_dict = { - "id":restored_vm.id, - "name":restored_vm.name, - "displayname":restored_vm.displayname, - "state":restored_vm.state, - "zoneid":restored_vm.zoneid, - "account":restored_vm.account, - "template":restored_vm.templateid - } - restored_vm_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - restored_vm_status, - "Restored VM details are not as expected" - ) - return - - @attr(tags=["advanced", "selfservice"]) - def test_22_deploy_vm_multiple_networks(self): - """ - @Desc: Test to verify deploy VM with multiple networks - @Steps: - Step1: List all the networks for user - Step2: If size of list networks is greater than 2 then get all the networks id's - Else create 2 networks and get network id's - Step3: List all the VM's for a user - Step4: Deploy a VM with multiple network id's - Step5: Listing all the VM's again for the user - Step6: Verifying that list size is increased by 1 - Step7: Verify that VM is associated with multiple networks - """ - # Listing all the networks available - networks_list_before = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - networks_list_size = 0 - if networks_list_before is not None: - networks_list_size = len(networks_list_before) - - # Listing Network Offerings - network_offerings_list = NetworkOffering.list( - self.apiClient, - forvpc="false", - guestiptype="Isolated", - state="Enabled", - supportedservices="SourceNat", - zoneid=self.zone.id - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Isolated Network Offerings with sourceNat enabled are not found" - ) - while networks_list_size < 2: - # Creating a network - network = Network.create( - self.userapiclient, - self.services["network"], - accountid=self.account.name, - domainid=self.domain.id, - networkofferingid=network_offerings_list[0].id, - zoneid=self.zone.id - ) - self.assertIsNotNone( - network, - "Network creation failed" - ) - self.cleanup.append(network) - networks_list_size = networks_list_size + 1 - - # Listing the networks again - networks_list_after = Network.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(network_offerings_list) - self.assertEquals( - PASS, - status[0], - "Listing networks failed" - ) - # populating network id's - networkids = networks_list_after[0].id + "," + networks_list_after[1].id - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - networkids=networkids, - serviceofferingid=self.service_offering.id, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Verifying that the NIC's in VM created are same as provided - vm_nics = vm_created.nic - # Verifying that the size of nics is 2 - self.assertEquals( - 2, - len(vm_nics), - "NIC's count in VM created is not matching" - ) - # Verifying that NIC network ID's are as expected - for i in range(0, len(vm_nics)): - if vm_nics[i].isdefault is True: - self.assertEquals( - networks_list_after[0].id, - vm_nics[i].networkid, - "Default NIC is not as expected" - ) - else: - self.assertEquals( - networks_list_after[1].id, - vm_nics[i].networkid, - "Non Default NIC is not as expected" - ) - return - - @attr(tags=["basic", "provisioning"]) - def test_23_deploy_vm_multiple_securitygroups(self): - """ - @Desc: Test to verify deploy VM with multiple Security Groups - @Steps: - Step1: List all the security groups for user - Step2: If size of list security groups is greater than 2 then get all the security groups id's - Else creating 2 security groups and get security groups id's - Step3: List all the VM's for a user - Step4: Deploy a VM with multiple security groups id's - Step5: Listing all the VM's again for the user - Step6: Verifying that list size is increased by 1 - Step7: Verify that VM is associated with multiple security groups - """ - # Listing all the security groups available - security_groups_list = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - domainid=self.domain.id - ) - security_groups_list_size = 0 - if security_groups_list is not None: - security_groups_list_size = len(security_groups_list) - - while security_groups_list_size < 2: - # Creating a security group - security_group = SecurityGroup.create( - self.userapiclient, - self.services["security_group"], - account=self.account.name, - domainid=self.domain.id - ) - self.assertIsNotNone( - security_group, - "Security Group creation failed" - ) - self.cleanup.append(security_group) - security_groups_list_size = security_groups_list_size + 1 - - # Listing the networks again - security_groups_list = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - domainid=self.domain.id - ) - status = validateList(security_groups_list) - self.assertEquals( - PASS, - status[0], - "Listing Security Groups failed" - ) - # populating Security Groups id's - securitygroupids = {security_groups_list[0].id , security_groups_list[1].id} - # Listing all the VM's for a User - list_vms_before = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - self.assertIsNone( - list_vms_before, - "Virtual Machine already exists for newly created user" - ) - # Deploying a VM - vm_created = VirtualMachine.create( - self.userapiclient, - self.services["virtual_machine"], - accountid=self.account.name, - domainid=self.account.domainid, - serviceofferingid=self.service_offering.id, - securitygroupids=securitygroupids, - ) - self.assertIsNotNone( - vm_created, - "VM creation failed" - ) - self.cleanup.append(vm_created) - # Listing all the VMs for a user again - list_vms_after = VirtualMachine.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vms_after) - self.assertEquals( - PASS, - status[0], - "VM creation failed" - ) - # Verifying that the size of the list is 1 - self.assertEquals( - 1, - len(list_vms_after), - "VM list count is not matching" - ) - # Verifying that the Security Groups's in VM created are same as provided - vm_securitygroups = vm_created.securitygroup - # Verifying that the size of security groups is 2 - self.assertEquals( - 2, - len(vm_securitygroups), - "Security Groups count in VM created is not matching" - ) - # Verifying that Security Group network ID's are as expected - vm_securitygroups_flag = True - for i in range(0, len(vm_securitygroups)): - if ((vm_securitygroups[i].id != security_groups_list[0].id) and\ - (vm_securitygroups[i].id != security_groups_list[1].id)): - vm_securitygroups_flag = False - break - - self.assertEquals( - True, - vm_securitygroups_flag, - "Security Groups in VM are not same as created" - ) - return - -class TestSnapshots(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestSnapshots, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - if cls.zone.localstorageenabled: - cls.storagetype = 'local' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'local' - cls.services["disk_offering"]["storagetype"] = 'local' - else: - cls.storagetype = 'shared' - cls.services["service_offerings"]["tiny"]["storagetype"] = 'shared' - cls.services["disk_offering"]["storagetype"] = 'shared' - - cls.services['mode'] = cls.zone.networktype - cls.services["virtual_machine"]["hypervisor"] = cls.testClient.getHypervisorInfo() - cls.services["virtual_machine"]["zoneid"] = cls.zone.id - cls.services["virtual_machine"]["template"] = cls.template.id - cls.services["custom_volume"]["zoneid"] = cls.zone.id - # Creating Disk offering, Service Offering and Account - cls.disk_offering = DiskOffering.create( - cls.api_client, - cls.services["disk_offering"] - ) - cls._cleanup.append(cls.disk_offering) - cls.service_offering = ServiceOffering.create( - cls.api_client, - cls.services["service_offerings"]["tiny"] - ) - cls._cleanup.append(cls.service_offering) - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - cls._cleanup.append(cls.account) - # Creating Virtual Machine - cls.virtual_machine = VirtualMachine.create( - cls.userapiclient, - cls.services["virtual_machine"], - accountid=cls.account.name, - domainid=cls.account.domainid, - serviceofferingid=cls.service_offering.id, - ) - cls._cleanup.append(cls.virtual_machine) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_01_list_volume_snapshots_pagination(self): - """ - @Desc: Test to List Volume Snapshots pagination - @steps: - Step1: Listing all the volume snapshots for a user - Step2: Verifying that list size is 0 - Step3: Creating (page size + 1) number of volume snapshots - Step4: Listing all the volume snapshots again for a user - Step5: Verifying that list size is (page size + 1) - Step6: Listing all the volume snapshots in page1 - Step7: Verifying that list size is (page size) - Step8: Listing all the volume snapshots in page2 - Step9: Verifying that list size is 1 - Step10: Deleting the volume snapshot present in page 2 - Step11: Listing all the volume snapshots in page2 - Step12: Verifying that list size is 0 - """ - # Listing all the volume snapshots for a User - list_vol_snaps_before = Snapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying list size is 0 - self.assertIsNone( - list_vol_snaps_before, - "Volume snapshots exists for newly created user" - ) - # Listing the root volumes available for the user - volumes_list = Volume.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(volumes_list) - self.assertEquals( - PASS, - status[0], - "Root volume did not get created while deploying a VM" - ) - # Verifying list size to be 1 - self.assertEquals( - 1, - len(volumes_list), - "More than 1 root volume created for deployed VM" - ) - root_volume = volumes_list[0] - # Creating pagesize + 1 number of volume snapshots - for i in range(0, (self.services["pagesize"] + 1)): - snapshot_created = Snapshot.create( - self.userapiclient, - root_volume.id, - ) - self.assertIsNotNone( - snapshot_created, - "Snapshot creation failed" - ) - self.cleanup.append(snapshot_created) - - # Listing all the volume snapshots for user again - list_vol_snaps_after = Snapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_vol_snaps_after) - self.assertEquals( - PASS, - status[0], - "Volume snapshot creation failed" - ) - # Verifying that list size is pagesize + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_vol_snaps_after), - "Failed to create pagesize + 1 number of Volume snapshots" - ) - # Listing all the volume snapshots in page 1 - list_vol_snaps_page1 = Snapshot.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_vol_snaps_page1) - self.assertEquals( - PASS, - status[0], - "Failed to list volume snapshots in page 1" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_vol_snaps_page1), - "Size of volume snapshots in page 1 is not matching" - ) - # Listing all the volume snapshots in page 2 - list_vol_snaps_page2 = Snapshot.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_vol_snaps_page2) - self.assertEquals( - PASS, - status[0], - "Failed to list volume snapshots in page 2" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - 1, - len(list_vol_snaps_page2), - "Size of volume snapshots in page 2 is not matching" - ) - # Deleting the volume snapshot present in page 2 - Snapshot.delete( - snapshot_created, - self.userapiclient - ) - # Listing all the snapshots in page 2 again - list_vol_snaps_page2 = Snapshot.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that list size is 0 - self.assertIsNone( - list_vol_snaps_page2, - "Volume snapshot not deleted from page 2" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_02_list_volume_snapshots_byid(self): - """ - @Desc: Test to List Volume Snapshots by Id - @Steps: - Step1: Listing all the volume snapshots for a user - Step2: Verifying that list size is 0 - Step3: Creating a volume snapshot - Step4: Listing all the volume snapshots again for a user - Step5: Verifying that list size is 1 - Step6: Listing all the volume snapshots by specifying snapshot id - Step7: Verifying that list size is 1 - Step8: Verifying details of the listed volume snapshot - """ - # Listing all the volume snapshots for a User - list_vol_snaps_before = Snapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying list size is 0 - self.assertIsNone( - list_vol_snaps_before, - "Volume snapshots exists for newly created user" - ) - # Listing the root volumes available for the user - volumes_list = Volume.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(volumes_list) - self.assertEquals( - PASS, - status[0], - "Root volume did not get created while deploying a VM" - ) - # Verifying list size to be 1 - self.assertEquals( - 1, - len(volumes_list), - "More than 1 root volume created for deployed VM" - ) - root_volume = volumes_list[0] - # Creating a volume snapshot - snapshot_created = Snapshot.create( - self.userapiclient, - root_volume.id, - ) - self.assertIsNotNone( - snapshot_created, - "Snapshot creation failed" - ) - self.cleanup.append(snapshot_created) - # Listing all the volume snapshots for user again - list_vol_snaps_after = Snapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_vol_snaps_after) - self.assertEquals( - PASS, - status[0], - "Volume snapshot creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_vol_snaps_after), - "Failed to create Volume snapshot" - ) - # Listing volume snapshot by id - list_vol_snapshot = Snapshot.list( - self.userapiclient, - listall=self.services["listall"], - id=snapshot_created.id - ) - status = validateList(list_vol_snapshot) - self.assertEquals( - PASS, - status[0], - "Failed to list Volume snapshot by Id" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_vol_snapshot), - "Size of the list volume snapshot by Id is not matching" - ) - # Verifying details of the listed snapshot to be same as snapshot created above - #Creating expected and actual values dictionaries - expected_dict = { - "id":snapshot_created.id, - "name":snapshot_created.name, - "state":snapshot_created.state, - "intervaltype":snapshot_created.intervaltype, - "account":snapshot_created.account, - "domain":snapshot_created.domainid, - "volume":snapshot_created.volumeid - } - actual_dict = { - "id":list_vol_snapshot[0].id, - "name":list_vol_snapshot[0].name, - "state":list_vol_snapshot[0].state, - "intervaltype":list_vol_snapshot[0].intervaltype, - "account":list_vol_snapshot[0].account, - "domain":list_vol_snapshot[0].domainid, - "volume":list_vol_snapshot[0].volumeid - } - vol_snapshot_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - vol_snapshot_status, - "Listed Volume Snapshot details are not as expected" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_03_list_vm_snapshots_pagination(self): - """ - @Desc: Test to List VM Snapshots pagination - @Steps: - Step1: Listing all the VM snapshots for a user - Step2: Verifying that list size is 0 - Step3: Creating (page size + 1) number of VM snapshots - Step4: Listing all the VM snapshots again for a user - Step5: Verifying that list size is (page size + 1) - Step6: Listing all the VM snapshots in page1 - Step7: Verifying that list size is (page size) - Step8: Listing all the VM snapshots in page2 - Step9: Verifying that list size is 1 - Step10: Deleting the VM snapshot present in page 2 - Step11: Listing all the volume snapshots in page2 - Step12: Verifying that list size is 0 - """ - # Listing all the VM snapshots for a User - list_vm_snaps_before = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying list size is 0 - self.assertIsNone( - list_vm_snaps_before, - "VM snapshots exists for newly created user" - ) - # Creating pagesize + 1 number of VM snapshots - for i in range(0, (self.services["pagesize"] + 1)): - snapshot_created = VmSnapshot.create( - self.userapiclient, - self.virtual_machine.id, - ) - self.assertIsNotNone( - snapshot_created, - "Snapshot creation failed" - ) - - # Listing all the VM snapshots for user again - list_vm_snaps_after = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_vm_snaps_after) - self.assertEquals( - PASS, - status[0], - "VM snapshot creation failed" - ) - # Verifying that list size is pagesize + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_vm_snaps_after), - "Failed to create pagesize + 1 number of VM snapshots" - ) - # Listing all the VM snapshots in page 1 - list_vm_snaps_page1 = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_vm_snaps_page1) - self.assertEquals( - PASS, - status[0], - "Failed to list vm snapshots in page 1" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_vm_snaps_page1), - "Size of vm snapshots in page 1 is not matching" - ) - # Listing all the vm snapshots in page 2 - list_vm_snaps_page2 = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_vm_snaps_page2) - self.assertEquals( - PASS, - status[0], - "Failed to list vm snapshots in page 2" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - 1, - len(list_vm_snaps_page2), - "Size of vm snapshots in page 2 is not matching" - ) - # Deleting the vm snapshot present in page 2 - VmSnapshot.deleteVMSnapshot( - self.userapiclient, - snapshot_created.id - ) - # Listing all the snapshots in page 2 again - list_vm_snaps_page2 = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that list size is 0 - self.assertIsNone( - list_vm_snaps_page2, - "VM snapshot not deleted from page 2" - ) - # Deleting all the existing VM snapshots - list_vm_snaps = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - ) - status = validateList(list_vm_snaps) - self.assertEquals( - PASS, - status[0], - "All VM snapshots deleted" - ) - # Verifying that list size is equal to page size - self.assertEquals( - self.services["pagesize"], - len(list_vm_snaps), - "VM Snapshots count is not matching" - ) - # Deleting all the existing VM snapshots - for i in range(0, len(list_vm_snaps)): - VmSnapshot.deleteVMSnapshot( - self.userapiclient, - list_vm_snaps[i].id - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_04_list_vm_snapshots_byid(self): - """ - @summary: Test to List VM Snapshots by Id - - Step1: Listing all the VM snapshots for a user - Step2: Verifying that list size is 0 - Step3: Creating a VM snapshot - Step4: Listing all the VM snapshots again for a user - Step5: Verifying that list size is 1 - Step6: Listing all the VM snapshots by specifying snapshot id - Step7: Verifying that list size is 1 - Step8: Verifying details of the listed VM snapshot - """ - # Listing all the VM snapshots for a User - list_vm_snaps_before = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying list size is 0 - self.assertIsNone( - list_vm_snaps_before, - "VM snapshots exists for newly created user" - ) - # Creating a VM snapshot - snapshot_created = VmSnapshot.create( - self.userapiclient, - self.virtual_machine.id, - ) - self.assertIsNotNone( - snapshot_created, - "Snapshot creation failed" - ) - # Listing all the VM snapshots for user again - list_vm_snaps_after = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_vm_snaps_after) - self.assertEquals( - PASS, - status[0], - "VM snapshot creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_vm_snaps_after), - "Failed to create VM snapshot" - ) - # Listing vm snapshot by id - list_vm_snapshot = VmSnapshot.list( - self.userapiclient, - listall=self.services["listall"], - vmsnapshotid=snapshot_created.id - ) - status = validateList(list_vm_snapshot) - self.assertEquals( - PASS, - status[0], - "Failed to list VM snapshot by Id" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_vm_snapshot), - "Size of the list vm snapshot by Id is not matching" - ) - # Verifying details of the listed snapshot to be same as snapshot created above - #Creating expected and actual values dictionaries - expected_dict = { - "id":snapshot_created.id, - "name":snapshot_created.name, - "state":snapshot_created.state, - "vmid":snapshot_created.virtualmachineid, - } - actual_dict = { - "id":list_vm_snapshot[0].id, - "name":list_vm_snapshot[0].name, - "state":list_vm_snapshot[0].state, - "vmid":list_vm_snapshot[0].virtualmachineid, - } - vm_snapshot_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - vm_snapshot_status, - "Listed VM Snapshot details are not as expected" - ) - return - -class TestSecurityGroups(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestSecurityGroups, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - cls.services['mode'] = cls.zone.networktype - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - cls._cleanup.append(cls.account) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["basic", "provisioning"]) - def test_01_list_securitygroups_pagination(self): - """ - @Desc: Test to List Security Groups pagination - @steps: - Step1: Listing all the Security Groups for a user - Step2: Verifying that list size is 1 - Step3: Creating (page size) number of Security Groups - Step4: Listing all the Security Groups again for a user - Step5: Verifying that list size is (page size + 1) - Step6: Listing all the Security Groups in page1 - Step7: Verifying that list size is (page size) - Step8: Listing all the Security Groups in page2 - Step9: Verifying that list size is 1 - Step10: Deleting the Security Group present in page 2 - Step11: Listing all the Security Groups in page2 - Step12: Verifying that no security groups are listed - """ - # Listing all the Security Groups for a User - list_securitygroups_before = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying that default security group is created - status = validateList(list_securitygroups_before) - self.assertEquals( - PASS, - status[0], - "Default Security Groups creation failed" - ) - # Verifying the size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_before), - "Count of Security Groups list is not matching" - ) - # Creating pagesize number of security groups - for i in range(0, (self.services["pagesize"])): - securitygroup_created = SecurityGroup.create( - self.userapiclient, - self.services["security_group"], - account=self.account.name, - domainid=self.domain.id, - description=self.services["security_group"]["name"] - ) - self.assertIsNotNone( - securitygroup_created, - "Security Group creation failed" - ) - if (i < self.services["pagesize"]): - self.cleanup.append(securitygroup_created) - - # Listing all the security groups for user again - list_securitygroups_after = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_securitygroups_after) - self.assertEquals( - PASS, - status[0], - "Security Groups creation failed" - ) - # Verifying that list size is pagesize + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_securitygroups_after), - "Failed to create pagesize + 1 number of Security Groups" - ) - # Listing all the security groups in page 1 - list_securitygroups_page1 = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_securitygroups_page1) - self.assertEquals( - PASS, - status[0], - "Failed to list security groups in page 1" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_securitygroups_page1), - "Size of security groups in page 1 is not matching" - ) - # Listing all the security groups in page 2 - list_securitygroups_page2 = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_securitygroups_page2) - self.assertEquals( - PASS, - status[0], - "Failed to list security groups in page 2" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - 1, - len(list_securitygroups_page2), - "Size of security groups in page 2 is not matching" - ) - # Deleting the security group present in page 2 - SecurityGroup.delete( - securitygroup_created, - self.userapiclient) - # Listing all the security groups in page 2 again - list_securitygroups_page2 = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that there are no security groups listed - self.assertIsNone( - list_securitygroups_page2, - "Security Groups not deleted from page 2" - ) - return - - @attr(tags=["basic", "provisioning"]) - def test_02_securitygroups_authorize_revoke_ingress(self): - """ - @Desc: Test to Authorize and Revoke Ingress for Security Group - @steps: - Step1: Listing all the Security Groups for a user - Step2: Verifying that list size is 1 - Step3: Creating a Security Groups - Step4: Listing all the Security Groups again for a user - Step5: Verifying that list size is 2 - Step6: Authorizing Ingress for the security group created in step3 - Step7: Listing the security groups by passing id of security group created in step3 - Step8: Verifying that list size is 1 - Step9: Verifying that Ingress is authorized to the security group - Step10: Verifying the details of the Ingress rule are as expected - Step11: Revoking Ingress for the security group created in step3 - Step12: Listing the security groups by passing id of security group created in step3 - Step13: Verifying that list size is 1 - Step14: Verifying that Ingress is revoked from the security group - """ - # Listing all the Security Groups for a User - list_securitygroups_before = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying that default security group is created - status = validateList(list_securitygroups_before) - self.assertEquals( - PASS, - status[0], - "Default Security Groups creation failed" - ) - # Verifying the size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_before), - "Count of Security Groups list is not matching" - ) - # Creating a security group - securitygroup_created = SecurityGroup.create( - self.userapiclient, - self.services["security_group"], - account=self.account.name, - domainid=self.domain.id, - description=self.services["security_group"]["name"] - ) - self.assertIsNotNone( - securitygroup_created, - "Security Group creation failed" - ) - self.cleanup.append(securitygroup_created) - - # Listing all the security groups for user again - list_securitygroups_after = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_securitygroups_after) - self.assertEquals( - PASS, - status[0], - "Security Groups creation failed" - ) - # Verifying that list size is 2 - self.assertEquals( - 2, - len(list_securitygroups_after), - "Failed to create Security Group" - ) - # Authorizing Ingress for the security group created in step3 - securitygroup_created.authorize( - self.userapiclient, - self.services["ingress_rule"], - self.account.name, - self.domain.id, - ) - # Listing the security group by Id - list_securitygroups_byid = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - id=securitygroup_created.id, - domainid=self.domain.id - ) - # Verifying that security group is listed - status = validateList(list_securitygroups_byid) - self.assertEquals( - PASS, - status[0], - "Listing of Security Groups by id failed" - ) - # Verifying size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_byid), - "Count of the listing security group by id is not matching" - ) - securitygroup_ingress = list_securitygroups_byid[0].ingressrule - # Validating the Ingress rule - status = validateList(securitygroup_ingress) - self.assertEquals( - PASS, - status[0], - "Security Groups Ingress rule authorization failed" - ) - self.assertEquals( - 1, - len(securitygroup_ingress), - "Security Group Ingress rules count is not matching" - ) - # Verifying the details of the Ingress rule are as expected - #Creating expected and actual values dictionaries - expected_dict = { - "cidr":self.services["ingress_rule"]["cidrlist"], - "protocol":self.services["ingress_rule"]["protocol"], - "startport":self.services["ingress_rule"]["startport"], - "endport":self.services["ingress_rule"]["endport"], - } - actual_dict = { - "cidr":str(securitygroup_ingress[0].cidr), - "protocol":str(securitygroup_ingress[0].protocol.upper()), - "startport":str(securitygroup_ingress[0].startport), - "endport":str(securitygroup_ingress[0].endport), - } - ingress_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - ingress_status, - "Listed Security group Ingress rule details are not as expected" - ) - # Revoking the Ingress rule from Security Group - securitygroup_created.revoke(self.userapiclient, securitygroup_ingress[0].ruleid) - # Listing the security group by Id - list_securitygroups_byid = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - id=securitygroup_created.id, - domainid=self.domain.id - ) - # Verifying that security group is listed - status = validateList(list_securitygroups_byid) - self.assertEquals( - PASS, - status[0], - "Listing of Security Groups by id failed" - ) - # Verifying size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_byid), - "Count of the listing security group by id is not matching" - ) - securitygroup_ingress = list_securitygroups_byid[0].ingressrule - # Verifying that Ingress rule is empty(revoked) - status = validateList(securitygroup_ingress) - self.assertEquals( - EMPTY_LIST, - status[2], - "Security Groups Ingress rule is not revoked" - ) - return - - @attr(tags=["basic", "provisioning"]) - def test_03_securitygroups_authorize_revoke_egress(self): - """ - @Desc: Test to Authorize and Revoke Egress for Security Group - @steps: - Step1: Listing all the Security Groups for a user - Step2: Verifying that list size is 1 - Step3: Creating a Security Groups - Step4: Listing all the Security Groups again for a user - Step5: Verifying that list size is 2 - Step6: Authorizing Egress for the security group created in step3 - Step7: Listing the security groups by passing id of security group created in step3 - Step8: Verifying that list size is 1 - Step9: Verifying that Egress is authorized to the security group - Step10: Verifying the details of the Egress rule are as expected - Step11: Revoking Egress for the security group created in step3 - Step12: Listing the security groups by passing id of security group created in step3 - Step13: Verifying that list size is 1 - Step14: Verifying that Egress is revoked from the security group - """ - # Listing all the Security Groups for a User - list_securitygroups_before = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying that default security group is created - status = validateList(list_securitygroups_before) - self.assertEquals( - PASS, - status[0], - "Default Security Groups creation failed" - ) - # Verifying the size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_before), - "Count of Security Groups list is not matching" - ) - # Creating a security group - securitygroup_created = SecurityGroup.create( - self.userapiclient, - self.services["security_group"], - account=self.account.name, - domainid=self.domain.id, - description=self.services["security_group"]["name"] - ) - self.assertIsNotNone( - securitygroup_created, - "Security Group creation failed" - ) - self.cleanup.append(securitygroup_created) - - # Listing all the security groups for user again - list_securitygroups_after = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_securitygroups_after) - self.assertEquals( - PASS, - status[0], - "Security Groups creation failed" - ) - # Verifying that list size is 2 - self.assertEquals( - 2, - len(list_securitygroups_after), - "Failed to create Security Group" - ) - # Authorizing Egress for the security group created in step3 - securitygroup_created.authorizeEgress( - self.userapiclient, - self.services["ingress_rule"], - self.account.name, - self.domain.id, - ) - # Listing the security group by Id - list_securitygroups_byid = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - id=securitygroup_created.id, - domainid=self.domain.id - ) - # Verifying that security group is listed - status = validateList(list_securitygroups_byid) - self.assertEquals( - PASS, - status[0], - "Listing of Security Groups by id failed" - ) - # Verifying size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_byid), - "Count of the listing security group by id is not matching" - ) - securitygroup_egress = list_securitygroups_byid[0].egressrule - # Validating the Ingress rule - status = validateList(securitygroup_egress) - self.assertEquals( - PASS, - status[0], - "Security Groups Egress rule authorization failed" - ) - self.assertEquals( - 1, - len(securitygroup_egress), - "Security Group Egress rules count is not matching" - ) - # Verifying the details of the Egress rule are as expected - #Creating expected and actual values dictionaries - expected_dict = { - "cidr":self.services["ingress_rule"]["cidrlist"], - "protocol":self.services["ingress_rule"]["protocol"], - "startport":self.services["ingress_rule"]["startport"], - "endport":self.services["ingress_rule"]["endport"], - } - actual_dict = { - "cidr":str(securitygroup_egress[0].cidr), - "protocol":str(securitygroup_egress[0].protocol.upper()), - "startport":str(securitygroup_egress[0].startport), - "endport":str(securitygroup_egress[0].endport), - } - ingress_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - ingress_status, - "Listed Security group Egress rule details are not as expected" - ) - # Revoking the Egress rule from Security Group - securitygroup_created.revokeEgress(self.userapiclient, securitygroup_egress[0].ruleid) - # Listing the security group by Id - list_securitygroups_byid = SecurityGroup.list( - self.userapiclient, - listall=self.services["listall"], - id=securitygroup_created.id, - domainid=self.domain.id - ) - # Verifying that security group is listed - status = validateList(list_securitygroups_byid) - self.assertEquals( - PASS, - status[0], - "Listing of Security Groups by id failed" - ) - # Verifying size of the list is 1 - self.assertEquals( - 1, - len(list_securitygroups_byid), - "Count of the listing security group by id is not matching" - ) - securitygroup_egress = list_securitygroups_byid[0].egressrule - # Verifying that Ingress rule is empty(revoked) - status = validateList(securitygroup_egress) - self.assertEquals( - EMPTY_LIST, - status[2], - "Security Groups Egress rule is not revoked" - ) - return - -class TestVpnCustomerGateways(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestVpnCustomerGateways, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - cls.services['mode'] = cls.zone.networktype - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - cls._cleanup.append(cls.account) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_01_list_vpncustomergateways_pagination(self): - """ - @Desc: Test to List VPN Customer Gateways pagination - @steps: - Step1: Listing all the VPN Customer Gateways for a user - Step2: Verifying that no VPN Customer Gateways are listed - Step3: Creating (page size + 1) number of VPN Customer Gateways - Step4: Listing all the VPN Customer Gateways again for a user - Step5: Verifying that list size is (page size + 1) - Step6: Listing all the VPN Customer Gateways in page1 - Step7: Verifying that list size is (page size) - Step8: Listing all the VPN Customer Gateways in page2 - Step9: Verifying that list size is 1 - Step10: Deleting the VPN Customer Gateways present in page 2 - Step11: Listing all the VPN Customer Gateways in page2 - Step12: Verifying that no VPN Customer Gateways are listed - """ - # Listing all the VPN Customer Gateways for a User - list_vpncustomergateways_before = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying that no VPN Customer Gateways are listed - self.assertIsNone( - list_vpncustomergateways_before, - "VPN Customer Gateways listed for newly created User" - ) - # Creating pagesize + 1 number of VPN Customer Gateways - for i in range(0, (self.services["pagesize"] + 1)): - vpncustomergateway_created = VpnCustomerGateway.create( - self.userapiclient, - self.services["vpncustomergateway"], - name="VPNCustGateway"+str(i+1), - gateway="10.102.153." + str(i+1), - cidrlist="10.0.0.0/24", - account=self.account.name, - domainid=self.domain.id - ) - self.assertIsNotNone( - vpncustomergateway_created, - "VPN Customer Gateway creation failed" - ) - if (i < self.services["pagesize"] + 1): - self.cleanup.append(vpncustomergateway_created) - - # Listing all the VPN Customer Gateways for a User - list_vpncustomergateways_after = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_vpncustomergateways_after) - self.assertEquals( - PASS, - status[0], - "VPN Customer Gateway creation failed" - ) - # Verifying that list size is pagesize + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_vpncustomergateways_after), - "Failed to create pagesize + 1 number of VPN Customer Gateways" - ) - # Listing all the VPN Customer Gateways in page 1 - list_vpncustomergateways_page1 = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"], - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_vpncustomergateways_page1) - self.assertEquals( - PASS, - status[0], - "Failed to list VPN Customer Gateways in page 1" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_vpncustomergateways_page1), - "Size of VPN Customer Gateways in page 1 is not matching" - ) - # Listing all the VPN Customer Gateways in page 2 - list_vpncustomergateways_page2 = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_vpncustomergateways_page2) - self.assertEquals( - PASS, - status[0], - "Failed to list VPN Customer Gateways in page 2" - ) - # Verifying the list size to be equal to 1 - self.assertEquals( - 1, - len(list_vpncustomergateways_page2), - "Size of VPN Customer Gateways in page 2 is not matching" - ) - # Deleting the VPM Customer Gateway present in page 2 - VpnCustomerGateway.delete( - vpncustomergateway_created, - self.userapiclient - ) - # Listing all the VPN Customer Gateways in page 2 again - list_vpncustomergateways_page2 = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"], - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that there are no VPN Customer Gateways listed - self.assertIsNone( - list_vpncustomergateways_page2, - "VPN Customer Gateways not deleted from page 2" - ) - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_02_update_vpncustomergateways(self): - """ - @Desc: Test to update VPN Customer Gateways pagination - @steps: - Step1: Listing all the VPN Customer Gateways for a user - Step2: Verifying that no VPN Customer Gateways are listed - Step3: Creating a VPN Customer Gateways - Step4: Listing all the VPN Customer Gateways again for a user - Step5: Verifying that list size is 1 - Step6: Updating the VPN Customer Gateways created in step3 - Step7: Listing the VPN customer gateway by id - Step8: Verifying that list size is 1 - Step9: Verifying the details of the listed VPN customer gateway are same as updated in step6 - """ - # Listing all the VPN Customer Gateways for a User - list_vpncustomergateways_before = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"] - ) - # Verifying that no VPN Customer Gateways are listed - self.assertIsNone( - list_vpncustomergateways_before, - "VPN Customer Gateways listed for newly created User" - ) - # Creating A VPN Customer Gateways - vpncustomergateway_created = VpnCustomerGateway.create( - self.userapiclient, - self.services["vpncustomergateway"], - name="VPNCustGateway", - gateway="10.102.153.90", - cidrlist="10.0.0.0/24", - account=self.account.name, - domainid=self.domain.id - ) - self.assertIsNotNone( - vpncustomergateway_created, - "VPN Customer Gateway creation failed" - ) - self.cleanup.append(vpncustomergateway_created) - # Listing all the VPN Customer Gateways for a User - list_vpncustomergateways_after = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"] - ) - status = validateList(list_vpncustomergateways_after) - self.assertEquals( - PASS, - status[0], - "VPN Customer Gateway creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_vpncustomergateways_after), - "Failed to create VPN Customer Gateways" - ) - # Updating the VPN Customer gateway - vpncustomergateway_updated = VpnCustomerGateway.update( - vpncustomergateway_created, - self.userapiclient, - self.services["vpncustomergateway"], - name="NewVPNCustGateway", - gateway="10.102.153.90", - cidrlist="10.0.0.0/24", - ) - self.assertIsNotNone( - vpncustomergateway_updated, - "Updation of VPN Customer Gateway failed" - ) - # Listing the VPN Customer Gateways by Id - list_vpncustomergateway = VpnCustomerGateway.list( - self.userapiclient, - listall=self.services["listall"], - id=vpncustomergateway_created.id - ) - status = validateList(list_vpncustomergateway) - self.assertEquals( - PASS, - status[0], - "Failed to list VPN Customer Gateways by Id" - ) - # Verifying the list size to be equal to 1 - self.assertEquals( - 1, - len(list_vpncustomergateway), - "Size of VPN Customer Gateways by id is not matching" - ) - # Verifying the details of the listed VPN Customer Gateway are same as updated - #Creating expected and actual values dictionaries - expected_dict = { - "name":vpncustomergateway_updated.name, - "id":vpncustomergateway_updated.id, - "account":vpncustomergateway_updated.account, - "domainid":vpncustomergateway_updated.domainid, - "gateway":vpncustomergateway_updated.gateway, - "cidrlist":vpncustomergateway_updated.cidrlist, - "seckey":vpncustomergateway_updated.ipsecpsk, - "ikepolicy":vpncustomergateway_updated.ikepolicy, - "ikelifetime":vpncustomergateway_updated.ikelifetime, - "esppolicy":vpncustomergateway_updated.esppolicy, - "esplifetime":vpncustomergateway_updated.esplifetime, - } - actual_dict = { - "name":list_vpncustomergateway[0].name, - "id":list_vpncustomergateway[0].id, - "account":list_vpncustomergateway[0].account, - "domainid":list_vpncustomergateway[0].domainid, - "gateway":list_vpncustomergateway[0].gateway, - "cidrlist":list_vpncustomergateway[0].cidrlist, - "seckey":list_vpncustomergateway[0].ipsecpsk, - "ikepolicy":list_vpncustomergateway[0].ikepolicy, - "ikelifetime":list_vpncustomergateway[0].ikelifetime, - "esppolicy":list_vpncustomergateway[0].esppolicy, - "esplifetime":list_vpncustomergateway[0].esplifetime, - } - vpncustomergateway_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - vpncustomergateway_status, - "Listed VPN Customer Gateway details are not as Updated" - ) - return - -class TestTemplates(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestTemplates, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - cls.hypervisor = cls.testClient.getHypervisorInfo() - cls.services['mode'] = cls.zone.networktype - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - cls._cleanup.append(cls.account) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_01_list_templates_pagination(self): - """ - @Desc: Test to List Templates pagination - @steps: - Step1: Listing all the Templates for a user - Step2: Verifying that no Templates are listed - Step3: Creating (page size + 1) number of Templates - Step4: Listing all the Templates again for a user - Step5: Verifying that list size is (page size + 1) - Step6: Listing all the Templates in page1 - Step7: Verifying that list size is (page size) - Step8: Listing all the Templates in page2 - Step9: Verifying that list size is 1 - Step10: Listing the template by Id - Step11: Verifying if the template is downloaded and ready. - If yes the continuing - If not waiting and checking for template to be ready till timeout - Step12: Deleting the Template present in page 2 - Step13: Listing all the Templates in page2 - Step14: Verifying that no Templates are listed - """ - # Listing all the Templates for a User - list_templates_before = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"] - ) - # Verifying that no Templates are listed - self.assertIsNone( - list_templates_before, - "Templates listed for newly created User" - ) - self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" - self.services["template"]["format"] = "VHD" - self.services["template"]["ostype"] = self.services["ostype"] - # Creating pagesize + 1 number of Templates - for i in range(0, (self.services["pagesize"] + 1)): - template_created = Template.register( - self.userapiclient, - self.services["template"], - self.zone.id, - hypervisor=self.hypervisor - ) - self.assertIsNotNone( - template_created, - "Template creation failed" - ) - if(i < self.services["pagesize"]): - self.cleanup.append(template_created) - - # Listing all the Templates for a User - list_templates_after = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"] - ) - status = validateList(list_templates_after) - self.assertEquals( - PASS, - status[0], - "Templates creation failed" - ) - # Verifying that list size is pagesize + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_templates_after), - "Failed to create pagesize + 1 number of Templates" - ) - # Listing all the Templates in page 1 - list_templates_page1 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_templates_page1) - self.assertEquals( - PASS, - status[0], - "Failed to list Templates in page 1" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_templates_page1), - "Size of Templates in page 1 is not matching" - ) - # Listing all the Templates in page 2 - list_templates_page2 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_templates_page2) - self.assertEquals( - PASS, - status[0], - "Failed to list Templates in page 2" - ) - # Verifying the list size to be equal to 1 - self.assertEquals( - 1, - len(list_templates_page2), - "Size of Templates in page 2 is not matching" - ) - # Verifying the state of the template to be ready. If not waiting for state to become ready - template_ready = False - count = 0 - while template_ready is False: - list_template = Template.list( - self.userapiclient, - id=template_created.id, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - ) - status = validateList(list_template) - self.assertEquals( - PASS, - status[0], - "Failed to list Templates by Id" - ) - if list_template[0].isready is True: - template_ready = True - elif (str(list_template[0].status) == "Error"): - self.fail("Created Template is in Errored state") - break - elif count > 10: - self.fail("Timed out before Template came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Deleting the Template present in page 2 - Template.delete( - template_created, - self.userapiclient - ) - # Listing all the Templates in page 2 again - list_templates_page2 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that there are no Templates listed - self.assertIsNone( - list_templates_page2, - "Templates not deleted from page 2" - ) - del self.services["template"]["url"] - del self.services["template"]["format"] - del self.services["template"]["ostype"] - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_02_download_template(self): - """ - @Desc: Test to Download Template - @steps: - Step1: Listing all the Templates for a user - Step2: Verifying that no Templates are listed - Step3: Creating a Templates - Step4: Listing all the Templates again for a user - Step5: Verifying that list size is 1 - Step6: Verifying if the template is in ready state. - If yes the continuing - If not waiting and checking for template to be ready till timeout - Step7: Downloading the template (Extract) - Step8: Verifying that Template is downloaded - """ - # Listing all the Templates for a User - list_templates_before = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"] - ) - # Verifying that no Templates are listed - self.assertIsNone( - list_templates_before, - "Templates listed for newly created User" - ) - self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" - self.services["template"]["format"] = "VHD" - self.services["template"]["ostype"] = self.services["ostype"] - self.services["template"]["isextractable"] = True - # Creating aTemplate - template_created = Template.register( - self.userapiclient, - self.services["template"], - self.zone.id, - hypervisor=self.hypervisor - ) - self.assertIsNotNone( - template_created, - "Template creation failed" - ) - self.cleanup.append(template_created) - # Listing all the Templates for a User - list_templates_after = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"] - ) - status = validateList(list_templates_after) - self.assertEquals( - PASS, - status[0], - "Templates creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_templates_after), - "Failed to create a Template" - ) - # Verifying the state of the template to be ready. If not waiting for state to become ready till time out - template_ready = False - count = 0 - while template_ready is False: - list_template = Template.list( - self.userapiclient, - id=template_created.id, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - ) - status = validateList(list_template) - self.assertEquals( - PASS, - status[0], - "Failed to list Templates by Id" - ) - if list_template[0].isready is True: - template_ready = True - elif (str(list_template[0].status) == "Error"): - self.fail("Created Template is in Errored state") - break - elif count > 10: - self.fail("Timed out before Template came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Downloading the Template name - download_template = Template.extract( - self.userapiclient, - template_created.id, - mode="HTTP_DOWNLOAD", - zoneid=self.zone.id - ) - self.assertIsNotNone( - download_template, - "Download Template failed" - ) - # Verifying the details of downloaded template - self.assertEquals( - "DOWNLOAD_URL_CREATED", - download_template.state, - "Download URL not created for Template" - ) - self.assertIsNotNone( - download_template.url, - "Download URL not created for Template" - ) - self.assertEquals( - template_created.id, - download_template.id, - "Download Template details are not same as Template created" - ) - del self.services["template"]["url"] - del self.services["template"]["format"] - del self.services["template"]["ostype"] - del self.services["template"]["isextractable"] - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_03_edit_template_details(self): - """ - @Desc: Test to Edit Template name, displaytext, OSType - @steps: - Step1: Listing all the Templates for a user - Step2: Verifying that no Templates are listed - Step3: Creating a Templates - Step4: Listing all the Templates again for a user - Step5: Verifying that list size is 1 - Step6: Verifying if the template is in ready state. - If yes the continuing - If not waiting and checking for template to be ready till timeout - Step7: Editing the template name - Step8: Verifying that Template name is edited - Step9: Editing the template displaytext - Step10: Verifying that Template displaytext is edited - Step11: Editing the template ostypeid - Step12: Verifying that Template ostypeid is edited - Step13: Editing the template name, displaytext - Step14: Verifying that Template name, displaytext are edited - Step15: Editing the template name, displaytext, ostypeid - Step16: Verifying that Template name, displaytext and ostypeid are edited - """ - # Listing all the Templates for a User - list_templates_before = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"] - ) - # Verifying that no Templates are listed - self.assertIsNone( - list_templates_before, - "Templates listed for newly created User" - ) - self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" - self.services["template"]["format"] = "VHD" - self.services["template"]["ostype"] = self.services["ostype"] - # Creating aTemplate - template_created = Template.register( - self.userapiclient, - self.services["template"], - self.zone.id, - hypervisor=self.hypervisor - ) - self.assertIsNotNone( - template_created, - "Template creation failed" - ) - self.cleanup.append(template_created) - # Listing all the Templates for a User - list_templates_after = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"] - ) - status = validateList(list_templates_after) - self.assertEquals( - PASS, - status[0], - "Templates creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_templates_after), - "Failed to create a Template" - ) - # Verifying the state of the template to be ready. If not waiting for state to become ready till time out - template_ready = False - count = 0 - while template_ready is False: - list_template = Template.list( - self.userapiclient, - id=template_created.id, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - ) - status = validateList(list_template) - self.assertEquals( - PASS, - status[0], - "Failed to list Templates by Id" - ) - if list_template[0].isready is True: - template_ready = True - elif (str(list_template[0].status) == "Error"): - self.fail("Created Template is in Errored state") - break - elif count > 10: - self.fail("Timed out before Template came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Editing the Template name - edited_template = Template.update( - template_created, - self.userapiclient, - name="NewTemplateName" - ) - self.assertIsNotNone( - edited_template, - "Editing Template failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":template_created.id, - "name":"NewTemplateName", - "displaytest":template_created.displaytext, - "account":template_created.account, - "domainid":template_created.domainid, - "format":template_created.format, - "ostypeid":template_created.ostypeid, - "templatetype":template_created.templatetype, - } - actual_dict = { - "id":edited_template.id, - "name":edited_template.name, - "displaytest":edited_template.displaytext, - "account":edited_template.account, - "domainid":edited_template.domainid, - "format":edited_template.format, - "ostypeid":edited_template.ostypeid, - "templatetype":edited_template.templatetype, - } - edit_template_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_template_status, - "Edited Template details are not as expected" - ) - # Editing the Template displaytext - edited_template = Template.update( - template_created, - self.userapiclient, - displaytext="TemplateDisplaytext" - ) - self.assertIsNotNone( - edited_template, - "Editing Template failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":template_created.id, - "name":"NewTemplateName", - "displaytest":"TemplateDisplaytext", - "account":template_created.account, - "domainid":template_created.domainid, - "format":template_created.format, - "ostypeid":template_created.ostypeid, - "templatetype":template_created.templatetype, - } - actual_dict = { - "id":edited_template.id, - "name":edited_template.name, - "displaytest":edited_template.displaytext, - "account":edited_template.account, - "domainid":edited_template.domainid, - "format":edited_template.format, - "ostypeid":edited_template.ostypeid, - "templatetype":edited_template.templatetype, - } - edit_template_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_template_status, - "Edited Template details are not as expected" - ) - # Editing the Template ostypeid - ostype_list = list_os_types(self.userapiclient) - status = validateList(ostype_list) - self.assertEquals( - PASS, - status[0], - "Failed to list OS Types" - ) - for i in range(0, len(ostype_list)): - if ostype_list[i].id != template_created.ostypeid: - newostypeid = ostype_list[i].id - break - - edited_template = Template.update( - template_created, - self.userapiclient, - ostypeid=newostypeid - ) - self.assertIsNotNone( - edited_template, - "Editing Template failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":template_created.id, - "name":"NewTemplateName", - "displaytest":"TemplateDisplaytext", - "account":template_created.account, - "domainid":template_created.domainid, - "format":template_created.format, - "ostypeid":newostypeid, - "templatetype":template_created.templatetype, - } - actual_dict = { - "id":edited_template.id, - "name":edited_template.name, - "displaytest":edited_template.displaytext, - "account":edited_template.account, - "domainid":edited_template.domainid, - "format":edited_template.format, - "ostypeid":edited_template.ostypeid, - "templatetype":edited_template.templatetype, - } - edit_template_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_template_status, - "Edited Template details are not as expected" - ) - # Editing the Template name, displaytext - edited_template = Template.update( - template_created, - self.userapiclient, - name=template_created.name, - displaytext=template_created.displaytext - ) - self.assertIsNotNone( - edited_template, - "Editing Template failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":template_created.id, - "name":template_created.name, - "displaytest":template_created.displaytext, - "account":template_created.account, - "domainid":template_created.domainid, - "format":template_created.format, - "ostypeid":newostypeid, - "templatetype":template_created.templatetype, - } - actual_dict = { - "id":edited_template.id, - "name":edited_template.name, - "displaytest":edited_template.displaytext, - "account":edited_template.account, - "domainid":edited_template.domainid, - "format":edited_template.format, - "ostypeid":edited_template.ostypeid, - "templatetype":edited_template.templatetype, - } - edit_template_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_template_status, - "Edited Template details are not as expected" - ) - # Editing the Template name, displaytext, ostypeid - edited_template = Template.update( - template_created, - self.userapiclient, - name="NewTemplateName", - displaytext="TemplateDisplaytext", - ostypeid=template_created.ostypeid - ) - self.assertIsNotNone( - edited_template, - "Editing Template failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":template_created.id, - "name":"NewTemplateName", - "displaytest":"TemplateDisplaytext", - "account":template_created.account, - "domainid":template_created.domainid, - "format":template_created.format, - "ostypeid":template_created.ostypeid, - "templatetype":template_created.templatetype, - } - actual_dict = { - "id":edited_template.id, - "name":edited_template.name, - "displaytest":edited_template.displaytext, - "account":edited_template.account, - "domainid":edited_template.domainid, - "format":edited_template.format, - "ostypeid":edited_template.ostypeid, - "templatetype":edited_template.templatetype, - } - edit_template_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_template_status, - "Edited Template details are not as expected" - ) - del self.services["template"]["url"] - del self.services["template"]["format"] - del self.services["template"]["ostype"] - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_04_copy_template(self): - """ - @Desc: Test to copy Template from one zone to another - @steps: - Step1: Listing Zones available for a user - Step2: Verifying if the zones listed are greater than 1. - If Yes continuing. - If not halting the test. - Step3: Listing all the templates for a user in zone1 - Step4: Verifying that no templates are listed - Step5: Listing all the templates for a user in zone2 - Step6: Verifying that no templates are listed - Step7: Creating a Template in zone 1 - Step8: Listing all the Templates again for a user in zone1 - Step9: Verifying that list size is 1 - Step10: Listing all the templates for a user in zone2 - Step11: Verifying that no templates are listed - Step12: Copying the template created in step7 from zone1 to zone2 - Step13: Listing all the templates for a user in zone2 - Step14: Verifying that list size is 1 - Step15: Listing all the Templates for a user in zone1 - Step16: Verifying that list size is 1 - """ - # Listing Zones available for a user - zones_list = Zone.list( - self.userapiclient, - available=True - ) - status = validateList(zones_list) - self.assertEquals( - PASS, - status[0], - "Failed to list Zones" - ) - if not len(zones_list) > 1: - self.fail("Enough zones doesnot exists to copy template") - else: - # Listing all the Templates for a User in Zone 1 - list_templates_zone1 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - zoneid=zones_list[0].id - ) - # Verifying that no Templates are listed - self.assertIsNone( - list_templates_zone1, - "Templates listed for newly created User in Zone1" - ) - # Listing all the Templates for a User in Zone 2 - list_templates_zone2 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - zoneid=zones_list[1].id - ) - # Verifying that no Templates are listed - self.assertIsNone( - list_templates_zone2, - "Templates listed for newly created User in Zone2" - ) - self.services["template"]["url"] = "http://10.147.28.7/templates/ttylinux_pv.vhd" - self.services["template"]["format"] = "VHD" - self.services["template"]["ostype"] = self.services["ostype"] - #Listing Hypervisors in Zone 1 - hypervisor_list = Hypervisor.list( - self.apiClient, - zoneid=zones_list[0].id - ) - status = validateList(zones_list) - self.assertEquals( - PASS, - status[0], - "Failed to list Hypervisors in Zone 1" - ) - # Creating aTemplate in Zone 1 - template_created = Template.register( - self.userapiclient, - self.services["template"], - zones_list[0].id, - hypervisor=hypervisor_list[0].name - ) - self.assertIsNotNone( - template_created, - "Template creation failed" - ) - self.cleanup.append(template_created) - # Listing all the Templates for a User in Zone 1 - list_templates_zone1 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - zoneid=zones_list[0].id - ) - status = validateList(list_templates_zone1) - self.assertEquals( - PASS, - status[0], - "Templates creation failed in Zone1" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_templates_zone1), - "Failed to create a Template" - ) - # Listing all the Templates for a User in Zone 2 - list_templates_zone2 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - zoneid=zones_list[1].id - ) - # Verifying that no Templates are listed - self.assertIsNone( - list_templates_zone2, - "Templates listed for newly created User in Zone2" - ) - # Verifying the state of the template to be ready. If not waiting for state to become ready till time out - template_ready = False - count = 0 - while template_ready is False: - list_template = Template.list( - self.userapiclient, - id=template_created.id, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - ) - status = validateList(list_template) - self.assertEquals( - PASS, - status[0], - "Failed to list Templates by Id" - ) - if list_template[0].isready is True: - template_ready = True - elif (str(list_template[0].status) == "Error"): - self.fail("Created Template is in Errored state") - break - elif count > 10: - self.fail("Timed out before Template came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Copying the Template from Zone1 to Zone2 - copied_template = Template.copy( - self.userapiclient, - template_created.id, - sourcezoneid=template_created.zoneid, - destzoneid=zones_list[1].id - ) - self.assertIsNotNone( - copied_template, - "Copying Template from Zone1 to Zone2 failed" - ) - # Listing all the Templates for a User in Zone 1 - list_templates_zone1 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - zoneid=zones_list[0].id - ) - status = validateList(list_templates_zone1) - self.assertEquals( - PASS, - status[0], - "Templates creation failed in Zone1" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_templates_zone1), - "Failed to create a Template" - ) - # Listing all the Templates for a User in Zone 2 - list_templates_zone2 = Template.list( - self.userapiclient, - listall=self.services["listall"], - templatefilter=self.services["templatefilter"], - zoneid=zones_list[1].id - ) - status = validateList(list_templates_zone2) - self.assertEquals( - PASS, - status[0], - "Template failed to copy into Zone2" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_templates_zone2), - "Template failed to copy into Zone2" - ) - self.assertNotEquals( - "Connection refused", - list_templates_zone2[0].status, - "Failed to copy Template" - ) - self.assertEquals( - True, - list_templates_zone2[0].isready, - "Failed to copy Template" - ) - del self.services["template"]["url"] - del self.services["template"]["format"] - del self.services["template"]["ostype"] - return - -class TestIsos(cloudstackTestCase): - - @classmethod - def setUpClass(cls): - try: - cls._cleanup = [] - cls.testClient = super(TestIsos, cls).getClsTestClient() - cls.api_client = cls.testClient.getApiClient() - cls.services = cls.testClient.getParsedTestDataConfig() - # Get Domain, Zone, Template - cls.domain = get_domain(cls.api_client) - cls.zone = get_zone(cls.api_client) - cls.template = get_template( - cls.api_client, - cls.zone.id, - cls.services["ostype"] - ) - cls.hypervisor = cls.testClient.getHypervisorInfo() - cls.services['mode'] = cls.zone.networktype - cls.account = Account.create( - cls.api_client, - cls.services["account"], - domainid=cls.domain.id - ) - # Getting authentication for user in newly created Account - cls.user = cls.account.user[0] - cls.userapiclient = cls.testClient.getUserApiClient(cls.user.username, cls.domain.name) - cls._cleanup.append(cls.account) - except Exception as e: - cls.tearDownClass() - raise Exception("Warning: Exception in setup : %s" % e) - return - - def setUp(self): - - self.apiClient = self.testClient.getApiClient() - self.cleanup = [] - - def tearDown(self): - #Clean up, terminate the created resources - cleanup_resources(self.apiClient, self.cleanup) - return - - @classmethod - def tearDownClass(cls): - try: - cleanup_resources(cls.api_client, cls._cleanup) - except Exception as e: - raise Exception("Warning: Exception during cleanup : %s" % e) - - return - - def __verify_values(self, expected_vals, actual_vals): - """ - @Desc: Function to verify expected and actual values - @Steps: - Step1: Initializing return flag to True - Step1: Verifying length of expected and actual dictionaries is matching. - If not matching returning false - Step2: Listing all the keys from expected dictionary - Step3: Looping through each key from step2 and verifying expected and actual dictionaries have same value - If not making return flag to False - Step4: returning the return flag after all the values are verified - """ - return_flag = True - - if len(expected_vals) != len(actual_vals): - return False - - keys = expected_vals.keys() - for i in range(0, len(expected_vals)): - exp_val = expected_vals[keys[i]] - act_val = actual_vals[keys[i]] - if exp_val == act_val: - return_flag = return_flag and True - else: - return_flag = return_flag and False - self.debug("expected Value: %s, is not matching with actual value: %s" % ( - exp_val, - act_val - )) - return return_flag - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_01_list_isos_pagination(self): - """ - @Desc: Test to List ISO's pagination - @steps: - Step1: Listing all the ISO's for a user - Step2: Verifying that no ISO's are listed - Step3: Creating (page size + 1) number of ISO's - Step4: Listing all the ISO's again for a user - Step5: Verifying that list size is (page size + 1) - Step6: Listing all the ISO's in page1 - Step7: Verifying that list size is (page size) - Step8: Listing all the ISO's in page2 - Step9: Verifying that list size is 1 - Step10: Listing the ISO's by Id - Step11: Verifying if the ISO is downloaded and ready. - If yes the continuing - If not waiting and checking for iso to be ready till timeout - Step12: Deleting the ISO present in page 2 - Step13: Listing all the ISO's in page2 - Step14: Verifying that no ISO's are listed - """ - # Listing all the ISO's for a User - list_iso_before = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"] - ) - # Verifying that no ISOs are listed - self.assertIsNone( - list_iso_before, - "ISOs listed for newly created User" - ) - self.services["iso"]["zoneid"] = self.zone.id - # Creating pagesize + 1 number of ISO's - for i in range(0, (self.services["pagesize"] + 1)): - iso_created = Iso.create( - self.userapiclient, - self.services["iso"] - ) - self.assertIsNotNone( - iso_created, - "ISO creation failed" - ) - if(i < self.services["pagesize"]): - self.cleanup.append(iso_created) - - # Listing all the ISO's for a User - list_iso_after = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"] - ) - status = validateList(list_iso_after) - self.assertEquals( - PASS, - status[0], - "ISO's creation failed" - ) - # Verifying that list size is pagesize + 1 - self.assertEquals( - self.services["pagesize"] + 1, - len(list_iso_after), - "Failed to create pagesize + 1 number of ISO's" - ) - # Listing all the ISO's in page 1 - list_iso_page1 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - page=1, - pagesize=self.services["pagesize"] - ) - status = validateList(list_iso_page1) - self.assertEquals( - PASS, - status[0], - "Failed to list ISO's in page 1" - ) - # Verifying the list size to be equal to pagesize - self.assertEquals( - self.services["pagesize"], - len(list_iso_page1), - "Size of ISO's in page 1 is not matching" - ) - # Listing all the Templates in page 2 - list_iso_page2 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - page=2, - pagesize=self.services["pagesize"] - ) - status = validateList(list_iso_page2) - self.assertEquals( - PASS, - status[0], - "Failed to list ISo's in page 2" - ) - # Verifying the list size to be equal to 1 - self.assertEquals( - 1, - len(list_iso_page2), - "Size of ISO's in page 2 is not matching" - ) - # Verifying the state of the ISO to be ready. If not waiting for state to become ready - iso_ready = False - count = 0 - while iso_ready is False: - list_iso = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - id=iso_created.id - ) - status = validateList(list_iso) - self.assertEquals( - PASS, - status[0], - "Failed to list ISO by Id" - ) - if list_iso[0].isready is True: - iso_ready = True - elif (str(list_iso[0].status) == "Error"): - self.fail("Created ISO is in Errored state") - break - elif count > 10: - self.fail("Timed out before ISO came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Deleting the ISO present in page 2 - Iso.delete( - iso_created, - self.userapiclient - ) - # Listing all the ISO's in page 2 again - list_iso_page2 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - page=2, - pagesize=self.services["pagesize"] - ) - # Verifying that there are no ISO's listed - self.assertIsNone( - list_iso_page2, - "ISO's not deleted from page 2" - ) - del self.services["iso"]["zoneid"] - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_02_download_iso(self): - """ - @Desc: Test to Download ISO - @steps: - Step1: Listing all the ISO's for a user - Step2: Verifying that no ISO's are listed - Step3: Creating an ISO - Step4: Listing all the ISO's again for a user - Step5: Verifying that list size is 1 - Step6: Verifying if the ISO is in ready state. - If yes the continuing - If not waiting and checking for template to be ready till timeout - Step7: Downloading the ISO (Extract) - Step8: Verifying the details of downloaded ISO - """ - # Listing all the ISO's for a User - list_iso_before = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"] - ) - # Verifying that no ISOs are listed - self.assertIsNone( - list_iso_before, - "ISOs listed for newly created User" - ) - self.services["iso"]["zoneid"] = self.zone.id - self.services["iso"]["isextractable"] = True - # Creating an ISO's - iso_created = Iso.create( - self.userapiclient, - self.services["iso"] - ) - self.assertIsNotNone( - iso_created, - "ISO creation failed" - ) - self.cleanup.append(iso_created) - # Listing all the ISO's for a User - list_iso_after = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"] - ) - status = validateList(list_iso_after) - self.assertEquals( - PASS, - status[0], - "ISO's creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_iso_after), - "Failed to create an ISO's" - ) - # Verifying the state of the ISO to be ready. If not waiting for state to become ready - iso_ready = False - count = 0 - while iso_ready is False: - list_iso = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - id=iso_created.id - ) - status = validateList(list_iso) - self.assertEquals( - PASS, - status[0], - "Failed to list ISO by Id" - ) - if list_iso[0].isready is True: - iso_ready = True - elif (str(list_iso[0].status) == "Error"): - self.fail("Created ISO is in Errored state") - break - elif count > 10: - self.fail("Timed out before ISO came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Downloading the ISO - download_iso = Iso.extract( - self.userapiclient, - iso_created.id, - mode="HTTP_DOWNLOAD", - zoneid=self.zone.id - ) - self.assertIsNotNone( - download_iso, - "Download ISO failed" - ) - # Verifying the details of downloaded ISO - self.assertEquals( - "DOWNLOAD_URL_CREATED", - download_iso.state, - "Download URL not created for ISO" - ) - self.assertIsNotNone( - download_iso.url, - "Download URL not created for ISO" - ) - self.assertEquals( - iso_created.id, - download_iso.id, - "Download ISO details are not same as ISO created" - ) - del self.services["iso"]["zoneid"] - del self.services["iso"]["isextractable"] - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_03_edit_iso_details(self): - """ - @Desc: Test to Edit ISO name, displaytext, OSType - @steps: - Step1: Listing all the ISO's for a user - Step2: Verifying that no ISO's are listed - Step3: Creating an ISO - Step4: Listing all the ISO's again for a user - Step5: Verifying that list size is 1 - Step6: Verifying if the ISO is in ready state. - If yes the continuing - If not waiting and checking for template to be ready till timeout - Step7: Editing the ISO's name, displaytext - Step8: Verifying that ISO name and displaytext are edited - Step9: Editing the ISO name, displaytext, ostypeid - Step10: Verifying that ISO name, displaytext and ostypeid are edited - """ - # Listing all the ISO's for a User - list_iso_before = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"] - ) - # Verifying that no ISOs are listed - self.assertIsNone( - list_iso_before, - "ISOs listed for newly created User" - ) - self.services["iso"]["zoneid"] = self.zone.id - # Creating an ISO's - iso_created = Iso.create( - self.userapiclient, - self.services["iso"] - ) - self.assertIsNotNone( - iso_created, - "ISO creation failed" - ) - self.cleanup.append(iso_created) - # Listing all the ISO's for a User - list_iso_after = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"] - ) - status = validateList(list_iso_after) - self.assertEquals( - PASS, - status[0], - "ISO's creation failed" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_iso_after), - "Failed to create an ISO's" - ) - # Verifying the state of the ISO to be ready. If not waiting for state to become ready - iso_ready = False - count = 0 - while iso_ready is False: - list_iso = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - id=iso_created.id - ) - status = validateList(list_iso) - self.assertEquals( - PASS, - status[0], - "Failed to list ISO by Id" - ) - if list_iso[0].isready is True: - iso_ready = True - elif (str(list_iso[0].status) == "Error"): - self.fail("Created ISO is in Errored state") - break - elif count > 10: - self.fail("Timed out before ISO came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Editing the ISO name, displaytext - edited_iso = Iso.update( - iso_created, - self.userapiclient, - name="NewISOName", - displaytext="NewISODisplayText" - ) - self.assertIsNotNone( - edited_iso, - "Editing ISO failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":iso_created.id, - "name":"NewISOName", - "displaytest":"NewISODisplayText", - "account":iso_created.account, - "domainid":iso_created.domainid, - "isfeatured":iso_created.isfeatured, - "ostypeid":iso_created.ostypeid, - "ispublic":iso_created.ispublic, - } - actual_dict = { - "id":edited_iso.id, - "name":edited_iso.name, - "displaytest":edited_iso.displaytext, - "account":edited_iso.account, - "domainid":edited_iso.domainid, - "isfeatured":edited_iso.isfeatured, - "ostypeid":edited_iso.ostypeid, - "ispublic":edited_iso.ispublic, - } - edit_iso_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_iso_status, - "Edited ISO details are not as expected" - ) - # Editing the ISO name, displaytext, ostypeid - ostype_list = list_os_types(self.userapiclient) - status = validateList(ostype_list) - self.assertEquals( - PASS, - status[0], - "Failed to list OS Types" - ) - for i in range(0, len(ostype_list)): - if ostype_list[i].id != iso_created.ostypeid: - newostypeid = ostype_list[i].id - break - - edited_iso = Iso.update( - iso_created, - self.userapiclient, - name=iso_created.name, - displaytext=iso_created.displaytext, - ostypeid=newostypeid - ) - self.assertIsNotNone( - edited_iso, - "Editing ISO failed" - ) - # Verifying the details of edited template - expected_dict = { - "id":iso_created.id, - "name":iso_created.name, - "displaytest":iso_created.displaytext, - "account":iso_created.account, - "domainid":iso_created.domainid, - "isfeatured":iso_created.isfeatured, - "ostypeid":newostypeid, - "ispublic":iso_created.ispublic, - } - actual_dict = { - "id":edited_iso.id, - "name":edited_iso.name, - "displaytest":edited_iso.displaytext, - "account":edited_iso.account, - "domainid":edited_iso.domainid, - "isfeatured":edited_iso.isfeatured, - "ostypeid":edited_iso.ostypeid, - "ispublic":edited_iso.ispublic, - } - edit_iso_status = self.__verify_values( - expected_dict, - actual_dict - ) - self.assertEqual( - True, - edit_iso_status, - "Edited ISO details are not as expected" - ) - del self.services["iso"]["zoneid"] - return - - @attr(tags=["advanced", "basic", "provisioning"]) - def test_04_copy_iso(self): - """ - @Desc: Test to copy ISO from one zone to another - @steps: - Step1: Listing Zones available for a user - Step2: Verifying if the zones listed are greater than 1. - If Yes continuing. - If not halting the test. - Step3: Listing all the ISO's for a user in zone1 - Step4: Verifying that no ISO's are listed - Step5: Listing all the ISO's for a user in zone2 - Step6: Verifying that no ISO's are listed - Step7: Creating an ISO in zone 1 - Step8: Listing all the ISO's again for a user in zone1 - Step9: Verifying that list size is 1 - Step10: Listing all the ISO's for a user in zone2 - Step11: Verifying that no ISO's are listed - Step12: Copying the ISO created in step7 from zone1 to zone2 - Step13: Listing all the ISO's for a user in zone2 - Step14: Verifying that list size is 1 - Step15: Listing all the ISO's for a user in zone1 - Step16: Verifying that list size is 1 - """ - # Listing Zones available for a user - zones_list = Zone.list( - self.userapiclient, - available=True - ) - status = validateList(zones_list) - self.assertEquals( - PASS, - status[0], - "Failed to list Zones" - ) - if not len(zones_list) > 1: - self.fail("Enough zones doesnot exists to copy iso") - else: - # Listing all the ISO's for a User in Zone 1 - list_isos_zone1 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - zoneid=zones_list[0].id - ) - # Verifying that no ISO's are listed - self.assertIsNone( - list_isos_zone1, - "ISO's listed for newly created User in Zone1" - ) - # Listing all the ISO's for a User in Zone 2 - list_isos_zone2 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - zoneid=zones_list[1].id - ) - # Verifying that no ISO's are listed - self.assertIsNone( - list_isos_zone2, - "ISO's listed for newly created User in Zone2" - ) - self.services["iso"]["zoneid"] = zones_list[0].id - # Creating an ISO in Zone 1 - iso_created = Iso.create( - self.userapiclient, - self.services["iso"] - ) - self.assertIsNotNone( - iso_created, - "ISO creation failed" - ) - self.cleanup.append(iso_created) - # Listing all the ISO's for a User in Zone 1 - list_isos_zone1 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - zoneid=zones_list[0].id - ) - status = validateList(list_isos_zone1) - self.assertEquals( - PASS, - status[0], - "ISO creation failed in Zone1" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_isos_zone1), - "Failed to create a Template" - ) - # Listing all the ISO's for a User in Zone 2 - list_isos_zone2 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - zoneid=zones_list[1].id - ) - # Verifying that no ISO's are listed - self.assertIsNone( - list_isos_zone2, - "ISO's listed for newly created User in Zone2" - ) - # Verifying the state of the ISO to be ready. If not waiting for state to become ready - iso_ready = False - count = 0 - while iso_ready is False: - list_iso = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - id=iso_created.id - ) - status = validateList(list_iso) - self.assertEquals( - PASS, - status[0], - "Failed to list ISO by Id" - ) - if list_iso[0].isready is True: - iso_ready = True - elif (str(list_iso[0].status) == "Error"): - self.fail("Created ISO is in Errored state") - break - elif count > 10: - self.fail("Timed out before ISO came into ready state") - break - else: - time.sleep(self.services["sleep"]) - count = count + 1 - - # Copying the ISO from Zone1 to Zone2 - copied_iso = Iso.copy( - self.userapiclient, - iso_created.id, - sourcezoneid=iso_created.zoneid, - destzoneid=zones_list[1].id - ) - self.assertIsNotNone( - copied_iso, - "Copying ISO from Zone1 to Zone2 failed" - ) - # Listing all the ISO's for a User in Zone 1 - list_isos_zone1 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - zoneid=zones_list[0].id - ) - status = validateList(list_isos_zone1) - self.assertEquals( - PASS, - status[0], - "ISO creation failed in Zone1" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_isos_zone1), - "Failed to create a Template" - ) - # Listing all the ISO's for a User in Zone 2 - list_isos_zone2 = Iso.list( - self.userapiclient, - listall=self.services["listall"], - isofilter=self.services["templatefilter"], - zoneid=zones_list[1].id - ) - status = validateList(list_isos_zone2) - self.assertEquals( - PASS, - status[0], - "ISO failed to copy into Zone2" - ) - # Verifying that list size is 1 - self.assertEquals( - 1, - len(list_isos_zone2), - "ISO failed to copy into Zone2" - ) - self.assertNotEquals( - "Connection refused", - list_isos_zone2[0].status, - "Failed to copy ISO" - ) - self.assertEquals( - True, - list_isos_zone2[0].isready, - "Failed to copy ISO" - ) - del self.services["iso"]["zoneid"] - return From cd414a0f56798ae801fc464be127e37daabef809 Mon Sep 17 00:00:00 2001 From: ynojima Date: Wed, 18 Jun 2014 00:01:47 -0600 Subject: [PATCH 619/683] CLOUDSTACK-6935 refactor StoragePoolAllocator#filter logic to support IOPS capacity control in a cluster wide storage pool and a local storage pool to enable hypervisor type check, storage type check for root volume and avoid list check --- .../storage/allocator/AbstractStoragePoolAllocator.java | 2 +- .../storage/allocator/ZoneWideStoragePoolAllocator.java | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java index ddbb5a467b..2d958a6bf6 100755 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java @@ -183,6 +183,6 @@ protected boolean filter(ExcludeList avoid, StoragePool pool, DiskProfile dskCh, Volume volume = _volumeDao.findById(dskCh.getVolumeId()); List requestVolumes = new ArrayList(); requestVolumes.add(volume); - return storageMgr.storagePoolHasEnoughSpace(requestVolumes, pool); + return storageMgr.storagePoolHasEnoughIops(requestVolumes, pool) && storageMgr.storagePoolHasEnoughSpace(requestVolumes, pool); } } diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java index 8fb9c8d87a..c629906010 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java @@ -47,14 +47,6 @@ public class ZoneWideStoragePoolAllocator extends AbstractStoragePoolAllocator { @Inject DataStoreManager dataStoreMgr; - @Override - protected boolean filter(ExcludeList avoid, StoragePool pool, DiskProfile dskCh, DeploymentPlan plan) { - Volume volume = _volumeDao.findById(dskCh.getVolumeId()); - List requestVolumes = new ArrayList(); - requestVolumes.add(volume); - - return storageMgr.storagePoolHasEnoughIops(requestVolumes, pool) && storageMgr.storagePoolHasEnoughSpace(requestVolumes, pool); - } @Override protected List select(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { From a61f77523dd70ebf54e577426fe2535e4359cc25 Mon Sep 17 00:00:00 2001 From: ynojima Date: Wed, 18 Jun 2014 13:09:17 -0600 Subject: [PATCH 620/683] Revert "CLOUDSTACK-6935 refactor StoragePoolAllocator#filter logic" This reverts commit cd414a0f56798ae801fc464be127e37daabef809. --- .../storage/allocator/AbstractStoragePoolAllocator.java | 2 +- .../storage/allocator/ZoneWideStoragePoolAllocator.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java index 2d958a6bf6..ddbb5a467b 100755 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/AbstractStoragePoolAllocator.java @@ -183,6 +183,6 @@ protected boolean filter(ExcludeList avoid, StoragePool pool, DiskProfile dskCh, Volume volume = _volumeDao.findById(dskCh.getVolumeId()); List requestVolumes = new ArrayList(); requestVolumes.add(volume); - return storageMgr.storagePoolHasEnoughIops(requestVolumes, pool) && storageMgr.storagePoolHasEnoughSpace(requestVolumes, pool); + return storageMgr.storagePoolHasEnoughSpace(requestVolumes, pool); } } diff --git a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java index c629906010..8fb9c8d87a 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java +++ b/engine/storage/src/org/apache/cloudstack/storage/allocator/ZoneWideStoragePoolAllocator.java @@ -47,6 +47,14 @@ public class ZoneWideStoragePoolAllocator extends AbstractStoragePoolAllocator { @Inject DataStoreManager dataStoreMgr; + @Override + protected boolean filter(ExcludeList avoid, StoragePool pool, DiskProfile dskCh, DeploymentPlan plan) { + Volume volume = _volumeDao.findById(dskCh.getVolumeId()); + List requestVolumes = new ArrayList(); + requestVolumes.add(volume); + + return storageMgr.storagePoolHasEnoughIops(requestVolumes, pool) && storageMgr.storagePoolHasEnoughSpace(requestVolumes, pool); + } @Override protected List select(DiskProfile dskCh, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoid, int returnUpTo) { From b8a29615838bd12d0f6699ef3e64bb9b89158c26 Mon Sep 17 00:00:00 2001 From: Jessica Wang Date: Wed, 18 Jun 2014 12:20:43 -0700 Subject: [PATCH 621/683] CLOUDSTACK-6936: UI - (1)dialog widget > dropdown field > provide a blank option if there is no data for option(s) in a dropdown field. (2) Add Primary Storage dialog - cluster dropdown field - still calls args.response.success() when there is no data for option(s). --- ui/scripts/system.js | 10 ++++++---- ui/scripts/ui/dialog.js | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ui/scripts/system.js b/ui/scripts/system.js index 37fe504507..24bdcf2e98 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -15436,17 +15436,19 @@ dependsOn: 'clusterId', select: function (args) { var clusterId = args.clusterId; - if (clusterId == null) + if (clusterId == null || clusterId.length == 0) { + args.response.success({ + data: [] + }); return; - var items =[]; + } + $(clusterObjs).each(function () { if (this.id == clusterId) { selectedClusterObj = this; return false; //break the $.each() loop } }); - if (selectedClusterObj == null) - return; if (selectedClusterObj.hypervisortype == "KVM") { var items =[]; diff --git a/ui/scripts/ui/dialog.js b/ui/scripts/ui/dialog.js index 7a903fdca0..0fddcf70b2 100644 --- a/ui/scripts/ui/dialog.js +++ b/ui/scripts/ui/dialog.js @@ -271,6 +271,11 @@ context: args.context, response: { success: function(args) { + if (args.data == undefined || args.data.length == 0) { + var $option = $('