diff --git a/api/src/com/cloud/network/IpAddress.java b/api/src/com/cloud/network/IpAddress.java index a1fcb795477..c48e8b97ca8 100644 --- a/api/src/com/cloud/network/IpAddress.java +++ b/api/src/com/cloud/network/IpAddress.java @@ -78,17 +78,9 @@ public interface IpAddress extends ControlledEntity, Identity, InternalIdentity boolean getSystem(); - /** - * @return - */ Long getVpcId(); - /** - * @param vpcId - */ - void setVpcId(Long vpcId); String getVmIp(); - void setVmIp(String vmIp); Long getNetworkId(); diff --git a/api/src/com/cloud/network/NetworkService.java b/api/src/com/cloud/network/NetworkService.java index 066009b8b75..5a6054da23b 100755 --- a/api/src/com/cloud/network/NetworkService.java +++ b/api/src/com/cloud/network/NetworkService.java @@ -79,7 +79,7 @@ public interface NetworkService { Long startIndex, Long pageSize, String name); PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags, - String newVnetRangeString, String state); + String newVnetRangeString, String state, String removeVlan); boolean deletePhysicalNetwork(Long id); diff --git a/api/src/com/cloud/network/PhysicalNetwork.java b/api/src/com/cloud/network/PhysicalNetwork.java index a2044a61047..c521dc4f888 100644 --- a/api/src/com/cloud/network/PhysicalNetwork.java +++ b/api/src/com/cloud/network/PhysicalNetwork.java @@ -18,6 +18,7 @@ package com.cloud.network; import java.util.List; +import com.cloud.utils.Pair; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; @@ -59,7 +60,9 @@ public interface PhysicalNetwork extends Identity, InternalIdentity { Long getDomainId(); - String getVnet(); + List> getVnet(); + + String getVnetString(); String getSpeed(); diff --git a/api/src/com/cloud/network/PublicIpAddress.java b/api/src/com/cloud/network/PublicIpAddress.java index d81e9c1ee6c..916d43428e9 100644 --- a/api/src/com/cloud/network/PublicIpAddress.java +++ b/api/src/com/cloud/network/PublicIpAddress.java @@ -30,7 +30,4 @@ public interface PublicIpAddress extends ControlledEntity, IpAddress, Vlan, Inte public String getNetmask(); public String getGateway(); - - @Override - public String getVlanTag(); } diff --git a/api/src/com/cloud/server/ManagementService.java b/api/src/com/cloud/server/ManagementService.java index 6e6dbc36f0c..460357b3c97 100755 --- a/api/src/com/cloud/server/ManagementService.java +++ b/api/src/com/cloud/server/ManagementService.java @@ -407,6 +407,4 @@ public interface ManagementService { */ List listTopConsumedResources(ListCapacityCmd cmd); - List listDeploymentPlanners(); - } diff --git a/api/src/com/cloud/user/Account.java b/api/src/com/cloud/user/Account.java index 5d32fb23253..940a0eb2667 100755 --- a/api/src/com/cloud/user/Account.java +++ b/api/src/com/cloud/user/Account.java @@ -22,6 +22,7 @@ import org.apache.cloudstack.acl.ControlledEntity; import org.apache.cloudstack.api.Identity; import org.apache.cloudstack.api.InternalIdentity; + public interface Account extends ControlledEntity, InternalIdentity, Identity { public enum Type { Normal, @@ -64,4 +65,7 @@ public interface Account extends ControlledEntity, InternalIdentity, Identity { public Long getDefaultZoneId(); public String getUuid(); + + boolean isDefault(); + } diff --git a/api/src/com/cloud/user/User.java b/api/src/com/cloud/user/User.java index 3742c7bf3e2..dcf27a0de69 100644 --- a/api/src/com/cloud/user/User.java +++ b/api/src/com/cloud/user/User.java @@ -72,5 +72,7 @@ public interface User extends OwnedBy, InternalIdentity { String getRegistrationToken(); boolean isRegistered(); + + boolean isDefault(); } diff --git a/api/src/org/apache/cloudstack/api/ApiConstants.java b/api/src/org/apache/cloudstack/api/ApiConstants.java index bac5819d255..70c366596b2 100755 --- a/api/src/org/apache/cloudstack/api/ApiConstants.java +++ b/api/src/org/apache/cloudstack/api/ApiConstants.java @@ -221,6 +221,7 @@ public class ApiConstants { public static final String VIRTUAL_MACHINE_ID = "virtualmachineid"; public static final String VIRTUAL_MACHINE_IDS = "virtualmachineids"; public static final String VLAN = "vlan"; + public static final String REMOVE_VLAN="removevlan"; public static final String VLAN_ID = "vlanid"; public static final String VM_AVAILABLE = "vmavailable"; public static final String VM_LIMIT = "vmlimit"; @@ -481,7 +482,6 @@ public class ApiConstants { public static final String PROVIDER_TYPE = "providertype"; public static final String AFFINITY_GROUP_IDS = "affinitygroupids"; public static final String AFFINITY_GROUP_NAMES = "affinitygroupnames"; - public static final String DEPLOYMENT_PLANNER = "deploymentplanner"; public static final String ASA_INSIDE_PORT_PROFILE = "insideportprofile"; public enum HostDetails { diff --git a/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java b/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java deleted file mode 100644 index 69004de2a6b..00000000000 --- a/api/src/org/apache/cloudstack/api/command/admin/config/ListDeploymentPlannersCmd.java +++ /dev/null @@ -1,71 +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.api.command.admin.config; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.cloudstack.api.APICommand; -import org.apache.cloudstack.api.BaseListCmd; -import org.apache.cloudstack.api.response.DeploymentPlannersResponse; -import org.apache.cloudstack.api.response.ListResponse; -import org.apache.log4j.Logger; - -@APICommand(name = "listDeploymentPlanners", description = "Lists all DeploymentPlanners available.", responseObject = DeploymentPlannersResponse.class) -public class ListDeploymentPlannersCmd extends BaseListCmd { - public static final Logger s_logger = Logger.getLogger(ListDeploymentPlannersCmd.class.getName()); - - private static final String s_name = "listdeploymentplannersresponse"; - - ///////////////////////////////////////////////////// - //////////////// API parameters ///////////////////// - ///////////////////////////////////////////////////// - - - ///////////////////////////////////////////////////// - /////////////////// Accessors /////////////////////// - ///////////////////////////////////////////////////// - - - ///////////////////////////////////////////////////// - /////////////// API Implementation/////////////////// - ///////////////////////////////////////////////////// - - @Override - public String getCommandName() { - return s_name; - } - - @Override - public void execute(){ - List planners = _mgr.listDeploymentPlanners(); - ListResponse response = new ListResponse(); - List plannerResponses = new ArrayList(); - - for (String planner : planners) { - DeploymentPlannersResponse plannerResponse = new DeploymentPlannersResponse(); - plannerResponse.setName(planner); - plannerResponse.setObjectName("deploymentPlanner"); - plannerResponses.add(plannerResponse); - } - - response.setResponses(plannerResponses); - response.setResponseName(getCommandName()); - this.setResponseObject(response); - - } -} diff --git a/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java b/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java index 06cf38dba3f..6d37dd8a49b 100644 --- a/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java +++ b/api/src/org/apache/cloudstack/api/command/admin/network/UpdatePhysicalNetworkCmd.java @@ -54,6 +54,8 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd { @Parameter(name=ApiConstants.VLAN, type=CommandType.STRING, description="the VLAN for the physical network") private String vlan; + @Parameter(name=ApiConstants.REMOVE_VLAN, type = CommandType.STRING, description ="The vlan range we want to remove") + private String removevlan; ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// @@ -79,6 +81,10 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd { return vlan; } + public String getRemoveVlan(){ + return removevlan; + } + ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// ///////////////////////////////////////////////////// @@ -95,7 +101,7 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd { @Override public void execute(){ - PhysicalNetwork result = _networkService.updatePhysicalNetwork(getId(),getNetworkSpeed(), getTags(), getVlan(), getState()); + PhysicalNetwork result = _networkService.updatePhysicalNetwork(getId(),getNetworkSpeed(), getTags(), getVlan(), getState(), getRemoveVlan()); PhysicalNetworkResponse response = _responseGenerator.createPhysicalNetworkResponse(result); response.setResponseName(getCommandName()); this.setResponseObject(response); 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 74392cd4299..0e35276d914 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 @@ -84,9 +84,6 @@ public class CreateServiceOfferingCmd extends BaseCmd { @Parameter(name=ApiConstants.NETWORKRATE, type=CommandType.INTEGER, description="data transfer rate in megabits per second allowed. Supported only for non-System offering and system offerings having \"domainrouter\" systemvmtype") private Integer networkRate; - @Parameter(name = ApiConstants.DEPLOYMENT_PLANNER, type = CommandType.STRING, description = "The deployment planner heuristics used to deploy a VM of this offering, default \"FirstFitPlanner\".") - private String deploymentPlanner; - ///////////////////////////////////////////////////// /////////////////// Accessors /////////////////////// ///////////////////////////////////////////////////// @@ -151,9 +148,6 @@ public class CreateServiceOfferingCmd extends BaseCmd { return networkRate; } - public String getDeploymentPlanner() { - return deploymentPlanner; - } ///////////////////////////////////////////////////// /////////////// API Implementation/////////////////// 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 63e2788b77c..a01bac39a4b 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 @@ -35,7 +35,7 @@ import org.apache.log4j.Logger; import com.cloud.event.EventTypes; import com.cloud.server.ResourceTag; import com.cloud.server.ResourceTag.TaggedResourceType; -@APICommand(name = "createTags", description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "Burbank") +@APICommand(name = "createTags", description = "Creates resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0") 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 084a5142aa1..a6ba0da82b7 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 @@ -34,7 +34,7 @@ import org.apache.log4j.Logger; import com.cloud.event.EventTypes; import com.cloud.server.ResourceTag.TaggedResourceType; -@APICommand(name = "deleteTags", description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "Burbank") +@APICommand(name = "deleteTags", description = "Deleting resource tag(s)", responseObject = SuccessResponse.class, since = "4.0.0") 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 e3dc108a757..f80da204cce 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 @@ -24,7 +24,7 @@ import org.apache.cloudstack.api.Parameter; 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 = "Burbank") +@APICommand(name = "listTags", description = "List resource tag(s)", responseObject = ResourceTagResponse.class, since = "4.0.0") public class ListTagsCmd extends BaseListProjectAndAccountResourcesCmd{ private static final String s_name = "listtagsresponse"; 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 30f03b88995..08f94570ee8 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 @@ -95,7 +95,7 @@ public class ListVMsCmd extends BaseListTaggedResourcesCmd { @Parameter(name=ApiConstants.DETAILS, type=CommandType.LIST, collectionType=CommandType.STRING, description="comma separated list of host details requested, " + - "value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min]." + + "value can be a list of [all, group, nics, stats, secgrp, tmpl, servoff, iso, volume, min, affgrp]." + " If no parameter is passed in, the details will be defaulted to all" ) private List viewDetails; diff --git a/api/src/org/apache/cloudstack/api/response/AccountResponse.java b/api/src/org/apache/cloudstack/api/response/AccountResponse.java index c109a6325c8..1e59822180f 100644 --- a/api/src/org/apache/cloudstack/api/response/AccountResponse.java +++ b/api/src/org/apache/cloudstack/api/response/AccountResponse.java @@ -183,6 +183,9 @@ public class AccountResponse extends BaseResponse { @SerializedName(ApiConstants.ACCOUNT_DETAILS) @Param(description="details for the account") private Map details; + + @SerializedName(ApiConstants.IS_DEFAULT) @Param(description="true if account is default, false otherwise", since="4.2.0") + private Boolean isDefault; @Override @@ -381,4 +384,8 @@ public class AccountResponse extends BaseResponse { public void setDefaultZone(String defaultZoneId) { this.defaultZoneId = defaultZoneId; } + + public void setIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + } } diff --git a/api/src/org/apache/cloudstack/api/response/UserResponse.java b/api/src/org/apache/cloudstack/api/response/UserResponse.java index 9cd25cb7ad6..e70a310bf06 100644 --- a/api/src/org/apache/cloudstack/api/response/UserResponse.java +++ b/api/src/org/apache/cloudstack/api/response/UserResponse.java @@ -18,6 +18,7 @@ package org.apache.cloudstack.api.response; import java.util.Date; +import org.apache.cloudstack.api.ApiConstants; import org.apache.cloudstack.api.BaseResponse; import org.apache.cloudstack.api.EntityReference; @@ -74,6 +75,9 @@ public class UserResponse extends BaseResponse { @SerializedName("iscallerchilddomain") @Param(description="the boolean value representing if the updating target is in caller's child domain") private boolean isCallerChildDomain; + + @SerializedName(ApiConstants.IS_DEFAULT) @Param(description="true if user is default, false otherwise", since="4.2.0") + private Boolean isDefault; @Override public String getObjectId() { @@ -206,4 +210,8 @@ public class UserResponse extends BaseResponse { public void setIsCallerChildDomain(boolean isCallerChildDomain) { this.isCallerChildDomain = isCallerChildDomain; } + + public void setIsDefault(Boolean isDefault) { + this.isDefault = isDefault; + } } diff --git a/client/tomcatconf/applicationContext.xml.in b/client/tomcatconf/applicationContext.xml.in index b9c6b28b161..16171670f99 100644 --- a/client/tomcatconf/applicationContext.xml.in +++ b/client/tomcatconf/applicationContext.xml.in @@ -614,7 +614,6 @@ - diff --git a/core/src/com/cloud/user/AccountVO.java b/core/src/com/cloud/user/AccountVO.java index 5e939c52173..77110aedb95 100644 --- a/core/src/com/cloud/user/AccountVO.java +++ b/core/src/com/cloud/user/AccountVO.java @@ -65,6 +65,9 @@ public class AccountVO implements Account { @Column(name="default_zone_id") private Long defaultZoneId = null; + + @Column(name = "default") + boolean isDefault; public AccountVO() { this.uuid = UUID.randomUUID().toString(); @@ -179,4 +182,8 @@ public class AccountVO implements Account { this.uuid = uuid; } + @Override + public boolean isDefault() { + return isDefault; + } } diff --git a/core/src/com/cloud/user/UserVO.java b/core/src/com/cloud/user/UserVO.java index 8b7c4e3f1e1..2a857580506 100644 --- a/core/src/com/cloud/user/UserVO.java +++ b/core/src/com/cloud/user/UserVO.java @@ -29,10 +29,11 @@ import javax.persistence.Id; import javax.persistence.Table; import org.apache.cloudstack.api.Identity; +import org.apache.cloudstack.api.InternalIdentity; + import com.cloud.user.Account.State; import com.cloud.utils.db.Encrypt; import com.cloud.utils.db.GenericDao; -import org.apache.cloudstack.api.InternalIdentity; /** * A bean representing a user @@ -92,6 +93,9 @@ public class UserVO implements User, Identity, InternalIdentity { @Column(name="uuid") private String uuid; + + @Column(name = "default") + boolean isDefault; public UserVO() { this.uuid = UUID.randomUUID().toString(); @@ -262,4 +266,9 @@ public class UserVO implements User, Identity, InternalIdentity { this.uuid = uuid; } + @Override + public boolean isDefault() { + return isDefault; + } + } diff --git a/docs/en-US/Release_Notes.xml b/docs/en-US/Release_Notes.xml index f449518401b..f243a26cce2 100644 --- a/docs/en-US/Release_Notes.xml +++ b/docs/en-US/Release_Notes.xml @@ -243,7 +243,7 @@ under the License. CLOUDSTACK-97 - Vmware network labels are ignored when creating a Zone using basic networkin + Vmware network labels are ignored when creating a Zone using basic networking @@ -259,7 +259,7 @@ under the License. CLOUDSTACK-118 - "Status of host resorce stuck in ""ErrorInMaintenance"" + Status of host resorce stuck in "ErrorInMaintenance" @@ -267,7 +267,7 @@ under the License. CLOUDSTACK-119 - Move Agent-Simulator in to the hypervisor plugin mode + Move Agent-Simulator in to the hypervisor plugin model @@ -275,7 +275,7 @@ under the License. CLOUDSTACK-130 - Clarify docs on tags parameter in API referenc + Clarify docs on tags parameter in API reference @@ -291,7 +291,7 @@ under the License. CLOUDSTACK-178 - Expose name parameter of VM in list Vm view + Expose name parameter of VM in list Vm view. @@ -299,7 +299,7 @@ under the License. CLOUDSTACK-198 - vpn:failto add VPN Users deletes all the existing Vpn use + vpn:failto add VPN Users deletes all the existing Vpn user @@ -307,7 +307,7 @@ under the License. CLOUDSTACK-222 - Admin UI prompts to restart Management server with cancel edit operatio + Admin UI prompts to restart Management server with cancel edit operation @@ -323,7 +323,7 @@ under the License. CLOUDSTACK-226 - UpdatePhysicalNetworkcommand failed due to java.sql.BatchUpdateException ; Tried to extend the existing Guest VLAN Range of one physical network into the Guest VLAN range of the other physical networ + UpdatePhysicalNetworkcommand failed due to java.sql.BatchUpdateException ; Tried to extend the existing Guest VLAN Range of one physical network into the Guest VLAN range of the other physical network @@ -331,7 +331,7 @@ under the License. CLOUDSTACK-227 - ReconnectHostCmd: NullPointerException: Unable to get host Information for XenServer 6.0.2 host - on intentionally changing the traffic labels on the physical networ + ReconnectHostCmd: NullPointerException: Unable to get host Information for XenServer 6.0.2 host - on intentionally changing the traffic labels on the physical network @@ -339,7 +339,7 @@ under the License. CLOUDSTACK-228 - UI provides an option to reconnect a disconnected host - ServerApiException is thrown on an attemp + UI provides an option to reconnect a disconnected host - ServerApiException is thrown on an attempt @@ -347,7 +347,7 @@ under the License. CLOUDSTACK-232 - Zone infrastructure chart -- disable resource total displa + Zone infrastructure chart -- disable resource total display @@ -363,7 +363,7 @@ under the License. CLOUDSTACK-249 - Add host id to failed VM deploy alert + Add host id to failed VM deploy alerts @@ -371,7 +371,7 @@ under the License. CLOUDSTACK-250 - Incorrect description of maintenance mode in admin guid + Incorrect description of maintenance mode in admin guide @@ -387,7 +387,7 @@ under the License. CLOUDSTACK-271 - updatePhysicalNetwork dies with an NPE when the vlan range is empt + updatePhysicalNetwork dies with an NPE when the vlan range is empty @@ -395,7 +395,7 @@ under the License. CLOUDSTACK-274 - Two error codes mapped to same value in AP + Two error codes mapped to same value in API @@ -403,7 +403,7 @@ under the License. CLOUDSTACK-275 - hostid not always a UUI + hostid not always a UUID @@ -411,7 +411,7 @@ under the License. CLOUDSTACK-277 - Message during CloudStack management server Installation: cannot access /usr/share/cloud/bridge/lib: No such file or director + Message during CloudStack management server Installation: cannot access /usr/share/cloud/bridge/lib: No such file or directory @@ -419,7 +419,7 @@ under the License. CLOUDSTACK-279 - deleteProject fails when executed by the regular user (works fine for root/domain admin + deleteProject fails when executed by the regular user (works fine for root/domain admin) @@ -427,7 +427,7 @@ under the License. CLOUDSTACK-284 - listVirtualMachines does not return deleted machines when zone is specifie + listVirtualMachines does not return deleted machines when zone is specified @@ -435,7 +435,7 @@ under the License. CLOUDSTACK-290 - 3.0.0 template also needed for 2.2.14 to 3.0.5 direct upgrade + 3.0.0 template also needed for 2.2.14 to 3.0.5 direct upgrade. @@ -443,7 +443,7 @@ under the License. CLOUDSTACK-293 - "We do awful, hacky things in our spec file for client + "We do awful, hacky things in our spec file for client" @@ -451,7 +451,7 @@ under the License. CLOUDSTACK-304 - Add synchronization for createSnapshot command per host basi + Add synchronization for createSnapshot command per host basis @@ -459,7 +459,7 @@ under the License. CLOUDSTACK-309 - iptables rules being deleted from wrong VM after a migratio + iptables rules being deleted from wrong VM after a migration @@ -467,7 +467,7 @@ under the License. CLOUDSTACK-318 - Adding XenServer Host Fails - 6.0.2 fails with 4.0. + Adding XenServer Host Fails - 6.0.2 fails with 4.0.0 @@ -475,7 +475,7 @@ under the License. CLOUDSTACK-320 - "sessionKey query parameter should be case-insensitive, now only sessionkey is accepted + "sessionKey query parameter should be case-insensitive, now only sessionkey is accepted" @@ -491,7 +491,7 @@ under the License. CLOUDSTACK-332 - """count"" property in list* API response should be equal to how many entries in database, not how many objects in API response + "count" property in list* API response should be equal to how many entries in database, not how many objects in API response @@ -499,7 +499,7 @@ under the License. CLOUDSTACK-333 - When Datacenter name in VCenter has spaces Primary Storage (VMFS) discovery will fai + When Datacenter name in VCenter has spaces Primary Storage (VMFS) discovery will fail @@ -507,7 +507,7 @@ under the License. CLOUDSTACK-335 - KVM VPC load balancer not workin + KVM VPC load balancer not working @@ -515,7 +515,7 @@ under the License. CLOUDSTACK-336 - listZones doesn't honour pagin + listZones doesn't honour paging @@ -531,7 +531,7 @@ under the License. CLOUDSTACK-346 - Cannot add Vmware cluster with class loader conflict exceptio + Cannot add Vmware cluster with class loader conflict exception @@ -539,7 +539,7 @@ under the License. CLOUDSTACK-347 - listNetworks API: return vlan information only when the caller is ROOT admi + listNetworks API: return vlan information only when the caller is ROOT admin @@ -547,7 +547,7 @@ under the License. CLOUDSTACK-348 - deleteNetwork does not clean up network resource count correctl + deleteNetwork does not clean up network resource count correctly @@ -579,7 +579,7 @@ under the License. CLOUDSTACK-359 - PropagateResourceEventCommand failes in cluster configuratio + PropagateResourceEventCommand failes in cluster configuration @@ -587,7 +587,7 @@ under the License. CLOUDSTACK-361 - Wrong creation of guest networks on a KVM host in Multiple Physical Networks with guest traffi + Wrong creation of guest networks on a KVM host in Multiple Physical Networks with guest traffic @@ -595,7 +595,7 @@ under the License. CLOUDSTACK-364 - Docs point to download.cloud.com for AWS API scrip + Docs point to download.cloud.com for AWS API script @@ -603,7 +603,7 @@ under the License. CLOUDSTACK-368 - OVM - cannot create guest V + OVM - cannot create guest VM @@ -611,7 +611,7 @@ under the License. CLOUDSTACK-369 - ASF 4.0 - unable to support XenServer 6.1 hos + ASF 4.0 - unable to support XenServer 6.1 host @@ -627,7 +627,7 @@ under the License. CLOUDSTACK-377 - provide deployment config access to marvin's testcas + provide deployment config access to marvin's testcase @@ -635,7 +635,7 @@ under the License. CLOUDSTACK-378 - mavenize marvin on maste + mavenize marvin on master @@ -643,7 +643,7 @@ under the License. CLOUDSTACK-390 - Install Guide: Section 4.5.7 (Prepare the System VM Template): Links go to cloud.co + Install Guide: Section 4.5.7 (Prepare the System VM Template): Links go to cloud.com @@ -651,7 +651,7 @@ under the License. CLOUDSTACK-397 - Install Guide: Section 11.1 (Guest Traffic): Diagram is the wrong diagra + Install Guide: Section 11.1 (Guest Traffic): Diagram is the wrong diagram @@ -691,7 +691,7 @@ under the License. CLOUDSTACK-416 - XCP 1.6beta2 (61002c) - can't add a hos + XCP 1.6beta2 (61002c) - can't add a host @@ -699,7 +699,7 @@ under the License. CLOUDSTACK-417 - Handle password server securely to run on port 8080 on V + Handle password server securely to run on port 8080 on VR @@ -723,7 +723,7 @@ under the License. CLOUDSTACK-428 - Storage capacity shown in UI is incorrec + Storage capacity shown in UI is incorrect @@ -731,7 +731,7 @@ under the License. CLOUDSTACK-435 - Vmware network labels are ignored when creating a Zone using basic networkin + Vmware network labels are ignored when creating a Zone using basic networking @@ -739,7 +739,7 @@ under the License. CLOUDSTACK-441 - Running mgmt server using jetty fails to start api serve + Running mgmt server using jetty fails to start api server @@ -755,7 +755,7 @@ under the License. CLOUDSTACK-448 - SSVM bootstrap failure on XenServer hosts with E3 CP + SSVM bootstrap failure on XenServer hosts with E3 CPU @@ -763,7 +763,7 @@ under the License. CLOUDSTACK-456 - License tag in SPEC isn't what RPM is expectin + License tag in SPEC isn't what RPM is expecting @@ -771,7 +771,7 @@ under the License. CLOUDSTACK-459 - [Optional Public IP assignment for EIP with Basic Zone] Associate IP Checkbox in Create Network Offering Dialog is Displayed When Elastic LB is Selecte + [Optional Public IP assignment for EIP with Basic Zone] Associate IP Checkbox in Create Network Offering Dialog is Displayed When Elastic LB is Selected @@ -779,7 +779,7 @@ under the License. CLOUDSTACK-462 - A few corrections to make to the 4.0.0 installation guid + A few corrections to make to the 4.0.0 installation guide @@ -803,7 +803,7 @@ under the License. CLOUDSTACK-467 - Developer's Guide points to cloud.com for API referenc + Developer's Guide points to cloud.com for API reference @@ -811,7 +811,7 @@ under the License. CLOUDSTACK-479 - UpdateVirtualMachine api fails to propagate userdata to dom + UpdateVirtualMachine api fails to propagate userdata to domr @@ -819,7 +819,7 @@ under the License. CLOUDSTACK-481 - Installation Guide Doc Erro + Installation Guide Doc Error @@ -907,7 +907,7 @@ under the License. CLOUDSTACK-520 - Dependency jar names mismatch with install-non-oss.s + Dependency jar names mismatch with install-non-oss.sh @@ -915,7 +915,7 @@ under the License. CLOUDSTACK-521 - Build will hung up when doing test for TestAgentShel + Build will hung up when doing test for TestAgentShell @@ -931,7 +931,7 @@ under the License. CLOUDSTACK-527 - List API performance optimization by using DB views and removing UUID conversion + List API performance optimization by using DB views and removing UUID conversion. @@ -939,7 +939,7 @@ under the License. CLOUDSTACK-534 - Failed to add hos + Failed to add host @@ -1091,7 +1091,7 @@ under the License. CLOUDSTACK-606 - Starting VM fails with 'ConcurrentOperationException' in a clustered MS scenari + Starting VM fails with 'ConcurrentOperationException' in a clustered MS scenario @@ -1107,7 +1107,7 @@ under the License. CLOUDSTACK-617 - Unable to edit a Sub domai + Unable to edit a Sub domain @@ -1115,7 +1115,7 @@ under the License. CLOUDSTACK-639 - API Refactoring: Adapters for AC + API Refactoring: Adapters for ACL @@ -1147,7 +1147,7 @@ under the License. CLOUDSTACK-689 - RVR: Stop pending flag is not cleared when user start the disconnected router from another hos + RVR: Stop pending flag is not cleared when user start the disconnected router from another host @@ -1283,7 +1283,7 @@ under the License. CLOUDSTACK-928 - [Simulator] Latency for Agent Commands - change unit of wait from seconds to millisecond + [Simulator] Latency for Agent Commands - change unit of wait from seconds to milliseconds @@ -1307,7 +1307,7 @@ under the License. CLOUDSTACK-968 - marvin: vlan should be an attribute of the physical_network and not the zon + marvin: vlan should be an attribute of the physical_network and not the zone @@ -1331,7 +1331,7 @@ under the License. CLOUDSTACK-985 - Different MAC address for RvR caused issue in short term network outrag + Different MAC address for RvR caused issue in short term network outage @@ -1339,7 +1339,7 @@ under the License. CLOUDSTACK-987 - Sections missing in Working With Snapshot + Sections missing in Working With Snapshots @@ -1475,7 +1475,7 @@ under the License. CLOUDSTACK-1051 - API dispatcher unable to find objectVO corresponding to DeleteTemplatecm + API dispatcher unable to find objectVO corresponding to DeleteTemplatecmd @@ -1491,7 +1491,7 @@ under the License. CLOUDSTACK-1056 - S3 secondary storage fails to upload systemvm template due to KVMHA director + S3 secondary storage fails to upload systemvm template due to KVMHA directory @@ -1507,7 +1507,7 @@ under the License. CLOUDSTACK-1063 - "SG Enabled Advanced Zone - "Add Guest Networks" - When user tries to add a guest Network with scope as "Account" he should NOT be presented with ""Offering for shared security group enabled"" + "SG Enabled Advanced Zone - "Add Guest Networks" - When user tries to add a guest Network with scope as "Account" he should NOT be presented with "Offering for shared security group enabled" @@ -1523,7 +1523,7 @@ under the License. CLOUDSTACK-1068 - Names in VR list is useles + Names in VR list is useless @@ -1531,7 +1531,7 @@ under the License. CLOUDSTACK-1070 - javelin: NPE on executing registerIso AP + javelin: NPE on executing registerIso API @@ -1547,7 +1547,7 @@ under the License. CLOUDSTACK-1078 - Not able to start System Vms on Rhel 6.3 KVM hos + Not able to start System Vms on Rhel 6.3 KVM host @@ -1571,7 +1571,7 @@ under the License. CLOUDSTACK-1083 - listUsageRecords api: removed project results in NP + listUsageRecords api: removed project results in NPE @@ -1579,7 +1579,7 @@ under the License. CLOUDSTACK-1087 - Update the Developer Guide for ASFCS 4.1 Releas + Update the Developer Guide for ASFCS 4.1 Release @@ -1587,7 +1587,7 @@ under the License. CLOUDSTACK-1088 - EnableStaticNat error will clear the data in databas + EnableStaticNat error will clear the data in database @@ -1611,7 +1611,7 @@ under the License. CLOUDSTACK-1100 - Expunge thread is not kicked off based on global configuration if the global setting is less than 60 second + Expunge thread is not kicked off based on global configuration if the global setting is less than 60 seconds @@ -1659,7 +1659,7 @@ under the License. CLOUDSTACK-1109 - "Ipv6 - Unable to expunge User Vms that are ""Destroyed"". + "Ipv6 - Unable to expunge User Vms that are "Destroyed". @@ -1667,7 +1667,7 @@ under the License. CLOUDSTACK-1111 - Ipv6 - listRouters() does not return guestipaddress + Ipv6 - listRouters() does not return guestipaddress/ @@ -1675,7 +1675,7 @@ under the License. CLOUDSTACK-1112 - "Errors in ""Prepare the System VM Template"" + "Errors in "Prepare the System VM Template" @@ -1683,7 +1683,7 @@ under the License. CLOUDSTACK-1113 - "Ipv6 - Not able to deploy a new VM in this network because of ""Unable to allocate Unique Ipv6 address"" + "Ipv6 - Not able to deploy a new VM in this network because of "Unable to allocate Unique Ipv6 address" @@ -1691,7 +1691,7 @@ under the License. CLOUDSTACK-1114 - unable to execute listegressfirewallrules API due invalid value i + unable to execute listegressfirewallrules API due invalid value id @@ -1699,7 +1699,7 @@ under the License. CLOUDSTACK-1115 - In multiple shared network unable to login with default nic - KV + In multiple shared network unable to login with default nic - KVM @@ -1707,7 +1707,7 @@ under the License. CLOUDSTACK-1123 - ListStoragePools API broken by refacto + ListStoragePools API broken by refactor @@ -1739,7 +1739,7 @@ under the License. CLOUDSTACK-1152 - Missing tag in host-add.xm + Missing tag in host-add.xml @@ -1819,7 +1819,7 @@ under the License. CLOUDSTACK-1176 - Issue with snapshots(create/list + Issue with snapshots(create/list) @@ -1827,7 +1827,7 @@ under the License. CLOUDSTACK-1181 - mvn deploy db failing with NP + mvn deploy db failing with NPE @@ -2027,7 +2027,7 @@ under the License. CLOUDSTACK-1239 - Unable to registerISO :unhandled exception executing api command: registerIs + Unable to registerISO :unhandled exception executing api command: registerIso @@ -2051,7 +2051,7 @@ under the License. CLOUDSTACK-1242 - [F5-SRX-InlineMode] Failed to create LB rule with F5-SRX inlinemode deployemen + [F5-SRX-InlineMode] Failed to create LB rule with F5-SRX inlinemode deployment @@ -2179,7 +2179,7 @@ under the License. CLOUDSTACK-1278 - Improper permissions on injectkeys.s + Improper permissions on injectkeys.sh @@ -2195,7 +2195,7 @@ under the License. CLOUDSTACK-1289 - [F5-SRX-InlineMode] Usage stats are not generated for Juniper SRX Firewall in inlinemod + [F5-SRX-InlineMode] Usage stats are not generated for Juniper SRX Firewall in inlinemode @@ -2259,7 +2259,7 @@ under the License. CLOUDSTACK-1310 - ASF-build-master-nonoss-rhel63 - create advance zone FAIL - CreatePhysicalNetworkCmd FAIL - MySQLIntegrityConstraintViolationException: Duplicate entry '200-Public' for key 'physical_network_id + ASF-build-master-nonoss-rhel63 - create advance zone FAIL - CreatePhysicalNetworkCmd FAIL - MySQLIntegrityConstraintViolationException: Duplicate entry '200-Public' for key 'physical_network_id' @@ -2283,7 +2283,7 @@ under the License. CLOUDSTACK-1315 - [F5-SRX-InlineMode] Network implement failed with Run time Exception during network upgrade from VR to SRX-F + [F5-SRX-InlineMode] Network implement failed with Run time Exception during network upgrade from VR to SRX-F5 @@ -2443,7 +2443,7 @@ under the License. CLOUDSTACK-1347 - "Not able to delete network. Error - ""Unable to insert queue item into database, DB is full?"" + "Not able to delete network. Error - "Unable to insert queue item into database, DB is full?" @@ -2475,7 +2475,7 @@ under the License. CLOUDSTACK-1353 - KVM 6.3 snapshot Scheduling snapshot failed due to java.lang.NullPointerExceptio + KVM 6.3 snapshot Scheduling snapshot failed due to java.lang.NullPointerException @@ -2563,7 +2563,7 @@ under the License. CLOUDSTACK-1383 - Deploying basic zone on 4.1 fails in NP + Deploying basic zone on 4.1 fails in NPE @@ -2595,7 +2595,7 @@ under the License. CLOUDSTACK-1394 - [F5-SRX-InlineMode] Failure in static nat configuration on SRX does not result in LB configuration error in CS during LB rule configuratio + [F5-SRX-InlineMode] Failure in static nat configuration on SRX does not result in LB configuration error in CS during LB rule configuration @@ -2603,7 +2603,7 @@ under the License. CLOUDSTACK-1397 - Static Nat configuration is failing with NP + Static Nat configuration is failing with NPE @@ -2619,7 +2619,7 @@ under the License. CLOUDSTACK-1402 - listRouters API response doesn't return linklocal IP and public IP detail + listRouters API response doesn't return linklocal IP and public IP details @@ -2739,7 +2739,7 @@ under the License. CLOUDSTACK-1446 - [UI]VPC Router type should be of type vpc and not syste + [UI]VPC Router type should be of type vpc and not system @@ -2755,7 +2755,7 @@ under the License. CLOUDSTACK-1449 - listAccounts and listProjectAccounts API lists all the users not account-specific users for each account returne + listAccounts and listProjectAccounts API lists all the users not account-specific users for each account returned @@ -2763,7 +2763,7 @@ under the License. CLOUDSTACK-1451 - Getting EntityExistsException while creating more than one project in CS 4. + Getting EntityExistsException while creating more than one project in CS 4.1 @@ -2787,7 +2787,7 @@ under the License. CLOUDSTACK-1463 - IPV6 - Ubuntu 12.10 - Multiple Nic - IPV6 address is assigned automatically for 1 nic only. Need to do a manual dhclient request to get the ipv6 for other nic + IPV6 - Ubuntu 12.10 - Multiple Nic - IPV6 address is assigned automatically for 1 nic only. Need to do a manual dhclient request to get the ipv6 for other nic. @@ -2803,7 +2803,7 @@ under the License. CLOUDSTACK-1465 - List Zones returns null under create instance when logged is as use + List Zones returns null under create instance when logged is as user @@ -2811,7 +2811,7 @@ under the License. CLOUDSTACK-1467 - Failed to create Volume for the System Vm's + Failed to create Volume for the System VMs @@ -2819,7 +2819,7 @@ under the License. CLOUDSTACK-1469 - kvm agent: agent service fails to start u + kvm agent: agent service fails to start up @@ -2827,7 +2827,7 @@ under the License. CLOUDSTACK-1470 - unhandled exception executing api command: deployVirtualMachin + unhandled exception executing api command: deployVirtualMachine @@ -2835,7 +2835,7 @@ under the License. CLOUDSTACK-1472 - AssignVirtualMachine API with wrong Virtual Instance ID failed with NP + AssignVirtualMachine API with wrong Virtual Instance ID failed with NPE @@ -2843,7 +2843,7 @@ under the License. CLOUDSTACK-1473 - deleteDomain is failing with NP + deleteDomain is failing with NPE @@ -2867,7 +2867,7 @@ under the License. CLOUDSTACK-1484 - "API Throttling : api.throttling.enabled, Global setting missing + API Throttling : api.throttling.enabled, Global setting missing @@ -2875,7 +2875,7 @@ under the License. CLOUDSTACK-1485 - Add Baremetal Provider back to 4.1 branc + Add Baremetal Provider back to 4.1 branch @@ -2883,7 +2883,7 @@ under the License. CLOUDSTACK-1487 - cloudstack-setup-agent fails to set private.network.device on KVM host ad + cloudstack-setup-agent fails to set private.network.device on KVM host add @@ -2907,7 +2907,7 @@ under the License. CLOUDSTACK-1496 - List API Performance: listAccounts failing with OOME for high values of pagesize (>1000 + List API Performance: listAccounts failing with OOME for high values of pagesize (>1000) @@ -2915,7 +2915,7 @@ under the License. CLOUDSTACK-1499 - ListAPI Performance for few APIs not as good as it was before API optimizatio + ListAPI Performance for few APIs not as good as it was before API optimization @@ -2923,7 +2923,7 @@ under the License. CLOUDSTACK-1503 - listHypervisor API not getting fired when logged in as Use + listHypervisor API not getting fired when logged in as User @@ -2931,7 +2931,7 @@ under the License. CLOUDSTACK-1505 - Unknown column 'domain.region_id' in 'field list + Unknown column 'domain.region_id' in 'field list' @@ -2947,7 +2947,7 @@ under the License. CLOUDSTACK-1511 - [UI] Instances NIC details does not have Network Nam + [UI] Instances NIC details does not have Network Name @@ -2955,7 +2955,7 @@ under the License. CLOUDSTACK-1512 - [UI] Wrong message[message.configure.all.traffic.types] when trying to create zone with mulitple physical networks without providing the traffic labe + [UI] Wrong message[message.configure.all.traffic.types] when trying to create zone with mulitple physical networks without providing the traffic label @@ -2963,7 +2963,7 @@ under the License. CLOUDSTACK-1515 - None of the cloudstack packges are marked for upgrade when tried to upgrade from.4.0/4.0.1 to 4. + None of the cloudstack packges are marked for upgrade when tried to upgrade from.4.0/4.0.1 to 4.1 @@ -2971,7 +2971,7 @@ under the License. CLOUDSTACK-1516 - Create documentation in languages that have translations availabl + Create documentation in languages that have translations available @@ -2979,7 +2979,7 @@ under the License. CLOUDSTACK-1517 - Check UI in languages availabl + Check UI in languages available @@ -2987,7 +2987,7 @@ under the License. CLOUDSTACK-1521 - Redundant router: Services are not stopped when switch to BACKUP stat + Redundant router: Services are not stopped when switch to BACKUP state @@ -3003,7 +3003,7 @@ under the License. CLOUDSTACK-1531 - vmware create volume from snapshot will missing dat + vmware create volume from snapshot will missing date @@ -3011,7 +3011,7 @@ under the License. CLOUDSTACK-1537 - Restart network with clean up set to true causes Autoscaled LB rule to get mangled and unusabl + Restart network with clean up set to true causes Autoscaled LB rule to get mangled and unusable @@ -3019,7 +3019,7 @@ under the License. CLOUDSTACK-1541 - NPE while deleting snapshot :Unexpected exception while executing org.apache.cloudstack.api.command.user.snapshot.DeleteSnapshotCm + NPE while deleting snapshot :Unexpected exception while executing org.apache.cloudstack.api.command.user.snapshot.DeleteSnapshotCmd @@ -3027,7 +3027,7 @@ under the License. CLOUDSTACK-1542 - unhandled exception while creating projec + unhandled exception while creating project @@ -3035,7 +3035,7 @@ under the License. CLOUDSTACK-1544 - The description and the response format for the deleteUser command are incorrec + The description and the response format for the deleteUser command are incorrect @@ -3067,7 +3067,7 @@ under the License. CLOUDSTACK-1557 - EC2 REST API : cloudbridge database is missing on the CloudStack Installatio + EC2 REST API : cloudbridge database is missing on the CloudStack Installation @@ -3075,7 +3075,7 @@ under the License. CLOUDSTACK-1562 - Replace the short-cut solution of supportting @DB with the formal on + Replace the short-cut solution of supportting @DB with the formal one @@ -3091,7 +3091,7 @@ under the License. CLOUDSTACK-1566 - Baremetal API addBaremetalPxePingServer fail to add PXE PING server to deployment causing create instance with PING style image to fai + Baremetal API addBaremetalPxePingServer fail to add PXE PING server to deployment causing create instance with PING style image to fail @@ -3115,7 +3115,7 @@ under the License. CLOUDSTACK-1574 - updateResourceCount API is failed saying to specify valida resource type even after parsing the valid resource typ + updateResourceCount API is failed saying to specify valida resource type even after parsing the valid resource type @@ -3131,7 +3131,7 @@ under the License. CLOUDSTACK-1587 - "Basic zone - CPVM fail to go to running state, Exception while trying to start secondary storage vm + Basic zone - CPVM fail to go to running state, Exception while trying to start secondary storage vm @@ -3139,7 +3139,7 @@ under the License. CLOUDSTACK-1588 - "AWS Regions - When registerUserKeys() is called for a user from a region that is not the owner, it is handled by this region. + AWS Regions - When registerUserKeys() is called for a user from a region that is not the owner, it is handled by this region. @@ -3147,7 +3147,7 @@ under the License. CLOUDSTACK-1600 - Typo in dpkg-buildpackage comman + Typo in dpkg-buildpackage command @@ -3155,7 +3155,7 @@ under the License. CLOUDSTACK-1604 - "deploy VM failed when global setting ""vm.allocation.algorithm"" is set to ""userdispersing"" + deploy VM failed when global setting "vm.allocation.algorithm" is set to "userdispersing @@ -3171,7 +3171,7 @@ under the License. CLOUDSTACK-1620 - Cannot provision CentOS 6 VMs on XenServer 6. + Cannot provision CentOS 6 VMs on XenServer 6.1 @@ -3187,7 +3187,7 @@ under the License. CLOUDSTACK-1624 - API is not returning response in details:UI is also not returning any outpu + API is not returning response in details:UI is also not returning any output @@ -3195,7 +3195,7 @@ under the License. CLOUDSTACK-1625 - NPE with updateResourceCount when && is passed thru AP + NPE with updateResourceCount when && is passed thru API @@ -3211,7 +3211,7 @@ under the License. CLOUDSTACK-1631 - 4.1 RPM packaging broke + 4.1 RPM packaging broken @@ -3227,7 +3227,7 @@ under the License. CLOUDSTACK-1642 - Add support CentOS 6. + Add support CentOS 6.4 @@ -3235,7 +3235,7 @@ under the License. CLOUDSTACK-1648 - Unable to add KVM hos + Unable to add KVM host. @@ -3243,7 +3243,7 @@ under the License. CLOUDSTACK-1649 - vmware vm os type erro + vmware vm os type error @@ -3259,7 +3259,7 @@ under the License. CLOUDSTACK-1656 - NicResponses in a UserVmResponse are not preseving the natural order + NicResponses in a UserVmResponse are not preserving the natural order @@ -3291,7 +3291,7 @@ under the License. CLOUDSTACK-1666 - KVM VPC NetworkUsage doesnot wor + KVM VPC NetworkUsage does not work @@ -3299,7 +3299,7 @@ under the License. CLOUDSTACK-1668 - IP conflict in VPC tie + IP conflict in VPC tier @@ -3347,7 +3347,7 @@ under the License. CLOUDSTACK-1690 - NPE from API server when starting mgmt serve + NPE from API server when starting mgmt server @@ -3355,7 +3355,7 @@ under the License. CLOUDSTACK-1694 - Issues to start/access Management Server after upgrade from 4.0 to 4. + Issues to start/access Management Server after upgrade from 4.0 to 4.1 @@ -3363,7 +3363,7 @@ under the License. CLOUDSTACK-1697 - Six DB tables are not available with upgraded setup(4.0 to 4.1) when compare to 4.1 newly installatio + Six DB tables are not available with upgraded setup(4.0 to 4.1) when compare to 4.1 newly installation @@ -3371,7 +3371,7 @@ under the License. CLOUDSTACK-1706 - "Failed to deploy VM with error ""cannot find DeployPlannerSelector"" + Failed to deploy VM with error "cannot find DeployPlannerSelector" @@ -3379,7 +3379,7 @@ under the License. CLOUDSTACK-1709 - "AWS Regions - As part of adding a new region, project related entries should not be synced from accounts table. + AWS Regions - As part of adding a new region, project related entries should not be synced from accounts table. @@ -3387,7 +3387,7 @@ under the License. CLOUDSTACK-1710 - "AWS Regions - As part of adding a new region,default_zone_id column for the account entries should not be synced. + AWS Regions - As part of adding a new region,default_zone_id column for the account entries should not be synced. @@ -3443,7 +3443,7 @@ under the License. CLOUDSTACK-1719 - EC2 REST API: AWS APIs are not getting translated on the CloudStack Management Serve + EC2 REST API: AWS APIs are not getting translated on the CloudStack Management Server @@ -3451,7 +3451,7 @@ under the License. CLOUDSTACK-1720 - Have an upgrade path from 4.0.x to 4.1 and 4.0.x to 4.2. + Have an upgrade path from 4.0.x to 4.1 and 4.0.x to 4.2.0 @@ -3459,7 +3459,7 @@ under the License. CLOUDSTACK-1729 - Ensure adapter execution order in runtim + Ensure adapter execution order in runtime @@ -3475,7 +3475,7 @@ under the License. CLOUDSTACK-1736 - Ubuntu 12.04 cloud-setup-management Failed to configure CloudStack Management Serve + Ubuntu 12.04 cloud-setup-management Failed to configure CloudStack Management Server @@ -3483,7 +3483,7 @@ under the License. CLOUDSTACK-1738 - StatsCollector is not runnin + StatsCollector is not running @@ -3491,7 +3491,7 @@ under the License. CLOUDSTACK-1740 - Failed to view consol + Failed to view console @@ -3499,7 +3499,7 @@ under the License. CLOUDSTACK-1746 - Cloudstack Usage Server won't star + Cloudstack Usage Server won't start @@ -3659,7 +3659,7 @@ under the License. CLOUDSTACK-1812 - create physical network fails while creating basic zon + create physical network fails while creating basic zone @@ -3667,7 +3667,7 @@ under the License. CLOUDSTACK-1825 - EC2 REST API: AWS APIs fail to execute due to BeanCreationException: Error creating bean with name 'SAclDaoImpl + EC2 REST API: AWS APIs fail to execute due to BeanCreationException: Error creating bean with name 'SAclDaoImpl' @@ -3739,7 +3739,7 @@ under the License. CLOUDSTACK-1845 - KVM - storage migration often fail. + KVM - storage migration often fails @@ -3763,7 +3763,7 @@ under the License. CLOUDSTACK-1856 - Upgrade 4.0 -> 4.1 - Fresh install of 4.1 has 3 parameters missing in db.properties compared to an upgraded 4.0 set up + Upgrade 4.0 -> 4.1 - Fresh install of 4.1 has 3 parameters missing in db.properties compared to an upgraded 4.0 setup @@ -3811,7 +3811,7 @@ under the License. CLOUDSTACK-1890 - listProjects is not listing state in the respons + listProjects is not listing state in the response @@ -3827,7 +3827,7 @@ under the License. CLOUDSTACK-1929 - ASF 4.1 cloudstack agent fail to install in KVM host CENTOS 6.3 OS: qemu-kvm-0.12.1.2-3.295.el6.10.x86_64 requires libusbredirparser.so. + ASF 4.1 cloudstack agent fail to install in KVM host CENTOS 6.3 OS: qemu-kvm-0.12.1.2-3.295.el6.10.x86_64 requires libusbredirparser.so.0 @@ -3835,7 +3835,7 @@ under the License. CLOUDSTACK-1934 - NPE with listSupportedNetworkServices after upgrade from 4.0 to 4.1 (Ubuntu MS + NPE with listSupportedNetworkServices after upgrade from 4.0 to 4.1 (Ubuntu MS) @@ -3843,7 +3843,7 @@ under the License. CLOUDSTACK-1935 - Cloud utilities are not renamed to Cloudstack after upgrade from 4.0 to 4.1 [Ubutnu MS + Cloud utilities are not renamed to Cloudstack after upgrade from 4.0 to 4.1 [Ubutnu MS] @@ -3907,7 +3907,7 @@ under the License. CLOUDSTACK-1988 - AWS API using SOAP client - User Registeration fails + AWS API using SOAP client - User Registration fails @@ -3934,10 +3934,6 @@ under the License. Release Notes failing to build on jenkins.cs. - - CS-16135 - Creating volumes after upgrading from snapshot taken in 2.2.14 no longer deletes the snapshot physically from the secondary storage. - @@ -4116,7 +4112,7 @@ under the License. If you run into any issues during upgrades, please feel free to ask questions on users@apache.cloudstack.org or dev@apache.cloudstack.org.
Upgrade from 4.0.x to 4.1.0 - This section will guide you from Apache CloudStack 4.0.x versions to &PRODUCT; 4.1.0. + This section will guide you from &PRODUCT; 4.0.x versions to &PRODUCT; 4.1.0. Any steps that are hypervisor-specific will be called out with a note. Package Structure Changes The package structure for &PRODUCT; has changed significantly since the 4.0.x releases. If you've compiled your own packages, you'll notice that the package names and the number of packages has changed. This is not a bug. @@ -4129,92 +4125,6 @@ under the License. Create RPM or Debian packages (as appropriate) and a repository from the 4.1.0 source, or check the Apache CloudStack downloads page at http://cloudstack.apache.org/downloads.html for package repositories supplied by community members. You will need them for step or step . Instructions for creating packages from the &PRODUCT; source are in the Installation Guide. - - For VMware Only - This step is only required if you are using VMware. You can safely skip this step if you are using KVM and/or Xen only. - - In each zone that includes VMware hosts, you need to add a new system VM template. - - - While running the existing 3.0.2 system, log in to the UI as root administrator. - - - In the left navigation bar, click Templates. - - - In Select view, click Templates. - - - Click Register template. - The Register template dialog box is displayed. - - - In the Register template dialog box, specify the following values (do not change these): - - - - - - - Field - Value - - - - - Name - systemvm-vmware-4.1 - - - Description - systemvm-vmware-4.1 - - - URL - http://download.cloud.com/templates/burbank/burbank-systemvm-08012012.ova - - - Zone - Choose the zone where this hypervisor is used - - - Hypervisor - VMware - - - Format - OVA - - - OS Type - Debian GNU/Linux 5.0 (32-bit) - - - Extractable - no - - - Password Enabled - no - - - Public - no - - - Featured - no - - - - - - - Watch the screen to be sure that the template downloads successfully and enters - the READY state. Do not proceed until this is successful. - - - Stop your management server or servers. Run this on all management server hosts: # service cloud-management stop diff --git a/docs/en-US/source-build.xml b/docs/en-US/source-build.xml index 33218962174..8504385ee29 100644 --- a/docs/en-US/source-build.xml +++ b/docs/en-US/source-build.xml @@ -25,11 +25,11 @@
Building &PRODUCT; from Source - Prior to the 4.0.0 incubating release, Ant was used to build &PRODUCT;. Starting with 4.0.0 a migration to Maven is underway. + Prior to the 4.0.0 incubating release, Ant was used to build &PRODUCT;. A migration to Maven started in the 4.0.0 cycle, and has completed in 4.1.0. The website and the wiki contain up to date information on the build procedure at: https://cwiki.apache.org/CLOUDSTACK/building-with-maven.html - http://incubator.apache.org/cloudstack/develop/environment.html + https://cwiki.apache.org/CLOUDSTACK/setting-up-cloudstack-development-environment.html The overarching steps to build &PRODUCT; are:. diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java index c4e121b8ae8..d1470d62519 100644 --- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java +++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/KVMHAMonitor.java @@ -23,6 +23,15 @@ import java.util.concurrent.ConcurrentHashMap; import org.apache.log4j.Logger; import com.cloud.utils.script.Script; +import org.libvirt.Connect; +import org.libvirt.LibvirtException; +import org.libvirt.Secret; +import org.libvirt.StoragePool; +import org.libvirt.StoragePoolInfo; +import org.libvirt.StoragePoolInfo.StoragePoolState; + +import com.cloud.hypervisor.kvm.resource.LibvirtConnection; + public class KVMHAMonitor extends KVMHABase implements Runnable { private static final Logger s_logger = Logger.getLogger(KVMHAMonitor.class); private Map _storagePool = new ConcurrentHashMap(); @@ -45,6 +54,9 @@ public class KVMHAMonitor extends KVMHABase implements Runnable { public void removeStoragePool(String uuid) { synchronized (_storagePool) { + NfsStoragePool pool = this._storagePool.get(uuid); + Script.runSimpleBashScript("umount " + pool._mountDestPath); + s_logger.debug("attempted to umount '" + pool._mountDestPath + "'"); this._storagePool.remove(uuid); } } @@ -60,7 +72,44 @@ public class KVMHAMonitor extends KVMHABase implements Runnable { @Override public void run() { synchronized (_storagePool) { - for (NfsStoragePool primaryStoragePool : _storagePool.values()) { + for (String uuid : _storagePool.keySet()) { + NfsStoragePool primaryStoragePool = _storagePool.get(uuid); + + // check for any that have been deregistered with libvirt and + // skip,remove them + + StoragePool storage = null; + try { + Connect conn = LibvirtConnection.getConnection(); + storage = conn.storagePoolLookupByUUIDString(uuid); + if (storage == null) { + s_logger.debug("Libvirt storage pool " + uuid + +" not found, removing from HA list"); + removeStoragePool(uuid); + continue; + + } else if (storage.getInfo().state != StoragePoolState.VIR_STORAGE_POOL_RUNNING) { + s_logger.debug("Libvirt storage pool " + uuid + +" found, but not running, removing from HA list"); + + removeStoragePool(uuid); + continue; + } + s_logger.debug("Found NFS storage pool " + uuid + " in libvirt, continuing"); + + } catch (LibvirtException e) { + s_logger.debug("Failed to lookup libvirt storage pool " + uuid + + " due to: " + e ); + + // we only want to remove pool if it's not found, not if libvirt + // connection fails + if (e.toString().contains("pool not found")) { + s_logger.debug("removing pool from HA monitor since it was deleted"); + removeStoragePool(uuid); + continue; + } + } + String result = null; for (int i = 0; i < 5; i++) { Script cmd = new Script(_heartBeatPath, 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 362e0a53e53..0064edf6a68 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 @@ -1077,8 +1077,7 @@ ServerResource { */ conn.domainCreateXML(domainXML, 0); } catch (final LibvirtException e) { - s_logger.warn("Failed to start domain " + vmName + ": " - + e.getMessage(), e); + throw e; } return null; } @@ -1270,7 +1269,7 @@ ServerResource { secondaryStoragePool = _storagePoolMgr.getStoragePoolByURI( secondaryStorageUrl); secondaryStoragePool.createFolder(volumeDestPath); - secondaryStoragePool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryStoragePool.getType(),secondaryStoragePool.getUuid()); secondaryStoragePool = _storagePoolMgr.getStoragePoolByURI( secondaryStorageUrl + volumeDestPath); @@ -1292,7 +1291,7 @@ ServerResource { return new CopyVolumeAnswer(cmd, false, e.toString(), null, null); } finally { if (secondaryStoragePool != null) { - secondaryStoragePool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryStoragePool.getType(),secondaryStoragePool.getUuid()); } } } @@ -1415,7 +1414,7 @@ ServerResource { return null; } finally { if (secondaryPool != null) { - secondaryPool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryPool.getType(),secondaryPool.getUuid()); } } } @@ -2008,7 +2007,7 @@ ServerResource { true); } finally { if (secondaryStoragePool != null) { - secondaryStoragePool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryStoragePool.getType(),secondaryStoragePool.getUuid()); } } return new BackupSnapshotAnswer(cmd, true, null, snapshotRelPath @@ -2040,7 +2039,7 @@ ServerResource { return new DeleteSnapshotBackupAnswer(cmd, false, e.toString()); } finally { if (secondaryStoragePool != null) { - secondaryStoragePool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryStoragePool.getType(),secondaryStoragePool.getUuid()); } } return new DeleteSnapshotBackupAnswer(cmd, true, null); @@ -2069,7 +2068,7 @@ ServerResource { return new Answer(cmd, false, e.toString()); } finally { if (secondaryStoragePool != null) { - secondaryStoragePool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryStoragePool.getType(),secondaryStoragePool.getUuid()); } } @@ -2167,10 +2166,10 @@ ServerResource { return new CreatePrivateTemplateAnswer(cmd, false, e.getMessage()); } finally { if (secondaryPool != null) { - secondaryPool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryPool.getType(), secondaryPool.getUuid()); } if (snapshotPool != null) { - snapshotPool.delete(); + _storagePoolMgr.deleteStoragePool(snapshotPool.getType(), snapshotPool.getUuid()); } } } @@ -2304,7 +2303,7 @@ ServerResource { return new CreatePrivateTemplateAnswer(cmd, false, e.toString()); } finally { if (secondaryStorage != null) { - secondaryStorage.delete(); + _storagePoolMgr.deleteStoragePool(secondaryStorage.getType(), secondaryStorage.getUuid()); } } } @@ -2362,7 +2361,7 @@ ServerResource { return new PrimaryStorageDownloadAnswer(e.toString()); } finally { if (secondaryPool != null) { - secondaryPool.delete(); + _storagePoolMgr.deleteStoragePool(secondaryPool.getType(),secondaryPool.getUuid()); } } } @@ -3454,7 +3453,7 @@ ServerResource { KVMStoragePool pool = _storagePoolMgr.getStoragePool( StoragePoolType.Filesystem, poolUuid); if (pool != null) { - pool.delete(); + _storagePoolMgr.deleteStoragePool(pool.getType(),pool.getUuid()); } return true; } catch (CloudRuntimeException e) { diff --git a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java index 51ea2126756..a0c991b5ad6 100644 --- a/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java +++ b/plugins/storage/volume/default/src/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java @@ -532,8 +532,7 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl implements throw new CloudRuntimeException("Failed to delete storage pool on host"); } - this.dataStoreHelper.deletePrimaryDataStore(store); - return false; + return this.dataStoreHelper.deletePrimaryDataStore(store); } @Override diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index dd0b7723f54..101106ebadd 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -755,6 +755,7 @@ public class ApiResponseHelper implements ResponseGenerator { response.setDescription(globalLoadBalancerRule.getDescription()); response.setRegionIdId(globalLoadBalancerRule.getRegion()); response.setId(globalLoadBalancerRule.getUuid()); + populateOwner(response, globalLoadBalancerRule); response.setObjectName("globalloadbalancer"); return response; } @@ -2655,7 +2656,7 @@ public class ApiResponseHelper implements ResponseGenerator { response.setZoneId(zone.getUuid()); } response.setNetworkSpeed(result.getSpeed()); - response.setVlan(result.getVnet()); + response.setVlan(result.getVnetString()); if (result.getDomainId() != null) { Domain domain = ApiDBUtils.findDomainById(result.getDomainId()); if (domain != null) { diff --git a/server/src/com/cloud/api/query/QueryManagerImpl.java b/server/src/com/cloud/api/query/QueryManagerImpl.java index ac9a3be3159..20343814215 100644 --- a/server/src/com/cloud/api/query/QueryManagerImpl.java +++ b/server/src/com/cloud/api/query/QueryManagerImpl.java @@ -1699,6 +1699,7 @@ public class QueryManagerImpl extends ManagerBase implements QueryService { sb.and("typeNEQ", sb.entity().getType(), SearchCriteria.Op.NEQ); sb.and("idNEQ", sb.entity().getId(), SearchCriteria.Op.NEQ); + if (listForDomain && isRecursive) { sb.and("path", sb.entity().getDomainPath(), SearchCriteria.Op.LIKE); } diff --git a/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java index 51ac5e61edb..796ae54d52f 100644 --- a/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/AccountJoinDaoImpl.java @@ -20,17 +20,16 @@ import java.util.List; import javax.ejb.Local; +import org.apache.cloudstack.api.response.AccountResponse; +import org.apache.cloudstack.api.response.UserResponse; import org.apache.log4j.Logger; +import org.springframework.stereotype.Component; import com.cloud.api.ApiDBUtils; import com.cloud.api.query.ViewResponseHelper; import com.cloud.api.query.vo.AccountJoinVO; import com.cloud.api.query.vo.UserAccountJoinVO; import com.cloud.configuration.Resource.ResourceType; -import org.apache.cloudstack.api.response.AccountResponse; -import org.apache.cloudstack.api.response.UserResponse; -import org.springframework.stereotype.Component; - import com.cloud.user.Account; import com.cloud.utils.db.GenericDaoBase; import com.cloud.utils.db.SearchBuilder; @@ -66,6 +65,7 @@ public class AccountJoinDaoImpl extends GenericDaoBase impl accountResponse.setState(account.getState().toString()); accountResponse.setNetworkDomain(account.getNetworkDomain()); accountResponse.setDefaultZone(account.getDataCenterUuid()); + accountResponse.setIsDefault(account.isDefault()); // get network stat accountResponse.setBytesReceived(account.getBytesReceived()); diff --git a/server/src/com/cloud/api/query/dao/UserAccountJoinDaoImpl.java b/server/src/com/cloud/api/query/dao/UserAccountJoinDaoImpl.java index 7072324080d..43b3a2d0a1f 100644 --- a/server/src/com/cloud/api/query/dao/UserAccountJoinDaoImpl.java +++ b/server/src/com/cloud/api/query/dao/UserAccountJoinDaoImpl.java @@ -80,6 +80,7 @@ public class UserAccountJoinDaoImpl extends GenericDaoBase { public List listAllocatedVnets(long physicalNetworkId); + public List listAllocatedVnetsInRange(long dcId, long physicalNetworkId, Integer start, Integer end); public List findVnet(long dcId, String vnet); public int countZoneVlans(long dcId, boolean onlyCountAllocated); public List findVnet(long dcId, long physicalNetworkId, String vnet); @@ -31,6 +33,10 @@ public interface DataCenterVnetDao extends GenericDao { public void delete(long physicalNetworkId); + public void deleteRange(Transaction txn, long dcId, long physicalNetworkId, int start, int end); + + public void lockRange(long dcId, long physicalNetworkId, Integer start, Integer end); + public DataCenterVnetVO take(long physicalNetworkId, long accountId, String reservationId); public void release(String vnet, long physicalNetworkId, long accountId, String reservationId); diff --git a/server/src/com/cloud/dc/dao/DataCenterVnetDaoImpl.java b/server/src/com/cloud/dc/dao/DataCenterVnetDaoImpl.java index 5ded0f4ecf5..2e044394ddc 100755 --- a/server/src/com/cloud/dc/dao/DataCenterVnetDaoImpl.java +++ b/server/src/com/cloud/dc/dao/DataCenterVnetDaoImpl.java @@ -21,6 +21,7 @@ import java.sql.SQLException; import java.util.Date; import java.util.List; +import com.cloud.exception.InvalidParameterValueException; import org.springframework.stereotype.Component; import com.cloud.dc.DataCenterVnetVO; @@ -46,8 +47,10 @@ public class DataCenterVnetDaoImpl extends GenericDaoBase VnetDcSearch; private final SearchBuilder VnetDcSearchAllocated; private final SearchBuilder DcSearchAllocated; + private final SearchBuilder DcSearchAllocatedInRange; private final GenericSearchBuilder countZoneVlans; private final GenericSearchBuilder countAllocatedZoneVlans; + private final SearchBuilder SearchRange; public List listAllocatedVnets(long physicalNetworkId) { SearchCriteria sc = DcSearchAllocated.create(); @@ -55,6 +58,22 @@ public class DataCenterVnetDaoImpl extends GenericDaoBase listAllocatedVnetsInRange(long dcId, long physicalNetworkId, Integer start, Integer end) { + SearchCriteria sc = DcSearchAllocatedInRange.create(); + sc.setParameters("dc",dcId); + sc.setParameters("physicalNetworkId", physicalNetworkId); + sc.setParameters("vnetRange", start.toString(), end.toString()); + return listBy(sc); + } + + public void lockRange(long dcId, long physicalNetworkId, Integer start, Integer end) { + SearchCriteria sc = SearchRange.create(); + sc.setParameters("dc",dcId); + sc.setParameters("physicalNetworkId", physicalNetworkId); + sc.setParameters("vnetRange", start.toString(), end.toString()); + lockRows(sc,null,true); + } + public List findVnet(long dcId, String vnet) { SearchCriteria sc = VnetDcSearch.create();; sc.setParameters("dc", dcId); @@ -93,11 +112,28 @@ public class DataCenterVnetDaoImpl extends GenericDaoBase sc = VnetDcSearch.create(); sc.setParameters("physicalNetworkId", physicalNetworkId); @@ -149,6 +185,18 @@ public class DataCenterVnetDaoImpl extends GenericDaoBase> vnetList = pNetwork.getVnet(); + //finding the vlanrange in which the vlanTag lies. + for (Pair vnet : vnetList){ + if (vlanTag >= vnet.first() && vlanTag <= vnet.second()){ + lowestVlanTag = vnet.first(); + } + } + if (lowestVlanTag == null) { + throw new InvalidParameterValueException ("The vlan tag dose not belong to any of the existing vlan ranges"); + } return vlanTag - lowestVlanTag; } diff --git a/server/src/com/cloud/network/NetworkServiceImpl.java b/server/src/com/cloud/network/NetworkServiceImpl.java index 27c8aa76062..0d949ab2aa5 100755 --- a/server/src/com/cloud/network/NetworkServiceImpl.java +++ b/server/src/com/cloud/network/NetworkServiceImpl.java @@ -37,6 +37,7 @@ import javax.inject.Inject; import javax.naming.ConfigurationException; import org.apache.cloudstack.acl.ControlledEntity.ACLType; +import org.apache.cloudstack.acl.SecurityChecker; import org.apache.cloudstack.acl.SecurityChecker.AccessType; import org.apache.cloudstack.api.command.admin.usage.ListTrafficTypeImplementorsCmd; import org.apache.cloudstack.api.command.user.network.CreateNetworkCmd; @@ -53,11 +54,13 @@ import com.cloud.configuration.dao.ConfigurationDao; import com.cloud.dc.DataCenter; import com.cloud.dc.DataCenter.NetworkType; import com.cloud.dc.DataCenterVO; +import com.cloud.dc.DataCenterVnetVO; import com.cloud.dc.Pod; import com.cloud.dc.Vlan.VlanType; import com.cloud.dc.VlanVO; import com.cloud.dc.dao.AccountVlanMapDao; import com.cloud.dc.dao.DataCenterDao; +import com.cloud.dc.dao.DataCenterVnetDao; import com.cloud.dc.dao.HostPodDao; import com.cloud.dc.dao.VlanDao; import com.cloud.deploy.DeployDestination; @@ -261,6 +264,8 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { HostPodDao _hostPodDao; @Inject InternalLoadBalancerElementService _internalLbElementSvc; + @Inject + DataCenterVnetDao _datacneter_vnet; int _cidrLimit; boolean _allowSubdomainNetworkAccess; @@ -593,7 +598,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { } else if (dc.getNetworkType() == NetworkType.Basic || ntwkOff.getGuestType() == Network.GuestType.Shared) { Account caller = UserContext.current().getCaller(); long callerUserId = UserContext.current().getCallerUserId(); - _accountMgr.checkAccess(caller, AccessType.UseNetwork, false, network); + _accountMgr.checkAccess(caller, SecurityChecker.AccessType.UseNetwork, false, network); //handle the basic networks here VirtualMachine vm = _userVmDao.findById(nicVO.getInstanceId()); if (vm == null) { @@ -813,18 +818,20 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { // in the zone when using external networking PhysicalNetworkVO pNetwork = _physicalNetworkDao.findById(physicalNetworkId); if (pNetwork.getVnet() != null) { - String vlanRange[] = pNetwork.getVnet().split("-"); - int lowestVlanTag = Integer.valueOf(vlanRange[0]); - int highestVlanTag = Integer.valueOf(vlanRange[1]); - for (int vlan=lowestVlanTag; vlan <= highestVlanTag; ++vlan) { - int offset = vlan - lowestVlanTag; - String globalVlanBits = _configDao.getValue(Config.GuestVlanBits.key()); - int cidrSize = 8 + Integer.parseInt(globalVlanBits); - String guestNetworkCidr = zone.getGuestNetworkCidr(); - String[] cidrTuple = guestNetworkCidr.split("\\/"); - long newCidrAddress = (NetUtils.ip2Long(cidrTuple[0]) & 0xff000000) | (offset << (32 - cidrSize)); - if (NetUtils.isNetworksOverlap(NetUtils.long2Ip(newCidrAddress), cidr)) { - throw new InvalidParameterValueException("Specified CIDR for shared network conflict with CIDR that is reserved for zone vlan " + vlan); + List > vlanList = pNetwork.getVnet(); + for (Pair vlanRange : vlanList){ + Integer lowestVlanTag = vlanRange.first(); + Integer highestVlanTag = vlanRange.second(); + for (int vlan=lowestVlanTag; vlan <= highestVlanTag; ++vlan) { + int offset = vlan - lowestVlanTag; + String globalVlanBits = _configDao.getValue(Config.GuestVlanBits.key()); + int cidrSize = 8 + Integer.parseInt(globalVlanBits); + String guestNetworkCidr = zone.getGuestNetworkCidr(); + String[] cidrTuple = guestNetworkCidr.split("\\/"); + long newCidrAddress = (NetUtils.ip2Long(cidrTuple[0]) & 0xff000000) | (offset << (32 - cidrSize)); + if (NetUtils.isNetworksOverlap(NetUtils.long2Ip(newCidrAddress), cidr)) { + throw new InvalidParameterValueException("Specified CIDR for shared network conflict with CIDR that is reserved for zone vlan " + vlan); + } } } } @@ -2224,7 +2231,6 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { } catch (NumberFormatException e) { throw new InvalidParameterValueException("Please specify valid integers for the vlan range."); } - if ((vnetStart > vnetEnd) || (vnetStart < 0) || (vnetEnd > 4096)) { s_logger.warn("Invalid vnet range: start range:" + vnetStart + " end range:" + vnetEnd); throw new InvalidParameterValueException("Vnet range should be between 0-4096 and start range should be lesser than or equal to end range"); @@ -2318,7 +2324,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { @Override @DB @ActionEvent(eventType = EventTypes.EVENT_PHYSICAL_NETWORK_UPDATE, eventDescription = "updating physical network", async = true) - public PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags, String newVnetRangeString, String state) { + public PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags, String newVnetRangeString, String state, String removeVlan) { // verify input parameters PhysicalNetworkVO network = _physicalNetworkDao.findById(id); @@ -2343,6 +2349,12 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { } } + if (removeVlan != null){ + List tokens = processVlanRange(network,removeVlan); + boolean result = removeVlanRange(network, tokens.get(0), tokens.get(1)); + + } + if (tags != null && tags.size() > 1) { throw new InvalidParameterException("Unable to support more than one tag on network yet"); } @@ -2369,90 +2381,211 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService { } // Vnet range can be extended only - boolean replaceVnet = false; - ArrayList> vnetsToAdd = new ArrayList>(2); + boolean AddVnet = true; + List> vnetsToAdd = new ArrayList>(); if (newVnetRangeString != null) { Integer newStartVnet = 0; Integer newEndVnet = 0; - String[] newVnetRange = newVnetRangeString.split("-"); - int maxVnet = 4096; - // for GRE phynets allow up to 32bits - // TODO: Not happy about this test. - // What about guru-like objects for physical networs? - s_logger.debug("ISOLATION METHODS:" + network.getIsolationMethods()); - // Java does not have unsigned types... - if (network.getIsolationMethods().contains("GRE")) { - maxVnet = (int)(Math.pow(2, 32)-1); - } - String rangeMessage = " between 0 and " + maxVnet; - if (newVnetRange.length < 2) { - throw new InvalidParameterValueException("Please provide valid vnet range" + rangeMessage); - } + List tokens = processVlanRange(network, newVnetRangeString); + newStartVnet = tokens.get(0); + newEndVnet = tokens.get(1); + Integer j=0; + List > existingRanges = network.getVnet(); + if (!existingRanges.isEmpty()) { + for (; j < existingRanges.size(); j++){ + int existingStartVnet = existingRanges.get(j).first(); + int existingEndVnet = existingRanges.get(j).second(); - if (newVnetRange[0] == null || newVnetRange[1] == null) { - throw new InvalidParameterValueException("Please provide valid vnet range" + rangeMessage); - } + // check if vnet is being extended + if (newStartVnet.intValue() >= existingStartVnet & newEndVnet.intValue() <= existingEndVnet) { + throw new InvalidParameterValueException("The vlan range you trying to add already exists."); + } - try { - newStartVnet = Integer.parseInt(newVnetRange[0]); - newEndVnet = Integer.parseInt(newVnetRange[1]); - } catch (NumberFormatException e) { - s_logger.warn("Unable to parse vnet range:", e); - throw new InvalidParameterValueException("Please provide valid vnet range" + rangeMessage); - } - if (newStartVnet < 0 || newEndVnet > maxVnet) { - throw new InvalidParameterValueException("Vnet range has to be" + rangeMessage); - } + if (newStartVnet < existingStartVnet & newEndVnet+1 >= existingStartVnet & newEndVnet <= existingEndVnet) { + vnetsToAdd.add(new Pair(newStartVnet, existingStartVnet - 1)); + existingRanges.get(j).first(newStartVnet); + AddVnet = false; + break; + } - if (newStartVnet > newEndVnet) { - throw new InvalidParameterValueException("Vnet range has to be" + rangeMessage + " and start range should be lesser than or equal to stop range"); - } - - if (physicalNetworkHasAllocatedVnets(network.getDataCenterId(), network.getId())) { - String[] existingRange = network.getVnet().split("-"); - int existingStartVnet = Integer.parseInt(existingRange[0]); - int existingEndVnet = Integer.parseInt(existingRange[1]); + else if (newStartVnet > existingStartVnet & newStartVnet-1 <= existingEndVnet & newEndVnet >= existingEndVnet) { + vnetsToAdd.add(new Pair(existingEndVnet + 1, newEndVnet)); + existingRanges.get(j).second(newEndVnet); + AddVnet = false; + break; + } - // check if vnet is being extended - if (newStartVnet.intValue() > existingStartVnet || newEndVnet.intValue() < existingEndVnet) { - throw new InvalidParameterValueException("Can't shrink existing vnet range as it the range has vnets allocated. Only extending existing vnet is supported"); + else if (newStartVnet< existingStartVnet & newEndVnet > existingEndVnet){ + vnetsToAdd.add(new Pair(newStartVnet,existingStartVnet-1)); + vnetsToAdd.add(new Pair(existingEndVnet+1,newEndVnet)); + existingRanges.get(j).first(newStartVnet); + existingRanges.get(j).second(newEndVnet); + break; + } } - if (newStartVnet < existingStartVnet) { - vnetsToAdd.add(new Pair(newStartVnet, existingStartVnet - 1)); - } - - if (newEndVnet > existingEndVnet) { - vnetsToAdd.add(new Pair(existingEndVnet + 1, newEndVnet)); - } - - } else { - vnetsToAdd.add(new Pair(newStartVnet, newEndVnet)); - replaceVnet = true; } - } + if (AddVnet){ + vnetsToAdd.add(new Pair(newStartVnet, newEndVnet)); + existingRanges.add(new Pair(newStartVnet,newEndVnet)); + } - if (newVnetRangeString != null) { - network.setVnet(newVnetRangeString); - } + Map vnetMap = new HashMap(existingRanges.size()); + Map IndexMap = new HashMap(existingRanges.size()); + for (int i=0; i< existingRanges.size(); i++){ + vnetMap.put(existingRanges.get(i).first(),existingRanges.get(i).second()); + IndexMap.put(existingRanges.get(i).first(),i); + } - _physicalNetworkDao.update(id, network); + Integer value; + Integer index; + String vnetString = ""; + for (int i=0; i < existingRanges.size(); i++){ + value = vnetMap.get((existingRanges.get(i).second()+1)); + if (value != null) { + vnetMap.remove((existingRanges.get(i).second()+1)); + vnetMap.remove(existingRanges.get(i).first()); + vnetMap.put(existingRanges.get(i).first(),value); + existingRanges.add(new Pair(existingRanges.get(i).first(),value)); + index = IndexMap.get(existingRanges.get(i).second()+1); + existingRanges.get(index).first(-1); + existingRanges.get(index).second(-1); + existingRanges.get(i).first(-1); + existingRanges.get(i).second(-1); + } + value = vnetMap.get((existingRanges.get(i).second())); + if (value != null) { + vnetMap.remove((existingRanges.get(i).second())); + vnetMap.remove(existingRanges.get(i).first()); + vnetMap.put(existingRanges.get(i).first(),value); + existingRanges.add(new Pair(existingRanges.get(i).first(),value)); + index = IndexMap.get(existingRanges.get(i).second()); + existingRanges.get(index).first(-1); + existingRanges.get(index).second(-1); + existingRanges.get(i).first(-1); + existingRanges.get(i).second(-1); + } + } - if (replaceVnet) { - s_logger.debug("Deleting existing vnet range for the physicalNetwork id= " + id + " and zone id=" + network.getDataCenterId() + " as a part of updatePhysicalNetwork call"); - _dcDao.deleteVnet(network.getId()); - } - for (Pair vnetToAdd : vnetsToAdd) { - s_logger.debug("Adding vnet range " + vnetToAdd.first() + "-" + vnetToAdd.second() + " for the physicalNetwork id= " + id + " and zone id=" + network.getDataCenterId() + + if (newVnetRangeString != null) { + for (Pair vnetRange : existingRanges ){ + value=vnetMap.get(vnetRange.first()); + if (value != null){ + vnetString = vnetString+vnetRange.first().toString()+"-"+value.toString()+";"; + } + } + vnetString = vnetString+"*"; + vnetString = vnetString.replace(";*",""); + network.setVnet(vnetString); + } + + + + _physicalNetworkDao.update(id, network); + + for (Pair vnetToAdd : vnetsToAdd) { + s_logger.debug("Adding vnet range " + vnetToAdd.first() + "-" + vnetToAdd.second() + " for the physicalNetwork id= " + id + " and zone id=" + network.getDataCenterId() + " as a part of updatePhysicalNetwork call"); - _dcDao.addVnet(network.getDataCenterId(), network.getId(), vnetToAdd.first(), vnetToAdd.second()); + _dcDao.addVnet(network.getDataCenterId(), network.getId(), vnetToAdd.first(), vnetToAdd.second()); + } } return network; } + private List processVlanRange(PhysicalNetworkVO network, String removeVlan) { + Integer StartVnet; + Integer EndVnet; + String[] VnetRange = removeVlan.split("-"); + int maxVnet = 4096; + // for GRE phynets allow up to 32bits + // TODO: Not happy about this test. + // What about guru-like objects for physical networs? + s_logger.debug("ISOLATION METHODS:" + network.getIsolationMethods()); + // Java does not have unsigned types... + if (network.getIsolationMethods().contains("GRE")) { + maxVnet = (int)(Math.pow(2, 32)-1); + } + String rangeMessage = " between 0 and " + maxVnet; + if (VnetRange.length < 2) { + throw new InvalidParameterValueException("Please provide valid vnet range" + rangeMessage); + } + + if (VnetRange[0] == null || VnetRange[1] == null) { + throw new InvalidParameterValueException("Please provide valid vnet range" + rangeMessage); + } + + try { + StartVnet = Integer.parseInt(VnetRange[0]); + EndVnet = Integer.parseInt(VnetRange[1]); + } catch (NumberFormatException e) { + s_logger.warn("Unable to parse vnet range:", e); + throw new InvalidParameterValueException("Please provide valid vnet range" + rangeMessage); + } + if (StartVnet < 0 || EndVnet > maxVnet) { + throw new InvalidParameterValueException("Vnet range has to be" + rangeMessage); + } + + if (StartVnet > EndVnet) { + throw new InvalidParameterValueException("Vnet range has to be" + rangeMessage + " and start range should be lesser than or equal to stop range"); + } + List tokens = new ArrayList(); + tokens.add(StartVnet); + tokens.add(EndVnet); + return tokens; + + } + + + private boolean removeVlanRange( PhysicalNetworkVO network, Integer start, Integer end) { + Integer temp=0; + int i; + List > existingRanges = network.getVnet(); + Transaction txn = Transaction.currentTxn(); + txn.start(); + _physicalNetworkDao.acquireInLockTable(network.getId(),10); + _datacneter_vnet.lockRange(network.getDataCenterId(), network.getId(), start, end); + List result = _datacneter_vnet.listAllocatedVnetsInRange(network.getDataCenterId(), network.getId(), start, end); + if (!result.isEmpty()){ + txn.close(); + throw new InvalidParameterValueException("Some of the vnets from this range are allocated, can only remove a range which has no allocated vnets"); + } + for (i=0; i= end){ + temp = existingRanges.get(i).second(); + existingRanges.get(i).second(start - 1); + existingRanges.add(new Pair((end+1),temp)); + break; + } + } + + if (temp == 0){ + throw new InvalidParameterValueException("The vlan range you are trying to delete dose not exist."); + } + if(existingRanges.get(i).first() > existingRanges.get(i).second()){ + existingRanges.remove(i); + } + if(existingRanges.get(existingRanges.size()-1).first() > existingRanges.get(existingRanges.size()-1).second()){ + existingRanges.remove(existingRanges.size()-1); + } + _datacneter_vnet.deleteRange(txn, network.getDataCenterId(), network.getId(), start, end); + + String vnetString=""; + for (Pair vnetRange : existingRanges ){ + vnetString=vnetString+vnetRange.first().toString()+"-"+vnetRange.second().toString()+";"; + } + vnetString = vnetString+"*"; + vnetString = vnetString.replace(";*",""); + network.setVnet(vnetString); + _physicalNetworkDao.update(network.getId(), network); + txn.commit(); + _physicalNetworkDao.releaseFromLockTable(network.getId()); + return true; + } + private boolean physicalNetworkHasAllocatedVnets(long zoneId, long physicalNetworkId) { return !_dcDao.listAllocatedVnets(physicalNetworkId).isEmpty(); } diff --git a/server/src/com/cloud/network/addr/PublicIp.java b/server/src/com/cloud/network/addr/PublicIp.java index 8217e4e47b9..25e9d308b14 100644 --- a/server/src/com/cloud/network/addr/PublicIp.java +++ b/server/src/com/cloud/network/addr/PublicIp.java @@ -194,23 +194,12 @@ public class PublicIp implements PublicIpAddress { public boolean getSystem() { return _addr.getSystem(); } - - /* (non-Javadoc) - * @see com.cloud.network.IpAddress#getVpcId() - */ + @Override public Long getVpcId() { return _addr.getVpcId(); } - /* (non-Javadoc) - * @see com.cloud.network.IpAddress#setVpcId(java.lang.Long) - */ - @Override - public void setVpcId(Long vpcId) { - _addr.setVpcId(vpcId); - } - @Override public String getIp6Gateway() { return _vlan.getIp6Gateway(); @@ -230,9 +219,4 @@ public class PublicIp implements PublicIpAddress { public String getVmIp() { return _addr.getVmIp(); } - - @Override - public void setVmIp(String vmIp) { - _addr.setVmIp(vmIp); - } } diff --git a/server/src/com/cloud/network/dao/IPAddressVO.java b/server/src/com/cloud/network/dao/IPAddressVO.java index 281f2118ff8..ae27e95ce4b 100644 --- a/server/src/com/cloud/network/dao/IPAddressVO.java +++ b/server/src/com/cloud/network/dao/IPAddressVO.java @@ -288,7 +288,6 @@ public class IPAddressVO implements IpAddress { return vpcId; } - @Override public void setVpcId(Long vpcId) { this.vpcId = vpcId; } @@ -298,7 +297,6 @@ public class IPAddressVO implements IpAddress { return vmIp; } - @Override public void setVmIp(String vmIp) { this.vmIp = vmIp; } diff --git a/server/src/com/cloud/network/dao/PhysicalNetworkVO.java b/server/src/com/cloud/network/dao/PhysicalNetworkVO.java index e5ffcfb7c0d..f68eee1de5c 100644 --- a/server/src/com/cloud/network/dao/PhysicalNetworkVO.java +++ b/server/src/com/cloud/network/dao/PhysicalNetworkVO.java @@ -34,11 +34,9 @@ import javax.persistence.Table; import javax.persistence.TableGenerator; import com.cloud.network.PhysicalNetwork; -import com.cloud.network.PhysicalNetwork.BroadcastDomainRange; -import com.cloud.network.PhysicalNetwork.State; import com.cloud.utils.NumbersUtil; +import com.cloud.utils.Pair; import com.cloud.utils.db.GenericDao; -import org.apache.cloudstack.api.InternalIdentity; /** * NetworkConfigurationVO contains information about a specific physical network. @@ -205,7 +203,21 @@ public class PhysicalNetworkVO implements PhysicalNetwork { } @Override - public String getVnet() { + public List> getVnet() { + List > vnetList = new ArrayList>(); + if (vnet != null) { + String [] Temp = vnet.split(";"); + String [] vnetSplit = null; + for (String vnetRange : Temp){ + vnetSplit = vnetRange.split("-"); + vnetList.add(new Pair(Integer.parseInt(vnetSplit[0]),Integer.parseInt(vnetSplit[1]))); + } + } + return vnetList; + } + + @Override + public String getVnetString() { return vnet; } diff --git a/server/src/com/cloud/network/guru/GuestNetworkGuru.java b/server/src/com/cloud/network/guru/GuestNetworkGuru.java index f1cacb5811b..b10cd5ed20a 100755 --- a/server/src/com/cloud/network/guru/GuestNetworkGuru.java +++ b/server/src/com/cloud/network/guru/GuestNetworkGuru.java @@ -26,6 +26,7 @@ import javax.ejb.Local; import javax.inject.Inject; import com.cloud.event.ActionEventUtils; +import com.cloud.utils.Pair; import org.apache.log4j.Logger; import com.cloud.configuration.Config; @@ -233,8 +234,17 @@ public abstract class GuestNetworkGuru extends AdapterBase implements NetworkGur if (pNetwork.getVnet() == null) { throw new CloudRuntimeException("Could not find vlan range for physical Network " + physicalNetworkId + "."); } - String vlanRange[] = pNetwork.getVnet().split("-"); - int lowestVlanTag = Integer.valueOf(vlanRange[0]); + Integer lowestVlanTag = null; + List> vnetList = pNetwork.getVnet(); + //finding the vlanrange in which the vlanTag lies. + for (Pair vnet : vnetList){ + if (vlanTag >= vnet.first() && vlanTag <= vnet.second()){ + lowestVlanTag = vnet.first(); + } + } + if (lowestVlanTag == null) { + throw new InvalidParameterValueException ("The vlan tag dose not belong to any of the existing vlan ranges"); + } return vlanTag - lowestVlanTag; } diff --git a/server/src/com/cloud/server/ConfigurationServerImpl.java b/server/src/com/cloud/server/ConfigurationServerImpl.java index d4a7417dd97..84073f2f9e6 100755 --- a/server/src/com/cloud/server/ConfigurationServerImpl.java +++ b/server/src/com/cloud/server/ConfigurationServerImpl.java @@ -333,7 +333,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio @DB protected void saveUser() { // insert system account - String insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id) VALUES (1, UUID(), 'system', '1', '1')"; + String insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id, account.default) VALUES (1, UUID(), 'system', '1', '1', 1)"; Transaction txn = Transaction.currentTxn(); try { PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql); @@ -341,8 +341,8 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio } catch (SQLException ex) { } // insert system user - insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id, firstname, lastname, created)" + - " VALUES (1, UUID(), 'system', RAND(), 1, 'system', 'cloud', now())"; + insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id, firstname, lastname, created, user.default)" + + " VALUES (1, UUID(), 'system', RAND(), 1, 'system', 'cloud', now(), 1)"; txn = Transaction.currentTxn(); try { PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql); @@ -358,7 +358,7 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio String lastname = "cloud"; // create an account for the admin user first - insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id) VALUES (" + id + ", UUID(), '" + username + "', '1', '1')"; + insertSql = "INSERT INTO `cloud`.`account` (id, uuid, account_name, type, domain_id, account.default) VALUES (" + id + ", UUID(), '" + username + "', '1', '1', 1)"; txn = Transaction.currentTxn(); try { PreparedStatement stmt = txn.prepareAutoCloseStatement(insertSql); @@ -367,8 +367,8 @@ public class ConfigurationServerImpl extends ManagerBase implements Configuratio } // now insert the user - insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id, firstname, lastname, created, state) " + - "VALUES (" + id + ", UUID(), '" + username + "', RAND(), 2, '" + firstname + "','" + lastname + "',now(), 'disabled')"; + insertSql = "INSERT INTO `cloud`.`user` (id, uuid, username, password, account_id, firstname, lastname, created, state, user.default) " + + "VALUES (" + id + ", UUID(), '" + username + "', RAND(), 2, '" + firstname + "','" + lastname + "',now(), 'disabled', 1)"; txn = Transaction.currentTxn(); try { diff --git a/server/src/com/cloud/server/ManagementServerImpl.java b/server/src/com/cloud/server/ManagementServerImpl.java index b37a3cfdcbb..81ad12f349c 100755 --- a/server/src/com/cloud/server/ManagementServerImpl.java +++ b/server/src/com/cloud/server/ManagementServerImpl.java @@ -699,14 +699,6 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe private List _userAuthenticators; private List _userPasswordEncoders; - protected List _planners; - public List getPlanners() { - return _planners; - } - public void setPlanners(List _planners) { - this._planners = _planners; - } - @Inject ClusterManager _clusterMgr; private String _hashKey = null; private String _encryptionKey = null; @@ -3698,15 +3690,4 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe } } - - @Override - public List listDeploymentPlanners() { - List plannersAvailable = new ArrayList(); - for (DeploymentPlanner planner : _planners) { - plannersAvailable.add(planner.getName()); - } - - return plannersAvailable; - } - } diff --git a/server/src/com/cloud/service/ServiceOfferingVO.java b/server/src/com/cloud/service/ServiceOfferingVO.java index a3da904688c..94a73515e6a 100755 --- a/server/src/com/cloud/service/ServiceOfferingVO.java +++ b/server/src/com/cloud/service/ServiceOfferingVO.java @@ -68,9 +68,6 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering @Column(name="sort_key") int sortKey; - @Column(name = "deployment_planner") - private String deploymentPlanner = "FirstFitPlanner"; - protected ServiceOfferingVO() { super(); } @@ -87,7 +84,6 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering this.volatileVm = false; this.default_use = defaultUse; this.vm_type = vm_type == null ? null : vm_type.toString().toLowerCase(); - this.deploymentPlanner = "FirstFitPlanner"; } public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitCpuUse, boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId) { @@ -101,26 +97,11 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering this.limitCpuUse = limitCpuUse; this.volatileVm = volatileVm; this.vm_type = vm_type == null ? null : vm_type.toString().toLowerCase(); - this.deploymentPlanner = "FirstFitPlanner"; } public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, boolean offerHA, boolean limitResourceUse, boolean volatileVm, String displayText, boolean useLocalStorage, boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId, String hostTag) { this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, limitResourceUse, volatileVm, displayText, useLocalStorage, recreatable, tags, systemUse, vm_type, domainId); this.hostTag = hostTag; - this.deploymentPlanner = "FirstFitPlanner"; - } - - public ServiceOfferingVO(String name, int cpu, int ramSize, int speed, Integer rateMbps, Integer multicastRateMbps, - boolean offerHA, boolean limitResourceUse, boolean volatileVm, String displayText, boolean useLocalStorage, - boolean recreatable, String tags, boolean systemUse, VirtualMachine.Type vm_type, Long domainId, - String hostTag, String deploymentPlanner) { - this(name, cpu, ramSize, speed, rateMbps, multicastRateMbps, offerHA, limitResourceUse, volatileVm, - displayText, useLocalStorage, recreatable, tags, systemUse, vm_type, domainId, hostTag); - if (deploymentPlanner != null) { - this.deploymentPlanner = deploymentPlanner; - } else { - this.deploymentPlanner = "FirstFitPlanner"; - } } @Override @@ -227,8 +208,4 @@ public class ServiceOfferingVO extends DiskOfferingVO implements ServiceOffering return volatileVm; } - public String getDeploymentPlanner() { - return deploymentPlanner; - } - } diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java index 4e410e4b41e..a182e39dd86 100755 --- a/server/src/com/cloud/storage/StorageManagerImpl.java +++ b/server/src/com/cloud/storage/StorageManagerImpl.java @@ -963,9 +963,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager, C DataStoreLifeCycle lifeCycle = storeProvider.getDataStoreLifeCycle(); DataStore store = dataStoreMgr.getDataStore( sPool.getId(), DataStoreRole.Primary); - lifeCycle.deleteDataStore(store); - - return false; + return lifeCycle.deleteDataStore(store); } @Override diff --git a/server/src/com/cloud/user/AccountManagerImpl.java b/server/src/com/cloud/user/AccountManagerImpl.java index e74c49124f7..8de73fbd582 100755 --- a/server/src/com/cloud/user/AccountManagerImpl.java +++ b/server/src/com/cloud/user/AccountManagerImpl.java @@ -37,7 +37,6 @@ import javax.ejb.Local; import javax.inject.Inject; import javax.naming.ConfigurationException; -import com.cloud.event.ActionEventUtils; import org.apache.cloudstack.acl.ControlledEntity; import org.apache.cloudstack.acl.RoleType; import org.apache.cloudstack.acl.SecurityChecker; @@ -53,7 +52,6 @@ import org.apache.log4j.Logger; import com.cloud.api.ApiDBUtils; import com.cloud.api.query.dao.UserAccountJoinDao; import com.cloud.api.query.vo.ControlledViewEntity; - import com.cloud.configuration.Config; import com.cloud.configuration.ConfigurationManager; import com.cloud.configuration.ResourceLimit; @@ -65,6 +63,7 @@ import com.cloud.domain.Domain; import com.cloud.domain.DomainVO; import com.cloud.domain.dao.DomainDao; import com.cloud.event.ActionEvent; +import com.cloud.event.ActionEventUtils; import com.cloud.event.EventTypes; import com.cloud.exception.AgentUnavailableException; import com.cloud.exception.CloudAuthenticationException; @@ -1178,8 +1177,9 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M checkAccess(caller, null, true, account); - if (account.getId() == Account.ACCOUNT_ID_SYSTEM) { - throw new PermissionDeniedException("Account id : " + accountId + " is a system account, delete is not allowed"); + //don't allow to delete default account (system and admin) + if (account.isDefault()) { + throw new InvalidParameterValueException("The account is default and can't be removed"); } // Account that manages project(s) can't be removed @@ -1384,9 +1384,10 @@ public class AccountManagerImpl extends ManagerBase implements AccountManager, M if (account.getType() == Account.ACCOUNT_TYPE_PROJECT) { throw new InvalidParameterValueException("The specified user doesn't exist in the system"); } - - if (account.getId() == Account.ACCOUNT_ID_SYSTEM) { - throw new InvalidParameterValueException("Account id : " + user.getAccountId() + " is a system account, delete for user associated with this account is not allowed"); + + //don't allow to delete default user (system and admin users) + if (user.isDefault()) { + throw new InvalidParameterValueException("The user is default and can't be removed"); } checkAccess(UserContext.current().getCaller(), null, true, account); diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 53a57c8e9cb..3ecdf426721 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -2264,9 +2264,14 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Use // check if account/domain is with in resource limits to create a new vm boolean isIso = Storage.ImageFormat.ISO == template.getFormat(); + long size = _templateHostDao.findByTemplateId(template.getId()).getSize(); + if (diskOfferingId != null) { + size += _diskOfferingDao.findById(diskOfferingId).getDiskSize(); + } resourceLimitCheck(owner, new Long(offering.getCpu()), new Long(offering.getRamSize())); _resourceLimitMgr.checkResourceLimit(owner, ResourceType.volume, (isIso || diskOfferingId == null ? 1 : 2)); + _resourceLimitMgr.checkResourceLimit(owner, ResourceType.primary_storage, new Long (size)); // verify security group ids if (securityGroupIdList != null) { diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java index 40725314f46..a53e38072ff 100755 --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -866,6 +866,11 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac } } + if (startedVm == null) { + throw new CloudRuntimeException("Unable to start instance '" + vm.getHostName() + + "' (" + vm.getUuid() + "), see management server log for details"); + } + return startedVm; } diff --git a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java index 2b490efe6e5..fc2cfcf8d95 100644 --- a/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java +++ b/server/src/org/apache/cloudstack/affinity/AffinityGroupServiceImpl.java @@ -295,7 +295,7 @@ public class AffinityGroupServiceImpl extends ManagerBase implements AffinityGro if (!status) { return false; } - if ((newState == State.Expunging)) { + if ((newState == State.Expunging) || (newState == State.Error)) { // cleanup all affinity groups associations of the Expunged VM SearchCriteria sc = _affinityGroupVMMapDao.createSearchCriteria(); sc.addAnd("instanceId", SearchCriteria.Op.EQ, vo.getId()); diff --git a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java index 696e6e9aa48..1ed2618f6cb 100644 --- a/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java +++ b/server/src/org/apache/cloudstack/region/gslb/GlobalLoadBalancingRulesServiceImpl.java @@ -392,6 +392,7 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR //mark all the GSLB-LB mapping to be in revoke state for (GlobalLoadBalancerLbRuleMapVO gslbLbMap : gslbLbMapVos) { gslbLbMap.setRevoke(true); + _gslbLbMapDao.update(gslbLbMap.getId(), gslbLbMap); } } @@ -411,6 +412,16 @@ public class GlobalLoadBalancingRulesServiceImpl implements GlobalLoadBalancingR throw new CloudRuntimeException("Failed to update the gloabal load balancer"); } + txn.start(); + //remove all mappings between GSLB rule and load balancer rules + if (gslbLbMapVos != null) { + for (GlobalLoadBalancerLbRuleMapVO gslbLbMap : gslbLbMapVos) { + _gslbLbMapDao.remove(gslbLbMap.getId()); + } + } + //remove the GSLB rule itself + _gslbRuleDao.remove(gslbRuleId); + txn.commit(); return success; } diff --git a/server/test/com/cloud/configuration/ConfigurationManagerTest.java b/server/test/com/cloud/configuration/ConfigurationManagerTest.java index ee98d53c922..5c1cabfe774 100755 --- a/server/test/com/cloud/configuration/ConfigurationManagerTest.java +++ b/server/test/com/cloud/configuration/ConfigurationManagerTest.java @@ -224,7 +224,7 @@ public class ConfigurationManagerTest { try { configurationMgr.dedicatePublicIpRange(dedicatePublicIpRangesCmd); } catch (Exception e) { - Assert.assertTrue(e.getMessage().contains("Please specify a valid Public IP range id")); + Assert.assertTrue(e.getMessage().contains("Unable to find vlan by id")); } finally { txn.close("runDedicatePublicIpRangeInvalidRange"); } @@ -306,7 +306,7 @@ public class ConfigurationManagerTest { try { configurationMgr.dedicatePublicIpRange(dedicatePublicIpRangesCmd); } catch (Exception e) { - Assert.assertTrue(e.getMessage().contains("Public IP address in range is already allocated to another account")); + Assert.assertTrue(e.getMessage().contains("Public IP address in range is allocated to another account")); } finally { txn.close("runDedicatePublicIpRangeIPAdressAllocated"); } diff --git a/server/test/com/cloud/network/MockNetworkManagerImpl.java b/server/test/com/cloud/network/MockNetworkManagerImpl.java index f6cf2cefc1f..0342a54aecb 100755 --- a/server/test/com/cloud/network/MockNetworkManagerImpl.java +++ b/server/test/com/cloud/network/MockNetworkManagerImpl.java @@ -328,7 +328,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage } @Override - public PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags, String newVnetRangeString, String state) { + public PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags, String newVnetRangeString, String state, String removeVlan) { // TODO Auto-generated method stub return null; } diff --git a/server/test/com/cloud/network/UpdatePhysicalNetworkTest.java b/server/test/com/cloud/network/UpdatePhysicalNetworkTest.java new file mode 100644 index 00000000000..ca9d149214f --- /dev/null +++ b/server/test/com/cloud/network/UpdatePhysicalNetworkTest.java @@ -0,0 +1,68 @@ +// 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; +import com.cloud.capacity.CapacityManagerImpl; +import com.cloud.dc.DataCenterVO; +import com.cloud.dc.dao.DataCenterDao; +import com.cloud.network.NetworkServiceImpl; +import com.cloud.network.dao.PhysicalNetworkDao; +import com.cloud.network.dao.PhysicalNetworkVO; +import com.cloud.utils.Pair; +import org.junit.Test; +import org.junit.*; +import org.mockito.ArgumentCaptor; +import org.mockito.MockitoAnnotations.*; + +import java.util.ArrayList; +import java.util.List; + +import static org.junit.Assert.assertEquals; +import static org.mockito.Matchers.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + + +public class UpdatePhysicalNetworkTest { + private PhysicalNetworkDao _physicalNetworkDao = mock(PhysicalNetworkDao.class); + private DataCenterDao _datacenterDao = mock(DataCenterDao.class); + private DataCenterVO datacentervo = mock(DataCenterVO.class); + private PhysicalNetworkVO physicalNetworkVO = mock(PhysicalNetworkVO.class); + List> existingRange = new ArrayList>(); + ArgumentCaptor argumentCaptor = ArgumentCaptor.forClass(String.class); + + public NetworkServiceImpl setUp() { + NetworkServiceImpl networkService = new NetworkServiceImpl(); + ((NetworkServiceImpl)networkService)._dcDao= _datacenterDao; + networkService._physicalNetworkDao = _physicalNetworkDao; + return networkService; + } + + @Test + public void updatePhysicalNetworkTest(){ + NetworkServiceImpl networkService = setUp(); + existingRange.add(new Pair(520, 524)); + when(_physicalNetworkDao.findById(anyLong())).thenReturn(physicalNetworkVO); + when(_datacenterDao.findById(anyLong())).thenReturn(datacentervo); + when(_physicalNetworkDao.update(anyLong(), any(physicalNetworkVO.getClass()))).thenReturn(true); + when(physicalNetworkVO.getVnet()).thenReturn(existingRange); + networkService.updatePhysicalNetwork(1l, null, null, "525-530", null, null); + verify(physicalNetworkVO).setVnet(argumentCaptor.capture()); + assertEquals("520-530", argumentCaptor.getValue()); + } + +} diff --git a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java index 48b19b906cc..ed3ccd20693 100755 --- a/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java +++ b/server/test/com/cloud/vpc/MockConfigurationManagerImpl.java @@ -435,7 +435,7 @@ public class MockConfigurationManagerImpl extends ManagerBase implements Configu */ @Override public ServiceOfferingVO createServiceOffering(long userId, boolean isSystem, Type vm_typeType, String name, int cpu, int ramSize, int speed, String displayText, boolean localStorageRequired, boolean offerHA, - boolean limitResourceUse, boolean volatileVm, String tags, Long domainId, String hostTag, Integer networkRate, String deploymentPlanner) { + boolean limitResourceUse, boolean volatileVm, String tags, Long domainId, String hostTag, Integer networkRate) { // TODO Auto-generated method stub return null; } diff --git a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java index 851165aba32..8f832f7095a 100644 --- a/server/test/com/cloud/vpc/MockNetworkManagerImpl.java +++ b/server/test/com/cloud/vpc/MockNetworkManagerImpl.java @@ -343,7 +343,7 @@ public class MockNetworkManagerImpl extends ManagerBase implements NetworkManage */ @Override public PhysicalNetwork updatePhysicalNetwork(Long id, String networkSpeed, List tags, - String newVnetRangeString, String state) { + String newVnetRangeString, String state, String removeVlan) { // TODO Auto-generated method stub return null; } diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql index 1d8a6f1e95b..52acd3c20eb 100644 --- a/setup/db/db/schema-410to420.sql +++ b/setup/db/db/schema-410to420.sql @@ -167,7 +167,6 @@ CREATE TABLE `cloud`.`affinity_group_vm_map` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -ALTER TABLE `cloud`.`service_offering` ADD COLUMN `deployment_planner` varchar(255) NOT NULL DEFAULT 'FirstFitPlanner' COMMENT 'Planner heuristics used to deploy a VM of this offering'; CREATE TABLE nic_secondary_ips ( `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT, @@ -280,6 +279,356 @@ INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Project Defaults', 'DEFAULT' INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Project Defaults', 'DEFAULT', 'management-server', 'max.project.primary.storage', '200', 'The default maximum primary storage space (in GiB) that can be used for a project'); INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Project Defaults', 'DEFAULT', 'management-server', 'max.project.secondary.storage', '400', 'The default maximum secondary storage space (in GiB) that can be used for a project'); + + +ALTER TABLE `cloud`.`remote_access_vpn` ADD COLUMN `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id'; +ALTER TABLE `cloud`.`remote_access_vpn` ADD COLUMN `uuid` varchar(40) UNIQUE; + +-- START: support for LXC + +INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('LXC', 'default', 50, 1); +ALTER TABLE `cloud`.`physical_network_traffic_types` ADD COLUMN `lxc_network_label` varchar(255) DEFAULT 'cloudbr0' COMMENT 'The network name label of the physical device dedicated to this traffic on a LXC host'; + +UPDATE configuration SET value='KVM,XenServer,VMware,BareMetal,Ovm,LXC' WHERE name='hypervisor.list'; + +INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) + VALUES (10, 'routing-10', 'SystemVM Template (LXC)', 0, now(), 'SYSTEM', 0, 64, 1, 'http://download.cloud.com/templates/acton/acton-systemvm-02062012.qcow2.bz2', '2755de1f9ef2ce4d6f2bee2efbb4da92', 0, 'SystemVM Template (LXC)', 'QCOW2', 15, 0, 1, 'LXC'); + +-- END: support for LXC + +CREATE TABLE `cloud`.`vm_snapshots` ( + `id` bigint(20) unsigned NOT NULL auto_increment COMMENT 'Primary Key', + `uuid` varchar(40) NOT NULL, + `name` varchar(255) NOT NULL, + `display_name` varchar(255) default NULL, + `description` varchar(255) default NULL, + `vm_id` bigint(20) unsigned NOT NULL, + `account_id` bigint(20) unsigned NOT NULL, + `domain_id` bigint(20) unsigned NOT NULL, + `vm_snapshot_type` varchar(32) default NULL, + `state` varchar(32) NOT NULL, + `parent` bigint unsigned default NULL, + `current` int(1) unsigned default NULL, + `update_count` bigint unsigned NOT NULL DEFAULT 0, + `updated` datetime default NULL, + `created` datetime default NULL, + `removed` datetime default NULL, + PRIMARY KEY (`id`), + CONSTRAINT UNIQUE KEY `uc_vm_snapshots_uuid` (`uuid`), + INDEX `vm_snapshots_name` (`name`), + INDEX `vm_snapshots_vm_id` (`vm_id`), + INDEX `vm_snapshots_account_id` (`account_id`), + INDEX `vm_snapshots_display_name` (`display_name`), + INDEX `vm_snapshots_removed` (`removed`), + INDEX `vm_snapshots_parent` (`parent`), + CONSTRAINT `fk_vm_snapshots_vm_id__vm_instance_id` FOREIGN KEY `fk_vm_snapshots_vm_id__vm_instance_id` (`vm_id`) REFERENCES `vm_instance` (`id`), + CONSTRAINT `fk_vm_snapshots_account_id__account_id` FOREIGN KEY `fk_vm_snapshots_account_id__account_id` (`account_id`) REFERENCES `account` (`id`), + CONSTRAINT `fk_vm_snapshots_domain_id__domain_id` FOREIGN KEY `fk_vm_snapshots_domain_id__domain_id` (`domain_id`) REFERENCES `domain` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN `vm_snapshot_enabled` tinyint(1) DEFAULT 0 NOT NULL COMMENT 'Whether VM snapshot is supported by hypervisor'; +UPDATE `cloud`.`hypervisor_capabilities` SET `vm_snapshot_enabled`=1 WHERE `hypervisor_type` in ('VMware', 'XenServer'); + + +DROP VIEW IF EXISTS `cloud`.`user_vm_view`; +CREATE VIEW `cloud`.`user_vm_view` AS + select + vm_instance.id id, + vm_instance.name name, + user_vm.display_name display_name, + user_vm.user_data user_data, + account.id account_id, + account.uuid account_uuid, + account.account_name account_name, + account.type account_type, + domain.id domain_id, + domain.uuid domain_uuid, + domain.name domain_name, + domain.path domain_path, + projects.id project_id, + projects.uuid project_uuid, + projects.name project_name, + instance_group.id instance_group_id, + instance_group.uuid instance_group_uuid, + instance_group.name instance_group_name, + vm_instance.uuid uuid, + vm_instance.last_host_id last_host_id, + vm_instance.vm_type type, + vm_instance.vnc_password vnc_password, + vm_instance.limit_cpu_use limit_cpu_use, + vm_instance.created created, + vm_instance.state state, + vm_instance.removed removed, + vm_instance.ha_enabled ha_enabled, + vm_instance.hypervisor_type hypervisor_type, + vm_instance.instance_name instance_name, + vm_instance.guest_os_id guest_os_id, + guest_os.uuid guest_os_uuid, + vm_instance.pod_id pod_id, + host_pod_ref.uuid pod_uuid, + vm_instance.private_ip_address private_ip_address, + vm_instance.private_mac_address private_mac_address, + vm_instance.vm_type vm_type, + data_center.id data_center_id, + data_center.uuid data_center_uuid, + data_center.name data_center_name, + data_center.is_security_group_enabled security_group_enabled, + host.id host_id, + host.uuid host_uuid, + host.name host_name, + vm_template.id template_id, + vm_template.uuid template_uuid, + vm_template.name template_name, + vm_template.display_text template_display_text, + vm_template.enable_password password_enabled, + iso.id iso_id, + iso.uuid iso_uuid, + iso.name iso_name, + iso.display_text iso_display_text, + service_offering.id service_offering_id, + disk_offering.uuid service_offering_uuid, + service_offering.cpu cpu, + service_offering.speed speed, + service_offering.ram_size ram_size, + disk_offering.name service_offering_name, + storage_pool.id pool_id, + storage_pool.uuid pool_uuid, + storage_pool.pool_type pool_type, + volumes.id volume_id, + volumes.uuid volume_uuid, + volumes.device_id volume_device_id, + volumes.volume_type volume_type, + security_group.id security_group_id, + security_group.uuid security_group_uuid, + security_group.name security_group_name, + security_group.description security_group_description, + nics.id nic_id, + nics.uuid nic_uuid, + nics.network_id network_id, + nics.ip4_address ip_address, + nics.ip6_address ip6_address, + nics.ip6_gateway ip6_gateway, + nics.ip6_cidr ip6_cidr, + nics.default_nic is_default_nic, + nics.gateway gateway, + nics.netmask netmask, + nics.mac_address mac_address, + nics.broadcast_uri broadcast_uri, + nics.isolation_uri isolation_uri, + vpc.id vpc_id, + vpc.uuid vpc_uuid, + networks.uuid network_uuid, + networks.name network_name, + networks.traffic_type traffic_type, + networks.guest_type guest_type, + user_ip_address.id public_ip_id, + user_ip_address.uuid public_ip_uuid, + user_ip_address.public_ip_address public_ip_address, + ssh_keypairs.keypair_name keypair_name, + resource_tags.id tag_id, + resource_tags.uuid tag_uuid, + resource_tags.key tag_key, + resource_tags.value tag_value, + resource_tags.domain_id tag_domain_id, + resource_tags.account_id tag_account_id, + resource_tags.resource_id tag_resource_id, + resource_tags.resource_uuid tag_resource_uuid, + resource_tags.resource_type tag_resource_type, + resource_tags.customer tag_customer, + async_job.id job_id, + async_job.uuid job_uuid, + async_job.job_status job_status, + async_job.account_id job_account_id, + affinity_group.id affinity_group_id, + affinity_group.uuid affinity_group_uuid, + affinity_group.name affinity_group_name, + affinity_group.description affinity_group_description + from + `cloud`.`user_vm` + inner join + `cloud`.`vm_instance` ON vm_instance.id = user_vm.id + and vm_instance.removed is NULL + inner join + `cloud`.`account` ON vm_instance.account_id = account.id + inner join + `cloud`.`domain` ON vm_instance.domain_id = domain.id + left join + `cloud`.`guest_os` ON vm_instance.guest_os_id = guest_os.id + left join + `cloud`.`host_pod_ref` ON vm_instance.pod_id = host_pod_ref.id + left join + `cloud`.`projects` ON projects.project_account_id = account.id + left join + `cloud`.`instance_group_vm_map` ON vm_instance.id = instance_group_vm_map.instance_id + left join + `cloud`.`instance_group` ON instance_group_vm_map.group_id = instance_group.id + left join + `cloud`.`data_center` ON vm_instance.data_center_id = data_center.id + left join + `cloud`.`host` ON vm_instance.host_id = host.id + left join + `cloud`.`vm_template` ON vm_instance.vm_template_id = vm_template.id + left join + `cloud`.`vm_template` iso ON iso.id = user_vm.iso_id + left join + `cloud`.`service_offering` ON vm_instance.service_offering_id = service_offering.id + left join + `cloud`.`disk_offering` ON vm_instance.service_offering_id = disk_offering.id + left join + `cloud`.`volumes` ON vm_instance.id = volumes.instance_id + left join + `cloud`.`storage_pool` ON volumes.pool_id = storage_pool.id + left join + `cloud`.`security_group_vm_map` ON vm_instance.id = security_group_vm_map.instance_id + left join + `cloud`.`security_group` ON security_group_vm_map.security_group_id = security_group.id + left join + `cloud`.`nics` ON vm_instance.id = nics.instance_id + left join + `cloud`.`networks` ON nics.network_id = networks.id + left join + `cloud`.`vpc` ON networks.vpc_id = vpc.id + left join + `cloud`.`user_ip_address` ON user_ip_address.vm_id = vm_instance.id + left join + `cloud`.`user_vm_details` ON user_vm_details.vm_id = vm_instance.id + and user_vm_details.name = 'SSH.PublicKey' + left join + `cloud`.`ssh_keypairs` ON ssh_keypairs.public_key = user_vm_details.value + left join + `cloud`.`resource_tags` ON resource_tags.resource_id = vm_instance.id + and resource_tags.resource_type = 'UserVm' + left join + `cloud`.`async_job` ON async_job.instance_id = vm_instance.id + and async_job.instance_type = 'VirtualMachine' + and async_job.job_status = 0 + left join + `cloud`.`affinity_group_vm_map` ON vm_instance.id = affinity_group_vm_map.instance_id + left join + `cloud`.`affinity_group` ON affinity_group_vm_map.affinity_group_id = affinity_group.id; + +DROP VIEW IF EXISTS `cloud`.`affinity_group_view`; +CREATE VIEW `cloud`.`affinity_group_view` AS + select + affinity_group.id id, + affinity_group.name name, + affinity_group.description description, + affinity_group.uuid uuid, + account.id account_id, + account.uuid account_uuid, + account.account_name account_name, + account.type account_type, + domain.id domain_id, + domain.uuid domain_uuid, + domain.name domain_name, + domain.path domain_path, + vm_instance.id vm_id, + vm_instance.uuid vm_uuid, + vm_instance.name vm_name, + vm_instance.state vm_state, + user_vm.display_name vm_display_name + from + `cloud`.`affinity_group` + inner join + `cloud`.`account` ON affinity_group.account_id = account.id + inner join + `cloud`.`domain` ON affinity_group.domain_id = domain.id + left join + `cloud`.`affinity_group_vm_map` ON affinity_group.id = affinity_group_vm_map.affinity_group_id + left join + `cloud`.`vm_instance` ON vm_instance.id = affinity_group_vm_map.instance_id + left join + `cloud`.`user_vm` ON user_vm.id = vm_instance.id; + +CREATE TABLE `cloud`.`external_cisco_vnmc_devices` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `uuid` varchar(255) UNIQUE, + `physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network in to which cisco vnmc device is added', + `provider_name` varchar(255) NOT NULL COMMENT 'Service Provider name corresponding to this cisco vnmc device', + `device_name` varchar(255) NOT NULL COMMENT 'name of the cisco vnmc device', + `host_id` bigint unsigned NOT NULL COMMENT 'host id coresponding to the external cisco vnmc device', + PRIMARY KEY (`id`), + CONSTRAINT `fk_external_cisco_vnmc_devices__host_id` FOREIGN KEY (`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_external_cisco_vnmc_devices__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`external_cisco_asa1000v_devices` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `uuid` varchar(255) UNIQUE, + `physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network in to which cisco asa1kv device is added', + `management_ip` varchar(255) UNIQUE NOT NULL COMMENT 'mgmt. ip of cisco asa1kv device', + `in_port_profile` varchar(255) NOT NULL COMMENT 'inside port profile name of cisco asa1kv device', + `cluster_id` bigint unsigned NOT NULL COMMENT 'id of the Vmware cluster to which cisco asa1kv device is attached (cisco n1kv switch)', + PRIMARY KEY (`id`), + CONSTRAINT `fk_external_cisco_asa1000v_devices__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_external_cisco_asa1000v_devices__cluster_id` FOREIGN KEY (`cluster_id`) REFERENCES `cluster`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +CREATE TABLE `cloud`.`network_asa1000v_map` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', + `network_id` bigint unsigned NOT NULL UNIQUE COMMENT 'id of guest network', + `asa1000v_id` bigint unsigned NOT NULL UNIQUE COMMENT 'id of asa1000v device', + PRIMARY KEY (`id`), + CONSTRAINT `fk_network_asa1000v_map__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`) ON DELETE CASCADE, + CONSTRAINT `fk_network_asa1000v_map__asa1000v_id` FOREIGN KEY (`asa1000v_id`) REFERENCES `external_cisco_asa1000v_devices`(`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +ALTER TABLE `cloud`.`network_offerings` ADD COLUMN `eip_associate_public_ip` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if public IP is associated with user VM creation by default when EIP service is enabled.' AFTER `elastic_ip_service`; + +-- Re-enable foreign key checking, at the end of the upgrade path +SET foreign_key_checks = 1; + + +-- Add "default" field to account/user tables +ALTER TABLE `cloud`.`account` ADD COLUMN `default` int(1) unsigned NOT NULL DEFAULT '0' COMMENT '1 if account is default'; +ALTER TABLE `cloud`.`user` ADD COLUMN `default` int(1) unsigned NOT NULL DEFAULT '0' COMMENT '1 if user is default'; +UPDATE `cloud`.`account` SET `cloud`.`account`.`default`=1 WHERE id IN (1,2); +UPDATE `cloud`.`user` SET `cloud`.`user`.`default`=1 WHERE id IN (1,2); + +ALTER VIEW `cloud`.`user_view` AS + select + user.id, + user.uuid, + user.username, + user.password, + user.firstname, + user.lastname, + user.email, + user.state, + user.api_key, + user.secret_key, + user.created, + user.removed, + user.timezone, + user.registration_token, + user.is_registered, + user.incorrect_login_attempts, + user.default, + account.id account_id, + account.uuid account_uuid, + account.account_name account_name, + account.type account_type, + domain.id domain_id, + domain.uuid domain_uuid, + domain.name domain_name, + domain.path domain_path, + async_job.id job_id, + async_job.uuid job_uuid, + async_job.job_status job_status, + async_job.account_id job_account_id + from + `cloud`.`user` + inner join + `cloud`.`account` ON user.account_id = account.id + inner join + `cloud`.`domain` ON account.domain_id = domain.id + left join + `cloud`.`async_job` ON async_job.instance_id = user.id + and async_job.instance_type = 'User' + and async_job.job_status = 0; + + DROP VIEW IF EXISTS `cloud`.`account_view`; CREATE VIEW `cloud`.`account_view` AS select @@ -291,6 +640,7 @@ CREATE VIEW `cloud`.`account_view` AS account.removed, account.cleanup_needed, account.network_domain, + account.default, domain.id domain_id, domain.uuid domain_uuid, domain.name domain_name, @@ -423,53 +773,6 @@ CREATE VIEW `cloud`.`account_view` AS and async_job.instance_type = 'Account' and async_job.job_status = 0; -ALTER TABLE `cloud`.`remote_access_vpn` ADD COLUMN `id` bigint unsigned NOT NULL UNIQUE AUTO_INCREMENT COMMENT 'id'; -ALTER TABLE `cloud`.`remote_access_vpn` ADD COLUMN `uuid` varchar(40) UNIQUE; - --- START: support for LXC - -INSERT IGNORE INTO `cloud`.`hypervisor_capabilities`(hypervisor_type, hypervisor_version, max_guests_limit, security_group_enabled) VALUES ('LXC', 'default', 50, 1); -ALTER TABLE `cloud`.`physical_network_traffic_types` ADD COLUMN `lxc_network_label` varchar(255) DEFAULT 'cloudbr0' COMMENT 'The network name label of the physical device dedicated to this traffic on a LXC host'; - -UPDATE configuration SET value='KVM,XenServer,VMware,BareMetal,Ovm,LXC' WHERE name='hypervisor.list'; - -INSERT INTO `cloud`.`vm_template` (id, unique_name, name, public, created, type, hvm, bits, account_id, url, checksum, enable_password, display_text, format, guest_os_id, featured, cross_zones, hypervisor_type) - VALUES (10, 'routing-10', 'SystemVM Template (LXC)', 0, now(), 'SYSTEM', 0, 64, 1, 'http://download.cloud.com/templates/acton/acton-systemvm-02062012.qcow2.bz2', '2755de1f9ef2ce4d6f2bee2efbb4da92', 0, 'SystemVM Template (LXC)', 'QCOW2', 15, 0, 1, 'LXC'); - --- END: support for LXC - -CREATE TABLE `cloud`.`vm_snapshots` ( - `id` bigint(20) unsigned NOT NULL auto_increment COMMENT 'Primary Key', - `uuid` varchar(40) NOT NULL, - `name` varchar(255) NOT NULL, - `display_name` varchar(255) default NULL, - `description` varchar(255) default NULL, - `vm_id` bigint(20) unsigned NOT NULL, - `account_id` bigint(20) unsigned NOT NULL, - `domain_id` bigint(20) unsigned NOT NULL, - `vm_snapshot_type` varchar(32) default NULL, - `state` varchar(32) NOT NULL, - `parent` bigint unsigned default NULL, - `current` int(1) unsigned default NULL, - `update_count` bigint unsigned NOT NULL DEFAULT 0, - `updated` datetime default NULL, - `created` datetime default NULL, - `removed` datetime default NULL, - PRIMARY KEY (`id`), - CONSTRAINT UNIQUE KEY `uc_vm_snapshots_uuid` (`uuid`), - INDEX `vm_snapshots_name` (`name`), - INDEX `vm_snapshots_vm_id` (`vm_id`), - INDEX `vm_snapshots_account_id` (`account_id`), - INDEX `vm_snapshots_display_name` (`display_name`), - INDEX `vm_snapshots_removed` (`removed`), - INDEX `vm_snapshots_parent` (`parent`), - CONSTRAINT `fk_vm_snapshots_vm_id__vm_instance_id` FOREIGN KEY `fk_vm_snapshots_vm_id__vm_instance_id` (`vm_id`) REFERENCES `vm_instance` (`id`), - CONSTRAINT `fk_vm_snapshots_account_id__account_id` FOREIGN KEY `fk_vm_snapshots_account_id__account_id` (`account_id`) REFERENCES `account` (`id`), - CONSTRAINT `fk_vm_snapshots_domain_id__domain_id` FOREIGN KEY `fk_vm_snapshots_domain_id__domain_id` (`domain_id`) REFERENCES `domain` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -ALTER TABLE `cloud`.`hypervisor_capabilities` ADD COLUMN `vm_snapshot_enabled` tinyint(1) DEFAULT 0 NOT NULL COMMENT 'Whether VM snapshot is supported by hypervisor'; -UPDATE `cloud`.`hypervisor_capabilities` SET `vm_snapshot_enabled`=1 WHERE `hypervisor_type` in ('VMware', 'XenServer'); ALTER TABLE `cloud`.`load_balancing_rules` ADD COLUMN `source_ip_address` varchar(40) COMMENT 'source ip address for the load balancer rule'; @@ -478,257 +781,6 @@ ALTER TABLE `cloud`.`load_balancing_rules` ADD COLUMN `scheme` varchar(40) NOT N UPDATE `cloud`.`load_balancing_rules` SET `scheme`='Public'; - -DROP VIEW IF EXISTS `cloud`.`user_vm_view`; -CREATE VIEW `cloud`.`user_vm_view` AS - select - vm_instance.id id, - vm_instance.name name, - user_vm.display_name display_name, - user_vm.user_data user_data, - account.id account_id, - account.uuid account_uuid, - account.account_name account_name, - account.type account_type, - domain.id domain_id, - domain.uuid domain_uuid, - domain.name domain_name, - domain.path domain_path, - projects.id project_id, - projects.uuid project_uuid, - projects.name project_name, - instance_group.id instance_group_id, - instance_group.uuid instance_group_uuid, - instance_group.name instance_group_name, - vm_instance.uuid uuid, - vm_instance.last_host_id last_host_id, - vm_instance.vm_type type, - vm_instance.vnc_password vnc_password, - vm_instance.limit_cpu_use limit_cpu_use, - vm_instance.created created, - vm_instance.state state, - vm_instance.removed removed, - vm_instance.ha_enabled ha_enabled, - vm_instance.hypervisor_type hypervisor_type, - vm_instance.instance_name instance_name, - vm_instance.guest_os_id guest_os_id, - guest_os.uuid guest_os_uuid, - vm_instance.pod_id pod_id, - host_pod_ref.uuid pod_uuid, - vm_instance.private_ip_address private_ip_address, - vm_instance.private_mac_address private_mac_address, - vm_instance.vm_type vm_type, - data_center.id data_center_id, - data_center.uuid data_center_uuid, - data_center.name data_center_name, - data_center.is_security_group_enabled security_group_enabled, - host.id host_id, - host.uuid host_uuid, - host.name host_name, - vm_template.id template_id, - vm_template.uuid template_uuid, - vm_template.name template_name, - vm_template.display_text template_display_text, - vm_template.enable_password password_enabled, - iso.id iso_id, - iso.uuid iso_uuid, - iso.name iso_name, - iso.display_text iso_display_text, - service_offering.id service_offering_id, - disk_offering.uuid service_offering_uuid, - service_offering.cpu cpu, - service_offering.speed speed, - service_offering.ram_size ram_size, - disk_offering.name service_offering_name, - storage_pool.id pool_id, - storage_pool.uuid pool_uuid, - storage_pool.pool_type pool_type, - volumes.id volume_id, - volumes.uuid volume_uuid, - volumes.device_id volume_device_id, - volumes.volume_type volume_type, - security_group.id security_group_id, - security_group.uuid security_group_uuid, - security_group.name security_group_name, - security_group.description security_group_description, - nics.id nic_id, - nics.uuid nic_uuid, - nics.network_id network_id, - nics.ip4_address ip_address, - nics.ip6_address ip6_address, - nics.ip6_gateway ip6_gateway, - nics.ip6_cidr ip6_cidr, - nics.default_nic is_default_nic, - nics.gateway gateway, - nics.netmask netmask, - nics.mac_address mac_address, - nics.broadcast_uri broadcast_uri, - nics.isolation_uri isolation_uri, - vpc.id vpc_id, - vpc.uuid vpc_uuid, - networks.uuid network_uuid, - networks.name network_name, - networks.traffic_type traffic_type, - networks.guest_type guest_type, - user_ip_address.id public_ip_id, - user_ip_address.uuid public_ip_uuid, - user_ip_address.public_ip_address public_ip_address, - ssh_keypairs.keypair_name keypair_name, - resource_tags.id tag_id, - resource_tags.uuid tag_uuid, - resource_tags.key tag_key, - resource_tags.value tag_value, - resource_tags.domain_id tag_domain_id, - resource_tags.account_id tag_account_id, - resource_tags.resource_id tag_resource_id, - resource_tags.resource_uuid tag_resource_uuid, - resource_tags.resource_type tag_resource_type, - resource_tags.customer tag_customer, - async_job.id job_id, - async_job.uuid job_uuid, - async_job.job_status job_status, - async_job.account_id job_account_id, - affinity_group.id affinity_group_id, - affinity_group.uuid affinity_group_uuid, - affinity_group.name affinity_group_name, - affinity_group.description affinity_group_description - from - `cloud`.`user_vm` - inner join - `cloud`.`vm_instance` ON vm_instance.id = user_vm.id - and vm_instance.removed is NULL - inner join - `cloud`.`account` ON vm_instance.account_id = account.id - inner join - `cloud`.`domain` ON vm_instance.domain_id = domain.id - left join - `cloud`.`guest_os` ON vm_instance.guest_os_id = guest_os.id - left join - `cloud`.`host_pod_ref` ON vm_instance.pod_id = host_pod_ref.id - left join - `cloud`.`projects` ON projects.project_account_id = account.id - left join - `cloud`.`instance_group_vm_map` ON vm_instance.id = instance_group_vm_map.instance_id - left join - `cloud`.`instance_group` ON instance_group_vm_map.group_id = instance_group.id - left join - `cloud`.`data_center` ON vm_instance.data_center_id = data_center.id - left join - `cloud`.`host` ON vm_instance.host_id = host.id - left join - `cloud`.`vm_template` ON vm_instance.vm_template_id = vm_template.id - left join - `cloud`.`vm_template` iso ON iso.id = user_vm.iso_id - left join - `cloud`.`service_offering` ON vm_instance.service_offering_id = service_offering.id - left join - `cloud`.`disk_offering` ON vm_instance.service_offering_id = disk_offering.id - left join - `cloud`.`volumes` ON vm_instance.id = volumes.instance_id - left join - `cloud`.`storage_pool` ON volumes.pool_id = storage_pool.id - left join - `cloud`.`security_group_vm_map` ON vm_instance.id = security_group_vm_map.instance_id - left join - `cloud`.`security_group` ON security_group_vm_map.security_group_id = security_group.id - left join - `cloud`.`nics` ON vm_instance.id = nics.instance_id - left join - `cloud`.`networks` ON nics.network_id = networks.id - left join - `cloud`.`vpc` ON networks.vpc_id = vpc.id - left join - `cloud`.`user_ip_address` ON user_ip_address.vm_id = vm_instance.id - left join - `cloud`.`user_vm_details` ON user_vm_details.vm_id = vm_instance.id - and user_vm_details.name = 'SSH.PublicKey' - left join - `cloud`.`ssh_keypairs` ON ssh_keypairs.public_key = user_vm_details.value - left join - `cloud`.`resource_tags` ON resource_tags.resource_id = vm_instance.id - and resource_tags.resource_type = 'UserVm' - left join - `cloud`.`async_job` ON async_job.instance_id = vm_instance.id - and async_job.instance_type = 'VirtualMachine' - and async_job.job_status = 0 - left join - `cloud`.`affinity_group_vm_map` ON vm_instance.id = affinity_group_vm_map.instance_id - left join - `cloud`.`affinity_group` ON affinity_group_vm_map.affinity_group_id = affinity_group.id; - -DROP VIEW IF EXISTS `cloud`.`affinity_group_view`; -CREATE VIEW `cloud`.`affinity_group_view` AS - select - affinity_group.id id, - affinity_group.name name, - affinity_group.description description, - affinity_group.uuid uuid, - account.id account_id, - account.uuid account_uuid, - account.account_name account_name, - account.type account_type, - domain.id domain_id, - domain.uuid domain_uuid, - domain.name domain_name, - domain.path domain_path, - vm_instance.id vm_id, - vm_instance.uuid vm_uuid, - vm_instance.name vm_name, - vm_instance.state vm_state, - user_vm.display_name vm_display_name - from - `cloud`.`affinity_group` - inner join - `cloud`.`account` ON affinity_group.account_id = account.id - inner join - `cloud`.`domain` ON affinity_group.domain_id = domain.id - left join - `cloud`.`affinity_group_vm_map` ON affinity_group.id = affinity_group_vm_map.affinity_group_id - left join - `cloud`.`vm_instance` ON vm_instance.id = affinity_group_vm_map.instance_id - left join - `cloud`.`user_vm` ON user_vm.id = vm_instance.id; - -CREATE TABLE `cloud`.`external_cisco_vnmc_devices` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `uuid` varchar(255) UNIQUE, - `physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network in to which cisco vnmc device is added', - `provider_name` varchar(255) NOT NULL COMMENT 'Service Provider name corresponding to this cisco vnmc device', - `device_name` varchar(255) NOT NULL COMMENT 'name of the cisco vnmc device', - `host_id` bigint unsigned NOT NULL COMMENT 'host id coresponding to the external cisco vnmc device', - PRIMARY KEY (`id`), - CONSTRAINT `fk_external_cisco_vnmc_devices__host_id` FOREIGN KEY (`host_id`) REFERENCES `host`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_external_cisco_vnmc_devices__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`external_cisco_asa1000v_devices` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `uuid` varchar(255) UNIQUE, - `physical_network_id` bigint unsigned NOT NULL COMMENT 'id of the physical network in to which cisco asa1kv device is added', - `management_ip` varchar(255) UNIQUE NOT NULL COMMENT 'mgmt. ip of cisco asa1kv device', - `in_port_profile` varchar(255) NOT NULL COMMENT 'inside port profile name of cisco asa1kv device', - `cluster_id` bigint unsigned NOT NULL COMMENT 'id of the Vmware cluster to which cisco asa1kv device is attached (cisco n1kv switch)', - PRIMARY KEY (`id`), - CONSTRAINT `fk_external_cisco_asa1000v_devices__physical_network_id` FOREIGN KEY (`physical_network_id`) REFERENCES `physical_network`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_external_cisco_asa1000v_devices__cluster_id` FOREIGN KEY (`cluster_id`) REFERENCES `cluster`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - -CREATE TABLE `cloud`.`network_asa1000v_map` ( - `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id', - `network_id` bigint unsigned NOT NULL UNIQUE COMMENT 'id of guest network', - `asa1000v_id` bigint unsigned NOT NULL UNIQUE COMMENT 'id of asa1000v device', - PRIMARY KEY (`id`), - CONSTRAINT `fk_network_asa1000v_map__network_id` FOREIGN KEY (`network_id`) REFERENCES `networks`(`id`) ON DELETE CASCADE, - CONSTRAINT `fk_network_asa1000v_map__asa1000v_id` FOREIGN KEY (`asa1000v_id`) REFERENCES `external_cisco_asa1000v_devices`(`id`) ON DELETE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; - - -ALTER TABLE `cloud`.`network_offerings` ADD COLUMN `eip_associate_public_ip` int(1) unsigned NOT NULL DEFAULT 0 COMMENT 'true if public IP is associated with user VM creation by default when EIP service is enabled.' AFTER `elastic_ip_service`; - --- Re-enable foreign key checking, at the end of the upgrade path -SET foreign_key_checks = 1; - - -- Add role to the domain router view ALTER VIEW `cloud`.`domain_router_view` AS select diff --git a/test/integration/component/test_accounts.py b/test/integration/component/test_accounts.py index cdb3e58dd94..882423e5764 100644 --- a/test/integration/component/test_accounts.py +++ b/test/integration/component/test_accounts.py @@ -95,7 +95,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced' } @@ -110,6 +109,7 @@ class TestAccounts(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -239,6 +239,7 @@ class TestRemoveUserFromAccount(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -506,7 +507,7 @@ class TestNonRootAdminsPrivileges(cloudstackTestCase): cls.services = Services().services # Get Zone settings cls.zone = get_zone(cls.api_client, cls.services) - + cls.services['mode'] = zone.networktype # Create an account, domain etc cls.domain = Domain.create( cls.api_client, @@ -852,6 +853,7 @@ class TesttemplateHierarchy(cloudstackTestCase): cls.services = Services().services # Get Zone settings cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["template"]["zoneid"] = cls.zone.id # Create domains, accounts and template @@ -1000,6 +1002,7 @@ class TestAddVmToSubDomain(cloudstackTestCase): cls.api_client, cls.services, ) + cls.services['mode'] = zone.networktype cls.sub_domain = Domain.create( cls.api_client, cls.services["domain"], @@ -1145,6 +1148,7 @@ class TestUserDetails(cloudstackTestCase): # Get Zone, Domain etc cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls._cleanup = [] return @@ -1451,6 +1455,7 @@ class TestUserLogin(cloudstackTestCase): # Get Zone, Domain etc cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls._cleanup = [] return @@ -1615,6 +1620,7 @@ class TestDomainForceRemove(cloudstackTestCase): cls.api_client, cls.services, ) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, diff --git a/test/integration/component/test_allocation_states.py b/test/integration/component/test_allocation_states.py index 103cb10c0cc..efbb3ba9ab6 100644 --- a/test/integration/component/test_allocation_states.py +++ b/test/integration/component/test_allocation_states.py @@ -79,7 +79,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced', } @@ -94,6 +93,7 @@ class TestAllocationState(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls._cleanup = [] return diff --git a/test/integration/component/test_blocker_bugs.py b/test/integration/component/test_blocker_bugs.py index 33e4a73f712..e85a07318b7 100644 --- a/test/integration/component/test_blocker_bugs.py +++ b/test/integration/component/test_blocker_bugs.py @@ -101,8 +101,6 @@ class Services: "ostype": 'CentOS 5.3 (64-bit)', # Cent OS 5.3 (64 bit) "sleep": 60, - "mode": 'advanced', - # Networking mode, Advanced, Basic } @@ -115,6 +113,7 @@ class TestSnapshots(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -422,6 +421,7 @@ class TestTemplate(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["virtual_machine"]["zoneid"] = cls.zone.id cls.services["templates"]["zoneid"] = cls.zone.id @@ -543,6 +543,7 @@ class TestNATRules(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -737,6 +738,7 @@ class TestRouters(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -863,6 +865,7 @@ class TestRouterRestart(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -992,6 +995,7 @@ class TestTemplates(cloudstackTestCase): # Get Zone, templates etc cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, diff --git a/test/integration/component/test_egress_rules.py b/test/integration/component/test_egress_rules.py index 6b9cd4f25fc..ffcb299aeac 100644 --- a/test/integration/component/test_egress_rules.py +++ b/test/integration/component/test_egress_rules.py @@ -122,8 +122,6 @@ class Services: # CentOS 5.3 (64-bit) "sleep": 60, "timeout": 10, - "mode": 'basic', - # Networking mode: Basic or Advanced } @@ -156,6 +154,7 @@ class TestDefaultSecurityGroupEgress(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -314,6 +313,7 @@ class TestAuthorizeIngressRule(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -471,6 +471,7 @@ class TestDefaultGroupEgress(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -671,6 +672,7 @@ class TestDefaultGroupEgressAfterDeploy(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -853,6 +855,7 @@ class TestRevokeEgressRule(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1114,6 +1117,7 @@ class TestInvalidAccountAuthroize(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1235,6 +1239,7 @@ class TestMultipleAccountsEgressRuleNeg(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1482,6 +1487,7 @@ class TestMultipleAccountsEgressRule(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1778,6 +1784,7 @@ class TestStartStopVMWithEgressRule(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1989,6 +1996,7 @@ class TestInvalidParametersForEgress(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -2171,6 +2179,7 @@ class TestEgressAfterHostMaintainance(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.pod = get_pod( cls.api_client, zoneid=cls.zone.id diff --git a/test/integration/component/test_eip_elb.py b/test/integration/component/test_eip_elb.py index 89fdd25fb25..c588c1bd1c4 100644 --- a/test/integration/component/test_eip_elb.py +++ b/test/integration/component/test_eip_elb.py @@ -85,7 +85,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'basic' } class TestEIP(cloudstackTestCase): @@ -97,6 +96,7 @@ class TestEIP(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -919,6 +919,7 @@ class TestELB(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_network_offering.py b/test/integration/component/test_network_offering.py index 0de03aa0938..cc6f25e9756 100644 --- a/test/integration/component/test_network_offering.py +++ b/test/integration/component/test_network_offering.py @@ -142,7 +142,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced' } @@ -158,6 +157,7 @@ class TestNOVirtualRouter(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -736,6 +736,7 @@ class TestNOWithNetscaler(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -1371,6 +1372,7 @@ class TestNetworkUpgrade(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -1827,6 +1829,7 @@ class TestSharedNetworkWithoutIp(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_project_configs.py b/test/integration/component/test_project_configs.py index 854b5a42853..92290d0adf3 100644 --- a/test/integration/component/test_project_configs.py +++ b/test/integration/component/test_project_configs.py @@ -102,7 +102,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced' } @@ -117,6 +116,7 @@ class TestUserProjectCreation(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype configs = Configurations.list( cls.api_client, @@ -282,6 +282,7 @@ class TestProjectCreationNegative(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype # Checking for prereqisits - global configs configs = Configurations.list( @@ -427,6 +428,7 @@ class TestProjectInviteRequired(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype # Create domains, account etc. cls.domain = get_domain(cls.api_client, cls.services) @@ -578,6 +580,7 @@ class TestProjectInviteRequiredTrue(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype # Create domains, account etc. cls.domain = get_domain(cls.api_client, cls.services) @@ -730,6 +733,7 @@ class TestProjectInviteTimeout(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype # Create domains, account etc. cls.domain = get_domain(cls.api_client, cls.services) diff --git a/test/integration/component/test_project_limits.py b/test/integration/component/test_project_limits.py index afae1808d04..2eceb884f7e 100644 --- a/test/integration/component/test_project_limits.py +++ b/test/integration/component/test_project_limits.py @@ -116,7 +116,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced', } @@ -131,6 +130,7 @@ class TestProjectLimits(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype # Create domains, account etc. cls.domain = Domain.create( @@ -481,6 +481,7 @@ class TestResourceLimitsProject(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -921,6 +922,7 @@ class TestMaxProjectNetworks(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_project_resources.py b/test/integration/component/test_project_resources.py index 24091d2f89c..9ad0365c80e 100644 --- a/test/integration/component/test_project_resources.py +++ b/test/integration/component/test_project_resources.py @@ -134,7 +134,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced', } @@ -149,6 +148,7 @@ class TestOfferings(cloudstackTestCase): cls.services = Services().services # Get Zone and template cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -329,6 +329,7 @@ class TestNetwork(cloudstackTestCase): cls.services = Services().services # Get Zone and template cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -516,6 +517,7 @@ class TestTemplates(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -745,6 +747,7 @@ class TestSnapshots(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -891,6 +894,7 @@ class TestPublicIpAddress(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -1190,6 +1194,7 @@ class TestSecurityGroup(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, diff --git a/test/integration/component/test_project_usage.py b/test/integration/component/test_project_usage.py index 9f0488d20ce..34335b7bc4d 100644 --- a/test/integration/component/test_project_usage.py +++ b/test/integration/component/test_project_usage.py @@ -109,7 +109,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced' } @@ -125,6 +124,7 @@ class TestVmUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -319,6 +319,7 @@ class TestPublicIPUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -490,6 +491,7 @@ class TestVolumeUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -674,6 +676,7 @@ class TestTemplateUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["server"]["zoneid"] = cls.zone.id template = get_template( cls.api_client, @@ -846,6 +849,7 @@ class TestISOUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["server"]["zoneid"] = cls.zone.id cls.services["iso"]["zoneid"] = cls.zone.id # Create Account, ISO image etc @@ -993,6 +997,7 @@ class TestLBRuleUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -1175,6 +1180,7 @@ class TestSnapshotUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1352,6 +1358,7 @@ class TestNatRuleUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -1534,6 +1541,7 @@ class TestVpnUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_projects.py b/test/integration/component/test_projects.py index 3e45cae6651..767cb06675d 100644 --- a/test/integration/component/test_projects.py +++ b/test/integration/component/test_projects.py @@ -96,7 +96,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced' } @@ -111,6 +110,7 @@ class TestMultipleProjectCreation(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype # Create domains, account etc. cls.domain = get_domain( @@ -323,6 +323,7 @@ class TestCrossDomainAccountAdd(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.domain = get_domain( cls.api_client, cls.services @@ -456,6 +457,7 @@ class TestDeleteAccountWithProject(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.domain = get_domain( cls.api_client, cls.services @@ -569,6 +571,7 @@ class TestDeleteDomainWithProject(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype configs = Configurations.list( cls.api_client, @@ -713,6 +716,7 @@ class TestProjectOwners(cloudstackTestCase): cls.services ) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype configs = Configurations.list( cls.api_client, @@ -1136,6 +1140,7 @@ class TestProjectResources(cloudstackTestCase): cls.services = Services().services # Get Zone cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.domain = get_domain( cls.api_client, cls.services @@ -1444,6 +1449,7 @@ class TestProjectSuspendActivate(cloudstackTestCase): cls.services = Services().services # Get Zone, domain, template etc cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.domain = get_domain( cls.api_client, cls.services diff --git a/test/integration/component/test_resource_limits.py b/test/integration/component/test_resource_limits.py index c20770ab24f..3e7548ee7bd 100644 --- a/test/integration/component/test_resource_limits.py +++ b/test/integration/component/test_resource_limits.py @@ -105,7 +105,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced', } @@ -118,6 +117,7 @@ class TestResourceLimitsAccount(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -881,6 +881,7 @@ class TestResourceLimitsDomain(cloudstackTestCase): cls.services = Services().services # Get Zone, Domain and templates cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -1338,6 +1339,7 @@ class TestMaxAccountNetworks(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_routers.py b/test/integration/component/test_routers.py index 02a08dee91c..41bf23f8817 100644 --- a/test/integration/component/test_routers.py +++ b/test/integration/component/test_routers.py @@ -91,7 +91,6 @@ class Services: }, "ostype": 'CentOS 5.3 (64-bit)', # Used for Get_Template : CentOS 5.3 (64 bit) - "mode": 'advanced', # Networking mode: Advanced, basic } @@ -105,6 +104,7 @@ class TestRouterServices(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, cls.zone.id, @@ -592,6 +592,7 @@ class TestRouterStopCreatePF(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -803,6 +804,7 @@ class TestRouterStopCreateLB(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -1014,6 +1016,7 @@ class TestRouterStopCreateFW(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_security_groups.py b/test/integration/component/test_security_groups.py index 39f6d6fcd26..4255d428a45 100644 --- a/test/integration/component/test_security_groups.py +++ b/test/integration/component/test_security_groups.py @@ -94,8 +94,6 @@ class Services: # CentOS 5.3 (64-bit) "sleep": 60, "timeout": 10, - "mode": 'basic', - # Networking mode: Basic or Advanced } @@ -125,6 +123,7 @@ class TestDefaultSecurityGroup(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -397,6 +396,7 @@ class TestAuthorizeIngressRule(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -532,6 +532,7 @@ class TestRevokeIngressRule(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -690,6 +691,7 @@ class TestDhcpOnlyRouter(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -826,6 +828,7 @@ class TestdeployVMWithUserData(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -985,6 +988,7 @@ class TestDeleteSecurityGroup(cloudstackTestCase): # Get Zone, Domain and templates self.domain = get_domain(self.apiclient, self.services) self.zone = get_zone(self.apiclient, self.services) + self.services['mode'] = zone.networktype template = get_template( self.apiclient, @@ -1230,6 +1234,7 @@ class TestIngressRule(cloudstackTestCase): # Get Zone, Domain and templates self.domain = get_domain(self.apiclient, self.services) self.zone = get_zone(self.apiclient, self.services) + self.services['mode'] = zone.networktype template = get_template( self.apiclient, diff --git a/test/integration/component/test_snapshots.py b/test/integration/component/test_snapshots.py index 825b8c6877e..9ff57ab346a 100644 --- a/test/integration/component/test_snapshots.py +++ b/test/integration/component/test_snapshots.py @@ -121,7 +121,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced', # Networking mode: Advanced, Basic } @@ -134,6 +133,7 @@ class TestSnapshotRootDisk(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -356,6 +356,7 @@ class TestSnapshots(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -1190,6 +1191,7 @@ class TestCreateVMsnapshotTemplate(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.template = get_template( cls.api_client, @@ -1485,6 +1487,7 @@ class TestAccountSnapshotClean(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1833,6 +1836,7 @@ class TestSnapshotDetachedDisk(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, @@ -2120,6 +2124,7 @@ class TestSnapshotLimit(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -2378,6 +2383,7 @@ class TestSnapshotEvents(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, diff --git a/test/integration/component/test_templates.py b/test/integration/component/test_templates.py index 65d9fe0a764..980640d976f 100644 --- a/test/integration/component/test_templates.py +++ b/test/integration/component/test_templates.py @@ -97,7 +97,6 @@ class Services: "ostype": 'CentOS 5.3 (64-bit)', "sleep": 60, "timeout": 10, - "mode": 'advanced', # Networking mode: Advanced, basic } @@ -128,6 +127,7 @@ class TestCreateTemplate(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["virtual_machine"]["zoneid"] = cls.zone.id cls.service_offering = ServiceOffering.create( @@ -283,6 +283,7 @@ class TestTemplates(cloudstackTestCase): # Get Zone, templates etc cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype #populate second zone id for iso copy cmd = listZones.listZonesCmd() zones = cls.api_client.listZones(cmd) diff --git a/test/integration/component/test_usage.py b/test/integration/component/test_usage.py index 82d13e5a9ff..27e3719e519 100644 --- a/test/integration/component/test_usage.py +++ b/test/integration/component/test_usage.py @@ -105,7 +105,6 @@ class Services: # Cent OS 5.3 (64 bit) "sleep": 60, "timeout": 10, - "mode": 'advanced' } @@ -118,6 +117,7 @@ class TestVmUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -301,6 +301,7 @@ class TestPublicIPUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -452,6 +453,7 @@ class TestVolumeUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -625,6 +627,7 @@ class TestTemplateUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["server"]["zoneid"] = cls.zone.id template = get_template( cls.api_client, @@ -789,6 +792,7 @@ class TestISOUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.services["server"]["zoneid"] = cls.zone.id cls.services["iso"]["zoneid"] = cls.zone.id # Create Account, ISO image etc @@ -925,6 +929,7 @@ class TestLBRuleUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -1086,6 +1091,7 @@ class TestSnapshotUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, @@ -1252,6 +1258,7 @@ class TestNatRuleUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, @@ -1413,6 +1420,7 @@ class TestVpnUsage(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, cls.zone.id, diff --git a/test/integration/component/test_vm_passwdenabled.py b/test/integration/component/test_vm_passwdenabled.py index fb881708e2f..eccc488fcf9 100644 --- a/test/integration/component/test_vm_passwdenabled.py +++ b/test/integration/component/test_vm_passwdenabled.py @@ -83,6 +83,7 @@ class TestVMPasswordEnabled(cloudstackTestCase): # Get Zone, Domain and templates domain = get_domain(cls.api_client, cls.services) zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype template = get_template( cls.api_client, zone.id, diff --git a/test/integration/component/test_volumes.py b/test/integration/component/test_volumes.py index bedf6efd8b4..d1f3cf5af09 100644 --- a/test/integration/component/test_volumes.py +++ b/test/integration/component/test_volumes.py @@ -87,7 +87,6 @@ class Services: }, "sleep": 50, "ostype": 'CentOS 5.3 (64-bit)', - "mode": 'advanced', } @@ -101,6 +100,7 @@ class TestAttachVolume(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -371,6 +371,7 @@ class TestAttachDetachVolume(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -616,6 +617,7 @@ class TestAttachVolumeISO(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -807,6 +809,7 @@ class TestVolumes(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"] @@ -1046,6 +1049,7 @@ class TestDeployVmWithCustomDisk(cloudstackTestCase): # Get Zone, Domain and templates cls.domain = get_domain(cls.api_client, cls.services) cls.zone = get_zone(cls.api_client, cls.services) + cls.services['mode'] = zone.networktype cls.disk_offering = DiskOffering.create( cls.api_client, cls.services["disk_offering"], diff --git a/test/integration/smoke/test_non_contigiousvlan.py b/test/integration/smoke/test_non_contigiousvlan.py new file mode 100644 index 00000000000..fe70f874f75 --- /dev/null +++ b/test/integration/smoke/test_non_contigiousvlan.py @@ -0,0 +1,125 @@ +# 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 Primary Storage +""" +import marvin +from marvin import cloudstackTestCase +from marvin.cloudstackTestCase import * + +import unittest +import hashlib +import random + + +class TestUpdatePhysicalNetwork(cloudstackTestCase): + """ + This test updates the existing physicalnetwork with a new vlan range. + """ + def setUp(self): + """ + CloudStack internally saves its passwords in md5 form and that is how we + specify it in the API. Python's hashlib library helps us to quickly hash + strings as follows + """ + mdf = hashlib.md5() + mdf.update('password') + mdf_pass = mdf.hexdigest() + + self.apiClient = self.testClient.getApiClient() #Get ourselves an API client + + self.acct = createAccount.createAccountCmd() #The createAccount command + self.acct.accounttype = 0 #We need a regular user. admins have accounttype=1 + self.acct.firstname = 'bharat' + self.acct.lastname = 'kumar' #What's up doc? + self.acct.password = mdf_pass #The md5 hashed password string + self.acct.username = 'bharat' + self.acct.email = 'bharat@kumar.com' + self.acct.account = 'bharat' + self.acct.domainid = 1 #The default ROOT domain + self.acctResponse = self.apiClient.createAccount(self.acct) + # using the default debug logger of the test framework + self.debug("successfully created account: %s, user: %s, id: \ + %s"%(self.acctResponse.account.account, \ + self.acctResponse.account.username, \ + self.acctResponse.account.id)) + + def test_UpdatePhysicalNetwork(self): + """ + Let's start by defining the attributes of our VM that we will be + deploying on CloudStack. We will be assuming a single zone is available + and is configured and all templates are Ready + + The hardcoded values are used only for brevity. + """ + listPhysicalNetworksCmd = listPhysicalNetworks.listPhysicalNetworksCmd() + listPhysicalNetworksResponse = self.apiClient.listPhysicalNetworks(listPhysicalNetworksCmd) + + self.assertNotEqual(len(listPhysicalNetworksResponse), 0, "Check if the list API \ + returns a non-empty response") + + networkid = listPhysicalNetworksResponse[0].id + updatePhysicalNetworkCmd = updatePhysicalNetwork.updatePhysicalNetworkCmd() + updatePhysicalNetworkCmd.id = networkid + updatePhysicalNetworkCmd.vlan = "4090-4091" + updatePhysicalNetworkResponse = self.apiClient.updatePhysicalNetwork(updatePhysicalNetworkCmd) + self.assertNotEqual((updatePhysicalNetworkResponse.len), 0, "Check if the list API \ + returns a non-empty response") + + updatePhysicalNetworkCmd = updatePhysicalNetwork.updatePhysicalNetworkCmd() + updatePhysicalNetworkCmd.id = networkid + updatePhysicalNetworkCmd.vlan = "4092-4096" + updatePhysicalNetworkResponse = self.apiClient.updatePhysicalNetwork(updatePhysicalNetworkCmd) + self.assertNotEqual((updatePhysicalNetworkResponse.len), 0, "Check if the list API \ + returns a non-empty response") + + vlanranges= updatePhysicalNetworkResponse.vlan + range = "" + vlanranges = vlanranges.split(";") + for vlan in vlanranges: + if (vlan == "4090-4096"): + range = vlan + + self.assertEqual(range, "4090-4096", "check if adding the range is successful") + + updatePhysicalNetworkCmd = updatePhysicalNetwork.updatePhysicalNetworkCmd() + updatePhysicalNetworkCmd.id = networkid + updatePhysicalNetworkCmd.removevlan = "4090-4096" + updatePhysicalNetworkResponse = self.apiClient.updatePhysicalNetwork(updatePhysicalNetworkCmd) + self.assertNotEqual((updatePhysicalNetworkResponse.len), 0, "Check if the list API \ + returns a non-empty response") + + vlanranges= updatePhysicalNetworkResponse.vlan + range = "" + vlanranges = vlanranges.split(";") + + for vlan in vlanranges: + if (vlan == "4090-4096"): + range = vlan + + + self.assertEqual(range, "", "check if removing the range is successful") + + + def tearDown(self): # Teardown will delete the Account as well as the VM once the VM reaches "Running" state + """ + And finally let us cleanup the resources we created by deleting the + account. All good unittests are atomic and rerunnable this way + """ + deleteAcct = deleteAccount.deleteAccountCmd() + deleteAcct.id = self.acctResponse.account.id + self.apiClient.deleteAccount(deleteAcct) + diff --git a/tools/apidoc/gen_toc.py b/tools/apidoc/gen_toc.py index 5403adb99df..f8bdae281b2 100644 --- a/tools/apidoc/gen_toc.py +++ b/tools/apidoc/gen_toc.py @@ -56,6 +56,7 @@ dirname_to_dirname = { known_categories = { + 'Cisco' : 'External Device', 'SystemVm': 'System VM', 'VirtualMachine': 'Virtual Machine', 'VM': 'Virtual Machine', diff --git a/tools/marvin/marvin/asyncJobMgr.py b/tools/marvin/marvin/asyncJobMgr.py index 935bebe4d7a..40304fa4141 100644 --- a/tools/marvin/marvin/asyncJobMgr.py +++ b/tools/marvin/marvin/asyncJobMgr.py @@ -54,7 +54,7 @@ class workThread(threading.Thread): try: self.lock.acquire() - result = self.connection.pollAsyncJob(job.jobId, job.responsecls).jobresult + result = self.connection.poll(job.jobId, job.responsecls).jobresult except cloudstackException.cloudstackAPIException, e: result = str(e) finally: diff --git a/tools/marvin/marvin/cloudstackConnection.py b/tools/marvin/marvin/cloudstackConnection.py index 1caeef35ff2..5fd3e1226a4 100644 --- a/tools/marvin/marvin/cloudstackConnection.py +++ b/tools/marvin/marvin/cloudstackConnection.py @@ -15,126 +15,132 @@ # specific language governing permissions and limitations # under the License. -import urllib2 +import requests import urllib -import httplib import base64 import hmac import hashlib -import json -import xml.dom.minidom -import types import time -import inspect import cloudstackException from cloudstackAPI import * import jsonHelper +from requests import ConnectionError +from requests import HTTPError +from requests import Timeout +from requests import RequestException class cloudConnection(object): - def __init__(self, mgtSvr, port=8096, apiKey = None, securityKey = None, asyncTimeout=3600, logging=None, protocol='http', path='/client/api'): + def __init__(self, mgtSvr, port=8096, apiKey=None, securityKey=None, asyncTimeout=3600, logging=None, + scheme='http', path='client/api'): self.apiKey = apiKey self.securityKey = securityKey self.mgtSvr = mgtSvr self.port = port self.logging = logging - if protocol != 'http' and protocol != 'https': - raise ValueError("Protocol must be 'http' or 'https'.") - else: - self.protocol=protocol self.path = path - if port == 8096 or (self.apiKey == None and self.securityKey == None): - self.auth = False - else: - self.auth = True self.retries = 5 self.asyncTimeout = asyncTimeout - - def close(self): - try: - self.connection.close() - except: - pass - + self.auth = True + if port == 8096 or \ + (self.apiKey == None and self.securityKey == None): + self.auth = False + if scheme not in ['http', 'https']: + raise RequestException("Protocol must be HTTP") + self.protocol = scheme + self.baseurl = "%s://%s:%d/%s"%(self.protocol, self.mgtSvr, self.port, self.path) + def __copy__(self): - return cloudConnection(self.mgtSvr, self.port, self.apiKey, self.securityKey, self.asyncTimeout, self.logging, self.protocol, self.path) - - def make_request_with_auth(self, command, requests={}): - requests["command"] = command - requests["apiKey"] = self.apiKey - requests["response"] = "json" - request = zip(requests.keys(), requests.values()) - request.sort(key=lambda x: str.lower(x[0])) - - requestUrl = "&".join(["=".join([r[0], urllib.quote_plus(str(r[1]))]) for r in request]) - hashStr = "&".join(["=".join([str.lower(r[0]), str.lower(urllib.quote_plus(str(r[1]))).replace("+", "%20")]) for r in request]) + return cloudConnection(self.mgtSvr, self.port, self.apiKey, self.securityKey, self.asyncTimeout, + self.logging, self.protocol, self.path) - sig = urllib.quote_plus(base64.encodestring(hmac.new(self.securityKey, hashStr, hashlib.sha1).digest()).strip()) - requestUrl += "&signature=%s"%sig - - try: - self.connection = urllib2.urlopen("%s://%s:%d%s?%s"%(self.protocol, self.mgtSvr, self.port, self.path, requestUrl)) - if self.logging is not None: - self.logging.debug("sending GET request: %s"%requestUrl) - response = self.connection.read() - if self.logging is not None: - self.logging.info("got response: %s"%response) - except IOError, e: - if hasattr(e, 'reason'): - if self.logging is not None: - self.logging.critical("failed to reach %s because of %s"%(self.mgtSvr, e.reason)) - elif hasattr(e, 'code'): - if self.logging is not None: - self.logging.critical("server returned %d error code"%e.code) - raise e - except httplib.HTTPException, h: - if self.logging is not None: - self.logging.debug("encountered http Exception %s"%h.args) - if self.retries > 0: - self.retries = self.retries - 1 - self.make_request_with_auth(command, requests) - else: - self.retries = 5 - raise h - else: - return response - - def make_request_without_auth(self, command, requests={}): - requests["command"] = command - requests["response"] = "json" - requests = zip(requests.keys(), requests.values()) - requestUrl = "&".join(["=".join([request[0], urllib.quote_plus(str(request[1]))]) for request in requests]) - - self.connection = urllib2.urlopen("%s://%s:%d%s?%s"%(self.protocol, self.mgtSvr, self.port, self.path, requestUrl)) - if self.logging is not None: - self.logging.debug("sending GET request without auth: %s"%requestUrl) - response = self.connection.read() - if self.logging is not None: - self.logging.info("got response: %s"%response) - return response - - def pollAsyncJob(self, jobId, response): + def poll(self, jobid, response): + """ + polls the completion of a given jobid + @param jobid: + @param response: + @return: + """ cmd = queryAsyncJobResult.queryAsyncJobResultCmd() - cmd.jobid = jobId + cmd.jobid = jobid timeout = self.asyncTimeout - + while timeout > 0: - asyncResonse = self.make_request(cmd, response, True) - + asyncResonse = self.marvin_request(cmd, response_type=response) + if asyncResonse.jobstatus == 2: raise cloudstackException.cloudstackAPIException("asyncquery", asyncResonse.jobresult) elif asyncResonse.jobstatus == 1: return asyncResonse - + time.sleep(5) if self.logging is not None: - self.logging.debug("job: %s still processing, will timeout in %ds"%(jobId, timeout)) + self.logging.debug("job: %s still processing, will timeout in %ds"%(jobid, timeout)) timeout = timeout - 5 - - raise cloudstackException.cloudstackAPIException("asyncquery", "Async job timeout %s"%jobId) - - def make_request(self, cmd, response = None, raw=False): - commandName = cmd.__class__.__name__.replace("Cmd", "") - isAsync = "false" + + raise cloudstackException.cloudstackAPIException("asyncquery", "Async job timeout %s"%jobid) + + def sign(self, payload): + """ + signs a given request URL when the apiKey and secretKey are known + + @param payload: dict of GET params to be signed + @return: the signature of the payload + """ + params = zip(payload.keys(), payload.values()) + params.sort(key=lambda k: str.lower(k[0])) + hashStr = "&".join( + ["=".join( + [str.lower(r[0]), str.lower(urllib.quote_plus(str(r[1]))).replace("+", "%20")] + ) for r in params] + ) + signature = base64.encodestring(hmac.new(self.securityKey, hashStr, hashlib.sha1).digest()).strip() + self.logging.info("Computed Signature by Marvin: %s"%signature) + return signature + + def request(self, command, auth=True, payload={}, data={}): + """ + Makes requests on the `integration.api.port` + @param command: cloudstack API command name eg: deployVirtualMachineCommand + @param auth: Authentication (apikey,secretKey) => True, else False + @param payload: GET param data composed as a dictionary of key,value pairs + @param data: POST data as a dictionary + @return: + """ + payload["command"] = command + payload["response"] = "json" + + if auth: + payload["apiKey"] = self.apiKey + signature = self.sign(payload) + payload["signature"] = signature + + + try: + if data: + response = requests.get(self.baseurl, params=payload, data=data) + else: + response = requests.get(self.baseurl, params=payload) + except ConnectionError, c: + self.logging.debug("Connection refused. Reason: %s"%(self.baseurl, c)) + raise c + except HTTPError, h: + self.logging.debug("Server returned error code: %s"%h) + raise h + except Timeout, t: + self.logging.debug("Connection timed out with %s"%t) + raise t + except RequestException,r: + self.logging.debug("Error returned by server %s"%r) + raise r + else: + return response + + def sanitize_command(self, cmd): + """ + Removes None values, Validates all required params are present + @param cmd: Cmd object eg: createPhysicalNetwork + @return: + """ requests = {} required = [] for attribute in dir(cmd): @@ -145,11 +151,11 @@ class cloudConnection(object): required = getattr(cmd, attribute) else: requests[attribute] = getattr(cmd, attribute) - + + cmdname = cmd.__class__.__name__.replace("Cmd", "") for requiredPara in required: if requests[requiredPara] is None: - raise cloudstackException.cloudstackAPIException(commandName, "%s is required"%requiredPara) - '''remove none value''' + raise cloudstackException.cloudstackAPIException(cmdname, "%s is required"%requiredPara) for param, value in requests.items(): if value is None: requests.pop(param) @@ -166,28 +172,30 @@ class cloudConnection(object): for k,v in val.iteritems(): requests["%s[%d].%s"%(param,i,k)] = v i = i + 1 - - if self.logging is not None: - self.logging.info("sending command: %s %s"%(commandName, str(requests))) - result = None + return cmdname, isAsync, requests + + def marvin_request(self, cmd, data={}, response_type=None): + """ + Requester for marvin command objects + @param cmd: marvin's command from cloudstackAPI + @param data: any data to be sent in as POST + @param response_type: response type of the command in cmd + @param raw: + @return: + """ + cmdname, isAsync, payload = self.sanitize_command(cmd) + self.logging.info("sending command: %s %s"%(cmdname, str(payload))) if self.auth: - result = self.make_request_with_auth(commandName, requests) + response = self.request(cmdname, auth=True, payload=payload, data=data) else: - result = self.make_request_without_auth(commandName, requests) - - if result is None: - return None - - result = jsonHelper.getResultObj(result, response) - if raw or isAsync == "false": - return result + response = self.request(cmdname, auth=False, payload=payload, data=data) + + self.logging.info("Request: %s Response: %s"%(response.url, response.text)) + response = jsonHelper.getResultObj(response.json, response_type) + + if isAsync == "false": + return response else: - asynJobId = result.jobid - result = self.pollAsyncJob(asynJobId, response) - return result.jobresult - -if __name__ == '__main__': - xml = '407i-1-407-RS3i-1-407-RS3system1ROOT2011-07-30T14:45:19-0700Runningfalse1CA13kvm-50-2054CentOS 5.5(64-bit) no GUI (KVM)CentOS 5.5(64-bit) no GUI (KVM)false1Small Instance15005121120NetworkFilesystem380203255.255.255.065.19.181.165.19.181.110vlan://65vlan://65GuestDirecttrue06:52:da:00:00:08KVM' - conn = cloudConnection(None) - - print conn.paraseReturnXML(xml, deployVirtualMachine.deployVirtualMachineResponse()) + asyncJobId = response.jobid + response = self.poll(asyncJobId, response_type) + return response.jobresult diff --git a/tools/marvin/marvin/cloudstackTestClient.py b/tools/marvin/marvin/cloudstackTestClient.py index e4735e453db..85552ed5523 100644 --- a/tools/marvin/marvin/cloudstackTestClient.py +++ b/tools/marvin/marvin/cloudstackTestClient.py @@ -111,7 +111,8 @@ class cloudstackTestClient(object): apiKey = registerUserRes.apikey securityKey = registerUserRes.secretkey - newUserConnection = cloudstackConnection.cloudConnection(self.connection.mgtSvr, self.connection.port, apiKey, securityKey, self.connection.asyncTimeout, self.connection.logging) + newUserConnection = cloudstackConnection.cloudConnection(self.connection.mgtSvr, self.connection.port, + apiKey, securityKey, self.connection.asyncTimeout, self.connection.logging) self.userApiClient = cloudstackAPIClient.CloudStackAPIClient(newUserConnection) self.userApiClient.connection = newUserConnection return self.userApiClient diff --git a/tools/marvin/marvin/codegenerator.py b/tools/marvin/marvin/codegenerator.py index 0622e5dbc9e..b3b2a863029 100644 --- a/tools/marvin/marvin/codegenerator.py +++ b/tools/marvin/marvin/codegenerator.py @@ -184,9 +184,9 @@ class codeGenerator: body += "\n" for cmdName in self.cmdsName: - body += self.space + 'def %s(self,command):\n'%cmdName + body += self.space + 'def %s(self, command, postdata={}):\n'%cmdName body += self.space + self.space + 'response = %sResponse()\n'%cmdName - body += self.space + self.space + 'response = self.connection.make_request(command, response)\n' + body += self.space + self.space + 'response = self.connection.marvin_request(command, data=postdata, response_type=response)\n' body += self.space + self.space + 'return response\n' body += '\n' diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py index 2e270a7cd58..d358789d8da 100644 --- a/tools/marvin/marvin/deployDataCenter.py +++ b/tools/marvin/marvin/deployDataCenter.py @@ -407,7 +407,6 @@ class deployDataCenters(): logging=self.testClientLogger) if mgt.apiKey is None: apiKey, securityKey = self.registerApiKey() - self.testClient.close() self.testClient = \ cloudstackTestClient.cloudstackTestClient(mgt.mgtSvrIp, 8080, \ apiKey, securityKey, \ diff --git a/tools/marvin/marvin/jsonHelper.py b/tools/marvin/marvin/jsonHelper.py index 652cce0bf9e..37363bc8c91 100644 --- a/tools/marvin/marvin/jsonHelper.py +++ b/tools/marvin/marvin/jsonHelper.py @@ -19,7 +19,6 @@ import cloudstackException import json import inspect from cloudstackAPI import * -import pdb class jsonLoader: '''The recursive class for building and representing objects with.''' @@ -113,12 +112,8 @@ def finalizeResultObj(result, responseName, responsecls): return result else: return result - - - + def getResultObj(returnObj, responsecls=None): - returnObj = json.loads(returnObj) - if len(returnObj) == 0: return None responseName = filter(lambda a: a!=u'cloudstack-version', returnObj.keys())[0] diff --git a/tools/marvin/setup.py b/tools/marvin/setup.py index ab5eb6f7c24..da138ce162b 100644 --- a/tools/marvin/setup.py +++ b/tools/marvin/setup.py @@ -45,6 +45,7 @@ setup(name="Marvin", license="LICENSE.txt", install_requires=[ "mysql-connector-python", + "requests", "paramiko", "nose" ], diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js index a8bca91769c..35969a27251 100644 --- a/ui/scripts/cloudStack.js +++ b/ui/scripts/cloudStack.js @@ -25,13 +25,13 @@ sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "system", "global-settings", "configuration", "projects", "regions"]; } else if(isDomainAdmin()) { - sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "projects"]; + sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "domains", "events", "projects", "regions"]; } else if (g_userProjectsEnabled) { - sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "projects"]; + sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "projects", "regions"]; } else { //normal user - sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events"]; + sections = ["dashboard", "instances", "storage", "network", "templates", "accounts", "events", "regions"]; } if (cloudStack.plugins.length) { diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js index ec5e21b7d4c..ef6f976b014 100644 --- a/ui/scripts/regions.js +++ b/ui/scripts/regions.js @@ -246,8 +246,30 @@ }, description: { label: 'label.description' - }, - /* + }, + gslbdomainname: { + label: 'GSLB Domain Name', + validation: { required: true } + }, + gslblbmethod: { + label: 'Algorithm', + select: function(args) { + var array1 = [{id: 'roundrobin', description: 'roundrobin'}, {id: 'leastconn', description: 'leastconn'}, {id: 'proximity', description: 'proximity'}]; + args.response.success({ + data: array1 + }); + } + }, + gslbservicetype: { + label: 'Service Type', + select: function(args) { + var array1 = [{id: 'tcp', description: 'tcp'}, {id: 'udp', description: 'udp'}]; + args.response.success({ + data: array1 + }); + }, + validation: { required: true } + }, domainid: { label: 'Domain', select: function(args) { @@ -293,31 +315,7 @@ else return true; } - }, - */ - gslblbmethod: { - label: 'Algorithm', - select: function(args) { - var array1 = [{id: 'roundrobin', description: 'roundrobin'}, {id: 'leastconn', description: 'leastconn'}, {id: 'proximity', description: 'proximity'}]; - args.response.success({ - data: array1 - }); - } - }, - gslbdomainname: { - label: 'GSLB Domain Name', - validation: { required: true } - }, - gslbservicetype: { - label: 'Service Type', - select: function(args) { - var array1 = [{id: 'tcp', description: 'tcp'}, {id: 'udp', description: 'udp'}]; - args.response.success({ - data: array1 - }); - }, - validation: { required: true } - } + } } }, action: function(args) { @@ -330,23 +328,22 @@ gslbservicetype: args.data.gslbservicetype }; if(args.data.description != null && args.data.description.length > 0) - $.extend(data, { description: args.data.description }); - /* + $.extend(data, { description: args.data.description }); if(args.data.domainid != null && args.data.domainid.length > 0) $.extend(data, { domainid: args.data.domainid }); if(args.data.account != null && args.data.account.length > 0) $.extend(data, { account: args.data.account }); - */ + $.ajax({ url: createURL('createGlobalLoadBalancerRule'), data: data, success: function(json) { - var jid = json.creategloballoadbalancerruleresponse.jobid; + var jid = json.creategloballoadbalancerruleresponse.jobid; args.response.success( {_custom: {jobId: jid, - getUpdatedItem: function(json) { - return json.queryasyncjobresultresponse.jobresult.globalloadbalancerrule; + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.globalloadbalancer; } } } @@ -355,9 +352,7 @@ }); }, notification: { - poll: function(args) { - poll: pollAsyncJobResult - } + poll: pollAsyncJobResult } } }, @@ -383,9 +378,246 @@ data: null }); } - } + }, + + detailView: { + name: 'GSLB details', + viewAll: { path: 'regions.lbUnderGSLB', label: 'load balancer rules' }, + actions: { + remove: { + label: 'delete GSLB', + messages: { + confirm: function(args) { + return 'Please confirm you want to delete this GSLB'; + }, + notification: function(args) { + return 'delete GSLB'; + } + }, + action: function(args) { + var data = { + id: args.context.GSLB[0].id + }; + $.ajax({ + url: createURL("deleteGlobalLoadBalancerRule"), + data: data, + success: function(json) { + var jid = json.deletegloballoadbalancerruleresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + tabs: { + details: { + title: 'label.details', + fields: [ + { + name: { label: 'label.name' } + }, + { + description: { label: 'label.description' }, + gslbdomainname: { label: 'GSLB Domain Name' }, + gslblbmethod: { label: 'Algorithm' }, + gslbservicetype: { label: 'Service Type' }, + id: { label: 'ID' } + } + ], + dataProvider: function(args) { + var data = { + id: args.context.GSLB[0].id + }; + $.ajax({ + url: createURL('listGlobalLoadBalancerRules'), + data: data, + success: function(json) { + var item = json.listgloballoadbalancerrulesresponse.globalloadbalancerrule[0]; + args.response.success({ + data: item + }); + } + }); + } + } + } + } } - } + }, + + lbUnderGSLB: { + id: 'lbUnderGSLB', + type: 'select', + title: 'assigned load balancer rules', + listView: { + section: 'lbUnderGSLB', + id: 'lbUnderGSLB', + label: 'assigned load balancer rules', + fields: { + name: { label: 'label.name' }, + publicport: { label: 'label.public.port' }, + privateport: { label: 'label.private.port' }, + algorithm: { label: 'label.algorithm' } + }, + dataProvider: function(args) { + var data = { + globalloadbalancerruleid: args.context.GSLB[0].id, + listAll: true + }; + $.ajax({ + url: createURL('listLoadBalancerRules'), + data: data, + success: function(json) { + var items = json.listloadbalancerrulesresponse.loadbalancerrule; + args.response.success({ + data: items + }); + } + }); + }, + actions: { + add: { + label: 'assign load balancer rule to GSLB', + messages: { + confirm: function(args) { + return 'Please confirm you want to assign load balancer rule to GSLB'; + }, + notification: function(args) { + return 'assign load balancer rule to GSLB'; + } + }, + createForm: { + title: 'assign load balancer rule to GSLB', + fields: { + loadbalancerrule: { + label: 'load balancer rule', + select: function(args) { + var data = { + globalloadbalancerruleid: args.context.GSLB[0].id, + listAll: true + }; + $.ajax({ + url: createURL('listLoadBalancerRules'), + data: data, + success: function(json) { + var items = json.listloadbalancerrulesresponse.loadbalancerrule; + args.response.success({ + data: items, + descriptionField: 'name' + }); + } + }); + } + } + } + }, + action: function(args) { + var data = { + id: args.context.GSLB[0].id, + loadbalancerrulelist: args.data.loadbalancerrule + }; + $.ajax({ + url: createURL('assignToGlobalLoadBalancerRule'), + data: data, + success: function(json) { + var jid = json.assigntogloballoadbalancerruleresponse.jobid; + args.response.success( + {_custom: + {jobId: jid, + getUpdatedItem: function(json) { + return json.queryasyncjobresultresponse.jobresult.loadbalancerrule; + } + } + } + ); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + + detailView: { + name: 'load balancer rule details', + actions: { + remove: { + label: 'remove load balancer rule from this GSLB', + messages: { + notification: function() { + return 'remove load balancer rule from GSLB'; + }, + confirm: function() { + return 'Please confirm you want to remove load balancer rule from GSLB'; + } + }, + action: function(args) { + $.ajax({ + url: createURL('removeFromGlobalLoadBalancerRule'), + data: { + id: args.context.lbUnderGSLB[0].id + }, + success: function(json) { + var jid = json.removefromloadbalancerruleresponse.jobid; + args.response.success({ + _custom: { + jobId: jid + } + }); + } + }); + }, + notification: { + poll: pollAsyncJobResult + } + } + }, + tabs: { + details: { + title: 'label.details', + fields: [ + { + name: { label: 'label.name' } + }, + { + publicport: { label: 'label.public.port' }, + privateport: { label: 'label.private.port' }, + algorithm: { label: 'label.algorithm' }, + publicip: { label: 'label.public.ip' }, + state: { label: 'label.state' }, + id: { label: 'label.id' }, + cidrlist: { label: 'label.cidr' }, + domain: { label: 'label.domain' }, + account: { label: 'label.account' } + } + ], + dataProvider: function(args) { + $.ajax({ + url: createURL('listLoadBalancerRules'), + data: { + id: args.context.lbUnderGSLB[0].id + }, + success: function(json) { + var item = json.listloadbalancerrulesresponse.loadbalancerrule[0]; + args.response.success({ + data: item + }); + } + }); + } + } + } + } + } + } } }; diff --git a/ui/scripts/system.js b/ui/scripts/system.js index a9054125774..73bf3fd4160 100644 --- a/ui/scripts/system.js +++ b/ui/scripts/system.js @@ -2410,15 +2410,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.routers[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } @@ -2986,15 +2984,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.routers[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } @@ -3264,6 +3260,19 @@ label: 'label.private.interface', docID: 'helpNetScalerPrivateInterface' }, + + gslbprovider: { + label: 'GSLB service', + isBoolean: true, + isChecked: true + }, + gslbproviderpublicip: { + label: 'GSLB service Public IP' + }, + gslbproviderprivateip: { + label: 'GSLB service Private IP' + }, + numretries: { label: 'label.numretries', defaultValue: '2', @@ -5259,15 +5268,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.systemVMs[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } @@ -5998,15 +6005,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.routers[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } @@ -6460,15 +6465,13 @@ select: function(args) { $.ajax({ url: createURL("listHosts&VirtualMachineId=" + args.context.systemVMs[0].id), - //url: createURL("listHosts"), //for testing only, comment it out before checking in. dataType: "json", async: true, success: function(json) { var hostObjs = json.listhostsresponse.host; var items = []; $(hostObjs).each(function() { - //items.push({id: this.id, description: (this.name + ": " +(this.hasEnoughCapacity? "Available" : "Full"))}); //listHosts API no longer returns hasEnoughCapacity proprety - items.push({id: this.id, description: this.name}); + items.push({id: this.id, description: (this.name + " (" + (this.suitableformigration? "Suitable": "Not Suitable") + ")")}); }); args.response.success({data: items}); } @@ -6644,6 +6647,19 @@ privateinterface: { label: 'label.private.interface' }, + + gslbprovider: { + label: 'GSLB service', + isBoolean: true, + isChecked: true + }, + gslbproviderpublicip: { + label: 'GSLB service Public IP' + }, + gslbproviderprivateip: { + label: 'GSLB service Private IP' + }, + numretries: { label: 'label.numretries', defaultValue: '2' @@ -10708,6 +10724,12 @@ array1.push("&username=" + todb(args.data.username)); array1.push("&password=" + todb(args.data.password)); array1.push("&networkdevicetype=" + todb(args.data.networkdevicetype)); + + if(apiCmd == "addNetscalerLoadBalancer") { + array1.push("&gslbprovider=" + (args.data.gslbprovider == "on")); + array1.push("&gslbproviderpublicip=" + todb(args.data.gslbproviderpublicip)); + array1.push("&gslbproviderprivateip=" + todb(args.data.gslbproviderprivateip)); + } //construct URL starts here var url = []; diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index 8add9bb085e..08cadd0913e 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -653,7 +653,18 @@ }, privateinterface: { label: 'label.private.interface' + }, + gslbprovider: { + label: 'GSLB service', + isBoolean: true, + isChecked: true }, + gslbproviderpublicip: { + label: 'GSLB service Public IP' + }, + gslbproviderprivateip: { + label: 'GSLB service Private IP' + }, numretries: { label: 'label.numretries', defaultValue: '2' @@ -2593,7 +2604,10 @@ array1.push("&physicalnetworkid=" + args.data.returnedBasicPhysicalNetwork.id); array1.push("&username=" + todb(args.data.basicPhysicalNetwork.username)); array1.push("&password=" + todb(args.data.basicPhysicalNetwork.password)); - array1.push("&networkdevicetype=" + todb(args.data.basicPhysicalNetwork.networkdevicetype)); + array1.push("&networkdevicetype=" + todb(args.data.basicPhysicalNetwork.networkdevicetype)); + array1.push("&gslbprovider=" + (args.data.basicPhysicalNetwork.gslbprovider == "on")); + array1.push("&gslbproviderpublicip=" + todb(args.data.basicPhysicalNetwork.gslbproviderpublicip)); + array1.push("&gslbproviderprivateip=" + todb(args.data.basicPhysicalNetwork.gslbproviderprivateip)); //construct URL starts here var url = [];